Added toString functions on Texlab LSP source booleans and other mapped values

This commit is contained in:
isaacST08 2025-01-18 20:01:08 -07:00
commit a504d8ef37

View file

@ -21,7 +21,12 @@
let let
inherit (lib.options) mkEnableOption mkOption; inherit (lib.options) mkEnableOption mkOption;
inherit (lib.modules) mkIf mkMerge; inherit (lib.modules) mkIf mkMerge;
inherit (lib.types) package str bool listOf; inherit (lib.types)
package
str
bool
listOf
;
inherit (lib.nvim.types) mkGrammarOption; inherit (lib.nvim.types) mkGrammarOption;
inherit (builtins) any attrValues; inherit (builtins) any attrValues;
@ -256,18 +261,16 @@ in
# Texlab # Texlab
( (
let let
inherit (builtins)
length
concatStringsSep
map
toString
;
tl = cfg.lsp.texlab; tl = cfg.lsp.texlab;
build = tl.build; build = tl.build;
listToLua = listToLua =
list: nullOnEmpty: list: nullOnEmpty:
let
inherit (builtins)
length
concatStringsSep
map
toString
;
in
if length list == 0 then if length list == 0 then
if nullOnEmpty then "null" else "{ }" if nullOnEmpty then "null" else "{ }"
else else
@ -281,12 +284,12 @@ in
build = { build = {
executable = "${build.package}/bin/${build.executable}", executable = "${build.package}/bin/${build.executable}",
args = ${listToLua build.args false}, args = ${listToLua build.args false},
forwardSearchAfter = ${build.forwardSearchAfter}, forwardSearchAfter = ${toString build.forwardSearchAfter},
onSave = ${build.onSave}, onSave = ${toString build.onSave},
useFileList = ${build.useFileList}, useFileList = ${toString build.useFileList},
auxDirectory = "${build.auxDirectroy}", auxDirectory = "${toString build.auxDirectroy}",
logDirectory = "${build.logDirectroy}", logDirectory = "${toString build.logDirectroy}",
pdfDirectory = "${build.pdfDirectroy}", pdfDirectory = "${toString build.pdfDirectroy}",
${if build.filename != null then ''filename = "${build.filename}",'' else ""} ${if build.filename != null then ''filename = "${build.filename}",'' else ""}
}, },
forwardSearch = { forwardSearch = {