0

我在为我的监视任务设置问题匹配器时遇到问题。正则表达式似乎是正确的,但即使它们显示在控制台中,它也不会在问题选项卡中显示任何错误。我错过了什么?

"problemMatcher": {
  "owner": "typescript",
  "fileLocation": "autoDetect",
  "pattern": [
    {
      "regexp": "(ERROR|WARNING) in (.+)\\(",
      "severity": 1,
      "file": 2
    },
    {
      "regexp": "^(\\d+):(\\d+) (.+)$",
      "line": 1,
      "column": 2,
      "message": 3,
      "loop": true
    }
  ],
  "background": {
    "activeOnStart": false,
    "beginsPattern": "Type checking in progress\\.\\.\\.",
    "endsPattern": "Time: \\d+ms"
  }
}

终端输出:

> Running compilation in watch mode
> Building component registry...
> Component registry built
> Starting type checking service...
> Type checking in progress...
> Type checking in progress...
× ERROR in C:/project/Shared/SizeGuide/index.tsx(180,8):
180:8 Cannot find name 'SizeGuideFlyout'. Did you mean 'SizeGuideInFlyout'?
    178 |   render() {
    179 |     return (
  > 180 |       <SizeGuideFlyout
        |        ^
    181 |         toggleFlyout={this.props.toggleSizeGuideFlyout}
    182 |         position={Position.Right}
    183 |         isOpen={this.props.isOpen}
> Version: typescript 3.7.2
> Time: 32ms
4

1 回答 1

0

文档

除了background问题匹配器上的属性外,还必须将任务本身标记为,isBackground以便任务在后台继续运行。

于 2021-03-24T20:28:23.783 回答