dotnet / dotnet/msbuild

[Feature Request]: Update VSCode Problem Matcher for MSBuild compilation errors to account for TerminalLogger formatting

Open
#8,760 3 comments 0 reactions 0 assignees View on GitHub
backlog Feature Request triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

### Summary

The VSCode problem matcher (seen [here](https://github.com/microsoft/vscode/blob/main/src/vs/workbench/contrib/tasks/common/problemMatcher.ts#L1286C26-L1294)) doesn't understand the new formatting from the TerminalLogger. We should contribute a fix for this regex to understand the new sigils from the TerminalLogger.

### Background and Motivation

Parity and not breaking existing VSCode tasks that use the `$msCompile` matcher.

### Proposed Feature

We should update the regex that VSCode ships with the regex from this simple task test harness (the `regexp` specifically):

```json
{
"label": "build codebase",
"command": "dotnet",
"args": [
"build", "/tl"
],
"type": "shell",
"problemMatcher": [
{
"owner": "dotnet",
"source": "msbuild",
"pattern": {
"regexp": "^(?:\\s+[❌︎|⚠|🛈]*\\s+)(?:\\d+>)?(\\S.*)\\((\\d+|\\d+,\\d+|\\d+,\\d+,\\d+,\\d+)\\)\\s*:\\s+(error|warning|info)\\s+(\\w+\\d+)\\s*:\\s*(.*)$",
"kind": "location",
"file": 1,
"location": 2,
"severity": 3,
"code": 4,
"message": 5,
}
}
],
"group": "build",
"presentation": {
"echo": true,
"reveal": "always",
"revealProblems": "onProblem",
"focus": false,
"panel": "shared",
"showReuseMessage": false,
"clear": true
}
}
```

### Alternative Designs

* drop the sigil and keep compatibility with the existing problem matcher regex

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.