-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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: consider the methods list at the end of the hover #56331
Comments
Makes sense to me, and should be straightforward. This feature was added in https://go.dev/cl/420714. |
Thanks for the feature request. I have assigned it to one of our experts. |
Is this something an external contributor can pick up? |
@danishprakash Sure! Assigning this to you. One question I have is whether we should do this conditionally or not. In v0.10.0, the hover message over a struct type will present in the order of:
When the number of methods are small, I think this layout works well and consistent. When the number of methods are long and the doc comment is short, placing the doc first sounds more convincing. |
Do you mean via configuration, or dynamically via some heuristic for the optimal layout. I think we should be consistent with pkgsite, which would put the type definition first, followed by doc, followed by methods. Unlike pkgsite we shouldn't include documentation for the methods, as that would be too verbose. |
|
Thanks for the questions, @ShoshinNikita. Quick thoughts below.
|
|
Change https://go.dev/cl/555456 mentions this issue: |
This change updates the logic to display the method set of the selected type so that: - it includes promoted methods; - it includes interface methods, if that would not be redundant with the syntax of the the type; - receiver variables are properly named, and have a pointer type if appropriate. Fixes golang/go#61634 Updates golang/go#56331 Change-Id: Ied9c06c36178424575012adb8fde0b1ddbd688c3 Reviewed-on: https://go-review.googlesource.com/c/tools/+/555456 Reviewed-by: Robert Findley <rfindley@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Change https://go.dev/cl/559495 mentions this issue: |
gopls version v0.10.0-pre.1
go version 1.19.1
It looks like gopls places
the type definition
list of methods (exported, and unexported)
type comments
When the list of methods is long, it needs quite some scrolling to get to the documentation. (example gopls/internal/lsp/cache/workspace.go, hover over
workspace
in line 160.How about placing the method list at the end?
The text was updated successfully, but these errors were encountered: