Added inlayHints options for texlab and some cleanup

This commit is contained in:
isaacST08 2025-01-26 19:47:50 -07:00
commit 6a023fc57a

View file

@ -2,7 +2,6 @@
# - Add Texlab LSP settings: # - Add Texlab LSP settings:
# - chktex # - chktex
# - symbols # - symbols
# - inlayHints
# - experimental # - experimental
{ {
config, config,
@ -141,6 +140,16 @@ in {
''; '';
}; };
inlayHints = {
labelDefinitions = mkBool true "When enabled, the server will return inlay hints for `\\label-like` commands.";
labelReferences = mkBool true "When enabled, the server will return inlay hints for `\\ref``-like commands.";
maxLength = mkOption {
type = nullOr ints.positive;
default = null;
description = "When set, the server will truncate the text of the inlay hints to the specified length.";
};
};
formatterLineLength = mkOption { formatterLineLength = mkOption {
type = ints.positive; type = ints.positive;
default = 80; default = 80;
@ -202,32 +211,31 @@ in {
# Create texlab settings section # Create texlab settings section
setupConfig.settings.texlab = ( setupConfig.settings.texlab = (
# -- General Settings --
{ {
# -- General Settings --
formatterLineLength = texlabCfg.formatterLineLength; formatterLineLength = texlabCfg.formatterLineLength;
# -- Formatters --
bibtexFormatter = texlabCfg.bibtexFormatter; bibtexFormatter = texlabCfg.bibtexFormatter;
latexFormatter = texlabCfg.latexFormatter; latexFormatter = texlabCfg.latexFormatter;
}
# -- Diagnostics -- # -- Diagnostics --
// {
diagnosticsDelay = texlabCfg.diagnostics.delay; diagnosticsDelay = texlabCfg.diagnostics.delay;
diagnostics = { diagnostics = {
allowedPatterns = texlabCfg.diagnostics.allowedPatterns; allowedPatterns = texlabCfg.diagnostics.allowedPatterns;
ignoredPatterns = texlabCfg.diagnostics.ignoredPatterns; ignoredPatterns = texlabCfg.diagnostics.ignoredPatterns;
}; };
}
# -- Latex Indent -- # -- Latex Indent --
// { latexindent = texlabCfg.latexindent;
latexindent = {
local = texlabCfg.latexindent.local;
modifyLineBreaks = texlabCfg.latexindent.modifyLineBreaks;
replacement = texlabCfg.latexindent.replacement;
};
}
# -- Completion -- # -- Completion --
// {
completion.matcher = texlabCfg.completion.matcher; completion.matcher = texlabCfg.completion.matcher;
# -- Inlay Hints --
inlayHints = texlabCfg.inlayHints;
} }
#
# -- Forward Search -- # -- Forward Search --
// ( // (
if texlabCfg.forwardSearch.enable if texlabCfg.forwardSearch.enable
@ -239,6 +247,7 @@ in {
} }
else {} else {}
) )
#
# -- Build -- # -- Build --
// ( // (
if cfg.build.enable if cfg.build.enable
@ -257,7 +266,8 @@ in {
} }
else {} else {}
) )
# -- Extra -- #
# -- Extra Settings --
// texlabCfg.extraLuaSettings // texlabCfg.extraLuaSettings
); );
in { in {