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: gopls api json should preserve deprecated configuration #71366

Open
h9jiang opened this issue Jan 21, 2025 · 1 comment
Open
Assignees
Labels
gopls Issues related to the Go language server, gopls. ToolProposal Issues describing a requested change to a Go tool or command-line program. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@h9jiang
Copy link
Member

h9jiang commented Jan 21, 2025

gopls version

N/A

go env

N/A

What did you do?

N/A

What did you see happen?

As of now, gopls apijson only contains fields that is effective, or currently being deprecated.

The state of being deprecated usually means, the field exist in the struct, the field is still being acknowledged and interpreted by the gopls but probably will be removed in the up coming release.

What did you expect to see?

gopls apijson output should preserve fields that is already deprecated.

Editor and settings

Logs

Context: vscode-go is reading the gopls apijson to create the package.json. This package.json will be read by vscode.

package.json
  name: ui.noSemanticTokenString
  markdownDescription: ...
  deprecationMessage: ...

If a field is being deprecated, the package.json will a deprecationMessage field providing instructions for users to migrate their configs. VSCode will highlight to user this field is deprecated and user can hover over to check the deprecation message. This is great.

Image

Once a field is fully deprecated, usually, the field is just removed, it will be deleted from api json output and deleted from package.json as well.
Because its missing from package.json, vscode does not understand this field, there is no hover over information and no deprecation highlight

Image

@findleyr @adonovan

@h9jiang h9jiang added gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. labels Jan 21, 2025
@h9jiang h9jiang self-assigned this Jan 21, 2025
@gopherbot gopherbot added this to the Unreleased milestone Jan 21, 2025
@h9jiang h9jiang modified the milestones: Unreleased, Backlog Jan 21, 2025
@gabyhelp
Copy link

Related Issues

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)

@gabyhelp gabyhelp added the ToolProposal Issues describing a requested change to a Go tool or command-line program. label Jan 21, 2025
@findleyr findleyr modified the milestones: Backlog, gopls/backlog Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gopls Issues related to the Go language server, gopls. ToolProposal Issues describing a requested change to a Go tool or command-line program. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

4 participants