Files
setup-msbuild/.github/msbuild.json
Chet Husk a5f6b5adfd Register a problem matcher for MSBuild/csc errors and warnings
- Add .github/msbuild.json with two owners: one matching file-based
  diagnostics (File(line,col): error/warning CODE: msg [project]) and
  one matching engine-level errors without file/line info.
- Register the matcher in src/main.ts via the ##[add-matcher] workflow
  command, resolved relative to __dirname so it works from the ncc
  bundle in dist/.
- Add src/__tests__/msbuild-matcher.test.ts validating the matcher
  regexes against representative CS/MSB error and warning lines.
- Document the new problem matcher in README.md.
- Rebuild dist/index.js via npm run build && npm run pack.

Fixes #4

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-21 16:20:37 -05:00

31 lines
698 B
JSON

{
"problemMatcher": [
{
"owner": "msbuild",
"pattern": [
{
"regexp": "^\\s*(?:\\d+>\\s*)?([^\\s].*?)\\((\\d+)(?:,(\\d+))?(?:,\\d+)*\\)\\s*:\\s*(error|warning)\\s+([A-Za-z]+\\d+)\\s*:\\s*(.*?)(?:\\s+\\[(.+?)\\])?\\s*$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"code": 5,
"message": 6,
"fromPath": 7
}
]
},
{
"owner": "msbuild-no-location",
"pattern": [
{
"regexp": "^(?!.*\\().*\\b(error|warning)\\s+([A-Za-z]+\\d+)\\s*:\\s*(.*)$",
"severity": 1,
"code": 2,
"message": 3
}
]
}
]
}