x/tools/gopls: blocking methods until notifications/requirements processed #32444
Labels
FrozenDueToAge
gopls
Issues related to the Go language server, gopls.
Tools
This label describes issues relating to any tools in the x/tools repository.
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
This is really a placeholder issue following discussion with @ianthehat on Slack.
In various
govim
integration tests, I am having to insert "waits" in order to be suregopls
can handle a particular request.Consider the following sequence:
govim
, which startsgopls
, callsInitialize
, callsInitialized
)main.go
(which results indidOpen
notification togopls
)Note: all of the above steps are sequential.
If these steps happen quickly, the triggering of go-to-def can happen before
gopls
is "ready". This results in a response along the lines of "don't know anything about identifier under cursor".As a workaround, I am waiting for diagnostics to be sent for
main.go
before triggering the go-to-def.However, I think this should really be an implementation detail of
gopls
. i.e. when the call to go-to-def comes in, any pending notifications should be handled, processed etc in such a way that if any is relevant to the subsequent go-to-def call they must be handled before the call (because the events themselves happened before).cc @stamblerre @ianthehat
The text was updated successfully, but these errors were encountered: