Skip to content

Commit 0016089

Browse files
committed
Removed deprecated Task constructor
1 parent 0517247 commit 0016089

File tree

1 file changed

+8
-20
lines changed

1 file changed

+8
-20
lines changed

editors/code/src/tasks.ts

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -109,26 +109,14 @@ export async function buildCargoTask(
109109
exec = new vscode.ProcessExecution(fullCommand[0], fullCommand.slice(1), definition);
110110
}
111111

112-
if (scope) {
113-
return new vscode.Task(
114-
definition,
115-
scope,
116-
name,
117-
TASK_SOURCE,
118-
exec,
119-
['$rustc']
120-
);
121-
}
122-
else {
123-
// if the original task did not provide a scope retain the original lack of scope
124-
return new vscode.Task(
125-
definition,
126-
name,
127-
TASK_SOURCE,
128-
exec,
129-
['$rustc']
130-
);
131-
}
112+
return new vscode.Task(
113+
definition,
114+
scope ?? vscode.TaskScope.Workspace,
115+
name,
116+
TASK_SOURCE,
117+
exec,
118+
['$rustc']
119+
);
132120
}
133121

134122
export function activateTaskProvider(config: Config): vscode.Disposable {

0 commit comments

Comments
 (0)