为什么 Visual Studio Code 会忽略我的 tasks.json 文件? [英] Why is Visual Studio Code ignoring my tasks.json file?

查看:55
本文介绍了为什么 Visual Studio Code 会忽略我的 tasks.json 文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

tasks.json 有问题,我已将其简化为以下内容.

I have a problem with tasks.json, which I have simplified by reducing it to the following.

在我的 Visual Studio Code 项目的根目录中,文件资源管理器侧边栏中的根文件夹清晰可见,是 .vscode,而 .vscode 内部是 tasks.json.这是由 VSCode 为我自动生成的,我没有移动文件夹或项目,也没有将 VSCode 指向其他文件夹.

At the root of my Visual Studio Code project, clearly visible inside of the file explorer sidebar as a root folder is .vscode, and inside of .vscode is tasks.json. This was auto-generated for my by VSCode and I did not move the folder or the project or point VSCode to a different folder.

tasks.json 的内容如下:

The contents of tasks.json is as follows:

{
    "version": "0.1.0",

    // The command is tsc. Assumes that tsc has been installed using npm install -g typescript
    "command": "tsc",

    // The command is a shell script
    "isShellCommand": true,

    // Show the output window only if unrecognized errors occur.
    "showOutput": "silent",

    // args is the HelloWorld program to compile.
    "args": ["test.ts"],

    // use the standard tsc problem matcher to find compile problems
    // in the output.
    "problemMatcher": "$tsc"
}

请注意,"args" 的原始默认值是 ["HelloWorld.ts"],但我只是将其更改为 ["test.ts"].

Please note that the original default value of "args" was ["HelloWorld.ts"], however I have simply changed it to ["test.ts"].

现在,当我按下 ctrl-shift-b 时,我得到以下信息:

Now, when I press ctrl-shift-b, I get the following:

错误 TS6053:找不到文件HelloWorld.ts".

error TS6053: File 'HelloWorld.ts' not found.

请注意,每次尝试执行此操作时,我都会清除输出窗口中的输出.看起来 VSCode 忽略了我的 tasks.json 文件并使用默认设置.

Note that I do clear the output in the output window every time I attempt this. It looks like VSCode is ignoring my tasks.json file and is using default settings.

我使用的是 Ubuntu 14.04.

I am on Ubuntu 14.04.

推荐答案

听起来您遇到了一个奇怪的错误……如果您关闭并重新打开 Visual Studio 代码,这似乎不是问题所在?

Sounds like you had a weird error... if you closed and reopened Visual studio code, it doesn't seem like that was the problem?

我以前从未听说过发生过这种错误.如果你继续得到它,在 vscode github repo 上打开一个问题.

I have not heard of that kind of error happening before. If you continue to get it, open an issue on the vscode github repo.

否则,我只是假设这是通过重新启动解决的随机操作系统问题之一.

Otherwise, I'd just assume it was one of those random OS issues solved by a reboot.

这就是我称其为健全性检查的原因.通常像重启这样简单的事情就可以解决很多奇怪的内存/内存错误.

That's why I called it a sanity check. Often something simple like a reboot can solve a lot of weird memory/ram errors.

这篇关于为什么 Visual Studio Code 会忽略我的 tasks.json 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆