-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: Tooltip shows distracting documentation for append() function when writing a struct literal #65681
Comments
Huh, I couldn't immediately reproduce this, which turned out to be because I was using the prerelease. I can reproduce with gopls@v0.14.2, but not with gopls@v0.15.0-pre.3. Could you please try installing the prerelease, to see if it reproduces for you?
With that said, I don't yet know when we would have fixed this (though we did refactor some code related to signatureHelp). I will try to bisect. In the meantime, I'm very curious if the prerelease also fixes the bug for you. |
@findleyr, I can reproduce this with go@master and gopls@master. Much though I would love to have fixed this by accident in CL 542057, I don't think I can take credit for that. ;-) Repro instructions: use the example above, and where it says |
Maybe some other UI element could be used instead of overlaying with a tooltip, especially when the box would be large. Maybe this type of information could be shown in a separate panel on the side of the editor window or something. |
Yeah, to be honest, I often find VS code's tooltips to be a bit hectic. I'm sure it's confirmation bias, but it feels like it's never there when I want it, and it's always there when I don't want it, usually covering something up. 😄 Then again, when it is what I want, tooltip is a very convenient location. Maybe if the type signature (short) were in a tooltip and the full docs were further to the side? Or maybe, for big multi-line statements, the tooltip could be anchored to the start or end of the statement instead of the cursor? (I assume those are all VS Code issues rather than LSP issues.) But I think there's also an LSP-level issue, which might address the immediate problem: I don't actually want the documentation for |
Elsewhere in the codebase (e.g. documentHighlight) there is short-circuit logic when the cursor is in a composite literal. I think we need the same logic for signatureHelp: if you're inside a composite literal, you probably don't need to see the signature. |
gopls version
golang.org/x/tools/gopls v0.14.2
go env
What did you do?
Say you're building up some list of some complex struct. It's reasonable to write expressions of the form:
Here's a longer example.
What did you see happen?
gopls in VS Code will keep the very, very long documentation for
append
persistently on screen. This is not very helpful because I'd rather have information about the struct I'm filing in. More importantly, it's distracting because theappend
documentation is very very long and invariably covers up all the context I need. I end up needing to press Esc after every few keystrokes to code effectively.See attached screenshot.
What did you expect to see?
gopls does not cover up my code and instead displays useful information about the struct I'm filling in, not
append
. If showingappend
is unavoidable, it should be much, much shorter so that it doesn't cover up important context.Editor and settings
No response
Logs
No response
The text was updated successfully, but these errors were encountered: