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

Expose search.action.refreshSearchResults #49248

Closed
tomzx opened this issue May 4, 2018 · 3 comments
Closed

Expose search.action.refreshSearchResults #49248

tomzx opened this issue May 4, 2018 · 3 comments
Assignees
Labels
search Search widget and operation issues

Comments

@tomzx
Copy link
Contributor

tomzx commented May 4, 2018

v1.23.0

This was initially asked in #23558.

#23558 listed refresh, collapse all and clear. In the keyboards bindings, one can access search.action.collapseSearchResults and search.action.clearSearchResults but not search.action.refreshSearchResults.

code_2018-05-04_16-38-01

I'm currently trying to write an extension that would automatically start a search with a given word. At the moment I'm able to get the search sidebar to show and to clear the current search, but I cannot execute/run the search.

@vscodebot vscodebot bot added the search Search widget and operation issues label May 4, 2018
@roblourens
Copy link
Member

I think 'refresh' isn't what you want exactly because it's only enabled when there are already results in the view. You want to be able to start a search, which doesn't have a command behind it currently.

I don't really want to add commands for extensions to basically automate the vscode UI like this, it doesn't feel like something that a vscode extension should be doing. What's your scenario?

@tomzx
Copy link
Contributor Author

tomzx commented May 5, 2018

My current code uses DocumentLinkProvider to generate clickable ranges that are then sent to the VS Code search engine. It's basically your poor man's peek. Basically all there is left at this point is for the search to trigger. At the moment the user will have to type enter to finish this process.

I might be wrong, but at the moment every extension has to implement itself how it searches through files. Given there is already some facility in VS Code to search, it seems to make sense to make use of that.

Also, I foresee that future versions of VS Code may provide better search support for files provided by the FileSystemProvider than by implementing something that expects files always exist on the current file system.

@roblourens
Copy link
Member

Ok, I don't think this is a good fit for extensions.

Also, I foresee that future versions of VS Code may provide better search support for files provided by the FileSystemProvider than by implementing something that expects files always exist on the current file system.

If that's your end goal, then yes. You can follow #47058 for that exact issue.

tomzx added a commit to TomzxForks/vscode that referenced this issue May 8, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Jun 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
search Search widget and operation issues
Projects
None yet
Development

No branches or pull requests

2 participants