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

Allow fzf style query in workspaceSymbols #106788

Closed
hyangah opened this issue Sep 15, 2020 · 5 comments
Closed

Allow fzf style query in workspaceSymbols #106788

hyangah opened this issue Sep 15, 2020 · 5 comments
Labels
feature-request Request for new features or functionality quick-pick Quick-pick widget issues workspace-symbols

Comments

@hyangah
Copy link

hyangah commented Sep 15, 2020

The go language server started to provide the fzf style search query support but the results are filtered out by VS Code that performs its own matching/sorting on the results the workspace symbols providers return.

For example, for query ^http, the language server returned


[Trace - 14:04:17.665 PM] Sending request 'workspace/symbol - (171)'.
Params: {"query":"^http"}


[Trace - 14:04:17.706 PM] Received response 'workspace/symbol - (171)' in 40ms.
Result: [
{"name":"httpresponse.Doc","kind":14,"location":{"uri":"file:///Users/hakim/go/src/golang.org/x/tools/go/analysis/passes/httpresponse/httpresponse.go","range":{"start":{"line":18,"character":6},"end":{"line":18,"character":9}}},"containerName":"golang.org/x/tools/go/analysis/passes/httpresponse"},
{"name":"httpresponse.Analyzer","kind":13,"location":{"uri":"file:///Users/hakim/go/src/golang.org/x/tools/go/analysis/passes/httpresponse/httpresponse.go","range":{"start":{"line":34,"character":4},"end":{"line":34,"character":12}}},"containerName":"golang.org/x/tools/go/analysis/passes/httpresponse"},
...

But vscode presents no results since none of the entries match ^http.

@aeschli aeschli assigned jrieken and bpasero and unassigned jrieken Sep 16, 2020
@bpasero bpasero added feature-request Request for new features or functionality quick-pick Quick-pick widget issues workspace-symbols labels Sep 16, 2020
@bpasero bpasero removed their assignment Sep 16, 2020
@findleyr
Copy link

This might be a dupe of #98125 -- it would be sufficient for the extension to be able to control symbol filtering and sorting.

@hyangah
Copy link
Author

hyangah commented Sep 16, 2020

Agree with @findleyr - Not sure about sorting when multiple workspace symbol providers are involved (e.g. multi-language projects). Letting the extension do the filtering and preserving the ordering as much as possible would be ideal.

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Sep 17, 2020
Memory usage

- Rewrite of caching model, resulting in significant memory usage improvements
  (@heschik).

New features

- Extract to function: Support for extracting code blocks that contain return
  statements (@joshbaum).
- Workspace symbols: Support for fzf-style search syntax (@findleyr). The
  following syntax is supported:
        ' for exact matching
        ^ for prefix matching
        $ for suffix matching

Note: This feature does not yet work in VS Code. See golang/vscode-go#647 and
microsoft/vscode#106788.

- An experimental new code lens to view GC optimization details (@pjweinb).
  Once the code lens is enabled, you will see a Toggle gc details annotation at
  the top of your file. Clicking it will show optimization diagnostics produced
  by the Go compiler, and clicking it once again will hide these diagnostics.
  Enable the code lens by adding the following to your settings:

     "codelens": {
     	"gc_details": true
     }

- go mod tidy and go mod vendor code lenses for go.mod files (@dandua98).
- Support for filling in matching in-scope variables instead of just empty
  values in fillstruct and fillreturns (@joshbaum).
- Autocompletion within import statements (@dandua98).
- Autocompletion within package declarations (@dandua98).

Improvements

- Improvements to workspace symbols ranking and fuzzy matching (@findleyr,
  @myitcv).
- Better completion suggestions in type switch case clauses and for calls to
  append, function literals, and unnamed types (@muirdm).
@github-actions github-actions bot locked and limited conversation to collaborators Jan 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality quick-pick Quick-pick widget issues workspace-symbols
Projects
None yet
Development

No branches or pull requests

5 participants
@bpasero @jrieken @hyangah @findleyr and others