Skip to content

x/tools/gopls: gopls api json should preserve deprecated configuration #71366

@h9jiang

Description

@h9jiang

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

Metadata

Metadata

Assignees

Labels

ToolProposalIssues describing a requested change to a Go tool or command-line program.ToolsThis label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions