fix(svelte): added organize imports and prettier (#3466)

* feat(svelte): add key binding for organize imports

* fix(svelte): solves sveltejs/language-tools#2008

* feat(svelte): add formatter for svelte
This commit is contained in:
Daniel Mata
2024-06-05 13:28:23 -05:00
committed by GitHub
parent 61689ad543
commit e0a0123b18

View File

@ -27,7 +27,28 @@ return {
"neovim/nvim-lspconfig",
opts = {
servers = {
svelte = {},
svelte = {
keys = {
{
"<leader>co",
function()
vim.lsp.buf.code_action({
apply = true,
context = {
only = { "source.organizeImports" },
diagnostics = {},
},
})
end,
desc = "Organize Imports",
},
},
capabilities = {
workspace = {
didChangeWatchedFiles = vim.fn.has("nvim-0.10") == 0 and { dynamicRegistration = true },
},
},
},
},
},
},
@ -45,4 +66,14 @@ return {
})
end,
},
{
"stevearc/conform.nvim",
optional = true,
opts = {
formatters_by_ft = {
["svelte"] = { "prettier" },
},
},
},
}