FurqanSoftware / codemirror-languageserver

Language Server integration for CodeMirror 6
BSD 3-Clause "New" or "Revised" License
183 stars 24 forks source link

Issue with wrong diagnostic info position #3

Closed bushev closed 3 years ago

bushev commented 3 years ago

Hey @hjr265,

Thanks for the great usage example!!!

Sometimes, I could see the error that says that a position in a code is wrong to set diagnostics data. It 100% happens when I adding something by clicking to autocomplete tooltip and then trying to remove it with backspace as the end of the document.

Do you know, is it is some known issue?

image

hjr265 commented 3 years ago

Thanks for reporting this @bushev. I have seen similar stack traces being captured from one of my projects using this in production. Although, I wasn't able to reproduce the issue reliably.

I will give this a try and if I can reproduce it, solving it should be easy.

bushev commented 3 years ago

Hey @hjr265,

The root cause with call stack like that was the delayed notification from LS while local document changes.

Thi PR should fix this issue: https://github.com/FurqanSoftware/codemirror-languageserver/pull/4

hjr265 commented 3 years ago

@bushev Spot on! Thank you for the pull request.