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 extending Search by replacing ripgrep with a stand in replacement search tool #87841

Closed
dutzi opened this issue Dec 29, 2019 · 3 comments
Closed
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) search Search widget and operation issues

Comments

@dutzi
Copy link

dutzi commented Dec 29, 2019

The idea is to allow extending the Search panel by providing an alternative for Ripgrep, one that outputs a similar format.

The use-case I'm addressing is one where a user wants to find-in-files by running some query that's applied to every file. The extension provides a "find callback" (the one that's getting called per-each file).

A concrete example: Running a TSQuery on all files, finding all function declarations, for instance.

This Search Extension I'm suggesting should do 2 things:

  • The extension should provide an alternative to Ripgrep (the replacement), one that implements a similar API (or at least a necessary subset which is required by VSCode).
  • The extension should provide an icon for a button (the button) that will be displayed within the search input box, next to the Match Case, Match Whole Word and Use Regular Expression buttons.

The button will be a toggle button that once toggled on will cause every search to go through the the replacement, so eventually the search results will be comprised of all the files that fall underneath the search criteria.

And here are some screenshots, to clarify the process of using such extension:

image

image

image

@vscodebot vscodebot bot added the search Search widget and operation issues label Dec 29, 2019
@roblourens
Copy link
Member

roblourens commented Dec 30, 2019

Thanks for the suggestion, this would be a potential application of the proposed text search provider API: #59921

However, I don't know if taking over the search viewlet is really the best approach for this kind of functionality. Maybe just showing an input box and putting results in an editor or custom view, which extensions can already do.

@roblourens roblourens added the *duplicate Issue identified as a duplicate of another issue(s) label Dec 30, 2019
@dutzi
Copy link
Author

dutzi commented Dec 31, 2019

Got it, makes sense.

Is there anywhere I can read about implementing custom views within an extension? I've searched for docs/examples but couldn't find anything.

@roblourens
Copy link
Member

Here is a good place to start, see the view containers and tree views topics: https://code.visualstudio.com/api/extension-capabilities/extending-workbench

@vscodebot vscodebot bot locked and limited conversation to collaborators Feb 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) search Search widget and operation issues
Projects
None yet
Development

No branches or pull requests

2 participants