From a05163db1429bfb8cf30dbea4b1aa86a24258d49 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Wed, 26 May 2021 01:11:52 +0300 Subject: Create tasks for all workspaces --- editors/code/src/main.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'editors/code/src/main.ts') diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts index b735186fe..d26273246 100644 --- a/editors/code/src/main.ts +++ b/editors/code/src/main.ts @@ -45,8 +45,7 @@ async function tryActivate(context: vscode.ExtensionContext) { throw new Error(message); }); - const workspaceFolder = vscode.workspace.workspaceFolders?.[0]; - if (workspaceFolder === undefined) { + if (vscode.workspace.workspaceFolders?.length === 0) { const rustDocuments = vscode.workspace.textDocuments.filter(document => isRustDocument(document)); if (rustDocuments.length > 0) { ctx = await Ctx.create(config, context, serverPath, { kind: 'Detached Files', files: rustDocuments }); @@ -58,8 +57,8 @@ async function tryActivate(context: vscode.ExtensionContext) { // registers its `onDidChangeDocument` handler before us. // // This a horribly, horribly wrong way to deal with this problem. - ctx = await Ctx.create(config, context, serverPath, { kind: "Workspace Folder", folder: workspaceFolder.uri }); - ctx.pushCleanup(activateTaskProvider(workspaceFolder, ctx.config)); + ctx = await Ctx.create(config, context, serverPath, { kind: "Workspace Folder" }); + ctx.pushCleanup(activateTaskProvider(ctx.config)); } await initCommonContext(context, ctx); -- cgit v1.2.3