Skip to content

Instantly share code, notes, and snippets.

@Barrixar
Last active October 13, 2025 12:21
Show Gist options
  • Select an option

  • Save Barrixar/d624ebe99c8ec4f4169c8fcd10a66773 to your computer and use it in GitHub Desktop.

Select an option

Save Barrixar/d624ebe99c8ec4f4169c8fcd10a66773 to your computer and use it in GitHub Desktop.
Per-Extension tasks.json fix for "Error: Invalid problemMatcher reference: $esbuild-watch"
"problemMatchers": [
{
"name": "esbuild",
"label": "esbuild problem matcher",
"applyTo": "allDocuments",
"source": "esbuild",
"fileLocation": "relative",
"pattern": [
{
"regexp": "^\\S \\[([A-Z]+)\\] (.+)$",
"severity": 1,
"message": 2
},
{
"regexp": "^\\s*(.+?):([0-9]+)(?::([0-9]+))?:?(?:\\s.*)?$",
"file": 1,
"line": 2,
"column": 3,
"loop": true
}
]
},
{
"name": "esbuild-watch",
"base": "$esbuild",
"label": "esbuild --watch problem matcher",
"applyTo": "allDocuments",
"source": "esbuild",
"fileLocation": "relative",
"background": {
"activeOnStart": true,
"beginsPattern": {
"regexp": "> \\[watch\\] build started"
},
"endsPattern": {
"regexp": "> \\[watch\\] build finished"
}
}
}
],
@Barrixar
Copy link
Author

This is the extension approach, while microsoft/vscode#271088 would be the VSCode native approach. However, this gist can be useful to some, should the PR not (yet) get merged.

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