mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-23 09:18:38 +02:00
plugins/nvim-lsp: add filetypes and autostart options for LS (#252)
This commit is contained in:
parent
720d55e999
commit
cf3f10265b
1 changed files with 16 additions and 1 deletions
|
@ -24,6 +24,7 @@
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
cfg = config.plugins.lsp.servers.${name};
|
cfg = config.plugins.lsp.servers.${name};
|
||||||
|
helpers = import ../helpers.nix {inherit lib;};
|
||||||
|
|
||||||
packageOption =
|
packageOption =
|
||||||
if package != null
|
if package != null
|
||||||
|
@ -39,11 +40,25 @@
|
||||||
plugins.lsp.servers.${name} =
|
plugins.lsp.servers.${name} =
|
||||||
{
|
{
|
||||||
enable = mkEnableOption description;
|
enable = mkEnableOption description;
|
||||||
|
|
||||||
cmd = mkOption {
|
cmd = mkOption {
|
||||||
type = with types; nullOr (listOf str);
|
type = with types; nullOr (listOf str);
|
||||||
default = cmd cfg;
|
default = cmd cfg;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
filetypes = helpers.mkNullOrOption (types.listOf types.str) ''
|
||||||
|
Set of filetypes for which to attempt to resolve {root_dir}.
|
||||||
|
May be empty, or server may specify a default value.
|
||||||
|
'';
|
||||||
|
|
||||||
|
autostart = helpers.defaultNullOpts.mkBool true ''
|
||||||
|
Controls if the `FileType` autocommand that launches a language server is created.
|
||||||
|
If `false`, allows for deferring language servers until manually launched with
|
||||||
|
`:LspStart` (|lspconfig-commands|).
|
||||||
|
'';
|
||||||
|
|
||||||
settings = settingsOptions;
|
settings = settingsOptions;
|
||||||
|
|
||||||
extraSettings = mkOption {
|
extraSettings = mkOption {
|
||||||
default = {};
|
default = {};
|
||||||
type = types.attrs;
|
type = types.attrs;
|
||||||
|
@ -66,7 +81,7 @@
|
||||||
{
|
{
|
||||||
name = serverName;
|
name = serverName;
|
||||||
extraOptions = {
|
extraOptions = {
|
||||||
cmd = cfg.cmd;
|
inherit (cfg) cmd filetypes autostart;
|
||||||
settings = settings (cfg.settings // cfg.extraSettings);
|
settings = settings (cfg.settings // cfg.extraSettings);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue