Add lsp for js/ts

This commit is contained in:
Torjus Håkestad 2024-03-05 22:54:24 +01:00
parent e0e927edb1
commit ad9656072c
2 changed files with 14 additions and 1 deletions

View File

@ -49,6 +49,7 @@
gopls gopls
nodePackages.pyright nodePackages.pyright
nodePackages.typescript-language-server nodePackages.typescript-language-server
nodePackages.typescript
nil nil
yaml-language-server yaml-language-server
lua-language-server lua-language-server

View File

@ -4,7 +4,7 @@
local lsp_zero = require('lsp-zero') 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 }) lsp_zero.default_keymaps({ buffer = bufnr })
end) end)
@ -17,6 +17,7 @@ lsp_zero.format_on_save({
['gopls'] = { 'go' }, ['gopls'] = { 'go' },
['nil_ls'] = { 'nix' }, ['nil_ls'] = { 'nix' },
['lua_ls'] = { 'lua' }, ['lua_ls'] = { 'lua' },
['tsserver'] = { 'typescript', 'javascript' },
}, },
}) })
@ -84,6 +85,17 @@ lspconfig.lua_ls.setup({
} }
}) })
lspconfig.tsserver.setup({
init_options = {
plugins = {
},
},
filetypes = {
"typescript",
"javascript",
},
})
-- Telescope -- Telescope
require('telescope').setup({ require('telescope').setup({