Skip to content

Commit

Permalink
plugins/lsp: Correctly mark servers as disabled if the lsp plugin is …
Browse files Browse the repository at this point in the history
…disabled
  • Loading branch information
traxys committed Nov 19, 2024
1 parent 31eb9d8 commit c674f10
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plugins/lsp/language-servers/_mk-lsp.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ with lib;
let
cfg = config.plugins.lsp.servers.${name};
opt = options.plugins.lsp.servers.${name};

enabled = config.plugins.lsp.enable && cfg.enable;
in
{
meta.nixvimInfo = {
Expand Down Expand Up @@ -131,7 +133,7 @@ in
} // extraOptions;
};

config = mkIf cfg.enable {
config = mkIf enabled {
extraPackages = [ cfg.package ];

plugins.lsp.enabledServers = [
Expand Down Expand Up @@ -168,7 +170,7 @@ in
(mkRemovedOptionModule (
basePluginPath ++ [ "extraSettings" ]
) "You can use `${basePluginPathString}.extraOptions.settings` instead.")
(lib.mkIf cfg.enable (extraConfig cfg))
(lib.mkIf enabled (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
Expand Down

0 comments on commit c674f10

Please sign in to comment.