VS Code custom problemMatcher doesn't work

1.1k Views Asked by At

I have a problem with setting up problemMatcher for my watch task. The regex seems to be correct, but it doesn't show any errors in the problems tab even then they show in the console. What am I missing?

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

Terminal output:

> 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
1

There are 1 best solutions below

0
On

From the docs

In addition to the background property on the problem matcher, the task itself has to be marked as isBackground so that the task keeps running in the background.