From 6a023fc57a504b20a2835e43878b87bb618de1d3 Mon Sep 17 00:00:00 2001 From: isaacST08 Date: Sun, 26 Jan 2025 19:47:50 -0700 Subject: [PATCH] Added inlayHints options for texlab and some cleanup --- modules/plugins/languages/tex/lsp/texlab.nix | 44 ++++++++++++-------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/modules/plugins/languages/tex/lsp/texlab.nix b/modules/plugins/languages/tex/lsp/texlab.nix index a0173efe..0d192011 100644 --- a/modules/plugins/languages/tex/lsp/texlab.nix +++ b/modules/plugins/languages/tex/lsp/texlab.nix @@ -2,7 +2,6 @@ # - Add Texlab LSP settings: # - chktex # - symbols -# - inlayHints # - experimental { 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 { type = ints.positive; default = 80; @@ -202,32 +211,31 @@ in { # Create texlab settings section setupConfig.settings.texlab = ( - # -- General Settings -- { + # -- General Settings -- formatterLineLength = texlabCfg.formatterLineLength; + + # -- Formatters -- bibtexFormatter = texlabCfg.bibtexFormatter; latexFormatter = texlabCfg.latexFormatter; - } - # -- Diagnostics -- - // { + + # -- Diagnostics -- diagnosticsDelay = texlabCfg.diagnostics.delay; diagnostics = { allowedPatterns = texlabCfg.diagnostics.allowedPatterns; ignoredPatterns = texlabCfg.diagnostics.ignoredPatterns; }; - } - # -- Latex Indent -- - // { - latexindent = { - local = texlabCfg.latexindent.local; - modifyLineBreaks = texlabCfg.latexindent.modifyLineBreaks; - replacement = texlabCfg.latexindent.replacement; - }; - } - # -- Completion -- - // { + + # -- Latex Indent -- + latexindent = texlabCfg.latexindent; + + # -- Completion -- completion.matcher = texlabCfg.completion.matcher; + + # -- Inlay Hints -- + inlayHints = texlabCfg.inlayHints; } + # # -- Forward Search -- // ( if texlabCfg.forwardSearch.enable @@ -239,6 +247,7 @@ in { } else {} ) + # # -- Build -- // ( if cfg.build.enable @@ -257,7 +266,8 @@ in { } else {} ) - # -- Extra -- + # + # -- Extra Settings -- // texlabCfg.extraLuaSettings ); in {