Skip to content

Introduce workspace.FindFiles2 API #204657

Closed

Description

@andreamah

Currently, there are the following issues with FindFiles:

  1. The exclude argument is quite overloaded, yet it doesn't allow for custom settings for force-including gitignore.
  2. Since the proposed FindTextInFiles API has more options and should supposedly allow for use of gitignore, "include-ing" a file path overrides gitignore, so adding useGitIgnore to the options there and trying to match once per file to emulate a pseudo FindFiles behavior actually doesn't work if you want the "gitignore" to kick in.

Because of these problems, it might be time to have a new function signature for FindFiles, although for now, we can just make a proposed API so that internal products can adopt it soon.

Activity

  1. added
    feature-request
    search
    on Feb 7, 2024
  2. added
    unreleased
    insiders-released
    and removed
    unreleased
    on Feb 7, 2024
  3. andreamah commented on Feb 9, 2024

    @andreamah
    ContributorAuthor

    You can test the new API with a code such as

    	vscode.commands.registerCommand('extension.testFindFiles2', async (args) => {
    		await vscode.workspace.findFiles2('**/target*', {
    			exclude: '**/*.ts',
    			useIgnoreFiles:true,
    		}).then(r => r.forEach(item => 
    			console.log(item.toString())));
    	});

    See here for docs and options: https://github.com/microsoft/vscode/blob/90cebfaeb260263075f88dc2a8b97658942a09d7/src/vscode-dts/vscode.proposed.findFiles2.d.ts

  4. locked and limited conversation to collaborators on Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

apifeature-requestinsiders-releasedon-testplansearch

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions