Why doesn't this problemMatcher in VS code work?

你说的曾经没有我的故事 提交于 2019-12-23 10:18:11

问题


Why doesnt my problemMatcher work? I'm pretty sure about the regex, but it doesn't report any problems, even there are some on stdout...

// the matcher
"problemMatcher": {
    "owner": "typescript",
    "fileLocation": ["relative", "${workspaceRoot}"],
    "pattern": {
        "regexp": "^TypeScript (warning|error): (.*)\\((\\d+),(\\d+)\\): (.*)$",
        "severity": 1,
        "file": 2,
        "line": 3,
        "column": 4,
        "message": 5
    }
}

//the browserify/tsify pipeline
browserify().add('main.ts')
  .plugin(tsify, { noImplicitAny: false, removeComments:true })
  .transform("babelify",{ extensions: ['.ts'], presets: ["es2015"]})
  .bundle()
  .on('error', function (error) { console.log(error.toString()); })
  .pipe(source('bundle.js'))
  .pipe(gulp.dest('www/js/dist/'));

//gulp sample output
[00:39:00] Starting 'ts-compile'...
TypeScript error: main.ts(118,30): Error TS2339: Property 'object' does not exist on type 'boolean'.
TypeScript error: main.ts(137,24): Error TS2339: Property 'object' does not exist on type 'boolean'.
TypeScript error: main.ts(507,44): Error TS2304: Cannot find name 'loading'.
[00:39:03] Finished 'ts-compile' after 2.98 s

回答1:


I resolved the problem by putting tasks.json into .vscode folder. I initially thought tasks.json would be found like tsconfig.json (project-root), but it turned out to be wrong.



来源:https://stackoverflow.com/questions/34055354/why-doesnt-this-problemmatcher-in-vs-code-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!