简体   繁体   中英

vscode: manually recheck for errors/problems (angular 2)

I have an angular 2 project on vsCode which I had to modify manually on disk. For some reason now the "problems" tab isn't updating and showing the new problems.

Any way we can tell it to manually recheck the files on disk for error?

When you open your solution in VSCode hit Ctrl + Shift + B to attempt a build, with no build configured it will ask you to configure a build task, in the dropdown select typescript watch mode.

Alternatively you can get tho the dropdown by hitting Ctrl + Shift + p and typing configure task runner

It will create a .vscode folder in the root of the folder you have open in VSCode and add a tasks.json file with the contents:

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

If your application is a cli application you may need to change the third argument in "args" from "." to "./src" to change where it looks for your typescript config/application

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM