Skip to content

Commit

Permalink
fix(languages/vue): updated lsp server
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas Brendgen committed Jan 13, 2025
1 parent 2df0049 commit 73486ec
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 10 deletions.
1 change: 0 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,6 @@
sql.enable = true;
tailwind.enable = true;
ts.enable = true;
vue.enable = true;
xml.enable = true;
};
vim.lsp = {
Expand Down
1 change: 0 additions & 1 deletion modules/languages/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ in {
./sql.nix
./tailwind.nix
./ts.nix
./vue.nix
./xml.nix
];

Expand Down
56 changes: 48 additions & 8 deletions modules/languages/vue.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,60 @@ with lib;
with builtins; let
cfg = config.vim.languages.vue;

defaultServer = "volar";
defaultServer = "vuels";
servers = {
volar = {
package = pkgs.nodePackages.volar;
vuels = {
package = pkgs.nodePackages.vls;
lspConfig =
/*
lua
*/
''
lspconfig.volar.setup {
capabilities = capabilities;
on_attach = default_on_attach,
cmd = { "${cfg.lsp.package}/bin/vue-language-server", "--stdio" },
filetypes = {"typescript", "typescriptreact", "javascript", "javascriptreact", "vue", "json"}
local util = require('lspconfig.util')
lspconfig.vuels.setup {
capabilities = capabilities,
on_attach = attach_keymaps,
filetypes = { 'vue' },
root_dir = util.root_pattern('package.json', 'vue.config.js'),
cmd = { "${pkgs.nodePackages.vls}/bin/vls", "--stdio" },
init_options = {
config = {
vetur = {
useWorkspaceDependencies = false,
validation = {
template = true,
style = true,
script = true,
},
completion = {
autoImport = false,
useScaffoldSnippets = false,
tagCasing = 'kebab',
},
format = {
defaultFormatter = {
js = 'none',
ts = 'none',
},
defaultFormatterOptions = {},
scriptInitialIndent = false,
styleInitialIndent = false,
},
},
css = {},
html = {
suggest = {},
},
javascript = {
format = {},
},
typescript = {
format = {},
},
emmet = {},
stylusSupremacy = {},
},
},
}
'';
};
Expand Down

0 comments on commit 73486ec

Please sign in to comment.