Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Tracked by #8370
baronfel opened this issue May 15, 2023 · 3 comments

Comments

@baronfel
Copy link
Member

baronfel commented May 15, 2023

Summary

The VSCode problem matcher (seen here) 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):

{
        "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
@rainersigwald
Copy link
Member

I would like to also consider dropping the sigil and matching the existing regexen. I like the visibility of the sigil but I wonder if we can get that in a less intrusive way.

@baronfel
Copy link
Member Author

Noted! I added that as an alternative design to the suggestion.

@AR-May AR-May added backlog and removed needs-triage Have yet to determine what bucket this goes in. labels May 18, 2023
@baronfel
Copy link
Member Author

We are going to revert the emoji for p6 and instead colorize only the diagnostic prefix (ie 'Warning' or 'Error') and the diagnostic code. The message text should remain the current terminal foreground color.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants