From ad9656072ce16a7a945e03e3b7b57c655e5a458d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torjus=20H=C3=A5kestad?= Date: Tue, 5 Mar 2024 22:54:24 +0100 Subject: [PATCH] Add lsp for js/ts --- home/editor/neovim/default.nix | 1 + home/editor/neovim/plugins.lua | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/home/editor/neovim/default.nix b/home/editor/neovim/default.nix index 44c58be..e382622 100644 --- a/home/editor/neovim/default.nix +++ b/home/editor/neovim/default.nix @@ -49,6 +49,7 @@ gopls nodePackages.pyright nodePackages.typescript-language-server + nodePackages.typescript nil yaml-language-server lua-language-server diff --git a/home/editor/neovim/plugins.lua b/home/editor/neovim/plugins.lua index e1b4454..f852fdf 100644 --- a/home/editor/neovim/plugins.lua +++ b/home/editor/neovim/plugins.lua @@ -4,7 +4,7 @@ local lsp_zero = require('lsp-zero') -lsp_zero.on_attach(function(client, bufnr) +lsp_zero.on_attach(function(_, bufnr) lsp_zero.default_keymaps({ buffer = bufnr }) end) @@ -17,6 +17,7 @@ lsp_zero.format_on_save({ ['gopls'] = { 'go' }, ['nil_ls'] = { 'nix' }, ['lua_ls'] = { 'lua' }, + ['tsserver'] = { 'typescript', 'javascript' }, }, }) @@ -84,6 +85,17 @@ lspconfig.lua_ls.setup({ } }) +lspconfig.tsserver.setup({ + init_options = { + plugins = { + }, + }, + filetypes = { + "typescript", + "javascript", + }, +}) + -- Telescope require('telescope').setup({