-
Notifications
You must be signed in to change notification settings - Fork 18k
x/tools/gopls: show signature help when typing a struct as an argument to a function? #42149
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
What you're seeing here is not actually the hover (which should return empty if your cursor isn't on a symbol), but rather signature help: From the logs:
I think this is working as intended here--signature help is meant to show up when you are typing the arguments to a function. Perhaps we could remove it when you are in a composite literal, but I'm not sure if that's more "correct". |
Yeah, just removing the signature wouldn't be particularly helpful: I really want some guidance for the struct fields. I guess a simpler reproducer is: package example
import "os"
func F() error {
return &os.PathError{
// Place cursor here.
}
} In that case, I get no hovers or completions at all. I guess the idea is that I should use a My initial reaction was that I should get a hover with a doc summary for the struct type, but maybe that's not quite right either. Maybe I actually want completions for all of the struct fields that aren't already present in the declaration? |
That is what you should be getting. In VS Code, you can trigger completion with Ctrl+Space, but I'm not sure how to manually trigger completions in Emacs. It would be nice if |
Oh, neato! Yeah, if I run So, I guess what's missing here is a mechanism in the LSP protocol, so that |
I suppose so, but even still, it probably wouldn't work well for |
Could you elaborate? (It's already checking whether the user typed the opening |
Signature help works similar to completions--there's a trigger character ( |
Ah, I see. That's unfortunate — I was really hoping for something a little more context-aware. |
Yeah I'm sorry that it's not more intuitive. OK to close this? |
Yep. |
What version?
What did you do?
// Place cursor here.
comment.What did you expect to see?
Hover information about the fields of the containing struct.
What did you see instead?
Hover information about the built-in
append
function.The text was updated successfully, but these errors were encountered: