Same error line doesn't get reported in Problems
As new versions of VSCode gets shipped, the "Problems" view of errors get more and more difficult to read.
We already have issue regarding ordering #253 and terminal size #137, and now it seems that when you have two or more errors at the exact same position, only the latest gets reported in Problems.
class Main {
static function main() {
trace(Math.ceil("hello"));
}
}
Terminal output:
Main.hx:3: characters 26-33 : String should be Float
Main.hx:3: characters 26-33 : For function argument 'v'
Problems output:
For function argument 'v'
I understand it's a VSCode problem but we should find ways to circumvent the problem by having the compiler output different format for error messages, for instance having a single line such as:
Main.hx:3: characters 26-33 : String should be Float. For function argument 'v'
Another option would be to see if we can somehow have another way to handle build (maybe not through tasks?) and be about to output directly to problems without having to go through the terminal and regular expressions to match the output.
having a single line such as:
Even with a single line it should preserve positions from both lines. Some errors look like this:
Main.hx:3: characters 26-33 : method XXX has incompatible type
Another.hx:3: characters 12-34 : parent method is declared here
@RealyUniqueName yes, that's #253 . I think we're quite stuck until https://github.com/microsoft/vscode/issues/55253 is resolved, unless @Gama11 has another option?
I think it mostly all comes down to VSCode's planned API for programmatic problem matching, which would allow us to fix all the various issues since we'd have full control.
Though even then I'm not sure how we'd be able to tell whether an error is related to the previous one.
Yeah. Even compiler doesn't always know if sequential messages are related to the same error.
Maybe there needs to be some "marker" for error messages that are merely additional info for another one. That would probably help humans parsing the CLI output too.
Hi! Was there any update on this issue? 🤔
IIRC since Haxe 4.1 sequential lines get prefixed with ... like this:
Main.hx:3: Terrible error happened
Main.hx:3: ... for function argument v
@RealyUniqueName that does not help much with the issue.
I think we need to find a way to deal with it on the haxe compiler side without waiting for an eventual VSCode solution that might never come (been waiting for more than one year already and nothing new happened...)
That means making a different output when some flag is activated, which means sadly either:
- only displaying the first line of the of the error group
- or concatenating all the messages together
This could be done using an environment variable that is set by VSHaxe when calling haxe (hxml task configuration) if some flag is enabled in the tasks.json configuration - this way people that want to keep the Terminal output won't have to do anything. Could you take care of it @RealyUniqueName ?
Yes. I think It would be easier to display the first line only.
Any update on this?
Problems are basically unusable 50% of the time for me, even for super simple case. Is it possible to switch to a single line format already instead of waiting for a future vscode change? :)