🔧 Updates to lsp for typescript

This commit is contained in:
z3rOR0ne 2024-09-07 11:51:09 -07:00
parent 4d20c4c986
commit e7c6476715

View file

@ -6,9 +6,8 @@ require("mason").setup()
lsp.ensure_installed({ lsp.ensure_installed({
"clangd", "clangd",
"tsserver",
"eslint", "eslint",
-- "rust_analyzer", "rust_analyzer",
"volar", "volar",
}) })
@ -71,40 +70,37 @@ require("mason-lspconfig").setup_handlers({
function(server_name) function(server_name)
local server_config = {} local server_config = {}
if server_name == "volar" then if server_name == "volar" then
server_config.filetypes = { "vue", "typescript", "javascript" } server_config.filetypes = { "vue", "ts_ls", "javascript" }
lspconfig.tsserver.setup({
["disabled"] = true,
})
lspconfig.volar.setup({ lspconfig.volar.setup({
settings = { settings = {
["volar.takeOverMode.enabled"] = true, ["volar.takeOverMode.enabled"] = true,
}, },
}) })
end
lspconfig.rust_analyzer.setup({ lspconfig.rust_analyzer.setup({
settings = { settings = {
["rust-analyzer"] = { ["rust-analyzer"] = {
-- procMacro = { procMacro = {
-- ignored = { ignored = {
-- leptos_macro = { leptos_macro = {
-- "server", "server",
-- }, },
-- }, },
-- }, },
-- rustfmt = { rustfmt = {
-- overrideCommand = { overrideCommand = {
-- "leptosfmt", "leptosfmt",
-- "--stdin", "--stdin",
-- "--rustfmt", "--rustfmt",
-- }, },
-- edition = { "2021" }, edition = { "2021" },
-- }, },
cargo = { cargo = {
allFeatures = true, allFeatures = true,
}, },
}, },
}, },
}) })
end
lspconfig[server_name].setup(server_config) lspconfig[server_name].setup(server_config)
end, end,
}) })