Skip to content
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 support for running custom tasks in VS Code Web #157112

Open
thegecko opened this issue Aug 4, 2022 · 3 comments
Open

Add support for running custom tasks in VS Code Web #157112

thegecko opened this issue Aug 4, 2022 · 3 comments
Assignees
Labels
feature-request Request for new features or functionality tasks Task system issues
Milestone

Comments

@thegecko
Copy link
Contributor

thegecko commented Aug 4, 2022

We have a web extension which provides a custom task provider and works as expected in both VS Code Desktop and VS Code Web.

A minor issue with dependencies was found in #157041 but this was closed as tasks aren't officially supported in VS Code Web.

I can understand that shell and process tasks can't work without some sort of access to the user's machine, but can custom tasks be officially supported especially as they already seem to work very well for us?

This would include exposing the task menu items and making it clear only custom tasks will work.

@alexr00
Copy link
Member

alexr00 commented Aug 5, 2022

Custom execution tasks should work in web. They aren't officially supported because we haven't found a real world use case for them yet, but a fair amount of work went into getting them most of the way there. The original thinking was that maybe an extension could contribute some CI-like tasks which would give users a way to build and test without actually having a way to run anything locally.

It sounds like you have a real world use for custom execution tasks in the web though and that it mostly works for you (with the exception of dependsOn, which would be a bug).

As for exposing all the task menu items: maybe this could be done if we detect an extension that contributes custom execution tasks. We don't currently have a great way to do this without fetching tasks from the extensions, which an be expensive, but if we just look at the tasks in tasks.json this might be a reasonable approach.

@thegecko
Copy link
Contributor Author

thegecko commented Aug 5, 2022

It sounds like you have a real world use for custom execution tasks in the web though...

We actually have two ;) One is a remote build system and the other is a deployment task for flashing binaries on microcontrollers. These work today and I'm happy to share more detail if it helps move this feature forwards.

...and that it mostly works for you (with the exception of dependsOn, which would be a bug).

That's right.

As for exposing all the task menu items: maybe this could be done if we detect an extension that contributes custom execution tasks. We don't currently have a great way to do this without fetching tasks from the extensions, which an be expensive, but if we just look at the tasks in tasks.json this might be a reasonable approach.

This sounds like an excellent approach and is so close to working today. Could activation events be used as a hint to triggering such a scan?

@meganrogge meganrogge added feature-request Request for new features or functionality tasks Task system issues labels Aug 8, 2022
@meganrogge meganrogge added this to the On Deck milestone Aug 8, 2022
@thegecko
Copy link
Contributor Author

A further update on this as we are still seeing issues with custom task providers in vscode.dev.

I've created an example extension to showcase the issues: https://github.com/thegecko/task-provider-sample

This is derived from the official example, but stripped back to be just the custom task.

Running this on the desktop, the tasks picker is populated and the custom task can be run.

Screenshot 2024-09-16 at 21 44 22

Running this on vscode.dev, the task menu does nothing:
Screenshot 2024-09-16 at 21 46 52

There's no error in the console and the behaviour is the same with and without a workspace open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality tasks Task system issues
Projects
None yet
Development

No branches or pull requests

3 participants