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

default run task #70118

Open
tobdub-snce opened this issue Mar 9, 2019 · 9 comments
Open

default run task #70118

tobdub-snce opened this issue Mar 9, 2019 · 9 comments
Assignees
Labels
feature-request Request for new features or functionality tasks Task system issues
Milestone

Comments

@tobdub-snce
Copy link

It would be nice if there was a default run task (build + execute), similar to the existing default build and test tasks.

@vscodebot
Copy link

vscodebot bot commented Mar 9, 2019

@vscodebot vscodebot bot added the tasks Task system issues label Mar 9, 2019
@alexr00
Copy link
Member

alexr00 commented Mar 11, 2019

@tobdub, are you referring to the configurations in launch.json which run when you use F5 or click the green arrow in the debug viewlet?

@alexr00 alexr00 added the info-needed Issue requires more information from poster label Mar 11, 2019
@tobdub-snce
Copy link
Author

@alexr00, I'm talking about tasks under Shift+Ctrl+P -> Tasks: Run task
There are default tasks for Build and Test. I'm looking for a default Run task i.e. build + execute.
F5 and Ctrl+F5 seem to require a debugger?

@Gama11
Copy link
Contributor

Gama11 commented Mar 11, 2019

There's a Debug: Start Without Debugging command that might be helpful? But I guess that only makes sense if the thing you want to start can be debugged, otherwise you wouldn't have a launch config for it.

@tobdub-snce
Copy link
Author

The specific case I have at the moment is a Rust project where I want to trigger the cargo run task with a default keybinding in the same way I can trigger cargo build using the default build task.
I can create a keybinding for the specific task, but I thought it could make sense to have a default run task since it seems to be a fairly common operation, available in most editors/IDEs.

@alexr00
Copy link
Member

alexr00 commented Mar 12, 2019

@weinand do you think a feature request like this makes more sense as a type of task, or as a debugger-less launch.json configuration?

@weinand
Copy link
Contributor

weinand commented Mar 12, 2019

@alexr00 IMO this feature makes more sense as a task because typical projects already have some VS Code independent "run" script (or "run" makefile target) that they want to surface painlessly as a VS Code "Run" task (similar to "Build"). So there is no need to implement a "Run" task; it is only necessary to wire it up as a standard "Run" task.

The "Debug: Start Without Debugging" is very VS Code specific and requires an existing launch configuration (and a debugger extension that actually supports to launch a debug target without debugging). Since this is much more effort and the result is VS Code specific, most user are probably not interested in this.

@alexr00
Copy link
Member

alexr00 commented Mar 12, 2019

@weinand that sounds reasonable.

@alexr00 alexr00 added feature-request Request for new features or functionality and removed info-needed Issue requires more information from poster labels Mar 12, 2019
@alexr00 alexr00 added this to the On Deck milestone Mar 12, 2019
@xrob
Copy link

xrob commented Jun 9, 2019

I believe this can be achieved with a change in the settings.json file similar to what I've done below:

"code-runner.executorMap": {
    "java": "mvn -B -q compile && java -cp ./target/classes com.something.$fileNameWithoutExt",
}

@alexr00 alexr00 assigned meganrogge and unassigned alexr00 Jun 30, 2022
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

6 participants