ltex-plus / vscode-ltex-plus

LTeX+: Grammar/spell checker :mag::heavy_check_mark: for VS Code using LanguageTool with support for LaTeX :mortar_board:, Markdown :pencil:, and others
https://marketplace.visualstudio.com/items?itemName=ltex-plus.vscode-ltex-plus
Mozilla Public License 2.0
21 stars 0 forks source link

LTeX-Plus started mistaking curly braces for punctuation #35

Open alchemiker opened 1 week ago

alchemiker commented 1 week ago

Describe the bug An example is shown in the image below. Pay attention to the underlined dot after aqua regia. grafik I get for this line the warning from LTeX: Two consecutive dots. This is produced by the line in the preamble, which changes the appearance of chapter headings. It shouldn't mess with punctuation, I think. I'm also open to a fix on my side.

Steps to reproduce

  1. Copy my source code from below to a .tex document
  2. Perform spellcheck
  3. See underlined dot

Expected behavior There should be no double punctuation warning.

Sample document Here is a minimal working example showing the error when checked

``` \documentclass[draft,british,12pt,a4paper, titlepage]{report} \usepackage{titlesec} \titleformat{\chapter}{\huge\normalfont\bfseries}{\thechapter}{1em}{}% Title format for chapters \begin{document} \subsection{General information} Before the synthesis, all glassware was cleaned with \emph{aqua regia}. \end{document} ```

LTeX+ configuration From settings.json, see below

``` "ltex.additionalRules.motherTongue": "de-DE", "ltex.dictionary": { }, "ltex.disabledRules": { }, "ltex.language": "en-GB", "ltex.statusBarItem": true, "ltex.latex.commands": { "\\autocite{}": "ignore", "\\unit{}": "dummy", "\\textsc{}": "dummy", "\\stuff{}": "ignore", "\\adjustbox{}": "ignore", "\\lstset{}": "ignore", "\\lstdefinestyle{}{}": "ignore", "\\ch{]": "dummy" }, "ltex.bibtex.fields": { "journaltitle": false, "shortjournal": false }, "ltex.checkFrequency": "save", ```

"LTeX+ Language Server" log file See below:

``` [Info - 3:05:42 PM] Starting ltex-ls... SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. Sep. 06, 2024 3:05:58 NACHM. org.bsplines.ltexls.server.LtexLanguageServer initialize INFORMATION: ltex-ls 17.0.1 - initializing... Sep. 06, 2024 3:05:58 NACHM. org.bsplines.ltexls.tools.I18n setLocale INFORMATION: Setting locale to 'en' Sep. 06, 2024 3:05:58 NACHM. org.bsplines.ltexls.server.LtexTextDocumentItem raiseExceptionIfCanceled FEIN: Canceling check due to incoming check request... Sep. 06, 2024 3:05:58 NACHM. org.bsplines.ltexls.settings.SettingsManager$Companion logDifferentSettings FEIN: Reinitializing LanguageTool due to different settings for language 'en-GB': setting 'settings', old 'null', new 'non-null' Sep. 06, 2024 3:06:02 NACHM. org.bsplines.ltexls.server.DocumentChecker logTextToBeChecked FEIN: Checking the following text in language 'en-GB' via LanguageTool: "" Sep. 06, 2024 3:06:02 NACHM. org.bsplines.ltexls.server.DocumentChecker checkAnnotatedTextFragment FEIN: Obtained 0 rule matches Sep. 06, 2024 3:06:02 NACHM. org.bsplines.ltexls.server.DocumentChecker logTextToBeChecked FEIN: Checking the following text in language 'en-GB' via LanguageTool: "" Sep. 06, 2024 3:06:02 NACHM. org.bsplines.ltexls.server.DocumentChecker checkAnnotatedTextFragment FEIN: Obtained 0 rule matches Sep. 06, 2024 3:06:02 NACHM. org.bsplines.ltexls.server.DocumentChecker checkAnnotatedTextFragment FEIN: Skipping text check as LTeX has been disabled for files with code language ID 'markdown' via ltex.enabled Sep. 06, 2024 3:06:02 NACHM. org.bsplines.ltexls.server.DocumentChecker logTextToBeChecked FEIN: Checking the following text in language 'en-GB' via LanguageTool: "\n\nBefore the synthesis, all glassware was cleaned with aqua regia. All reactions were, unless denote"... (truncated to 100 characters) Sep. 06, 2024 3:06:05 NACHM. org.bsplines.ltexls.server.DocumentChecker checkAnnotatedTextFragment FEIN: Obtained 0 rule matches Sep. 06, 2024 3:06:05 NACHM. org.bsplines.ltexls.server.DocumentChecker logTextToBeChecked FEIN: Checking the following text in language 'en-GB' via LanguageTool: "\n\n. .\n\n\n\nGeneral information.\n\nBefore the synthesis, all glassware was cleaned with aqua regia..\n\n" Sep. 06, 2024 3:06:06 NACHM. org.bsplines.ltexls.server.DocumentChecker checkAnnotatedTextFragment FEIN: Obtained 1 rule match Sep. 06, 2024 3:06:06 NACHM. org.bsplines.ltexls.server.DocumentChecker logTextToBeChecked FEIN: Checking the following text in language 'en-GB' via LanguageTool: " " Sep. 06, 2024 3:06:06 NACHM. org.bsplines.ltexls.server.DocumentChecker checkAnnotatedTextFragment FEIN: Obtained 0 rule matches Sep. 06, 2024 3:06:06 NACHM. org.bsplines.ltexls.server.DocumentChecker checkAnnotatedTextFragment FEIN: Skipping text check as LTeX has been disabled for files with code language ID 'latex' via ltex.enabled Sep. 06, 2024 3:06:06 NACHM. org.bsplines.ltexls.server.DocumentChecker checkAnnotatedTextFragment FEIN: Skipping text check as LTeX has been disabled for files with code language ID 'latex' via ltex.enabled Sep. 06, 2024 3:06:08 NACHM. org.bsplines.ltexls.server.DocumentChecker logTextToBeChecked FEIN: Checking the following text in language 'en-GB' via LanguageTool: " " Sep. 06, 2024 3:06:08 NACHM. org.bsplines.ltexls.server.DocumentChecker checkAnnotatedTextFragment FEIN: Obtained 0 rule matches Sep. 06, 2024 3:06:08 NACHM. org.bsplines.ltexls.server.DocumentChecker checkAnnotatedTextFragment FEIN: Skipping text check as LTeX has been disabled for files with code language ID 'latex' via ltex.enabled Sep. 06, 2024 3:06:08 NACHM. org.bsplines.ltexls.server.DocumentChecker checkAnnotatedTextFragment FEIN: Skipping text check as LTeX has been disabled for files with code language ID 'latex' via ltex.enabled Sep. 06, 2024 3:06:08 NACHM. org.bsplines.ltexls.server.DocumentChecker logTextToBeChecked FEIN: Checking the following text in language 'en-GB' via LanguageTool: "" Sep. 06, 2024 3:06:08 NACHM. org.bsplines.ltexls.server.DocumentChecker checkAnnotatedTextFragment FEIN: Obtained 0 rule matches Sep. 06, 2024 3:06:08 NACHM. org.bsplines.ltexls.server.DocumentChecker logTextToBeChecked FEIN: Checking the following text in language 'en-GB' via LanguageTool: "" Sep. 06, 2024 3:06:08 NACHM. org.bsplines.ltexls.server.DocumentChecker checkAnnotatedTextFragment FEIN: Obtained 0 rule matches Sep. 06, 2024 3:06:08 NACHM. org.bsplines.ltexls.server.DocumentChecker checkAnnotatedTextFragment FEIN: Skipping text check as LTeX has been disabled for files with code language ID 'markdown' via ltex.enabled Sep. 06, 2024 3:06:08 NACHM. org.bsplines.ltexls.server.DocumentChecker logTextToBeChecked FEIN: Checking the following text in language 'en-GB' via LanguageTool: "\n\n. .\n\n\n\nGeneral information.\n\nBefore the synthesis, all glassware was cleaned with aqua regia..\n\n" Sep. 06, 2024 3:06:08 NACHM. org.bsplines.ltexls.server.DocumentChecker checkAnnotatedTextFragment FEIN: Obtained 1 rule match Sep. 06, 2024 3:06:08 NACHM. org.bsplines.ltexls.server.DocumentChecker logTextToBeChecked FEIN: Checking the following text in language 'en-GB' via LanguageTool: "\n\nBefore the synthesis, all glassware was cleaned with aqua regia. All reactions were, unless denote"... (truncated to 100 characters) Sep. 06, 2024 3:06:08 NACHM. org.bsplines.ltexls.server.DocumentChecker checkAnnotatedTextFragment FEIN: Obtained 0 rule matches Sep. 06, 2024 3:06:08 NACHM. org.bsplines.ltexls.server.DocumentChecker logTextToBeChecked FEIN: Checking the following text in language 'en-GB' via LanguageTool: " " Sep. 06, 2024 3:06:08 NACHM. org.bsplines.ltexls.server.DocumentChecker checkAnnotatedTextFragment FEIN: Obtained 0 rule matches Sep. 06, 2024 3:06:08 NACHM. org.bsplines.ltexls.server.DocumentChecker checkAnnotatedTextFragment FEIN: Skipping text check as LTeX has been disabled for files with code language ID 'latex' via ltex.enabled Sep. 06, 2024 3:06:08 NACHM. org.bsplines.ltexls.server.DocumentChecker checkAnnotatedTextFragment FEIN: Skipping text check as LTeX has been disabled for files with code language ID 'latex' via ltex.enabled Sep. 06, 2024 3:06:08 NACHM. org.bsplines.ltexls.server.DocumentChecker logTextToBeChecked FEIN: Checking the following text in language 'en-GB' via LanguageTool: "\n\n. .\n\n\n\nGeneral information.\n\nBefore the synthesis, all glassware was cleaned with aqua regia..\n\n" Sep. 06, 2024 3:06:08 NACHM. org.bsplines.ltexls.server.DocumentChecker checkAnnotatedTextFragment FEIN: Obtained 1 rule match ```

"LTeX+ Language Client" log file See below. I replaced my name with "Name" by find & replace.

``` 2024-09-06T13:09:47.404Z Info: Setting LTeX UI language to 'en-us'. 2024-09-06T13:09:47.405Z Info: Loading i18n messages... 2024-09-06T13:09:47.406Z Info: Loading default i18n messages... 2024-09-06T13:09:47.409Z Info: 2024-09-06T13:09:47.409Z Info: ltex.ltex-ls.path not set. 2024-09-06T13:09:47.409Z Info: Searching for ltex-ls in 'c:\Users\Name\.vscode\extensions\ltex-plus.vscode-ltex-plus-14.0.0\lib'... 2024-09-06T13:09:47.410Z Info: ltex-ls found in 'c:\Users\Name\.vscode\extensions\ltex-plus.vscode-ltex-plus-14.0.0\lib\ltex-ls-plus-17.0.1'. 2024-09-06T13:09:47.410Z Info: 2024-09-06T13:09:47.410Z Info: Using ltex-ls from 'c:\Users\Name\.vscode\extensions\ltex-plus.vscode-ltex-plus-14.0.0\lib\ltex-ls-plus-17.0.1'. 2024-09-06T13:09:47.410Z Info: Using Java bundled with ltex-ls as ltex.java.path is not set. 2024-09-06T13:09:47.411Z Info: Testing ltex-ls... 2024-09-06T13:09:47.411Z Info: Command: "c:\\Users\\Name\\.vscode\\extensions\\ltex-plus.vscode-ltex-plus-14.0.0\\lib\\ltex-ls-plus-17.0.1\\bin\\ltex-ls-plus.bat" 2024-09-06T13:09:47.411Z Info: Arguments: ["--version"] 2024-09-06T13:09:47.411Z Info: env['JAVA_HOME']: undefined 2024-09-06T13:09:47.411Z Info: env['JAVA_OPTS']: "-Xms64m -Xmx512m" 2024-09-06T13:09:49.728Z Info: Test successful! 2024-09-06T13:09:49.728Z Info: 2024-09-06T13:09:49.744Z Info: Starting ltex-ls... 2024-09-06T13:09:49.744Z Info: Command: "c:\\Users\\Name\\.vscode\\extensions\\ltex-plus.vscode-ltex-plus-14.0.0\\lib\\ltex-ls-plus-17.0.1\\bin\\ltex-ls-plus.bat" 2024-09-06T13:09:49.744Z Info: Arguments: [] 2024-09-06T13:09:49.744Z Info: env['JAVA_HOME']: undefined 2024-09-06T13:09:49.744Z Info: env['JAVA_OPTS']: "-Xms64m -Xmx512m" 2024-09-06T13:09:49.744Z Info: 2024-09-06T13:10:08.542Z Info: Started watching external setting file 'd:\Name\Documents\Masterarbeit\LaTeX MA\.vscode\ltex.dictionary.en-GB.txt'. 2024-09-06T13:10:08.554Z Info: Started watching external setting file 'd:\Name\Documents\Masterarbeit\LaTeX MA\.vscode\ltex.disabledRules.en-GB.txt'. 2024-09-06T13:10:08.577Z Info: Started watching external setting file 'd:\Name\Documents\Masterarbeit\LaTeX MA\.vscode\ltex.hiddenFalsePositives.en-GB.txt'. ```

Version information

Additional context/information Thank you very much for this wonderful tool! It has been a great help to me so far.

spitzerd commented 1 week ago

To tell the truth, analyzing this issue would require most likely time-consuming debugging. Also, I am not familiar with the complete code yet, because Julian Valentin (the creator of LTeX) invested countless hours over years to build LTeX.

I am sorry, but this issue is not critical and there are other issues on which I have to work first (e.g native ARM builds for macOS)

If anyone has a solution, feel free to submit a Pull Request. Once I have the time and the knowledge about the code, I will have a look on your issue again.

Anyway, thank you for submitting the issue.

alchemiker commented 3 days ago

It's okay, I finished to write my thesis despite this bug, and LTeX-Plus has been a wonderful tool! I just thought that maintainers would like to know about the issues with their tools even if they don't know how to resolve it yet. Maybe someone who knows the solution will come along someday : )