vshaxe icon indicating copy to clipboard operation
vshaxe copied to clipboard

Same error line doesn't get reported in Problems

Open ncannasse opened this issue 6 years ago • 12 comments

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.

ncannasse avatar Oct 31 '19 09:10 ncannasse

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 avatar Oct 31 '19 09:10 RealyUniqueName

@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?

ncannasse avatar Oct 31 '19 09:10 ncannasse

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.

Gama11 avatar Oct 31 '19 10:10 Gama11

Yeah. Even compiler doesn't always know if sequential messages are related to the same error.

RealyUniqueName avatar Oct 31 '19 10:10 RealyUniqueName

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.

Gama11 avatar Oct 31 '19 10:10 Gama11

Hi! Was there any update on this issue? 🤔

deepnight avatar Feb 15 '21 12:02 deepnight

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 avatar Feb 15 '21 14:02 RealyUniqueName

@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

ncannasse avatar Feb 19 '21 19:02 ncannasse

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 ?

ncannasse avatar Feb 19 '21 19:02 ncannasse

Yes. I think It would be easier to display the first line only.

RealyUniqueName avatar Feb 20 '21 09:02 RealyUniqueName

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? :)

deepnight avatar May 06 '21 07:05 deepnight