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
63 stars 1 forks source link

Some missing features #34

Closed Cthutu closed 1 month ago

Cthutu commented 2 months ago

Describe the bug

First of all thanks for the fork!

I've followed the instructions to install it and there are missing features that I experienced in the original codebase.

Firstly, the extension doesn't seem to check automatically. I have to run the Check current document command for it to underline anything.

Secondly, there doesn't seem to be any code actions. For example, for a word that is not known, I would expect a code action to add it to the dictionary. VS Code responds with No code actions available.

Steps to reproduce

  1. Run VS Code on Windows.
  2. Open up any text document with mistakes.
  3. Notice it doesn't underline the errors initially.
  4. Run Check Current Document. Ltex finds all the error.
  5. Type Ctrl+. to open up code actions while cursor on underlined word.
  6. Notice no code actions available

Expected behavior I expect Ltex to show underlines immediately on opening document. I expect code actions to be listed on underlined words.

Sample document

.rumours 

Only a foolhardy adventurer would embark upon such a perilous quest
without first finding out as much as possible about the mountain and its
treasures.  Before your arrival at the foot of the Firetop Mountain, you spent
several days with the townsfolk of a local village some two day's journey from
the base.  Being a likeable sort of person, you found it easy to get on with the
local peasants.  Although they told many storis about the mysterious Warlock's
sanctuary, you could not feel sure that all -- or indeed any -- of these were
based on fact.  The villagers had seen many adventurers pass through on their
way to the mountain, but very few ever returned.  The journey ahead was
extremely dangerous, that you knew for certain.  Of those who returned to the
village, none contemplated going back to Firetop Mountain.

LTeX configuration

    "ltex.additionalRules.motherTongue": "en-GB",
    "ltex.language": "en-GB",
    "ltex.disabledRules": {
        "en-GB": [
            "OXFORD_SPELLING_Z_NOT_S"
        ]
    },

"LTeX Language Server" log file

[Info  - 9:30:22 AM] 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 02, 2024 9:30:28 AM org.bsplines.ltexls.server.LtexLanguageServer initialize
INFO: ltex-ls 17.0.1 - initializing...
Sep 02, 2024 9:30:28 AM org.bsplines.ltexls.tools.I18n setLocale
INFO: Setting locale to 'en'
Sep 02, 2024 9:30:28 AM org.bsplines.ltexls.settings.SettingsManager$Companion logDifferentSettings
FINE: Reinitializing LanguageTool due to different settings for language 'en-GB': setting 'settings', old 'null', new 'non-null'
Sep 02, 2024 9:30:29 AM org.bsplines.ltexls.parsing.CodeFragmentizer$Companion create
WARNING: Unsupported code language ID 'requirements.txt', treating text as plaintext
Sep 02, 2024 9:30:29 AM org.bsplines.ltexls.server.DocumentChecker logTextToBeChecked
FINE: Checking the following text in language 'en-GB' via LanguageTool: ".rumours \r\n\r\nOnly a foolhardy adventurer would embark upon such a perilous quest\r\nwithout first find"... (truncated to 100 characters)
Sep 02, 2024 9:30:31 AM org.bsplines.ltexls.server.DocumentChecker checkAnnotatedTextFragment
FINE: Obtained 2 rule matches

"LTeX Language Client" log file

2024-09-02T08:30:22.011Z Info: Setting LTeX UI language to 'en-us'.
2024-09-02T08:30:22.011Z Info: Loading i18n messages...
2024-09-02T08:30:22.011Z Info: Loading default i18n messages...
2024-09-02T08:30:22.012Z Info: 
2024-09-02T08:30:22.013Z Info: ltex.ltex-ls.path not set.
2024-09-02T08:30:22.013Z Info: Searching for ltex-ls in 'c:\Users\Matt17\.vscode-insiders\extensions\ltex-plus.vscode-ltex-plus-14.0.0\lib'...
2024-09-02T08:30:22.013Z Info: ltex-ls found in 'c:\Users\Matt17\.vscode-insiders\extensions\ltex-plus.vscode-ltex-plus-14.0.0\lib\ltex-ls-plus-17.0.1'.
2024-09-02T08:30:22.013Z Info: 
2024-09-02T08:30:22.013Z Info: Using ltex-ls from 'c:\Users\Matt17\.vscode-insiders\extensions\ltex-plus.vscode-ltex-plus-14.0.0\lib\ltex-ls-plus-17.0.1'.
2024-09-02T08:30:22.013Z Info: Using Java bundled with ltex-ls as ltex.java.path is not set.
2024-09-02T08:30:22.014Z Info: Testing ltex-ls...
2024-09-02T08:30:22.014Z Info:   Command: "c:\\Users\\Matt17\\.vscode-insiders\\extensions\\ltex-plus.vscode-ltex-plus-14.0.0\\lib\\ltex-ls-plus-17.0.1\\bin\\ltex-ls-plus.bat"
2024-09-02T08:30:22.014Z Info:   Arguments: ["--version"]
2024-09-02T08:30:22.014Z Info:   env['JAVA_HOME']: undefined
2024-09-02T08:30:22.014Z Info:   env['JAVA_OPTS']: "-Xms64m -Xmx512m"
2024-09-02T08:30:22.831Z Info: Test successful!
2024-09-02T08:30:22.831Z Info: 
2024-09-02T08:30:22.835Z Info: Starting ltex-ls...
2024-09-02T08:30:22.835Z Info:   Command: "c:\\Users\\Matt17\\.vscode-insiders\\extensions\\ltex-plus.vscode-ltex-plus-14.0.0\\lib\\ltex-ls-plus-17.0.1\\bin\\ltex-ls-plus.bat"
2024-09-02T08:30:22.835Z Info:   Arguments: []
2024-09-02T08:30:22.835Z Info:   env['JAVA_HOME']: undefined
2024-09-02T08:30:22.835Z Info:   env['JAVA_OPTS']: "-Xms64m -Xmx512m"
2024-09-02T08:30:22.835Z Info: 

Version information

Cthutu commented 2 months ago

I can work around these issues by

  1. Running the check command
  2. Manually correcting and ignoring the unknown word errors.
spitzerd commented 2 months ago

Based on "LTeX Language Server" log file, you opened a txt file ('requirements.txt'). LTeX+ is not activating itself on txt files and neither does the original LTeX.

Do you write in txt on a regular basis? If yes, we can consider activating LTeX+ on txt files.

Cthutu commented 2 months ago

I do - but if there is a way to turn it on auto for a given file extension, that would be enough. Actually, the file I was working on was not "requirements.txt" but another .txt file. Which is strange, because the following line shows text from the file I was working on (e.g. .rumours). I can't remember if I had a "requirements.txt" open at the time (which is a file used with Python programming), but I was definitely not working on it when I manually activated LTex. I was working on a file called wofm.txt.

However, even after manual activation, I am not seeing any code actions for unknown words or spelling mistakes.

spitzerd commented 2 months ago

Please have a look on following setting: https://ltex-plus.github.io/ltex-plus/settings.html#ltexenabled

Setting "ltex.enabled": ["plaintext"] in your configuration should solve your issue. Please don't forget to restart VS Code after activating this setting.

github-actions[bot] commented 1 month ago

Hi! Per the maintainer guidelines, this issue is automatically closed because it has been stale for too long. The most common reason for an issue to become stale is missing information from its submitter (see one of the previous comments). If the missing information is provided, the issue will be reopened again. Thank you!