From e0ede92edf877e1f0ae29ba6b1eff2de7bccf461 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 24 Sep 2023 20:22:06 +0900 Subject: neovim/lsp: enable denols --- .config/nvim/lua/vimrc/plugins.lua | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to '.config/nvim/lua/vimrc/plugins.lua') diff --git a/.config/nvim/lua/vimrc/plugins.lua b/.config/nvim/lua/vimrc/plugins.lua index 0dd0ac6..cc9d14f 100644 --- a/.config/nvim/lua/vimrc/plugins.lua +++ b/.config/nvim/lua/vimrc/plugins.lua @@ -663,8 +663,25 @@ return { config = function() local lspconfig = require('lspconfig') + -- TODO + -- Enable denols xor tsserver. + local is_deno_repo + if vim.fn.executable('deno') == 1 then + local get_deno_root_dir = lspconfig.util.root_pattern("deno.json", "deno.jsonc") + is_deno_repo = get_deno_root_dir(vim.api.nvim_buf_get_name(0)) ~= nil + else + is_deno_repo = false + end + if vim.fn.executable('typescript-language-server') == 1 then - lspconfig.tsserver.setup({}) + if not is_deno_repo then + lspconfig.tsserver.setup({}) + end + end + if vim.fn.executable('deno') == 1 then + if is_deno_repo then + lspconfig.denols.setup({}) + end end if vim.fn.executable('gopls') == 1 then lspconfig.gopls.setup({}) -- cgit v1.2.3-70-g09d2