From 5d12aaacb0052f697e0ceb90de4b33c44ed08e85 Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Sat, 30 Sep 2023 11:07:39 -0400 Subject: [PATCH] neovim: Conditionally load denols/tsserver Makes it possible to use both Deno and Node/Bun projects with the same config. --- home/neovim.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/home/neovim.nix b/home/neovim.nix index 1b63f9d7..c4c1578a 100644 --- a/home/neovim.nix +++ b/home/neovim.nix @@ -228,7 +228,13 @@ in lspconfig.clangd.setup {} lspconfig.texlab.setup {} lspconfig.crystalline.setup {} - lspconfig.tsserver.setup {} + lspconfig.denols.setup { + root_dir = lspconfig.util.root_pattern("deno.json", "deno.jsonc"), + } + lspconfig.tsserver.setup { + root_dir = lspconfig.util.root_pattern("package.json"), + single_file_support = false + } lspconfig.astro.setup {} vim.keymap.set('n', 'e', vim.diagnostic.open_float) vim.keymap.set('n', '[d', vim.diagnostic.goto_prev)