🔧 Updates to lsp for typescript
This commit is contained in:
parent
4d20c4c986
commit
e7c6476715
1 changed files with 24 additions and 28 deletions
|
|
@ -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,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
lspconfig.rust_analyzer.setup({
|
end
|
||||||
settings = {
|
lspconfig.rust_analyzer.setup({
|
||||||
["rust-analyzer"] = {
|
settings = {
|
||||||
-- procMacro = {
|
["rust-analyzer"] = {
|
||||||
-- ignored = {
|
procMacro = {
|
||||||
-- leptos_macro = {
|
ignored = {
|
||||||
-- "server",
|
leptos_macro = {
|
||||||
-- },
|
"server",
|
||||||
-- },
|
},
|
||||||
-- },
|
|
||||||
-- rustfmt = {
|
|
||||||
-- overrideCommand = {
|
|
||||||
-- "leptosfmt",
|
|
||||||
-- "--stdin",
|
|
||||||
-- "--rustfmt",
|
|
||||||
-- },
|
|
||||||
-- edition = { "2021" },
|
|
||||||
-- },
|
|
||||||
cargo = {
|
|
||||||
allFeatures = true,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
rustfmt = {
|
||||||
|
overrideCommand = {
|
||||||
|
"leptosfmt",
|
||||||
|
"--stdin",
|
||||||
|
"--rustfmt",
|
||||||
|
},
|
||||||
|
edition = { "2021" },
|
||||||
|
},
|
||||||
|
cargo = {
|
||||||
|
allFeatures = true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
})
|
},
|
||||||
end
|
})
|
||||||
lspconfig[server_name].setup(server_config)
|
lspconfig[server_name].setup(server_config)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue