-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Labels
feature-requestRequest for new features or functionalityRequest for new features or functionality
Description
I've changed the helloworld-web-sample with this simple testing code below but it can't find files when running it with the vscode-test-web (files.length always 0). It works fine when I run it using the Run Web Extension in VS Code though (files.length > 0).
Is there a different way of using vscode.RelativePattern and vscode.workspace.findFiles for browser? Thanks!
diff --git a/helloworld-web-sample/src/web/extension.ts b/helloworld-web-sample/src/web/extension.ts
index 176a2dd..482892a 100644
--- a/helloworld-web-sample/src/web/extension.ts
+++ b/helloworld-web-sample/src/web/extension.ts
@@ -13,11 +13,13 @@ export function activate(context: vscode.ExtensionContext) {
// The command has been defined in the package.json file
// Now provide the implementation of the command with registerCommand
// The commandId parameter must match the command field in package.json
- let disposable = vscode.commands.registerCommand('helloworld-web-sample.helloWorld', () => {
+ let disposable = vscode.commands.registerCommand('helloworld-web-sample.helloWorld', async () => {
// The code you place here will be executed every time your command is executed
// Display a message box to the user
- vscode.window.showInformationMessage('Hello World from helloworld-web-sample in a web extension host!');
+ const relativePattern = new vscode.RelativePattern(vscode.workspace.workspaceFolders![0], "**/*");
+ const files = await vscode.workspace.findFiles(relativePattern);
+ await vscode.window.showInformationMessage(`Hello World from helloworld-web-sample in a web extension host! ${files.length}`);
});
context.subscriptions.push(disposable);
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
feature-requestRequest for new features or functionalityRequest for new features or functionality