mirror of
https://github.com/nix-community/nixvim.git
synced 2025-08-02 09:04:54 +02:00
modules/lsp/servers: move the *
server to its own module
Introduce a bespoke `global-server.nix` module. This is less DRY, but
much simpler.
The `lsp.servers."*"` options are different enough from the other
`lsp.servers.<name>` options that it is simpler to just declare them
separately.
Now that we have a dedicated `global-server.nix` module, we no longer
need to split the normal server module into `server.nix`+`server-base.nix`
This partially reverts f2e96b67a3
This commit is contained in:
parent
8b3107ad6f
commit
90eb4e681c
5 changed files with 98 additions and 82 deletions
49
modules/lsp/global-server.nix
Normal file
49
modules/lsp/global-server.nix
Normal file
|
@ -0,0 +1,49 @@
|
|||
{ lib, ... }:
|
||||
let
|
||||
inherit (lib) types;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
enable = lib.mkOption {
|
||||
type = types.bool;
|
||||
description = "Whether to enable global defaults shared by all servers.";
|
||||
default = true;
|
||||
example = false;
|
||||
};
|
||||
|
||||
name = lib.mkOption {
|
||||
type = types.str;
|
||||
description = ''
|
||||
The name to use for global defaults shared by all servers.
|
||||
|
||||
Supplied to functions like `vim.lsp.config()`.
|
||||
|
||||
Will always be `"*"`.
|
||||
'';
|
||||
readOnly = true;
|
||||
};
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = with types; attrsOf anything;
|
||||
description = ''
|
||||
Default configuration shared by all servers.
|
||||
|
||||
Will be merged by neovim using the behaviour of [`vim.tbl_deep_extend()`](https://neovim.io/doc/user/lua.html#vim.tbl_deep_extend()).
|
||||
'';
|
||||
default = { };
|
||||
example = {
|
||||
root_markers = [ ".git" ];
|
||||
capabilities.textDocument.semanticTokens = {
|
||||
multilineTokenSupport = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
imports = [
|
||||
./server-renames.nix
|
||||
];
|
||||
|
||||
# Define the read-only `name` here, instead of via `default`, to avoid documenting it twice
|
||||
config.name = "*";
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue