mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
plugins/lsp/vls: inline options and config in language-servers/default.nix
This commit is contained in:
parent
e97755be47
commit
f14aa756ba
2 changed files with 12 additions and 21 deletions
|
@ -635,6 +635,18 @@ let
|
||||||
# The v language server has to be installed from v and thus is not packaged "as is" in
|
# The v language server has to be installed from v and thus is not packaged "as is" in
|
||||||
# nixpkgs.
|
# nixpkgs.
|
||||||
package = null;
|
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";
|
name = "vuels";
|
||||||
|
@ -670,7 +682,6 @@ in
|
||||||
./pylsp.nix
|
./pylsp.nix
|
||||||
./rust-analyzer.nix
|
./rust-analyzer.nix
|
||||||
./svelte.nix
|
./svelte.nix
|
||||||
./vls.nix
|
|
||||||
];
|
];
|
||||||
|
|
||||||
config = lib.mkMerge [ nixdSettings.config ];
|
config = lib.mkMerge [ nixdSettings.config ];
|
||||||
|
|
|
@ -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"; }; };
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue