plugins/lsp/efmls-configs: simplify implementation

This commit is contained in:
Gaetan Lepage 2024-06-03 16:34:40 +02:00 committed by Gaétan Lepage
parent c0a4c2ef6f
commit 4b05fde873

View file

@ -214,7 +214,6 @@ in
config = config =
let let
cfg = config.plugins.efmls-configs; cfg = config.plugins.efmls-configs;
toolAsList = tools: if isList tools then tools else [ tools ];
# Tools that have been selected by the user # Tools that have been selected by the user
tools = lists.unique ( tools = lists.unique (
@ -225,7 +224,7 @@ in
linter ? [ ], linter ? [ ],
formatter ? [ ], formatter ? [ ],
}: }:
(toolAsList linter) ++ (toolAsList formatter) (toList linter) ++ (toList formatter)
) (attrValues cfg.setup) ) (attrValues cfg.setup)
) )
) )
@ -251,7 +250,7 @@ in
kind: opt: kind: opt:
map ( map (
tool: if isString tool then helpers.mkRaw "require 'efmls-configs.${kind}.${tool}'" else tool tool: if isString tool then helpers.mkRaw "require 'efmls-configs.${kind}.${tool}'" else tool
) (toolAsList opt); ) (toList opt);
setupOptions = setupOptions =
(mapAttrs ( (mapAttrs (