neo-ltex / 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
16 stars 1 forks source link

German spelling errors are not recognized/displayed #49

Closed AdiWeit closed 4 months ago

AdiWeit commented 5 months ago

Note: It is highly recommended to follow the instructions at https://valentjn.github.io/ltex/vscode-ltex/contributing.html#how-to-report-bugs and use the LTeX: Report bug in LTeX command from within Visual Studio Code. Per the contribution guidelines, deleting parts of the template or not filling in vital information may result in the issue to be immediately closed as invalid.

Describe the bug Spelling errors in a German text (typed markdown for example) will not be recognized or at least not displayed as an error.

Steps to reproduce Steps to reproduce the behavior:

  1. Create a new document
  2. Set the language mode to Markdown
  3. enter the text Deshalb ist die Leitfrage dieser Arbeit, warum C# entwicklet wurde, wenn es doch Java schon gab. or something else with spelling errors
  4. See error (the spelling entwicklet for example will not be marked, although it should obviously be entwickelt)

Expected behavior It would be expected to be marked as an error. Maybe there should even be a quick fix to the problem. The expected behavior is pretty much what the language tool "demo" on their website does if you put the same text in there.

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.

```markdown Deshalb ist die Leitfrage dieser Arbeit, warum C# entwicklet wurde, wenn es doch Java schon gab. ```

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.

``` { "enabled": [ "bibtex", "context", "context.tex", "html", "latex", "markdown", "org", "restructuredtext", "rsweave" ], "language": "de", "dictionary": {}, "disabledRules": {}, "enabledRules": {}, "hiddenFalsePositives": {}, "bibtex": { "fields": {} }, "latex": { "commands": {}, "environments": {} }, "markdown": { "nodes": {} }, "configurationTarget": { "dictionary": "workspaceFolderExternalFile", "disabledRules": "workspaceFolderExternalFile", "hiddenFalsePositives": "workspaceFolderExternalFile" }, "additionalRules": { "enablePickyRules": false, "motherTongue": "de", "languageModel": "", "neuralNetworkModel": "", "word2VecModel": "" }, "languageToolHttpServerUri": "", "languageToolOrg": { "username": "", "apiKey": "" }, "ltex-ls": { "path": "", "logLevel": "fine", "languageToolHttpServerUri": "", "languageToolOrgUsername": "", "languageToolOrgApiKey": "" }, "java": { "path": "", "initialHeapSize": 64, "maximumHeapSize": 512 }, "sentenceCacheSize": 2000, "completionEnabled": false, "diagnosticSeverity": "information", "checkFrequency": "save", "clearDiagnosticsWhenClosingFile": true, "statusBarItem": false, "trace": { "server": "off" } } ```

"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 - 08:50:26] Starte ltex-ls ... Feb. 14, 2024 8:50:46 VORM. org.bsplines.ltexls.server.LtexLanguageServer initialize INFORMATION: ltex-ls 15.2.0 - initializing... Feb. 14, 2024 8:50:46 VORM. org.bsplines.ltexls.tools.I18n setLocale INFORMATION: Setting locale to 'en' Feb. 14, 2024 8:50:47 VORM. org.bsplines.ltexls.settings.SettingsManager$Companion logDifferentSettings FEIN: Reinitializing LanguageTool due to different settings for language 'de': setting 'settings', old 'null', new 'non-null' Feb. 14, 2024 8:50:53 VORM. org.bsplines.ltexls.server.DocumentChecker logTextToBeChecked FEIN: Checking the following text in language 'de' via LanguageTool: "" Feb. 14, 2024 8:50:53 VORM. org.bsplines.ltexls.server.DocumentChecker checkAnnotatedTextFragment FEIN: Obtained 0 rule matches Feb. 14, 2024 8:50:58 VORM. org.bsplines.ltexls.server.DocumentChecker logTextToBeChecked FEIN: Checking the following text in language 'de' via LanguageTool: "Deshalb ist die Leitfrage dieser Arbeit, warum C# entwicklet wurde, wenn es doch Java schon gab." Feb. 14, 2024 8:51:09 VORM. org.bsplines.ltexls.server.DocumentChecker checkAnnotatedTextFragment FEIN: Obtained 0 rule matches Feb. 14, 2024 8:51:09 VORM. org.bsplines.ltexls.server.DocumentChecker logTextToBeChecked FEIN: Checking the following text in language 'de' via LanguageTool: "Deshalb ist die Leitfrage dieser Arbeit, warum C# entwicklet wurde, wenn es doch Java schon gab." Feb. 14, 2024 8:51:09 VORM. org.bsplines.ltexls.server.DocumentChecker checkAnnotatedTextFragment FEIN: 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):

``` 2024-02-14T07:50:21.887Z Info: Setting LTeX UI language to 'de'. 2024-02-14T07:50:21.887Z Info: Loading i18n messages... 2024-02-14T07:50:21.893Z Info: Loading default i18n messages... 2024-02-14T07:50:21.901Z Info: 2024-02-14T07:50:21.901Z Info: ltex.ltex-ls.path not set. 2024-02-14T07:50:21.901Z Info: Searching for ltex-ls in '/home/adi/.vscode/extensions/neo-ltex.ltex-13.1.1/lib'... 2024-02-14T07:50:21.903Z Info: ltex-ls found in '/home/adi/.vscode/extensions/neo-ltex.ltex-13.1.1/lib/ltex-ls-15.2.0'. 2024-02-14T07:50:21.903Z Info: 2024-02-14T07:50:21.903Z Info: Using ltex-ls from '/home/adi/.vscode/extensions/neo-ltex.ltex-13.1.1/lib/ltex-ls-15.2.0'. 2024-02-14T07:50:21.903Z Info: Using Java bundled with ltex-ls as ltex.java.path is not set. 2024-02-14T07:50:21.905Z Info: Testing ltex-ls... 2024-02-14T07:50:21.905Z Info: Command: "/home/adi/.vscode/extensions/neo-ltex.ltex-13.1.1/lib/ltex-ls-15.2.0/bin/ltex-ls" 2024-02-14T07:50:21.905Z Info: Arguments: ["--version"] 2024-02-14T07:50:21.905Z Info: env['JAVA_HOME']: undefined 2024-02-14T07:50:21.905Z Info: env['JAVA_OPTS']: "-Xms64m -Xmx512m" 2024-02-14T07:50:26.260Z Info: Test successful! 2024-02-14T07:50:26.260Z Info: 2024-02-14T07:50:26.281Z Info: Starte ltex-ls ... 2024-02-14T07:50:26.281Z Info: Command: "/home/adi/.vscode/extensions/neo-ltex.ltex-13.1.1/lib/ltex-ls-15.2.0/bin/ltex-ls" 2024-02-14T07:50:26.281Z Info: Arguments: [] 2024-02-14T07:50:26.281Z Info: env['JAVA_HOME']: undefined 2024-02-14T07:50:26.281Z Info: env['JAVA_OPTS']: "-Xms64m -Xmx512m" 2024-02-14T07:50:26.281Z Info: 2024-02-14T07:51:17.374Z Info: Creating bug report... ```

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

spitzerd commented 4 months ago

It seems that this is an issue of LanguageTool itself, not LTEX. When you type in the sentence Deshalb ist die Leitfrage dieser Arbeit, warum C# entwicklet wurde, wenn es doch Java schon gab. in https://languagetool.org/de, you also don't get an error message. The right place to submit the issue is the LanguageTool repository: https://github.com/languagetool-org/languagetool

After LanguageTool implemented the fix and released a new version, LTEX has to be updated with the latest LaguageTool version in order to fix the issue.

AdiWeit commented 4 months ago

That's interesting. It seems like it ignores it when you copy and paste the sentence from this site, including the formatting. But if you paste it without the formatting, it does correct it as it should ("ohne Formatierung einfügen" means paste without formatting):

https://github.com/neo-ltex/vscode-ltex/assets/43521682/3ee05535-bbdb-4e0a-a39c-f2effaa98210

So I'm not sure if it really is an issue of LanguageTool itself.

spitzerd commented 4 months ago

You are right, I face the same issue at https://languagetool.org/de You can ignore my first comment.

I just tested in VS Code with LTEX on my Windows computer and LTEX recognizes the spelling error with "ltex.language": "de-DE", in settings.json. If I use "ltex.language": "de", like you, it does not show an error message. Can you verify that on your side?

It's recommended to use a specific country version to improve the spelling correction: https://valentjn.github.io/ltex/settings.html#ltexlanguage

AdiWeit commented 4 months ago

Yes, I can confirm it (using Linux Mint). Thank you for the help :) I don't know if it's intentional. Should I close the issue? :thinking:

AdiWeit commented 4 months ago

I just checked the settings description. Reading it clarifies that it is indeed intentional. Should have done that in the first place :)