-
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: add configuration for single-line hover #32561
Comments
This is intentional. Often, documentation can be lengthy and overwhelming ( However, if this is not the case, and other people are also interested in this behavior, I'd be willing to make this change. If you want to see full documentation on hover, please upvote this issue or comment with your reasoning. |
Actually full docs on hover was available with all editors/tools that I was using so far:
From my experience it's one of the most useful and demanded features. I wouldn't mind that |
I like the small doc to not clutter everything. Before Gopls, when you hover over a signature you get a mini version of the doc (or none), but if you |
Filed microsoft/language-server-protocol#772 to get more clarity on |
I personally would prefer to have full comments over the single line version, but I can understand the desire to only see the signature at times. Is it possible to add a configuration that will change the length of comments that you see on hover? Something like: showFullComments: true (default: false) A setting like this would allow each developer to decide the style of comments they see when hovering. |
That does seem like a reasonable solution while we wait on modifications to the LSP specification. I think the options should be 1) full, 2) shortened, 3) single line (to support clients like vim-go, which currently trims to a single line). |
Change https://golang.org/cl/184797 mentions this issue: |
Instead of defaulting to a one sentence synopsis for documentation on hover, allow the user to configure the amount of documentation they want to see. Right now, the options are none, some (using go/doc.Synopsis), or all. We should add a 4th, single-line, mode, which will allow clients like vim-go to stop stripping off documentation on hover. Updates golang/go#32561 Change-Id: I529242da84b794636984d5ef2918b7252886f0ef Reviewed-on: https://go-review.googlesource.com/c/tools/+/184797 Run-TryBot: Rebecca Stambler <rstambler@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Cottrell <iancottrell@google.com>
Instead of defaulting to a one sentence synopsis for documentation on hover, allow the user to configure the amount of documentation they want to see. Right now, the options are none, some (using go/doc.Synopsis), or all. We should add a 4th, single-line, mode, which will allow clients like vim-go to stop stripping off documentation on hover. Updates golang/go#32561 Change-Id: I529242da84b794636984d5ef2918b7252886f0ef Reviewed-on: https://go-review.googlesource.com/c/tools/+/184797 Run-TryBot: Rebecca Stambler <rstambler@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Cottrell <iancottrell@google.com>
I think |
Change https://golang.org/cl/188981 mentions this issue: |
Latest Vim have popup window. it can indicate multiple-lines. vim-lsp have already option to switch hover to popup. |
@mattn: Right, I have heard that the latest versions of Vim have popups, but I think a large number of people are still using older versions. |
@stamblerre how do I use this new option? |
Add this to your VSCode settings: "gopls": {
"hoverKind": "SingleLine", // hoverKind can be NoDocumentation, SingleLine, Synopsis, FullDocumentation
} I will add more documentation to the |
@stamblerre thanks, that works, I will use "FullDocumentation". Now with that option available, may I ask to move signature above the documentation, as it was done previously in sourcegraph's language server, |
Right now

gopls
returns only first sentence from the symbol documentation, please make it return full docs.The text was updated successfully, but these errors were encountered: