refactor: Rename CargoTask to RustTask in extension

This commit is contained in:
Wilfred Hughes 2024-03-13 15:47:34 -07:00
parent 14558af15e
commit d472fd932b
2 changed files with 13 additions and 13 deletions

View file

@ -113,7 +113,7 @@ export async function createTask(runnable: ra.Runnable, config: Config): Promise
const args = createArgs(runnable);
const definition: tasks.CargoTaskDefinition = {
const definition: tasks.RustTargetDefinition = {
type: tasks.TASK_TYPE,
command: args[0], // run, test, etc...
args: args.slice(1),
@ -124,7 +124,7 @@ export async function createTask(runnable: ra.Runnable, config: Config): Promise
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
const target = vscode.workspace.workspaceFolders![0]; // safe, see main activate()
const cargoTask = await tasks.buildCargoTask(
const task = await tasks.buildRustTask(
target,
definition,
runnable.label,
@ -134,12 +134,12 @@ export async function createTask(runnable: ra.Runnable, config: Config): Promise
true,
);
cargoTask.presentationOptions.clear = true;
task.presentationOptions.clear = true;
// Sadly, this doesn't prevent focus stealing if the terminal is currently
// hidden, and will become revealed due to task execution.
cargoTask.presentationOptions.focus = false;
task.presentationOptions.focus = false;
return cargoTask;
return task;
}
export function createArgs(runnable: ra.Runnable): string[] {