mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-23 01:08:43 +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
|
||||
cfg = config.plugins.lsp.servers.${name};
|
||||
helpers = import ../helpers.nix {inherit lib;};
|
||||
|
||||
packageOption =
|
||||
if package != null
|
||||
|
@ -39,11 +40,25 @@
|
|||
plugins.lsp.servers.${name} =
|
||||
{
|
||||
enable = mkEnableOption description;
|
||||
|
||||
cmd = mkOption {
|
||||
type = with types; nullOr (listOf str);
|
||||
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;
|
||||
|
||||
extraSettings = mkOption {
|
||||
default = {};
|
||||
type = types.attrs;
|
||||
|
@ -66,7 +81,7 @@
|
|||
{
|
||||
name = serverName;
|
||||
extraOptions = {
|
||||
cmd = cfg.cmd;
|
||||
inherit (cfg) cmd filetypes autostart;
|
||||
settings = settings (cfg.settings // cfg.extraSettings);
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue