mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 10:21:31 +00:00
lsp: vue files formatter on TS server
This commit is contained in:
parent
4b7357166d
commit
5a4908dcf0
1 changed files with 7 additions and 1 deletions
|
@ -75,7 +75,6 @@
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = function(client, bufnr)
|
on_attach = function(client, bufnr)
|
||||||
attach_keymaps(client, bufnr);
|
attach_keymaps(client, bufnr);
|
||||||
-- TODO: do we need to disable formatting for this LS?
|
|
||||||
client.server_capabilities.documentFormattingProvider = false;
|
client.server_capabilities.documentFormattingProvider = false;
|
||||||
end,
|
end,
|
||||||
filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' },
|
filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' },
|
||||||
|
@ -96,6 +95,11 @@
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.lsp.config('vue_ls', {
|
vim.lsp.config('vue_ls', {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = function(client, bufnr)
|
||||||
|
attach_keymaps(client, bufnr);
|
||||||
|
client.server_capabilities.documentFormattingProvider = false;
|
||||||
|
end,
|
||||||
cmd = {"${getExe pkgs.vue-language-server}", "--stdio"}
|
cmd = {"${getExe pkgs.vue-language-server}", "--stdio"}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -252,6 +256,8 @@ in {
|
||||||
formatters_by_ft.typescript = [cfg.format.type];
|
formatters_by_ft.typescript = [cfg.format.type];
|
||||||
# .tsx files
|
# .tsx files
|
||||||
formatters_by_ft.typescriptreact = [cfg.format.type];
|
formatters_by_ft.typescriptreact = [cfg.format.type];
|
||||||
|
# .vue files
|
||||||
|
formatters_by_ft.vue = [cfg.format.type];
|
||||||
formatters.${cfg.format.type} = {
|
formatters.${cfg.format.type} = {
|
||||||
command = getExe cfg.format.package;
|
command = getExe cfg.format.package;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue