-
Notifications
You must be signed in to change notification settings - Fork 27.9k
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
Proposal for extended task API #45980
Comments
@jrieken FYI |
I'd like to share the first feedback on the proposed API based on a prototype work for a task state synchronization mechanism:
Thanks! |
@alpaix thanks for the feedback. Regarding your items:
|
I implemented the following changes for this milestone:
Did not do anything about 4, 5. Will do early next milestone. |
Would it be possible to query the |
@dbaeumer Thanks for addressing the feedback. Here are some thoughts:
|
I'm also interested in capturing |
Regarding |
@alpaix some comments:
|
Agreed on not caching the task entries. This would make the design consistent with the rest of the product. |
Regarding 2-4. Will try to come up with a working prototype using the latest API we've got so far. |
@dbaeumer Just wanted to clarify how |
@alpaix I would accept a bug for this :-). However there will not be any |
Filed a new issue #47465. |
Regarding |
@dbaeumer What's your plan regarding the Task Execution Provider you mentioned earlier? I'm evaluating possible mechanisms of capturing task output in VSCode so I hoped this new provider would help. |
@alpaix there will not be a task execution provider API. I am working with @Tyriar to get Please note: this will only work for tasks v2.0.0 not for the old task system that uses the Output panel. But I think that is tolerable since the old task runner is deprecated anyways. |
@alpaix see #46192 (comment) for the current thinking on the API @dbaeumer mentioned. |
@Tyriar I will work with @IlyaBiryukov on integrating new terminal API with a remote task service on our side. |
Thanks for addressing these requests! Appreciate you helping us! |
I am closing this item. I added additional API for:
We still need to find a solution for relating a terminal to a task. This is tracked here: #48032 |
Please note that the API is still in proposed. I didn't want to make it final due to #48032. |
Marking as verified. This got already tested in March. |
Would it be possible to get task state and exit code as part of |
This would make TasKExecution objects live objects which they currently aren't. Adding an exit code to the end event does make sense. Can you please open a separate issue for this? Why would you prefer querying instead of listening to events? |
For this milestone we would like to add API that offers the following features:
The new API should be homogeneous. That is why I try to handle it in one issue:
Query available tasks
This got implemented by proving a
fetchTasks
function on the workspace namespace:Execute a Task
The execute method returns a
TaskExecution
which is different form aTask
for the following reason: there are requests that tasks can be started n times hence we need a different representation for a running task than for the task itself. ATaskExecution
is currently opaque and doesn't offer any special properties. This might change in the futureTerminate Task
Straight forward. A function
terminateTask
in theworkspace
namespace that takes aTaskExecution
onDidStartTask
An Event on the
workspace
namespace firing when a task gets executed. The event type will beExecuteTaskEvent
with a running task property. Open question is whether the providedRunningTask
instance can be used to terminate the task since the start could have happened from another extension. I would for now allow this.OnDidEndTask
An event on the
workspace
namespace firing when a task terminates. Event type will beTaskTerminateEvent
with a singleRunningTask
Execute a task that is not managed by VS Code
Extension can simply construct the task and execute it using the workspace API. No access to the output is provided right now since this should go hand in hand of providing output of the underlying terminal.
Task Execution Provider
Under construction. Need to think a little more :-)
The text was updated successfully, but these errors were encountered: