Open bcmills opened 4 years ago
I can still reproduce this problem using eglot v1.15 and gopls v0.15. I can also reproduce it with VS Code, so it's definitely at least partly a gopls bug as well.
In particular, I notice that the state change from no package to package doesn't cause the correct invalidation, but introducing and reverting a typo into the package declaration does cause the correct invalidation in both directions.
Also, in Emacs but not in Code, deleting the file has a similar (but inverse) lack of invalidation: the reference pkg.Thing continues to generate hover messages describing the phantom type; it persists until a gopls restart.
Configuration
Initial project state (in
txtar
format):My
eglot
configuration (.emacs
):Steps to reproduce:
emacs -nw main.go
Observe that
main.go
has agopls
diagnostic on theimport
statement.M-x find-file ./pkg/pkg.go
In the new buffer, enter the contents:
and then save the buffer. (Create the subdirectory when prompted.)
Look at the
main.go
buffer from step (2).Expected behavior
The error in the
main.go
buffer should clear whendep/dep.go
is saved (or, ideally, when its contents are entered in the buffer).Observed behavior
The error in the
main.go
buffer does not clear until I runM-x eglot-reconnect
in themain.go
buffer.Some particular points of interest:
textDocument/didOpen
events forpkg/pkg.go
, despite the fact that the buffer opens ingo-mode
.Flymake
orElDoc
minor-mode indicators in thepkg.go
buffer, which suggests to me thateglot-ensure
has not activatedeglot
for that buffer.M-x eglot-events-buffer
: