@@ -9,15 +9,15 @@ import { unwrapUndefinable } from "./undefinable";
99export const TASK_TYPE = "cargo" ;
1010export const TASK_SOURCE = "rust" ;
1111
12- export interface CargoTaskDefinition extends vscode . TaskDefinition {
12+ export interface RustTargetDefinition extends vscode . TaskDefinition {
1313 command ?: string ;
1414 args ?: string [ ] ;
1515 cwd ?: string ;
1616 env ?: { [ key : string ] : string } ;
1717 overrideCargo ?: string ;
1818}
1919
20- class CargoTaskProvider implements vscode . TaskProvider {
20+ class RustTaskProvider implements vscode . TaskProvider {
2121 private readonly config : Config ;
2222
2323 constructor ( config : Config ) {
@@ -42,7 +42,7 @@ class CargoTaskProvider implements vscode.TaskProvider {
4242 const tasks : vscode . Task [ ] = [ ] ;
4343 for ( const workspaceTarget of vscode . workspace . workspaceFolders || [ ] ) {
4444 for ( const def of defs ) {
45- const vscodeTask = await buildCargoTask (
45+ const vscodeTask = await buildRustTask (
4646 workspaceTarget ,
4747 { type : TASK_TYPE , command : def . command } ,
4848 `cargo ${ def . command } ` ,
@@ -63,11 +63,11 @@ class CargoTaskProvider implements vscode.TaskProvider {
6363 // we need to inform VSCode how to execute that command by creating
6464 // a ShellExecution for it.
6565
66- const definition = task . definition as CargoTaskDefinition ;
66+ const definition = task . definition as RustTargetDefinition ;
6767
6868 if ( definition . type === TASK_TYPE && definition . command ) {
6969 const args = [ definition . command ] . concat ( definition . args ?? [ ] ) ;
70- return await buildCargoTask (
70+ return await buildRustTask (
7171 task . scope ,
7272 definition ,
7373 task . name ,
@@ -81,9 +81,9 @@ class CargoTaskProvider implements vscode.TaskProvider {
8181 }
8282}
8383
84- export async function buildCargoTask (
84+ export async function buildRustTask (
8585 scope : vscode . WorkspaceFolder | vscode . TaskScope | undefined ,
86- definition : CargoTaskDefinition ,
86+ definition : RustTargetDefinition ,
8787 name : string ,
8888 args : string [ ] ,
8989 problemMatcher : string [ ] ,
@@ -138,6 +138,6 @@ export async function buildCargoTask(
138138}
139139
140140export function activateTaskProvider ( config : Config ) : vscode . Disposable {
141- const provider = new CargoTaskProvider ( config ) ;
141+ const provider = new RustTaskProvider ( config ) ;
142142 return vscode . tasks . registerTaskProvider ( TASK_TYPE , provider ) ;
143143}
0 commit comments