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.
|
|
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: