mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
plugins/lsp: automatically add serverName
alias
A warning will be printed if the `serverName` alias is used, which may help new users to figure out the correct `plugins.lsp.servers.*` name.
This commit is contained in:
parent
61fa26c9e9
commit
0a24327632
1 changed files with 9 additions and 3 deletions
|
@ -113,14 +113,15 @@ in
|
|||
}
|
||||
];
|
||||
};
|
||||
|
||||
imports =
|
||||
let
|
||||
basePluginPath = [
|
||||
basePath = [
|
||||
"plugins"
|
||||
"lsp"
|
||||
"servers"
|
||||
name
|
||||
];
|
||||
basePluginPath = basePath ++ [ name ];
|
||||
basePluginPathString = concatStringsSep "." basePluginPath;
|
||||
in
|
||||
[
|
||||
|
@ -128,5 +129,10 @@ in
|
|||
basePluginPath ++ [ "extraSettings" ]
|
||||
) "You can use `${basePluginPathString}.extraOptions.settings` instead.")
|
||||
(extraConfig cfg)
|
||||
];
|
||||
]
|
||||
# Add an alias (with warning) for the lspconfig server name, if different to `name`.
|
||||
# Note: users may use lspconfig's docs to guess the `plugins.lsp.servers.*` name
|
||||
++ (optional (name != serverName) (
|
||||
mkRenamedOptionModule (basePath ++ [ serverName ]) basePluginPath
|
||||
));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue