-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Feature Request: Add Built-in Text Search API for Extensions #191383
Comments
There are two proposed api's that have been around awhile you can test now:
See if they what you want. Not a lot has happened with them lately though. There must be issues about them here. |
Thank you @andreamah. Are they currently only available in Insiders, or is it available in all current versions of VS Code? |
They can only be used in Insiders as they are proposed apis cuurrently. To try them out see Using Proposed API. |
Feature Request for VS Code: Text Search API
Summary
VS Code currently lacks a built-in API for text-based search within files. While the
findFiles
method allows for file discovery based on glob patterns, there is no straightforward way to perform text-based searches within those files programmatically.Problem Statement
Developers often have to resort to using Node.js file system APIs or other libraries to read file content and then apply their own search algorithms. This adds extra overhead and complexity to extensions that aim to provide advanced search features.
Proposed Solution
Introduce a new API method, tentatively named
findTextInFiles
, that allows for text-based search within files. This method could accept parameters like search query, file type, and directory, and return a list of matches with their respective line numbers.Use Cases
Benefits
Additional Context
This feature request aims to fill a gap in the current VS Code API and make it more robust and developer-friendly.
The text was updated successfully, but these errors were encountered: