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

hyangah opened this issue May 9, 2022 · 1 comment

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

hyangah opened this issue May 9, 2022 · 1 comment
Documentation gopls Tools


Copy link

@hyangah 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 gopls labels May 9, 2022
@gopherbot gopherbot added this to the Unreleased milestone May 9, 2022
Copy link

@gopherbot gopherbot commented May 9, 2022

Change mentions this issue: internal/lsp/source: derive document symbols from syntax alone

@jamalc jamalc removed this from the Unreleased milestone May 10, 2022
@jamalc jamalc added this to the gopls/later milestone May 10, 2022
@findleyr findleyr removed this from the gopls/later milestone May 13, 2022
@findleyr findleyr added this to the gopls/v0.9.0 milestone May 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Documentation gopls Tools
None yet

No branches or pull requests

4 participants