-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
Disable PUNCTUATION_PARAGRAPH_END for current line #46
Comments
@tobiasdiez I see where you're coming from, but I wouldn't do it as you suggested:
What I can imagine is having some kind of detection whether the user is typing (we only get text change events, so we have to determine when they stopped), and if they are, omit any diagnostics at the current caret position. The diagnostics would pop up one or two seconds after they stopped typing. |
While formulating the feature suggestion I also realized that it might be hard to implement properly. What about combining both ideas:
For now I'm also happy with completely disabling this rule, so if you fell like this cannot be implemented in a nice fashion, feel free to close this suggestion. |
The LSP spec only supports text change events. We do not know where the caret is; we'd have to infer that from the text change events. There's microsoft/language-server-protocol#718 proposing to implement some kind of notification for that. Of course it would be possible to somehow get the info, but I'm a bit reluctant to write a workaround just tailored to VS Code, since that kind of defeats the purpose of LSP. |
Fix released in 6.0.0. |
The incremental document updates sporadically led to diverging documents (document in the editor vs. what LTEX thinks what the document is), i.e., the positions of the diagnostics were not matching the contents of the document anymore. I'm not sure whether the reason was messy RPC communication, or whether LTEX incorrectly applied the incremental updates. Anyways, with 7.3.0, full document updates will be used again, as correct diagnostics are too important. Unfortunately, this means that we cannot guess the position of the caret anymore, so this feature is then disabled. If this bothers people, I suggest opening an issue for VS Code to not immediately request diagnostics while typing. I would say LTEX is behaving as expected: If VS Code requests diagnostics, it gets diagnostics. |
I've implemented a workaround to guess the position of the caret even for full document updates, so this should work again in the next release. |
Is your feature request related to a problem? Please describe.
If you are in the middle of writing a sentence, for example at "This is a |" (where
|
is the cursor), then ltex complains that there is no punctuation by underlyinga
. While being correct, it is distracting because one things there is a problem with the last word but its actually only because one has not yet finished the sentence.Describe the solution you'd like
Ignore the rule PUNCTUATION_PARAGRAPH_END for the current sentence.
Describe alternatives you've considered
Disabling PUNCTUATION_PARAGRAPH_END completely, which is what I do currently.
The text was updated successfully, but these errors were encountered: