diff options
Diffstat (limited to 'editors/code/src/main.ts')
-rw-r--r-- | editors/code/src/main.ts | 7 |
1 files changed, 3 insertions, 4 deletions
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) { | |||
45 | throw new Error(message); | 45 | throw new Error(message); |
46 | }); | 46 | }); |
47 | 47 | ||
48 | const workspaceFolder = vscode.workspace.workspaceFolders?.[0]; | 48 | if (vscode.workspace.workspaceFolders?.length === 0) { |
49 | if (workspaceFolder === undefined) { | ||
50 | const rustDocuments = vscode.workspace.textDocuments.filter(document => isRustDocument(document)); | 49 | const rustDocuments = vscode.workspace.textDocuments.filter(document => isRustDocument(document)); |
51 | if (rustDocuments.length > 0) { | 50 | if (rustDocuments.length > 0) { |
52 | ctx = await Ctx.create(config, context, serverPath, { kind: 'Detached Files', files: rustDocuments }); | 51 | ctx = await Ctx.create(config, context, serverPath, { kind: 'Detached Files', files: rustDocuments }); |
@@ -58,8 +57,8 @@ async function tryActivate(context: vscode.ExtensionContext) { | |||
58 | // registers its `onDidChangeDocument` handler before us. | 57 | // registers its `onDidChangeDocument` handler before us. |
59 | // | 58 | // |
60 | // This a horribly, horribly wrong way to deal with this problem. | 59 | // This a horribly, horribly wrong way to deal with this problem. |
61 | ctx = await Ctx.create(config, context, serverPath, { kind: "Workspace Folder", folder: workspaceFolder.uri }); | 60 | ctx = await Ctx.create(config, context, serverPath, { kind: "Workspace Folder" }); |
62 | ctx.pushCleanup(activateTaskProvider(workspaceFolder, ctx.config)); | 61 | ctx.pushCleanup(activateTaskProvider(ctx.config)); |
63 | } | 62 | } |
64 | await initCommonContext(context, ctx); | 63 | await initCommonContext(context, ctx); |
65 | 64 | ||