Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Feature: golang: package qualified symbols #954

Closed
josh-tepper opened this issue May 2, 2017 · 6 comments
Closed

Feature: golang: package qualified symbols #954

josh-tepper opened this issue May 2, 2017 · 6 comments
Labels
upstream-gopls Issue for gopls

Comments

@josh-tepper
Copy link

Issue copied from here: microsoft/vscode#23509

When doing a "global symbol search" ('# ' in the palette), I wish that it was possible to qualify the symbol name with the package name. E.g., for a symbol Sym in package my/package/here, I would like to be able to type both of:

  • my/package/here.Sym
  • here.Sym
@josh-tepper
Copy link
Author

@ramya-rao-a

@ramya-rao-a
Copy link
Contributor

I dont know how I lost this issue in my notifications for over a year! Apologies.

Yes, this is do-able.

We currently use the go-symbols tool to look for the given query in the symbol search.
What we can do is

  • If the search term has a /, then provide all packages as result
  • If the search term has a ., assume the preceding text is the package name, then pass the package path to go-symbols to restrict the search to just that package.

PRs are most welcome.

@josh-tepper
Copy link
Author

Oh -- cool. I won't have a chance to open up a PR this week, and then I'll be traveling for two weeks. Will take a look at opening a PR when I get back

@ramya-rao-a
Copy link
Contributor

@stamblerre This is related to the workspace symbol search feature.
Any thoughts on how you would tackle the above via the language server?

@stamblerre
Copy link
Contributor

@ramya-rao-a: Just to confirm, you are referring to the Workspace Symbols feature of the LSP (https://microsoft.github.io/language-server-protocol/specification#workspace_symbol)? I filed golang/go#33844 to track this.

@ramya-rao-a
Copy link
Contributor

@stamblerre Yes, that's the one

@josh-tepper Now that there is active development on an official language server for Go via gopls, this issue is being closed in favor of having the features requested here via the language server.

For more on language server integration with this extension, please see Go language server

To go a feature request for gopls, use the Go issue tracker

@vscodebot vscodebot bot locked and limited conversation to collaborators Oct 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
upstream-gopls Issue for gopls
Projects
None yet
Development

No branches or pull requests

3 participants