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
- Visual Studio Code version: 1.49.1
- Java extension version: 0.67.0
Steps To Reproduce
- Open a Java class with problems in it (unused variable warnings, for example).
- Make some changes in quick succession.
- You should see the error messages jumping around and getting offset to incorrect positions.
- In some rare cases, the error messages get stuck on the wrong location until a new character is typed.
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:

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:
