I am making an msbuild task that drives tsc and I am capturing the output and attempting to provide accurate file, line, column and message information to msbuild. However as I am trying to do this I am seeing that error message formats can come in multiple forms. The trick is that if I have to parse these error messages the actual message body should probably come last, since it can contain any character, whereas the file can only have certain characters and the ( , ) surrounding and splitting the line/col are easy to parse.
I am seeing:
[message] [file] ([line], [col]) : [message2]
[file] ([line], [col]) [message]
[message]
And possibly more.
Repro:
- create a simple class in a file somewhere
- temporarily delete lib.d.ts from your path (should probably copy it somewhere first)
-
tsc.exe simpleClass.ts
Expected:
errors to occur, all with this format: [file] ([col], [line]) [message]
Actual:
mixed error message formats.