在可视代码

时间:2017-02-05 07:23:10

标签: typescript visual-studio-code

尝试以转换和运行JS代码的方式配置tasks.json。但不知道该怎么做。 此外,每当我尝试( Ctrl + Shift + B )时,VS代码告诉我:

  

在tasks.json中没有任务被标记为构建任务。使用'isBuildCommand'标记任务

tasks.json

{
    "version": "0.1.0",
    "command": "tsc",
    "isShellCommand": true,
    "showOutput": "silent", 
    "isBuildCommand": true,
    "args": ["--target", "ES5",
         "--outDir", "js",
         "--sourceMap",
         "--watch",
         "app.ts"],
    "problemMatcher": "$tsc"
}

2 个答案:

答案 0 :(得分:2)

您似乎错过了配置中的任务数组。以下是documentation

的示例
{
    "version": "0.1.0",
    "command": "tsc",
    "isShellCommand": true,
    "tasks":[
        {
           "isBuildCommand": true,
           "args": ["--target", "ES5",
                    "--outDir", "js",
                    "--sourceMap",
                    "--watch",
                    "app.ts"],
           "problemMatcher": "$tsc",
           "showOutput": "silent"
        }
}

在你的情况下,它可能是这样的。

System.Runtime.InteropServices.COMException

答案 1 :(得分:0)

似乎有一个错误。

关闭并重新打开窗口会暂时解决它。

https://github.com/Microsoft/vscode/issues/24796

相关问题