mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +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 =
|
imports =
|
||||||
let
|
let
|
||||||
basePluginPath = [
|
basePath = [
|
||||||
"plugins"
|
"plugins"
|
||||||
"lsp"
|
"lsp"
|
||||||
"servers"
|
"servers"
|
||||||
name
|
|
||||||
];
|
];
|
||||||
|
basePluginPath = basePath ++ [ name ];
|
||||||
basePluginPathString = concatStringsSep "." basePluginPath;
|
basePluginPathString = concatStringsSep "." basePluginPath;
|
||||||
in
|
in
|
||||||
[
|
[
|
||||||
|
@ -128,5 +129,10 @@ in
|
||||||
basePluginPath ++ [ "extraSettings" ]
|
basePluginPath ++ [ "extraSettings" ]
|
||||||
) "You can use `${basePluginPathString}.extraOptions.settings` instead.")
|
) "You can use `${basePluginPathString}.extraOptions.settings` instead.")
|
||||||
(extraConfig cfg)
|
(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