I'm trying to write a simple problem matcher for the output of ts-node-dev
, but for some reason VSCode never detects problems in the output.
Here's the terminal output I would like to match; it contains an error message and a stack trace. I've copied it from the task output in VSCode's terminal pane:
Please migrate your code to use AWS SDK for JavaScript (v3).
For more information, check the migration guide at https://a.co/7PzMCcy
(Use `node --trace-warnings ...` to show where the warning was created)
[INFO] 15:58:00 Restarting: /Users/myname/dev/workspaces/ts_workspace/code/api/src/graphql/schemas/dataDiagnostic.ts has been modified
trying to use docker executor...but configured as cannot.
Error: Unknown type "DataDiagnosticSverity". Did you mean "DataDiagnosticSeverity", "DataDiagnosticEdge", "DataDiagnostic", or "DataDiagnosticConnection"?
at assertValidSDL (/Users/myname/dev/workspaces/ts_workspace/code/node_modules/graphql/validation/validate.js:135:11)
at buildASTSchema (/Users/myname/dev/workspaces/ts_workspace/code/node_modules/graphql/utilities/buildASTSchema.js:44:34)
at makeExecutableSchema (/Users/myname/dev/workspaces/ts_workspace/code/node_modules/@graphql-tools/schema/cjs/makeExecutableSchema.js:73:47)
at Object.<anonymous> (/Users/myname/dev/workspaces/ts_workspace/code/api/src/apolloServer.ts:12:36)
at Module._compile (node:internal/modules/cjs/loader:1155:14)
at Module._compile (/Users/myname/dev/workspaces/ts_workspace/code/node_modules/source-map-support/source-map-support.js:568:25)
at Module.m._compile (/private/var/folders/fr/gxs3qpcs2zxby__p9lm9h_rm0000gn/T/ts-node-dev-hook-6064780755344261.js:69:33)
at Module._extensions..js (node:internal/modules/cjs/loader:1209:10)
at require.extensions..jsx.require.extensions..js (/private/var/folders/fr/gxs3qpcs2zxby__p9lm9h_rm0000gn/T/ts-node-dev-hook-6064780755344261.js:114:20)
at require.extensions.<computed> (/private/var/folders/fr/gxs3qpcs2zxby__p9lm9h_rm0000gn/T/ts-node-dev-hook-6064780755344261.js:71:20)
[ERROR] 15:58:01 Error: Unknown type "DataDiagnosticSverity". Did you mean "DataDiagnosticSeverity", "DataDiagnosticEdge", "DataDiagnostic", or "DataDiagnosticConnection"?
(node:54671) NOTE: We are formalizing our plans to enter AWS SDK for JavaScript (v2) into maintenance mode in 2023.
And here's my problemMatcher for the task that gives the above output:
"problemMatcher": [
{
"fileLocation": "absolute",
"pattern": {
"regexp": "^(Error|Warning):\\s*(.*)[\\n\\r]+\\s+at\\s+(.*)\\s+\\((.*):(\\d+):(\\d+)\\)",
"severity": 1,
"message": 2,
"file": 4,
"line": 5,
"column": 6
}
}
]
I designed the regex on regex101.com and then passed it through a JSON escaper to get the extra slashes needed. You can see the regex working correctly with all of its captures here. I've also pasted the output into VSCode and run the regex manually to ensure that it matches there.
Despite all of that, when I start the task in VSCode, the problem is not detected. I don't see any options for debugging or testing the problemMatcher beyond what I've already done.
How can I change my problemMatcher so that it correctly detects the problem in the output shown above?