x/tools/gopls: Using nil as protocol.ProgressToken will cause trouble #53288
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.
Milestone
Tracker.Start() is defined in internal/lps/progress/progress.go. Its fourth parameter is a protocol.ProgressToken. Although the Go type of ProgressToken is interface{}, the comments in tsprotocol.go (and in the LSP specification) say it must be either an integer or a string.
Most of the calls to Start() pass a nil value, which the code in Start() converts to a randomized string.
The proposed fix is to change the type of ProgressToken to string (which matches all its uses in gopls), replace the nil arguments with empty strings, and replace the test at line 89 of progress.go with a test for an empty string.
The text was updated successfully, but these errors were encountered: