Lewis Campbell
Lewis Campbell2mo ago

neovim LSP - both denols and tsserver are attaching

Hi, I am following the guide here. https://docs.deno.com/runtime/manual/getting_started/setup_your_environment/#neovim-0.6%2B-using-the-built-in-language-server and have lsp set up like
lspconfig["denols"].setup{
root_dir = lspconfig.util.root_pattern("deno.json", "deno.jsonrc")
}

lspconfig["tsserver"].setup{
root_dir = lspconfig.util.root_pattern("package.json"),
single_file_support = false,
}
lspconfig["denols"].setup{
root_dir = lspconfig.util.root_pattern("deno.json", "deno.jsonrc")
}

lspconfig["tsserver"].setup{
root_dir = lspconfig.util.root_pattern("package.json"),
single_file_support = false,
}
but if I open main.ts in a directory that looks like this:
$ ls
deno.json deno.lock main.ts README.md
$ ls
deno.json deno.lock main.ts README.md
Both denols and tsserver attach.
1 Reply
Lewis Campbell
Lewis Campbell2mo ago
SOLVED:
--vim.api.nvim_exec("let g:prettier#autoformat = 1", false)
--vim.api.nvim_exec("let g:prettier#autoformat = 1", false)
This was in my init.lua. It'd detect I was coding in typescript, then fire up prettier. which would in turn fire up tsserver.