Added general texlab options and some cleanup

This commit is contained in:
isaacST08 2025-01-26 19:09:35 -07:00
commit c2796c929f

View file

@ -2,9 +2,6 @@
# - Add Texlab LSP settings: # - Add Texlab LSP settings:
# - chktex # - chktex
# - symbols # - symbols
# - formatterLineLength
# - bibtexFormatter
# - latexFormatter
# - latexindent # - latexindent
# - completion # - completion
# - inlayHints # - inlayHints
@ -17,20 +14,7 @@
}: let }: let
inherit (lib.options) mkOption; inherit (lib.options) mkOption;
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
inherit (lib.types) listOf package str attrs ints; inherit (lib.types) listOf package str attrs ints enum;
inherit
(builtins)
attrNames
concatStringsSep
elemAt
filter
hasAttr
isAttrs
length
map
throw
toString
;
inherit (lib.nvim.config) mkBool; inherit (lib.nvim.config) mkBool;
cfg = config.vim.languages.tex; cfg = config.vim.languages.tex;
@ -119,11 +103,37 @@ in {
}; };
}; };
formatterLineLength = mkOption {
type = ints.positive;
default = 80;
description = "Defines the maximum amount of characters per line (0 = disable) when formatting BibTeX files.";
};
bibtexFormatter = mkOption {
type = enum ["texlab" "latexindent"];
default = "texlab";
description = ''
Defines the formatter to use for BibTeX formatting.
Possible values are either texlab or latexindent.
'';
};
latexFormatter = mkOption {
type = enum ["texlab" "latexindent"];
default = "latexindent";
description = ''
Defines the formatter to use for LaTeX formatting.
Possible values are either texlab or latexindent.
Note that texlab is not implemented yet.
'';
};
extraLuaSettings = mkOption { extraLuaSettings = mkOption {
type = attrs; type = attrs;
default = {}; default = {};
example = { example = {
formatterLineLength = 80; foo = "bar";
baz = 314;
}; };
description = '' description = ''
For any options that do not have options provided through nvf this can be used to add them. For any options that do not have options provided through nvf this can be used to add them.
@ -155,8 +165,13 @@ in {
# Create texlab settings section # Create texlab settings section
setupConfig.settings.texlab = ( setupConfig.settings.texlab = (
# -- General Settings -- # -- General Settings --
# -- Diagnostics --
{ {
formatterLineLength = texlabCfg.formatterLineLength;
bibtexFormatter = texlabCfg.bibtexFormatter;
latexFormatter = texlabCfg.latexFormatter;
}
# -- Diagnostics --
// {
diagnosticsDelay = texlabCfg.diagnostics.delay; diagnosticsDelay = texlabCfg.diagnostics.delay;
diagnostics = { diagnostics = {
allowedPatterns = texlabCfg.diagnostics.allowedPatterns; allowedPatterns = texlabCfg.diagnostics.allowedPatterns;