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

vscode.workspace.findFiles now splits comma-separated glob patterns #69862

Closed
roblourens opened this issue Mar 5, 2019 · 1 comment
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release search Search widget and operation issues verified Verification succeeded
Milestone

Comments

@roblourens
Copy link
Member

roblourens commented Mar 5, 2019

Use this code in an extension, run the command

'use strict';

import * as vscode from 'vscode';

export function activate(context: vscode.ExtensionContext) {

    let disposable = vscode.commands.registerCommand('extension.helloWorld', () => {
        const workspace = vscode.workspace.workspaceFolders![0];
        if (workspace) {
            vscode.workspace.findFiles('package.json, tsconfig.json').then(results => {
                console.log('results: ', results);
            });
        }
    });

    context.subscriptions.push(disposable);
}
  • In 1.31, it returns no results because findFiles takes a single glob pattern
  • In 1.32, it returns results because the include and exclude patterns for findFiles are split on the comma
@roblourens roblourens added bug Issue identified by VS Code Team member as probable bug search Search widget and operation issues candidate Issue identified as probable candidate for fixing in the next release labels Mar 5, 2019
@roblourens roblourens added this to the February 2019 milestone Mar 5, 2019
@roblourens roblourens self-assigned this Mar 5, 2019
@roblourens
Copy link
Member Author

This is a candidate because it would be an API change. If we want to support multiple glob patterns we should use an array like we discussed in #38545. Parsing a comma-delimited string in this API feels wrong.

roblourens added a commit that referenced this issue Mar 5, 2019
@roblourens roblourens mentioned this issue Mar 5, 2019
octref added a commit that referenced this issue Mar 5, 2019
@RMacfarlane RMacfarlane added the verified Verification succeeded label Mar 6, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Apr 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release search Search widget and operation issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

2 participants