Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delay Runs after Quick Fix or Enable Quick Fix while Running #390

Closed
alexandres opened this issue Aug 20, 2021 · 2 comments
Closed

Delay Runs after Quick Fix or Enable Quick Fix while Running #390

alexandres opened this issue Aug 20, 2021 · 2 comments
Assignees
Labels
1-feature-request ✨ Issue type: Request for a desirable, nice-to-have feature 3-fixed Issue resolution: Issue has been fixed on the develop branch
Milestone

Comments

@alexandres
Copy link

Is your feature request related to a problem? Please describe.

When using the Quick fix "Add _ to dictionary", LTeX re-runs immediately for the entire document. For long documents, this makes it very slow to correct errors, since Quick fixes are disabled while LTeX is running. I've tried setting LTeX frequency to 'Manual' but it still runs immediately. I don't mind if the "Problems" corresponding to the added word are not cleared immediately after adding it to the dictionary.

Describe the solution you'd like

Either respect the 'Manual' setting, or don't disable Quick fixes while LTeX is running.

Describe alternatives you've considered

Right now I'm manually editing the .vscode/ltex.dictionary.en-US.txt file to sidestep this issue.

Additional context

None.

@alexandres alexandres added the 1-feature-request ✨ Issue type: Request for a desirable, nice-to-have feature label Aug 20, 2021
@valentjn valentjn self-assigned this Aug 21, 2021
@valentjn
Copy link
Owner

Thanks for the feature request. The problem is that LanguageTool (LT) was reinitialized when the dictionary changed, which cleared the sentence cache. This means a full recheck of the document, not an incremental one.

I mitigated this by having LTEX filter out unknown word rule matches when the word is in the dictionary, and not reinitializing LT with the new dictionary when it changes. This might result in slightly different diagnostics and correction suggestions (Use '...' quick fixes) after adding a word to the dictionary compared to closing and reopening the document as LT might use the dictionary to alter its behavior, but at least we don't have to reinitialize LT anymore.

The same holds for the Disable rule quick fix. LTEX now takes care of filtering out matches of disabled rules itself, so that we don't have to supply the disabled rules to LT anymore.

Regarding ltex.checkFrequency, the documentation is pretty clear about that (emphasis mine—the dictionary is part of the settings):

"manual": Documents are not checked automatically, except when the settings change. Use commands such as LTeX: Check Current Document to manually trigger checks.

@valentjn valentjn added the 3-fixed Issue resolution: Issue has been fixed on the develop branch label Aug 21, 2021
@valentjn valentjn added this to the 11.1.0 milestone Aug 21, 2021
@valentjn
Copy link
Owner

Fix released in 12.0.0.

me-johnomar added a commit to me-johnomar/ltex-ls that referenced this issue Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1-feature-request ✨ Issue type: Request for a desirable, nice-to-have feature 3-fixed Issue resolution: Issue has been fixed on the develop branch
Projects
None yet
Development

No branches or pull requests

2 participants