mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
plugins/lsp: deprecate extraSettings
This commit is contained in:
parent
944a84b2c0
commit
ae3a47674b
1 changed files with 13 additions and 32 deletions
|
@ -1,9 +1,4 @@
|
||||||
{
|
{pkgs, ...}: {
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
mkLsp = {
|
mkLsp = {
|
||||||
name,
|
name,
|
||||||
description ? "Enable ${name}.",
|
description ? "Enable ${name}.",
|
||||||
|
@ -92,13 +87,6 @@
|
||||||
|
|
||||||
settings = settingsOptions;
|
settings = settingsOptions;
|
||||||
|
|
||||||
extraSettings = mkOption {
|
|
||||||
type = types.attrs;
|
|
||||||
description = ''
|
|
||||||
Extra settings for the ${name} language server.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
extraOptions = mkOption {
|
extraOptions = mkOption {
|
||||||
default = {};
|
default = {};
|
||||||
type = types.attrs;
|
type = types.attrs;
|
||||||
|
@ -108,10 +96,7 @@
|
||||||
// packageOption;
|
// packageOption;
|
||||||
};
|
};
|
||||||
|
|
||||||
config = let
|
config =
|
||||||
extraSettingsOption = options.plugins.lsp.servers.${name}.extraSettings;
|
|
||||||
extraSettingsAreDefined = extraSettingsOption.isDefined;
|
|
||||||
in
|
|
||||||
mkIf cfg.enable
|
mkIf cfg.enable
|
||||||
{
|
{
|
||||||
extraPackages =
|
extraPackages =
|
||||||
|
@ -136,25 +121,21 @@
|
||||||
end
|
end
|
||||||
''
|
''
|
||||||
);
|
);
|
||||||
settings =
|
settings = settings cfg.settings;
|
||||||
(settings cfg.settings)
|
|
||||||
// (
|
|
||||||
if extraSettingsAreDefined
|
|
||||||
then cfg.extraSettings
|
|
||||||
else {}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
// cfg.extraOptions;
|
// cfg.extraOptions;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
warnings =
|
|
||||||
optional extraSettingsAreDefined
|
|
||||||
(
|
|
||||||
let
|
|
||||||
optionPrefix = "plugins.lsp.servers.${name}";
|
|
||||||
in "The `${optionPrefix}.extraSettings` option is deprecated in favor of `${optionPrefix}.extraOptions.settings`."
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
imports = let
|
||||||
|
basePluginPath = ["plugins" "lsp" "servers" name];
|
||||||
|
basePluginPathString = concatStringsSep "." basePluginPath;
|
||||||
|
in [
|
||||||
|
(
|
||||||
|
mkRemovedOptionModule
|
||||||
|
(basePluginPath ++ ["extraSettings"])
|
||||||
|
"You can use `${basePluginPathString}.extraOptions.settings` instead."
|
||||||
|
)
|
||||||
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue