about summary refs log tree commit diff
path: root/editors/code/src
diff options
context:
space:
mode:
authorOliver Cooper <oliver.cooper@me.com>2021-09-08 10:46:31 +1200
committerOliver Cooper <oliver.cooper@me.com>2021-09-08 10:46:31 +1200
commit001608914b2ee39b38ca919e41a8c8f4e4b70655 (patch)
tree3e576b2def10db0e47194f257a03098cf1566454 /editors/code/src
parent0517247bbc30f7f72f4c2f993fe345d3c0634c57 (diff)
downloadrust-001608914b2ee39b38ca919e41a8c8f4e4b70655.tar.gz
rust-001608914b2ee39b38ca919e41a8c8f4e4b70655.zip
Removed deprecated Task constructor
Diffstat (limited to 'editors/code/src')
-rw-r--r--editors/code/src/tasks.ts28
1 files changed, 8 insertions, 20 deletions
diff --git a/editors/code/src/tasks.ts b/editors/code/src/tasks.ts
index 6481822eb49..02b4d34ff69 100644
--- a/editors/code/src/tasks.ts
+++ b/editors/code/src/tasks.ts
@@ -109,26 +109,14 @@ export async function buildCargoTask(
         exec = new vscode.ProcessExecution(fullCommand[0], fullCommand.slice(1), definition);
     }
 
-    if (scope) {
-        return new vscode.Task(
-            definition,
-            scope,
-            name,
-            TASK_SOURCE,
-            exec,
-            ['$rustc']
-        );
-    }
-    else {
-        // if the original task did not provide a scope retain the original lack of scope
-        return new vscode.Task(
-            definition,
-            name,
-            TASK_SOURCE,
-            exec,
-            ['$rustc']
-        );
-    }
+    return new vscode.Task(
+        definition,
+        scope ?? vscode.TaskScope.Workspace,
+        name,
+        TASK_SOURCE,
+        exec,
+        ['$rustc']
+    );
 }
 
 export function activateTaskProvider(config: Config): vscode.Disposable {