Test: findFiles2New
(new FindFiles API shape)
#226670
Labels
Milestone
findFiles2New
(new FindFiles API shape)
#226670
Refs #48674
Complexity: 4
Roles: Developer, Engineering Manager
Create Issue
History/Context
FYI: you can skip this part if you already know what's going on with these search APIs.
General
There has been a lot of work going into finalizing 4 search APIs. Here is a little table that soft of explains how they're related, plus the main function calls from each. Essentially, for file and text search, we have to finalize APIs for
findFiles2
is meant to replace the existing finalized APIworkspace.findFiles
. So it will be renamed tofindFiles
then. It will be added as an overload of the currentfindFiles
call, where the old call signature will be deprecated (but still supported).Since this is gonna be a huge change for any first-party extensions that are using these proposed APIs, I've split out the new shape in new files that end in
New
. For example, the new shape forfindTextInFiles
is infindTextInFilesNew
.findFiles2New
This TPI focuses on testing the functionality and shape for
findFiles2New
An extension would use the
findFiles2New
API when it wants to find text search results in the user's workspace.Note that a 'file search' is what happens when you do
CTRL+P
/CMD+P
and search for a file in your workspace. You would usefindFiles2New
if you were an extension that wanted to get a list of file search results that matches a certain pattern.Set up
Update to the latest Insiders.
Create an extension to test with. To enable the proposed API, use the following in your
package.json
:and run
npx vscode-dts dev
to download the proposed API files.You're going to test
findFiles2New
, which is the new shape forfindFiles2
.See below for the shape to test:
https://github.com/microsoft/vscode/blob/94f869842859c273491a8067d81f82f5fb30709a/src/vscode-dts/vscode.proposed.findFiles2New.d.ts
Testing
In your extension, call the function
vscode.workspace.findFiles2New
with the different options available.For example,
Try to be creative with the options you use, and please refer to the documentation in the proposed API file for details on how to use each.
If you're feeling extra gutsy, you can even test with the new
fileSearchProviderNew
API (but don't feel too pressured to do this- I have another TPI to test this API in-depth)! :)Thanks for testing! Please message me if you have any questions! I intentionally left this testing section vague so that I can get a measure of how easy it is to adopt the API.
Known Bugs
exclude
option can be aGlobPattern
, which, in turn, can be aRelativePattern
. This being said, it can have abaseUri
, but VS Code's internal file/text search doesn't pay attention to that field. In all cases, it will only read thepattern
component of theRelativePattern
.The text was updated successfully, but these errors were encountered: