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:
@ -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" },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user