plugins/lsp: add vls language server

This commit is contained in:
Gaetan Lepage 2023-11-27 13:20:12 +01:00 committed by Gaétan Lepage
parent bacdae2c50
commit abb10f097e
3 changed files with 37 additions and 0 deletions

View file

@ -510,6 +510,13 @@ with lib; let
description = "Enable typst-lsp for typst";
package = pkgs.typst-lsp;
}
{
name = "vls";
description = "Enable vls for v";
# The v language server has to be installed from v and thus is not packaged "as is" in
# nixpkgs.
package = null;
}
{
name = "vuels";
description = "Enable vuels, for Vue";
@ -540,5 +547,6 @@ in {
./pylsp.nix
./rust-analyzer.nix
./svelte.nix
./vls.nix
];
}

View file

@ -0,0 +1,28 @@
{
lib,
config,
...
}:
with lib; let
cfg = config.plugins.lsp.servers.vls;
in {
options.plugins.lsp.servers.vls = {
autoSetFiletype = mkOption {
type = types.bool;
description = ''
Files with the `.v` extension are not automatically detected as vlang files.
If this option is enabled, Nixvim will automatically set the filetype accordingly.
'';
default = true;
example = false;
};
};
config =
mkIf cfg.enable
{
filetype.extension =
mkIf cfg.autoSetFiletype
{v = "vlang";};
};
}

View file

@ -131,6 +131,7 @@
texlab.enable = true;
tsserver.enable = true;
typst-lsp.enable = true;
vls.enable = true;
vuels.enable = true;
yamlls.enable = true;
zls.enable = true;