-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
Comments
Great, let's remove kind=structured then. |
Change https://go.dev/cl/635226 mentions this issue: |
FWIW, vim-go was using |
@bhcleek very sorry about the breakage :(. This was, I think, perhaps the first time we've just removed a setting without a probationary release where it is a warning. We really thought the only user was govim -- I'm afraid the similar naming of the clients may have been part of the confusion. Lesson (re)learned. What can we do to help? We can revert the deprecation temporarily, though that might be messy (I'll try). If instead you can fix forward, that may be cleanest. Going forward If you need structured information from hover, we can can add a custom command. As described in the release notes, it was a mistake to shoehorn a JSON API into hover. |
I can probably refactor vim-go to get what I need, but I won't be able to get to it immediately. IIRC, I'd relied on |
Reopening and moving to the v0.19.0 milestone, since this deletion is being reverted. |
Would it be possible to change the plaintext hover content to use two newlines between the identifier and the beginning of its documentation?
edit: strike wondering after checking actual godoc source for fmt.Println and realizing I'd assumed something based on how the pkg.go.dev renders it. |
@findleyr nevermind, I think I've found a way forward. |
@findleyr I got most of what I needed done, but there's one aspect of the structured content that I've been unable to find a good answer for. The structured output includes Interestingly, the markdown format provides the links I'd need with I was hoping that Do you have any suggestions? |
Would it suffice to include the links in plaintext mode, in the footer? That seems reasonable. For users that don't want links, we could we could extend the "linksInHover" setting to plaintext: I don't think we should use documentLink for this. |
Yes, I think that could work for vim-go's purposes as long as:
|
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
The text was updated successfully, but these errors were encountered: