mirror of
https://github.com/microsoft/vscode-extension-samples.git
synced 2026-04-27 16:55:44 +08:00
Update task provider sample for resolveTask
This commit is contained in:
@ -27,6 +27,14 @@ export class RakeTaskProvider implements vscode.TaskProvider {
|
||||
}
|
||||
|
||||
public resolveTask(_task: vscode.Task): vscode.Task | undefined {
|
||||
const task = _task.definition.task;
|
||||
// A Rake task consists of a task and an optional file as specified in RakeTaskDefinition
|
||||
// Make sure that this looks like a Rake task by checking that there is a task.
|
||||
if (task) {
|
||||
// resolveTask requires that the same definition object be used.
|
||||
const definition: RakeTaskDefinition = <any>_task.definition;
|
||||
return new vscode.Task(definition, definition.task, 'rake', new vscode.ShellExecution(`rake ${definition.task}`));
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user