Provide Angular Build Problem Matcher
See original GitHub issueI have the following task for build:
{
"label": "build",
"type": "npm",
"script": "build",
"group": {
"kind": "build",
"isDefault": true
},
"isBackground": true,
"problemMatcher": {
"owner": "typescript",
"source": "ts",
"applyTo": "closedDocuments",
"fileLocation": ["relative", "${workspaceRoot}/src"],
"pattern": "$tsc",
"background": {
"activeOnStart": true,
"beginsPattern": {
"regexp": "(.*?)"
},
"endsPattern": {
"regexp": "Compiled |Failed to compile."
}
}
}
},
This used to show errors/warnings under problems. With the new syntax it doesn’t work and I can’t find any information on how this needs to be fixed to parse errors for angular properly.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:8
- Comments:11 (5 by maintainers)
Top Results From Across the Web
VS Code task problem matcher for Angular CLI build/serve ...
I tried to create a custom matcher, but it looks harder than I expected. Angular CLI outputs typescript errors as well as html...
Read more >Tasks in Visual Studio Code
VS Code can process the output from a task with a problem matcher. Problem matchers scan the task output text for known warning...
Read more >Tutorial: Creating custom route matches - Angular
Pattern matching with the Angular Router provides you with a lot of flexibility when you have dynamic URLs in your application. To learn...
Read more >Debug angular like PRO with visual studio code - Medium
It will launch angular application in debugger mode. In case some one doesn't know way of adding debugger point, it's quite simple just...
Read more >Angular Material - Error State Matcher for Form Fields (2021)
You can get more in-depth knowledge about Angular Forms & Custom Form Controls in my brand-new advanced course ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hello everybody,
I’ve updated Angular to 11 version and have faced with the issue.
The standard typescript problem matcher of VS Code ($tsc) cannot parse ng build errors anymore.
I have reviewed VS Code source code and have found a regular expression which parses errors from tsc (link).
The following regex is used:
/^([^\s].*)[\(:](\d+)[,:](\d+)(?:\):\s+|\s+-\s+)(error|warning|info)\s+TS(\d+)\s*:\s*(.*)$/
But Angular displays errors in the following formats now:
Error: src/app/app.component.ts:9:18 - error TS1005: ';' expected.
and problem matcher takes the row ‘Error: src/app/app.component.ts’ as a file path with the extra ‘Error: ’ word at the beginning. That causes incorrect file paths building and VS Code failing during attempt to open the file with the error:
I don’t know whom to reach with this issue and this branch is the single one which I’ve found in all angular/angular-cli/vscode repositories, that’s why I’ve written it here.
Moreover, problem matcher $msCompile source code you mentioned is located next to it. But I don’t understand why you even need $msCompile. I use the following matcher as a temporary solution in my tasks.json:
But it works half the time because the error messages are displayed in different formats.
I was getting some error when using @kvart714, so used https://regex101.com/ , pasted all errors and came up with below. This exactly matches with the default
$tsc
matcher except the beginningError:
current-matcher: https://github.com/microsoft/vscode/blob/149a8b71c534df0554c17b05cf1a925e9139c47f/extensions/typescript-language-features/package.json#L1105