electron Visual studio代码,在外部应用程序中打开当前文件

jpfvwuh4  于 8个月前  发布在  Electron
关注(0)|答案(2)|浏览(95)

我试图写一个简单的扩展在Visual Studio代码,扩展将简单地采取当前文件,并启动它在外部应用程序.我们如何才能做到这一点?

i7uq4tfw

i7uq4tfw1#

使用VS Code Tasks找到了答案。如果有人有使用扩展的解决方案,将不胜感激。

{
    "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}"]

}

字符串

uqxowvwt

uqxowvwt2#

您可以使用node / npm上的任何可用内容。在本例中,您可以使用spawnhttps://nodejs.org/api/child_process.html
或者,你可以使用open,我个人喜欢 * 前台进程启动 *:https://www.npmjs.com/package/open

相关问题