Skip to content
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

x/tools/gopls: Using nil as protocol.ProgressToken will cause trouble #53288

Closed
pjweinb opened this issue Jun 8, 2022 · 1 comment
Closed
Assignees
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

Comments

@pjweinb
Copy link

pjweinb commented Jun 8, 2022

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.

@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Jun 8, 2022
@gopherbot gopherbot added this to the Unreleased milestone Jun 8, 2022
@pjweinb pjweinb self-assigned this Jun 8, 2022
@jamalc jamalc modified the milestones: Unreleased, gopls/later Jun 8, 2022
@pjweinb
Copy link
Author

pjweinb commented Feb 2, 2023

This is obsolete.

@pjweinb pjweinb closed this as completed Feb 2, 2023
@golang golang locked and limited conversation to collaborators Feb 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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.
Projects
None yet
Development

No branches or pull requests

3 participants