valentjn / vscode-ltex

LTeX: Grammar/spell checker :mag::heavy_check_mark: for VS Code using LanguageTool with support for LaTeX :mortar_board:, Markdown :pencil:, and others
https://valentjn.github.io/ltex
Mozilla Public License 2.0
800 stars 27 forks source link

Spell check stops between `$\in[$` and `]` #859

Open peiranxiao opened 11 months ago

peiranxiao commented 11 months ago

Describe the bug Spell check stops between $\in[$ and $]$ (or simply ]). Checking is restored after adding a whitespace in `$\in [$'.

Steps to reproduce Steps to reproduce the behavior:

  1. Input This is a bugs. This are another mistake. $y \in (c,d].$ LTeX catches the mistakes.
  2. Add $x \in[a,b)$. before the sentence. LTeX stops checking between \in[ and ].
  3. Add a whitespace after \in: $x \in [a,b)$. LTeX starts checking again.

Expected behavior Spell check stops between $\in[$' and]. Checking is restored after adding a whitespace in$\in [$'.

Sample document If the bug occurs for a specific document (e.g. LaTeX), please paste it here. If your document is very long or confidential, please create and attach a smaller example for which the bug still occurs so that we can reproduce it.

``` \begin{document} $x\in[a,b)$. This is a bugs. This are another mistake. $(c,d]$ \end{document} ```

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.

Default

"LTeX Language Server" log file First, reproduce the bug. Then, go to ViewOutput and select LTeX Language Server in the drop-down list. Paste this log here:

``` [Info - 11:43:29 PM] Starting ltex-ls... Nov 02, 2023 11:43:35 PM org.bsplines.ltexls.server.LtexLanguageServer initialize INFO: ltex-ls 15.2.0 - initializing... Nov 02, 2023 11:43:35 PM org.bsplines.ltexls.tools.I18n setLocale INFO: Setting locale to 'en' Nov 02, 2023 11:43:35 PM org.bsplines.ltexls.settings.SettingsManager$Companion logDifferentSettings FINE: Reinitializing LanguageTool due to different settings for language 'en-US': setting 'additionalRules.motherTongue', old '', new 'zh-CN' Nov 02, 2023 11:43:36 PM org.bsplines.ltexls.server.DocumentChecker logTextToBeChecked FINE: Checking the following text in language 'en-US' via LanguageTool: " Ina0Dummy1\n\n" Nov 02, 2023 11:43:37 PM org.bsplines.ltexls.server.DocumentChecker checkAnnotatedTextFragment FINE: Obtained 0 rule matches ```

"LTeX Language Client" log file First, set the ltex.trace.server setting in your settings.json to "verbose". Then, reload the VS Code window and reproduce the bug. Go to ViewOutput and select LTeX Language Client in the drop-down list. Paste this log here (note: it will contain your checked document):

``` 2023-11-03T03:43:27.805Z Info: Setting LTeX UI language to 'en-us'. 2023-11-03T03:43:27.805Z Info: Loading i18n messages... 2023-11-03T03:43:27.806Z Info: Loading default i18n messages... 2023-11-03T03:43:27.808Z Info: 2023-11-03T03:43:27.808Z Info: ltex.ltex-ls.path not set. 2023-11-03T03:43:27.808Z Info: Searching for ltex-ls in 'c:\Users\xiaop\.vscode\extensions\valentjn.vscode-ltex-13.1.0\lib'... 2023-11-03T03:43:27.809Z Info: ltex-ls found in 'c:\Users\xiaop\.vscode\extensions\valentjn.vscode-ltex-13.1.0\lib\ltex-ls-15.2.0'. 2023-11-03T03:43:27.809Z Info: 2023-11-03T03:43:27.809Z Info: Using ltex-ls from 'c:\Users\xiaop\.vscode\extensions\valentjn.vscode-ltex-13.1.0\lib\ltex-ls-15.2.0'. 2023-11-03T03:43:27.809Z Info: Using Java bundled with ltex-ls as ltex.java.path is not set. 2023-11-03T03:43:27.810Z Info: Testing ltex-ls... 2023-11-03T03:43:27.810Z Info: Command: "c:\\Users\\xiaop\\.vscode\\extensions\\valentjn.vscode-ltex-13.1.0\\lib\\ltex-ls-15.2.0\\bin\\ltex-ls.bat" 2023-11-03T03:43:27.810Z Info: Arguments: ["--version"] 2023-11-03T03:43:27.810Z Info: env['JAVA_HOME']: undefined 2023-11-03T03:43:27.810Z Info: env['JAVA_OPTS']: "-Xms64m -Xmx512m" 2023-11-03T03:43:29.293Z Info: Test successful! 2023-11-03T03:43:29.293Z Info: 2023-11-03T03:43:29.297Z Info: Starting ltex-ls... 2023-11-03T03:43:29.297Z Info: Command: "c:\\Users\\xiaop\\.vscode\\extensions\\valentjn.vscode-ltex-13.1.0\\lib\\ltex-ls-15.2.0\\bin\\ltex-ls.bat" 2023-11-03T03:43:29.297Z Info: Arguments: [] 2023-11-03T03:43:29.297Z Info: env['JAVA_HOME']: undefined 2023-11-03T03:43:29.297Z Info: env['JAVA_OPTS']: "-Xms64m -Xmx512m" 2023-11-03T03:43:29.297Z Info: 2023-11-03T03:43:35.841Z Info: Started watching external setting file '\.vscode\ltex.dictionary.en-US.txt'. ```

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

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