-
Notifications
You must be signed in to change notification settings - Fork 456
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
Problem messages can get offset by frequent changes to the document #1633
Comments
If anyone wants a more detailed showcase on how to reproduce the issue, see my comment here. Those instructions apply to this issue as well. |
Here's another example, which occurred when applying a fix from the integrated merge conflict resolver in VS Code. The errors were caused by the conflict markers, but when the document was changed with the conflict resolver, the errors became offset to the wrong location, and also didn't go away until the document was changed again. I'm guessing the cause is that the conflict resolver is making multiple document edits in quick succession when applying the fix. This is what I mean by "conflict resolver". The fix I applied was "Accept Incoming Change". |
I've just discovered the root cause of this issue, see eclipse-jdtls/eclipse.jdt.ls#1920 for details and how to reproduce this issue with 100% accuracy. |
Now that we know the cause for the issue I also realized that if you use |
Seeing as eclipse-jdtls/eclipse.jdt.ls#1930 was merged (and fixes this issue), this issue can now be closed. |
When editing a Java file with problems in it, the underlines (reported problem positions) can sometimes become offset. Usually, this fixes itself after a second or so of delay, but in some rare cases the problem underline gets stuck in the wrong position until further changes are made to the document.
Environment
Steps To Reproduce
Current Result
Expected Result
The error messages (underlines) should always appear on the correct positions, and never get stuck on the wrong ones, like in the screenshot above.
Additional Informations
As you can see in the screenshots above, not only are the error messages offset, the semantic tokens are also offset in the exact same way (see #1597). I've submitted two PRs (#1632, eclipse-jdtls/eclipse.jdt.ls#1552) to fix the semantic highlighting issue, but this issue with problem messages still persists since I only changed the semantic highlighting implementation. From what I can tell in the screenshots above, the two issues seem highly related, so a fix for this PR can probably be made by looking at how I fixed #1597.
This is how the semantic tokens look with #1632 and eclipse-jdtls/eclipse.jdt.ls#1552 applied, I would expect the problem underlines to behave in the same way:

The text was updated successfully, but these errors were encountered: