VS代码中的问题匹配器为什么不起作用?

问题描述 投票:5回答:1

为什么我的problemMatcher不起作用?我对正则表达式非常确定,但是它没有报告任何问题,即使在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
regex visual-studio-code gulp tsify vscode-problem-matcher
1个回答
4
投票

我通过将tasks.json放入.vscode文件夹解决了该问题。我最初以为tasks.json会像tsconfig.json(项目根目录)那样被发现,但事实证明是错误的。

© www.soinside.com 2019 - 2024. All rights reserved.