You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Observe that main.go has a gopls diagnostic on the import statement.
M-x find-file ./pkg/pkg.go
In the new buffer, enter the contents:
package pkg
typeThingstruct{}
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 when dep/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 run M-x eglot-reconnect in the main.go buffer.
Some particular points of interest:
There do not seem to be any textDocument/didOpen events for pkg/pkg.go, despite the fact that the buffer opens in go-mode.
There are no Flymake or ElDoc minor-mode indicators in the pkg.go buffer, which suggests to me that eglot-ensure has not activated eglot for that buffer.
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
:The text was updated successfully, but these errors were encountered: