Skip to content
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: handle DocumentSymbol request using syntax info #52797

Closed
hyangah opened this issue May 9, 2022 · 2 comments
Closed

x/tools/gopls: handle DocumentSymbol request using syntax info #52797

hyangah opened this issue May 9, 2022 · 2 comments
Assignees
Labels
Documentation FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@hyangah
Copy link
Contributor

hyangah commented May 9, 2022

Currently gopls uses type information in populating DocumentSymbol responses.
As a result, it is available only if the file is in the current workspace or build set.
For example, if the current file is excluded by build tag or GOOS/GOARCh constraints
DocumentSymbol is completely empty.

Editors and plugins like VS Code and VS Code Go heavily rely on DocumentSymbol
(e.g. Test function discovery, Breadcrumb, ...) - mostly for go file parsing info.
Completely omitting DocumentSymbol limits the utility.

From a quick investigation, the type info provides very little additional info for
DocumentSymbol, so consider changing the implementation to use only syntax info.

@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels May 9, 2022
@gopherbot gopherbot added this to the Unreleased milestone May 9, 2022
@gopherbot
Copy link

Change https://go.dev/cl/405254 mentions this issue: internal/lsp/source: derive document symbols from syntax alone

@jamalc jamalc modified the milestones: Unreleased, gopls/later May 10, 2022
@findleyr findleyr modified the milestones: gopls/later, gopls/v0.9.0 May 13, 2022
@findleyr
Copy link
Contributor

While there's a CL pending for this, there are enough outstanding questions that let's wait until v0.9.1, since this isn't critical.

@findleyr findleyr modified the milestones: gopls/v0.9.0, gopls/v0.9.1 Jun 27, 2022
@findleyr findleyr modified the milestones: gopls/v0.9.1, gopls/v0.9.2 Jul 13, 2022
@findleyr findleyr modified the milestones: gopls/v0.9.2, gopls/v0.10.0 Aug 3, 2022
@golang golang locked and limited conversation to collaborators Sep 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

4 participants