Add js/ts LSP
- Id
- 43244c7676973a2549927c9c45f0afb603379923
- Author
- Caio
- Commit time
- 2025-11-09T07:19:32+01:00
Modified config/nvim/lua/config/lsp.lua
command = "clippy",
},
cargo = {
- allFeatures = true,
+ features = "all",
},
},
}
settings = { Lua = { diagnostics = { globals = { 'vim' } } } },
})
+vim.lsp.config("ts_ls", {
+ init_options = { hostInfo = 'neovim' },
+ cmd = { 'typescript-language-server', '--stdio' },
+ filetypes = {
+ 'javascript',
+ 'javascriptreact',
+ 'javascript.jsx',
+ 'typescript',
+ 'typescriptreact',
+ 'typescript.tsx',
+ },
+ root_markers = { 'package.json', '.git' }
+})
+
vim.api.nvim_create_user_command("LspStart", function()
- vim.lsp.enable({ "rust_analyzer", "gopls", "ccls", "ruff", "lua_ls" })
+ vim.lsp.enable({ "rust_analyzer", "gopls", "ccls", "ruff", "lua_ls", "ts_ls" })
vim.cmd("edit") -- reload buffer
end, {})