I am trying to write a simple extension in Visual Studio Code, the extension will simply take the current file and launch it in external application. How can we do that?
Found an answer using VS Code Tasks. will appreciate if someone has a solution using extensions.
{
"version": "0.1.0",
// we want to run vs
"command": "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\devenv.exe",
// the command is a shell script
"isShellCommand": true,
"showOutput": "silent",
"args": ["/edit", "${file}"]
}
You can use anything that is available on node / npm. In your case you can just use spawn
https://nodejs.org/api/child_process.html
Alternatively you can use open
which I personally love from foreground process launching : https://www.npmjs.com/package/open
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With