add svelte to lspconfig

This commit is contained in:
2026-06-11 10:13:21 -07:00
parent 05dfddd04b
commit 5f01172523
2 changed files with 28 additions and 6 deletions
+27 -5
View File
@@ -104,6 +104,31 @@ return {
}
})
vim.lsp.config("svelte", {
settings = {
svelte = {
plugin = {
svelte = {
diagnostics = { enable = true },
format = { enable = true },
},
},
},
},
on_attach = function(client, bufnr)
-- svelte LS needs to be told when .js/.ts files change
-- so it can update component prop types
vim.api.nvim_create_autocmd("BufWritePost", {
pattern = { "*.js", "*.ts" },
group = vim.api.nvim_create_augroup("svelte_ondidchangetsorjsfile", { clear = true }),
callback = function(ctx)
client:notify("$/onDidChangeTsOrJsFile", { uri = ctx.match })
end,
})
end,
})
vim.lsp.config("rust_analyzer", {
settings = {
["rust-analyzer"] = {
@@ -171,8 +196,8 @@ return {
})
vim.lsp.config("bashls", {
cmd = {'bash-language-server', 'start' },
filetypes = {'bash', 'sh'}
cmd = { 'bash-language-server', 'start' },
filetypes = { 'bash', 'sh' }
})
require("roslyn").setup()
@@ -201,15 +226,12 @@ return {
--capabilities.offsetEncoding = { "utf-16" }
local eslint_format = require("none-ls.formatting.eslint_d").with({
extra_filetypes = { "svelte" },
})
local eslint_diag = require("none-ls.diagnostics.eslint_d").with({
extra_filetypes = { "svelte" },
})
local eslint_code_actions = require("none-ls.code_actions.eslint_d").with({
extra_filetypes = { "svelte" },
})
null_ls.setup {