我在 vsCode 上有一个 Angular 2 项目,我必须在磁盘上手动修改它。由于某种原因,现在“问题”选项卡没有更新并显示新问题。
我们有什么办法可以告诉它手动重新检查磁盘上的文件是否有错误?
最佳答案
当您在 VSCode 中打开解决方案时,按 Ctrl + Shift + B
尝试构建,如果没有配置构建,它会要求您配置构建任务,在下拉列表中选择 typescript 监视模式。
或者,您可以通过按 Ctrl + Shift + p
并输入配置任务运行程序来获取下拉列表
它将在您在 VSCode 中打开的文件夹的根目录中创建一个 .vscode 文件夹,并添加一个包含以下内容的 tasks.json
文件:
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "tsc",
"isShellCommand": true,
"args": [
"-w",
"-p",
"."
],
"showOutput": "silent",
"isBackground": true,
"isBuildCommand": true,
"problemMatcher": "$tsc-watch"
}
如果您的应用程序是 cli 应用程序,您可能需要将 "args"
中的第三个参数从 "."
更改为 "./src"
更改查找 typescript 配置/应用程序的位置
关于angular - vscode : manually recheck for errors/problems (angular 2),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44175539/