mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-25 02:08:40 +02:00
nvim-lsp: add installLanguageServer option for servers
This commit is contained in:
parent
efdcbe225f
commit
21f2e43568
2 changed files with 13 additions and 4 deletions
|
@ -32,7 +32,7 @@
|
||||||
then {
|
then {
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
default = package;
|
default = package;
|
||||||
type = types.nullOr types.package;
|
type = types.package;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else {};
|
else {};
|
||||||
|
@ -42,9 +42,18 @@
|
||||||
{
|
{
|
||||||
enable = mkEnableOption description;
|
enable = mkEnableOption description;
|
||||||
|
|
||||||
|
installLanguageServer = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "Whether nixvim should take care of installing the language server.";
|
||||||
|
};
|
||||||
|
|
||||||
cmd = mkOption {
|
cmd = mkOption {
|
||||||
type = with types; nullOr (listOf str);
|
type = with types; nullOr (listOf str);
|
||||||
default = cmd cfg;
|
default =
|
||||||
|
if cfg.installLanguageServer
|
||||||
|
then cmd cfg
|
||||||
|
else null;
|
||||||
};
|
};
|
||||||
|
|
||||||
filetypes = helpers.mkNullOrOption (types.listOf types.str) ''
|
filetypes = helpers.mkNullOrOption (types.listOf types.str) ''
|
||||||
|
@ -103,7 +112,7 @@
|
||||||
extraPackages =
|
extraPackages =
|
||||||
(
|
(
|
||||||
optional
|
optional
|
||||||
((package != null) && (cfg.package != null))
|
(cfg.installLanguageServer && (package != null))
|
||||||
cfg.package
|
cfg.package
|
||||||
)
|
)
|
||||||
++ (mapAttrsToList (name: _: cfg."${name}Package") extraPackages);
|
++ (mapAttrsToList (name: _: cfg."${name}Package") extraPackages);
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
# Do not install the language server using nixvim
|
# Do not install the language server using nixvim
|
||||||
gopls = {
|
gopls = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = null;
|
installLanguageServer = false;
|
||||||
};
|
};
|
||||||
nil_ls.enable = true;
|
nil_ls.enable = true;
|
||||||
rust-analyzer.enable = true;
|
rust-analyzer.enable = true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue