Skip to content

"problemMatcher": "$msCompile" in tasks.json no longer properly matches problems. #2300

@JohnGalt1717

Description

@JohnGalt1717

Describe the Issue

problemMatcher is no longer matching on build and there is no documentation on how to do this properly anymore, it is relying on magic instead of exlicit definition in tasks.json

Steps To Reproduce

Add this to tasks:

    {
      "type": "shell",
      "label": "dotnet: build",
      "detail": "Builds the Entire Solution",
      "command": "dotnet",
      "args": [
        "build",
        "${workspaceFolder}",
        "/property:GenerateFullPaths=true",
        "/consoleloggerparameters:NoSummary"
      ],
      "group": {
        "kind": "build",
        "isDefault": true
      },
      "problemMatcher":  "$msCompile"      
    },

Create code with an error

then press CTRL+SHIFT+B

Make sure you have no problems detected before you do this.

It won't show the errors in problems.

And if you do this:

    {
      "type": "shell",
      "label": "dotnet: build",
      "detail": "Builds the Entire Solution",
      "command": "dotnet",
      "args": [
        "build",
        "${workspaceFolder}",
        "/property:GenerateFullPaths=true",
        "/consoleloggerparameters:NoSummary"
      ],
      "group": {
        "kind": "build",
        "isDefault": true
      },
      "problemMatcher": {
        "owner": "msbuild",
        "source": "msbuild",
        "fileLocation": "absolute",
        "pattern": {
          "regexp": "^(.*)\\((\\d+),(\\d+)\\):\\s+(error|warning)\\s+(\\w+)\\d+:\\s+(.*)$",
          "file": 1,
          "line": 2,
          "column": 3,
          "severity": 4,
          "code": 5,
          "message": 6
        }
      }
    },

Which AI generates to fix it, it does fix it, but when you fix the error in the file, the problems don't update automatically, you have to rebuild to see them updated unlike Rider and VS.net.

Expected Behavior

Should automatically update on the entire solution on build with just a single line in the tasks.json.
Should have documentation on how to setup tasks.json
Should automatically update when files are fixed in source.

Environment Information

Windows 11 Latest
VS Code latest public
C# Dev Kit latest public.

Metadata

Metadata

Assignees

Labels

area-vscodebugSomething isn't workingexternalExternal to this extension

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions