@@ -9,15 +9,15 @@ import { unwrapUndefinable } from "./undefinable";
9
9
export const TASK_TYPE = "cargo" ;
10
10
export const TASK_SOURCE = "rust" ;
11
11
12
- export interface CargoTaskDefinition extends vscode . TaskDefinition {
12
+ export interface RustTargetDefinition extends vscode . TaskDefinition {
13
13
command ?: string ;
14
14
args ?: string [ ] ;
15
15
cwd ?: string ;
16
16
env ?: { [ key : string ] : string } ;
17
17
overrideCargo ?: string ;
18
18
}
19
19
20
- class CargoTaskProvider implements vscode . TaskProvider {
20
+ class RustTaskProvider implements vscode . TaskProvider {
21
21
private readonly config : Config ;
22
22
23
23
constructor ( config : Config ) {
@@ -42,7 +42,7 @@ class CargoTaskProvider implements vscode.TaskProvider {
42
42
const tasks : vscode . Task [ ] = [ ] ;
43
43
for ( const workspaceTarget of vscode . workspace . workspaceFolders || [ ] ) {
44
44
for ( const def of defs ) {
45
- const vscodeTask = await buildCargoTask (
45
+ const vscodeTask = await buildRustTask (
46
46
workspaceTarget ,
47
47
{ type : TASK_TYPE , command : def . command } ,
48
48
`cargo ${ def . command } ` ,
@@ -63,11 +63,11 @@ class CargoTaskProvider implements vscode.TaskProvider {
63
63
// we need to inform VSCode how to execute that command by creating
64
64
// a ShellExecution for it.
65
65
66
- const definition = task . definition as CargoTaskDefinition ;
66
+ const definition = task . definition as RustTargetDefinition ;
67
67
68
68
if ( definition . type === TASK_TYPE && definition . command ) {
69
69
const args = [ definition . command ] . concat ( definition . args ?? [ ] ) ;
70
- return await buildCargoTask (
70
+ return await buildRustTask (
71
71
task . scope ,
72
72
definition ,
73
73
task . name ,
@@ -81,9 +81,9 @@ class CargoTaskProvider implements vscode.TaskProvider {
81
81
}
82
82
}
83
83
84
- export async function buildCargoTask (
84
+ export async function buildRustTask (
85
85
scope : vscode . WorkspaceFolder | vscode . TaskScope | undefined ,
86
- definition : CargoTaskDefinition ,
86
+ definition : RustTargetDefinition ,
87
87
name : string ,
88
88
args : string [ ] ,
89
89
problemMatcher : string [ ] ,
@@ -138,6 +138,6 @@ export async function buildCargoTask(
138
138
}
139
139
140
140
export function activateTaskProvider ( config : Config ) : vscode . Disposable {
141
- const provider = new CargoTaskProvider ( config ) ;
141
+ const provider = new RustTaskProvider ( config ) ;
142
142
return vscode . tasks . registerTaskProvider ( TASK_TYPE , provider ) ;
143
143
}
0 commit comments