-
Notifications
You must be signed in to change notification settings - Fork 18k
x/tools/gopls: deprecate 'Structured' hover kind #70233
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
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:
|
@findleyr will there be an intermediate release of gopls before Structured is removed so I can release changes of vim-go that expect the links in plaintext documentation before Structured is removed? |
@bhcleek yes, there will be an intermediate release (v0.19.0). |
Thank you. I have fatih/vim-go#3702 staged and will update it with the rest of the work it requires after v0.19.0 is released. |
I wonder what is gained by replacing a weakly defined JSON structure that is parsed by some clients by an ill-defined text structure that is parsed by some clients. Perhaps we should just live with it. |
I agree @adonovan . I'd prefer for Vim-go could completely workaround removal of |
If the only thing causing us to hold on to |
@findleyr are you proposing to implement |
@bhcleek no, I was proposing having a separate command (to be invoked via workspace/executeCommand. IIRC Documentlink causes many editors to linkify symbols in a way that would be distracting. |
This is not happening for v0.19.0 moving to v0.20.0. |
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: