mirror of
https://github.com/nix-community/nixvim.git
synced 2025-08-31 23:40:12 +02:00
modules/lsp/server: rename config
-> settings
`config` is a loaded term within modules and options. `settings` is the name usually used for freeform config in nixvim and most other module configurations.
This commit is contained in:
parent
fc6f00a7fd
commit
21688b1d2a
3 changed files with 38 additions and 12 deletions
|
@ -93,7 +93,7 @@ in
|
|||
'';
|
||||
default = { };
|
||||
example = {
|
||||
"*".config = {
|
||||
"*".settings = {
|
||||
root_markers = [ ".git" ];
|
||||
capabilities.textDocument.semanticTokens = {
|
||||
multilineTokenSupport = true;
|
||||
|
@ -102,7 +102,7 @@ in
|
|||
luals.enable = true;
|
||||
clangd = {
|
||||
enable = true;
|
||||
config = {
|
||||
settings = {
|
||||
cmd = [
|
||||
"clangd"
|
||||
"--background-index"
|
||||
|
@ -127,6 +127,13 @@ in
|
|||
builtins.attrValues
|
||||
(builtins.filter (server: server.enable))
|
||||
];
|
||||
|
||||
# Collect per-server warnings
|
||||
serverWarnings = lib.pipe cfg.servers [
|
||||
builtins.attrValues
|
||||
(builtins.catAttrs "warnings")
|
||||
builtins.concatLists
|
||||
];
|
||||
in
|
||||
{
|
||||
extraPackages = builtins.catAttrs "package" enabledServers;
|
||||
|
@ -137,10 +144,10 @@ in
|
|||
server:
|
||||
let
|
||||
luaName = toLuaObject server.name;
|
||||
luaCfg = toLuaObject server.config;
|
||||
luaSettings = toLuaObject server.settings;
|
||||
in
|
||||
''
|
||||
vim.lsp.config(${luaName}, ${luaCfg})
|
||||
vim.lsp.config(${luaName}, ${luaSettings})
|
||||
''
|
||||
+ lib.optionalString server.activate ''
|
||||
vim.lsp.enable(${luaName})
|
||||
|
@ -158,5 +165,8 @@ in
|
|||
end
|
||||
-- }}}
|
||||
'';
|
||||
|
||||
# Propagate per-server warnings
|
||||
warnings = lib.mkIf (serverWarnings != [ ]) serverWarnings;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue