mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Create tasks for all workspaces
This commit is contained in:
parent
5587d0a3e3
commit
a05163db14
4 changed files with 20 additions and 22 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue