Skip to content

findFiles with RelativePattern returns empty array on vscode.dev with local folder #146641

@lewisl9029

Description

@lewisl9029

Version: 1.67.0-insider
Commit: 8b7086a
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.84 Safari/537.36
Embedder: vscode.dev

Steps to repro:

  1. Open a local folder on vscode.dev
  2. Create the following file: app/main.js
  3. Create a new extension that attempts to use the vscode.workspace.findFiles API with vscode.RelativePattern, like below:
import * as vscode from 'vscode'

export const activate = (context) => {
  const uris = await vscode.workspace.findFiles(
    new vscode.RelativePattern(
      vscode.workspace.workspaceFolders[0],
      'app/**/*',
    ),
  )

  console.log(uris)
}
  1. Inspect console logs

Expected:
Array with the URI for app/main.js is logged.

Actual:
Empty array is logged.

I tested on vscode.dev and insiders.vscode.dev, using Chrome on both macOS and Windows.

Happy to provide any more info to help debug. Thanks!

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable buginsiders-releasedPatch has been released in VS Code InsiderssearchSearch widget and operation issuesverifiedVerification succeededwebIssues related to running VSCode in the web

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions