mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-07 15:54:31 +02:00
lsp: add support for several LSP clients (#111)
* nvim-lsp: Allow to pass settings to clients Some clients (like rust-analyzer, nil_ls, ...) can take settings specified in the setup function. This commit adds two fields for the 'mkLsp' function to handle this: - extraOptions: define nix module options - settings: A function that takes the corresponding lsp module config and formats it as a settings object compatible with the server. * nvim-lsp: Add nil-ls (for Nix) * nvim-lsp: Add bashls (for Bash) * nvim-lsp: Add dartls, for dart Co-authored-by: Pedro Alves <pta2002@users.noreply.github.com>
This commit is contained in:
parent
02f28c7b48
commit
b1ba5f873e
2 changed files with 132 additions and 1 deletions
|
@ -7,6 +7,8 @@
|
|||
, serverName ? name
|
||||
, packages ? [ pkgs.${name} ]
|
||||
, cmd ? null
|
||||
, settings ? null
|
||||
, extraOptions ? { }
|
||||
, ...
|
||||
}:
|
||||
# returns a module
|
||||
|
@ -19,7 +21,7 @@
|
|||
options = {
|
||||
plugins.lsp.servers.${name} = {
|
||||
enable = mkEnableOption description;
|
||||
};
|
||||
} // extraOptions;
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
@ -29,6 +31,7 @@
|
|||
name = serverName;
|
||||
extraOptions = {
|
||||
inherit cmd;
|
||||
settings = if settings != null then settings cfg else { };
|
||||
};
|
||||
}];
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue