-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
vim-go highlighting of gopls diagnostics not updating on write #2753
Comments
Can you be more specific? I'll need a way to replicate what you're seeing if this has any chance of getting fixed. A few things I'mo wondering:
|
I have the exact same issue. How I caught the issue:
I've tried running all type of commands in order to get it working. But the highlighting is not showing. @bhcleek, I can answer the following:
|
@miscing I can't duplicate this in $GOPATH either. Does this problem still exist for you on master? Also, can you run vim with |
It still persists on master. debug output: sent: Content-Length: 288^M^@^M^@{"method": "textDocument/didChange", "jsonrpc": "2.0", "params": {"contentChanges": [{"text": "package main\n\nimport "fmt"\n\nfunc main() {\n\n\t// hello := "hello"\n\tfmt.Println(hello)\n}\n"}], "textDocument": {"uri": "file:///[REMOVED:GOPATH]/go/src/hello/main.go", "version": 7}}} go pls check works fine inside GOPATH. |
There should be a lot more output than that. |
That log doesn't show any |
Another attempt. Thanks for the patience. |
@miscing those logs show that the diagnostics were cleared after your edits. The first diagnostic that identified the problematic code:
followed by writing your changes:
followed by the diagnostics that show that there are no errors:
I'm still unable to duplicate what you're describing. The last screen recording you posted doesn't show the command you're typing, which is what I'd need to be able to see to understand when the file is being written so that I can correlate that with what's highlighted. |
I've created a small project outside GOPATH. NOTE: I have other projects defined outside GOPATH, but this problem never showed before the binaries update I did couple of days ago. |
github.com/miscing/govim-highlighting-issue Did the same, one directory has gif of issue inside gopath and other gif of no issue outside gopath. gif of issue and logs included here too: |
Thank you for your patience. I can duplicate this now and will have a fix soon. |
A quick progress report: I'm making headway, but am currently fighting getting some useful tests working so I can validate my fixes; we have to be careful with this to avoid introducing a regression. In the meantime, you might consider either disabling the gopls diagnostic highlighting entirely or going back to revision that doesn't have this problem (252602d ?) or v1.22. |
@bhcleek I guess only checkout to v1.22 is not enough. What else I need to execute ? |
@davidlubomirov That should be enough, but you have to check it out to the right place. Without knowing how you manage your Vim plugins, it's impossible for me to say precisely what you need to do. |
I've made progress on the tests, so I'll be able to focus on implementing a fix. |
The solution for this issue was delayed, because my computer took a dive shortly after my last progress update. I have good tests and am working on a fix, but I am having a hard time getting one in place. Interestingly, I can duplicate the issue pretty easily. I'm trying to figure out if this is a bug in Vim or not. Either way, using |
I have the tests passing. Now I need to write one more to deal with another situation that the code was trying to workaround when formatting or imports are changed on write. |
I'm finally nearly done with this. It was surprisingly tricky to get right, and I suspect there is still an edge case that I'm going to try to verify and hopefully resolve before I merge the PR after I put it up. |
What did you do? (required: The issue will be closed when not provided)
Highlighting seems to work incorrectly, cannot think of a way reproduce issue other than stating that highlighting does not update on ":w" since last update. For some reason quitting and re-entering file does work. Writing to file fails to pickup both new errors and remove fixed errors
What did you expect to happen?
Highlighting to disappear as per usual behavior before update. Also new syntax errors should highligh automatically after a write to file. Now requires exiting and re-entering.
What happened instead?
Incorrect highlighting persists unless one exits and re-opens vim.
Configuration (MUST fill this out):
vim-go version:
v.1.22
vimrc
you used to reproduce:vimrc
Vim version (first three lines from
:version
):NVIM v0.4.3
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Go version (
go version
):go1.13.6 linux/amd64
Go environment
go env
Output:gopls version
gopls version
Output:The text was updated successfully, but these errors were encountered: