add svelte to lspconfig
This commit is contained in:
+1
-1
@@ -17,7 +17,7 @@
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "25050e4ed39e628282831d4cbecb1850454ce915" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "221ce6b2d999187044529f49da6554a92f740a96" },
|
||||
"mini.icons": { "branch": "main", "commit": "520995f1d75da0e4cc901ee95080b1ff2bc46b94" },
|
||||
"mini.icons": { "branch": "main", "commit": "284509648db084c5e40a31afa9abb9887c49e04a" },
|
||||
"neogen": { "branch": "main", "commit": "23e7e9f883d01289ebd90e98025acc860ea26366" },
|
||||
"nightfox.nvim": { "branch": "main", "commit": "26b61b1f856ec37cae3cb64f5690adb955f246a1" },
|
||||
"none-ls-extras.nvim": { "branch": "main", "commit": "27681d797a26f1b4d6119296df42f5204c88a2dc" },
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user