plugins/lsp/vls: inline options and config in language-servers/default.nix

This commit is contained in:
Gaetan Lepage 2024-05-14 16:47:28 +02:00 committed by Gaétan Lepage
parent e97755be47
commit f14aa756ba
2 changed files with 12 additions and 21 deletions

View file

@ -635,6 +635,18 @@ let
# The v language server has to be installed from v and thus is not packaged "as is" in
# nixpkgs.
package = null;
extraOptions = {
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;
};
};
extraConfig = cfg: { filetype.extension = mkIf cfg.autoSetFiletype { v = "vlang"; }; };
}
{
name = "vuels";
@ -670,7 +682,6 @@ in
./pylsp.nix
./rust-analyzer.nix
./svelte.nix
./vls.nix
];
config = lib.mkMerge [ nixdSettings.config ];

View file

@ -1,20 +0,0 @@
{ 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"; }; };
}