-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a rerun last task command #62645
Conversation
@@ -85,6 +83,7 @@ export const enum TaskExecuteKind { | |||
export interface ITaskExecuteResult { | |||
kind: TaskExecuteKind; | |||
promise: TPromise<ITaskSummary>; | |||
task: Task; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you quickly explain why we need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In handleExecuteResult
in task.contribution.ts we need the Task that was executed. For tasks that were run using rerun, task.contribution.ts has no knowledge of the task. Putting the task in the execute result solves this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Only one questions.
With these changes you will own the terminal task system :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually there is on thing we should think about: would it make sense to let users control what rerunning means in a per task basis. I could for example imagine that rerunning some tasks should reevaluate the vars and rerunning some other should not. So would be cool if I can control this with a property on the task itself. The question will then be what the default is. I would actually argue to should rerun and reevaluate.
As a task property, I agree that the default should be to rerun and reevaluate. Having the task revaluate seems like a logical step from Run to Rerun, while having it as a setting gives the user more power to use the already evaluated variables. I'll make this change. |
Would it make sense to introduce a |
@alexr00 this is a long awaited feature! Thank you for this! One quick question though - there are no tests for this feature except adding a custom section, or does it do more? |
I didn't write any new tests for this command, that's correct. You do not need to add anything to your tasks.json to try it out with the default rerun behavior. The default behavior is that all task related variables will be re-evaluated. If you want to make your task run faster and you always want the same variables as the previous run, you can set the |
I am looking forward to trying it when it’s released! I am just curious it was accepted with no automated tests. I am wondering if it is a newer tendency and automated tests no longer considered a best practice? |
Fixes #25310