valentjn / ltex-ls

LTeX Language Server: LSP language server for LanguageTool :mag::heavy_check_mark: with support for LaTeX :mortar_board:, Markdown :pencil:, and others
https://valentjn.github.io/ltex
Mozilla Public License 2.0
764 stars 33 forks source link

"ltex.latex.commands" and "ltex.latex.environments" cannot act on some original ones #263

Open unknownnumbers opened 1 year ago

unknownnumbers commented 1 year ago

Describe the bug when I used "ltex.latex.commands" in Settings.json. That is,

 "ltex.latex.commands" =
   {"align" : "ignore",
   "cases" : "ignore",} 

It works for "cases", but not for "align". I guess it means the setting cannot override the default situations. (I think "align" owns a default one while cases does not.) The test codes in *.tex:

   \begin{cases}
       \text{an apples. }
   \end{cases}
   \begin{align}
       \text{an apples. }
   \end{align}

"an apples" is ignored for "cases" successfully but not ignored for "align".

Also the same for "ltex.latex.commands", Such as: "\\begin{}[]":"ignore" in settings.json does not work for \begin{frame}[allowframebreaks=1,t] \end{frame} in *.tex and "\\fullcite{}": "ignore" works for \fullcite{allowframebreaks=1,t}

Steps to reproduce Steps to reproduce the behavior:

  1. Go to "setting.json" for VSCode & "*.tex" (a new .tex file)
  2. Add thses code respectively.
  3. active the check
  4. See errors (different results for these situations).

Expected behavior LTeX can ignore correctly for both of them. (ones with initial settings and without intial settings)

Sample document

  "ltex.latex.environments": {
    "align" : "ignore",
    "cases" : "ignore",
  },
  "ltex.latex.commands": {
    "\\fullcite{}": "ignore",
    "\\begin{}[]":"ignore"
  },

for settings.json

and

      \begin{cases}
          \text{an apples. }
      \end{cases}
      \begin{align}
          \text{an apples. }
      \end{align}
      \begin{frame}[allowframebreaks=1,t] \end{frame}

for *.tex

LTeX configuration Please paste all configuration settings starting with ltex. from your settings.json. You can help us by temporarily removing some irrelevant settings from your settings.json and see if the bug still occurs.

``` "ltex.completionEnabled": true, "ltex.enabled": [ //"bibtex", "latex", "markdown", ], "ltex.language": "en-US", "ltex.latex.environments": { "align" : "ignore", // "aligned" : "ignore", "cases" : "ignore", // "frame": "ignore", }, "ltex.latex.commands": { "\\label{}": "ignore", "\\documentclass[]{}": "ignore", "\\cite{}": "dummy", "\\cite[]{}": "dummy", "\\setbeamertemplate{}[]": "ignore", "\\fullcite{}": "dummy", "\\footfullcite{}":"ignore", "\\mathrm{}": "dummy", "\\begin{}[]":"ignore", "\\tableofcontents[]":"ignore" }, ```

LTeX LS log Paste the log (output) of LTeX LS here:

``` REPLACE_THIS_WITH_LTEX_LS_LOG ```

Version information List here the version information of the relevant software.

Windows 10 LTeX – LanguageTool grammar/spell checking 13.1.0

Additional context/information You can add any other context or information about the problem here.