-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: supply imported package names in documentSymbol results #40514
Comments
@gopherbot remove Documentation |
Experimented a bit and I am now unsure if this is desirable. Including the imported packages pollute the Outline view. Looking further, I learned that vscode-go's existing document symbol provider supports two modes (include or exclude imports). Unfortunately, we have no control when using LSP. Is there any other LSP feature that allows to retrieve the import information? I also noticed the vscode-go's symbol provider has |
Not that I can think of off the top of my head. There may be something in the spec that I'm missing, or maybe we can implement a custom command.
We can adjust this in |
Change https://golang.org/cl/383354 mentions this issue: |
I want to replace vscode-go's existing
DocumentSymbolsProvider
withgopls
.The extension currently uses the
go-outline
tool to extract the document symbol informationand uses it for various purposes (creating codelenses, generate test functions, call other tools, etc).
Even though I think most of them will be eventually replaced with
gopls
and the extension itselfdoes not have to retrieve the information directly, I still think it's useful for the extension to access
the info, and possibly relay the info to other extensions (e.g. golang/vscode-go#404)
Looking into
gopls
's responses and implementation, it looks like the response currentlyincludes functions and variables declarations.
The existing vscode-go provider provides imported package names. The names are used
when checking the file depends on a package of interest - e.g. whether the test file imports
a popular test framework?
Not sure how the LSP's symbol kinds map to Go's type. For reference -
he following is the currently used mapping by vscode-go's existing symbol provider.
The text was updated successfully, but these errors were encountered: