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

Ltex not starting automatically for python files #842

Open mgorfer opened 1 year ago

mgorfer commented 1 year ago

Describe the bug Ltex is only starting the analysis of a python file after opening a tex file first.

Steps to reproduce Steps to reproduce the behavior:

  1. Open a .py file
  2. Ltex does not start running
  3. Open a .tex file
  4. Ltex starts and now also works for analyzing comments in the .py file.

Expected behavior Ltex starts up for every file type defined in ltex.enabled in the settings.json

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.additionalRules.enablePickyRules": true, "ltex.dictionary": {}, "ltex.enabled": [ "python", "bibtex", "context", "context.tex", "html", "latex", "markdown", "org", "restructuredtext", "rsweave" ], "ltex.additionalRules.motherTongue": "de-AT", ```

"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 - 22:26:45] Starting ltex-ls... Jul 15, 2023 10:26:49 PM org.bsplines.ltexls.server.LtexLanguageServer initialize INFO: ltex-ls 15.2.0 - initializing... Jul 15, 2023 10:26:49 PM org.bsplines.ltexls.tools.I18n setLocale INFO: Setting locale to 'en' Jul 15, 2023 10:26:49 PM org.bsplines.ltexls.settings.SettingsManager$Companion logDifferentSettings FINE: Reinitializing LanguageTool due to different settings for language 'en-US': setting 'additionalRules.motherTongue', old '', new 'de-AT' Jul 15, 2023 10:26:49 PM org.bsplines.ltexls.server.DocumentChecker logTextToBeChecked FINE: Checking the following text in language 'en-US' via LanguageTool: "This is short." Jul 15, 2023 10:26:51 PM org.bsplines.ltexls.server.DocumentChecker checkAnnotatedTextFragment FINE: Obtained 0 rule matches Jul 15, 2023 10:26:57 PM org.bsplines.ltexls.server.DocumentChecker logTextToBeChecked FINE: Checking the following text in language 'en-US' via LanguageTool: "\n\n\nThis is two banana." Jul 15, 2023 10:26:57 PM org.bsplines.ltexls.server.DocumentChecker checkAnnotatedTextFragment FINE: Obtained 1 rule match Jul 15, 2023 10:26:57 PM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint handleCancellation WARNING: Unmatched cancel notification for request id 5 Jul 15, 2023 10:26:58 PM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint handleCancellation WARNING: Unmatched cancel notification for request id 8 ```

"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-07-15T20:26:44.765Z Info: Setting LTeX UI language to 'en-us'. 2023-07-15T20:26:44.765Z Info: Loading i18n messages... 2023-07-15T20:26:44.766Z Info: Loading default i18n messages... 2023-07-15T20:26:44.768Z Info: 2023-07-15T20:26:44.769Z Info: ltex.ltex-ls.path not set. 2023-07-15T20:26:44.769Z Info: Searching for ltex-ls in '/home/user/.vscode/extensions/valentjn.vscode-ltex-13.1.0/lib'... 2023-07-15T20:26:44.769Z Info: ltex-ls found in '/home/user/.vscode/extensions/valentjn.vscode-ltex-13.1.0/lib/ltex-ls-15.2.0'. 2023-07-15T20:26:44.769Z Info: 2023-07-15T20:26:44.769Z Info: Using ltex-ls from '/home/user/.vscode/extensions/valentjn.vscode-ltex-13.1.0/lib/ltex-ls-15.2.0'. 2023-07-15T20:26:44.769Z Info: Using Java bundled with ltex-ls as ltex.java.path is not set. 2023-07-15T20:26:44.769Z Info: Testing ltex-ls... 2023-07-15T20:26:44.769Z Info: Command: "/home/user/.vscode/extensions/valentjn.vscode-ltex-13.1.0/lib/ltex-ls-15.2.0/bin/ltex-ls" 2023-07-15T20:26:44.770Z Info: Arguments: ["--version"] 2023-07-15T20:26:44.770Z Info: env['JAVA_HOME']: undefined 2023-07-15T20:26:44.770Z Info: env['JAVA_OPTS']: "-Xms64m -Xmx512m" 2023-07-15T20:26:45.308Z Info: Test successful! 2023-07-15T20:26:45.308Z Info: 2023-07-15T20:26:45.311Z Info: Starting ltex-ls... 2023-07-15T20:26:45.311Z Info: Command: "/home/user/.vscode/extensions/valentjn.vscode-ltex-13.1.0/lib/ltex-ls-15.2.0/bin/ltex-ls" 2023-07-15T20:26:45.311Z Info: Arguments: [] 2023-07-15T20:26:45.311Z Info: env['JAVA_HOME']: undefined 2023-07-15T20:26:45.311Z Info: env['JAVA_OPTS']: "-Xms64m -Xmx512m" 2023-07-15T20:26:45.311Z Info: ```

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

Catatomik commented 9 months ago

Also having this issue with C files instead of python. Same behavior : doesn't start on C files before opening a tex file. But works great after opening a tex file.