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: deprecate 'Structured' hover kind #70233

Open
findleyr opened this issue Nov 6, 2024 · 4 comments
Open

x/tools/gopls: deprecate 'Structured' hover kind #70233

findleyr opened this issue Nov 6, 2024 · 4 comments
Labels
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

@findleyr
Copy link
Member

findleyr commented Nov 6, 2024

The 'Structured' hover kind does not serve human readable hover content. Rather, it serves JSON describing the hover.
https://github.com/golang/tools/blob/master/gopls/doc/settings.md#hoverkind-enum

gopls should conform to the semantics of the LSP: hover is intended to be human readable. If we want to delegate hover presentation to the client, we must by definition have a thick client, in which case the client can just use a separate command via workspace/executeCommand. By analogy, tsserver has a command for structured hover info: https://github.com/microsoft/TypeScript/blob/55f1248a2052eebdea6bc0e2eef754df89a44bf7/src/server/protocol.ts#L2015.

CC @adonovan

@findleyr findleyr added this to the gopls/v0.18.0 milestone Nov 6, 2024
@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 Nov 6, 2024
@adonovan
Copy link
Member

adonovan commented Nov 8, 2024

I vaguely recall that the sole thick client of the Hover JSON output is one of the Vims. (The feature was added in the CL attached to #33352. Paging @myitcv for awareness.)

@myitcv
Copy link
Member

myitcv commented Dec 9, 2024

Paging @myitcv for awareness.

Thanks, @adonovan - we're actually using what I believe the gopls default is in this space, "FullDocumentation":

https://github.com/govim/govim/blob/6280deb8b406332ed0c9f0eea59671d954b815ab/cmd/govim/gopls_client.go#L159

@adonovan
Copy link
Member

[govim is] actually using what I believe the gopls default is in this space, "FullDocumentation":

Great, let's remove kind=structured then.

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/635226 mentions this issue: gopls/internal/settings: drop experimental hoverKind=Structured

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. 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