-
-
Notifications
You must be signed in to change notification settings - Fork 960
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
Incorrect incremental sync states #596
Comments
The diagnostics would only get refreshed on InsertLeave by default. |
It could be happening when diagnostics are not refreshed on Insert Mode. Theoretically:
IIRC the document is still syncing during Insert Mode, it's just that diagnostics aren't being updated. Due to this syncing the server could be building diagnostic analysis for incomplete states which don't exist after leaving Insert Mode. It seems like InsertLeave is delegating to the same action as TextChangedI so that shouldn't be a problem as far as behavior goes. Line 108 in 568d1cb
Line 125 in 568d1cb
Perhaps the place to look at would be Line 656 in 568d1cb
and also forcing the sync when insertLeave is true.
I've had similar problems with RLS because it's slow, so diagnostic takes time to build and sometimes doesn't go away after InsertLeave. Unsure how to deal with it though because I don't code in Rust much. |
I'm facing the same issue with coc-tsserver. |
@Free-Easy looks like it's caused by slow of language server, please upload log of tsserver. |
Ok. When I encounter this problem again, I'll upload. |
I'm facing the same problem consistently with both cquery and ccls. Diagnostics will show errors on buffer states that never existed, or really old ones. These diagnostics will persist until I force a sync with Here is the log from ccls when this happened, but it doesn't seem very informative: https://gist.github.com/suo/7cf1540552b71fc280b024f4b4887dd8. This problem only started happening when I updated to the latest release, so it could have been a recently introduced regression. I don't know how to check release I was on before though :( |
I'm also facing this problem. Diagnostics stop refreshing randomly and I have to |
I have meet this problem several times. |
I have missed this problem for sometime, please turn on verbose output of language server and upload the output so I can know what happened. |
I rolled back to Edit: I was wrong, |
I'm still having this problem, and I found an example which will consistently reproduce the problem on my machine
So suppose you have a file like the above code snippet Then you put your cursor on the line: typedef ... Then press O to insert a line above. Enter: /*<cr><cr><cr><backspace>/
And then you exit the insert mode using <esc>, you will be seeing a red mark marking the beginning of the comment. It says something about your comment is not finished correctly. However, the error message is incorrect. The way I remove this error is to write the file and reload it using ":e" command, or using ":CocRestart" It's not a big problem, but it's annoying. I'm using clangd-8 BTW. Maybe this type of comments will shadow everything afterward before it's completed, and after completing the comments, the language server will need to process a lot more new symbols that slow it down, this might be the reason why I can constantly reproduce the problem. |
Also reproduce with below javascript code.
Cursor on the line: Then press O to insert a line above. Enter: then got the follow diagnostic: tsserver channel output
|
I can reproduce, consider open a new issue |
Result from CocInfo
vim version: NVIM v0.4.0-430-g8698830cb
node version: v11.12.0
coc.nvim version: 0.0.62
term: xterm-256color
platform: linux
Describe the bug
This bug has been present since I started using Coc.
Diagnostics occasionally appear for buffer states that never existed in vim.
I have observed this bug with several language servers all of which support incremental sync.
After a few seconds plus inserting deleting a space diagnostics become correct.
I'll trace when I get a chance. So I know exactly what is being sent.
Is anyone else having this issue?
The text was updated successfully, but these errors were encountered: