HaxeFoundation / intellij-haxe

Haxe plugin for IntelliJ Platform based IDEs (IDEA, Android-Studio)
http://intellij-haxe.org
Apache License 2.0
219 stars 100 forks source link

Compiler error / warning shows just default message #180

Closed derRaab closed 9 years ago

derRaab commented 9 years ago

I'm using Intellij IDEA 14 with the latest Haxe plug-in (0.9.2) but now compiler errors are not shown - instead it just says:

Warning:This is not a real warning, it's just here to force this window to open ...

Is there a manual way to fix this or do we have to wait for another update? I really appreciate your work :) - but for now I would have to go back to Intellij IDEA 13 with plug-in version 0.8.1 (which does everything nicely)

TIR: STB-9363

as3boyan commented 9 years ago

I did some changes(redirect stderr to stdout if I'm not mistaking) to getProcessStdout and getProcessStderr, to avoid hangs, now will need to check how it works, not sure if it's functionality used to perform compilation

EBatTiVo commented 9 years ago

@derRaab - Which compiler are you using, HXML, NME/Neko (NMML), Haxe compiler, OpenFL (Lime)?

@as3boyan - I doubt that this trouble is caused by the changes to the process code. I think it's an issue with the error/warning parsing, which we changed because everything was a warning. Using Idea 13 and the recent changes (0.9) I've noticed that real errors still stop compilation, but the actual error messages are showing up as info lines. They're not highlighted or shown as errors, (which is annoying) so it's likely that the regular expression that determines if a compiler emission is an error needs updating for more environments.

That said, @derRaab, if there are no compiler errors, we still want the window open (at least TiVo devs want to see the output of the compiler as it's running). That's why the fake warning.

So, what is the real problem here? In other words, is this bug really about not wanting to see an unnecessary window, or is it about real errors not being displayed in the IDE? Are compiler errors not being shown (in info lines) when the same compile from the command line has errors? Is it that errors aren't highlighted, so they're hard to see?

derRaab commented 9 years ago

Hi there! :) We're always using HXML for compilation. And regarding compiler errors:

If I try to compile this snipped:

var someInt : Int = 1;
someInt = "string";

I only get this in the message window:

bildschirmfoto 2015-03-24 um 09 17 27

derRaab commented 9 years ago

It's the same for Js projects as for Flash projects...

derRaab commented 9 years ago

In Intellij IDEA 13.1.6 with Haxe plug-in 0.8.1 I get this output: bildschirmfoto 2015-03-24 um 09 20 31 I think this warning message is crucial to our development process but would be even better if clicking on on (or hitting F4) would automatically jump to the corresponding line. :D

derRaab commented 9 years ago

Additional note: I just updated to Intellij IDEA 14.1 to give it a try, but it results in the same problem.

as3boyan commented 9 years ago

@EBatTiVo Some time ago it used to work. Currently people say that compiler errors is not shown, so this should be one of most annoying issues. Issue of the year)

as3boyan commented 9 years ago

@EBatTiVo What do you think if we replace dat fake warning with command line arguments(to compiler and etc) if possible?

EBatTiVo commented 9 years ago

@as3boyan, I'm more than happy to put the command line there instead. The trouble is that the message must be at least at warning level to force the window open (currently -- maybe there's a way around that?). That said, we have enough error reports that may simply be configuration issues that I'd love to see what command is actually being run when a compile is requested. I think that we even had a request for that in an earlier bug.

EBatTiVo commented 9 years ago

@as3boyan, Note above how the actual error is still displayed in v13. I wonder if there's a bug in the code that captures compiler output, too... Not just with the regex, which I think is responsible for mis-identifying the severity of messages.

derRaab commented 9 years ago

Since it currently doesn't work I wonder how you guys at tivo debug compiler errors and warnings? Is there another way to see the actual warning?

EBatTiVo commented 9 years ago

I wonder how you guys at tivo debug compiler errors and warnings?

A) We build for OpenFL exclusively. B) We automate the creation of project files using an external program integrated into our legacy Make system. (Thus, we don't lose our project settings, either, though we know it's a bug and intend to fix it.) C) We still use Idea 13 for our development. (Notice that we still have a focus on keeping v13 running?) D) We always have a command-line build that doesn't use the IDE at all. So, before every commit, and when there are questions about reliability, we fall back to the command line.

derRaab commented 9 years ago

Hi there, since I have no clue how to contribute to this I can just pressing my thumbs hoping this will get fixed soon. Is somebody working on this issue?

sganapavarapu1 commented 9 years ago

@derRaab In the right panel of the issue, if 'Assignee' does not have any user - then, no one is currently working on that issue. Usually, the person working on it will assign it to himself to indicate to others (to avoid duplicating efforts) about upcoming fix. If you'd like to contribute by fixing this issue: please see the contributing document, readme document.

derRaab commented 9 years ago

@sganapavarapu1 yes, you're right, I checked it but some contributors added comments 3 weeks ago and we rely on this feature I thought - why not ask again. :) Anyway - I updated my report on jetbrains as well with more detailed informations - so maybe someone there might have a look. https://youtrack.jetbrains.com/issue/HAXE-377 See how desperate I am? :)

sganapavarapu1 commented 9 years ago

@derRaab Your issue is probably fixed with my latest commit https://github.com/TiVo/intellij-haxe/commit/d4984443743971cea5b2b62237f7be690036cdb3

I tested it on 13.1.6 with plugin version 0.9.3 + this change.

In your IntelliJ 13.1.6...

Download this attached JPEG file Rename it to 'intellij-haxe.jar' Uninstall your 'haxe support' existing plugin Select 'install from disk' and use this jar file

Let me know if that fixes your issue.

intellij-haxe

derRaab commented 9 years ago

Ah - I just tested 0.9.3 with IntelliJ IDEA 14.1.1 but it was still the same. I would love to try your solution but sadly there is no image attached.

sganapavarapu1 commented 9 years ago

Right click the 'intellij-haxe' link in my post above and download the target file to your disk.

I had to rename .jar file to .jpeg because it won't allow me to upload .jar file there's no image because it was not able to show preview of .jpeg file I uploaded ( as it isn't a jpeg file )

derRaab commented 9 years ago

Since I'm currently under development pressure (using 13.1.6 with Haxe 0.8.1) i won't mess around with it yet. I can just give it a separate try with Intellij IDEA 14.1.1 but this plug-in build is not compatible with the newest version. I thank you very much for your effort! Awesome!

But we need Intellij Idea 14 support anyway. Using Intellij 13 is just an interim solution for us. :)

EBatTiVo commented 9 years ago

160 is another report of this bug.

129 is related.

EBatTiVo commented 9 years ago

Fixed. Will be in the next release after 0.9.3. Please re-open if it recurs.

derRaab commented 9 years ago

I love to hear that! Thank you very - very much! When will we see the next version released?

derRaab commented 9 years ago

Hi again - I wonder when will we see a fixed plug-in released? Am I the only one thinking this bug is an absolute killer? :)

EBatTiVo commented 9 years ago

You'll see one on 5/27.

derRaab commented 9 years ago

I think this still exists? I downloaded Plug-in Version 0.9.4 for IDEA 14.1.3 (using 14.1.3) from https://plugins.jetbrains.com/plugin/6873?pr=idea and still got the same result. Is there a more recent .jar version I missed? Kind regards

EBatTiVo commented 9 years ago

No, it is fixed in 0.9.4. I just retested it and it's working for me.

@derRaab, Please upload the entire contents of your "Messages" pane after a compile/build run, along with the entire contents of your "Event Log" pane, and your logs from /system/log/idea.log and /system/log/build-log/build.log.

And, then please tell us what you are expecting to see that you are not.

In my case, when I rebuild with an intentional code error, I see a number of Information lines and two error lines in the "Messages Make" panel: Error:Compilation Failed near the top of the output window, and Error:(5,0) Unexpected asdfasdf at the bottom.

When a compilation error that is configuration related occurs, I see the error line at the top of the panel: Error:Compilation Failed near the top of the output window, and and a warning line near the bottom: Information: Class not found : fee.fie.foe.Main

In both cases, the relevant error data is in the "Messages Make" panel. The output is the same with both Javascript and Flash outputs.

EBatTiVo commented 9 years ago

@derRaab Also, make sure that you have turned off "Hide Warnings" on the left-hand side of the "Messages Make" panel.

derRaab commented 9 years ago

Just to make that sure: It works for you with the latest Intellij IDEA 14.1.3 and the Plug-in downloadable from https://plugins.jetbrains.com/plugin/6873?pr=idea ?

EBatTiVo commented 9 years ago

14.1.0 and 14.1.3, which works just like 14.0 did; the behavior hasn't changed. The plugin at JetBrains should be identical to the one at http://github.com/tivo/intellij-haxe/releases, which was built locally by me. I did not do the copying, @as3boyan can verify where the actual files on the JetBrains IDEA repo came from.

ophibox commented 9 years ago

We still have the same problem @derRaab is facing. After some digging, found out it is not working when using HXML file. Could you confirm?

EBatTiVo commented 9 years ago

So, here's the thing: The Haxe compiler doesn't always prepend its error and warning messages with a nice tag. Sure sometimes it does, but not always; not by a long shot. It also doesn't print them all via the stderr file handle, or have any other unique markings that always hold true. The error printer (from main.ml) simply uses a generic message printer which prints (sprintf) the message with the following format: "%s : %s". As you can guess, the message printer is called all over the place, particularly when compiling with the -v (verbose) flag set. Sooo.....

We can either catalog all of the error messages (and try to keep them up to date) or request that the compiler folks make all of the error and warning messages unique. Or, we can simply call all messages with an embedded colon an error and possibly show some false positives.

I did the latter. However, the list of verbose status messages using a colon was fairly small, so I look for those, specifically, to mark as information lines. PR #328.

EBatTiVo commented 9 years ago

PR has been merged. Look for the changes in 0.9.5, which should be published 13July15.

ophibox commented 9 years ago

Thank you for working on this (critical) issue, looking forward to try 0.9.5 And BTW, double clicking the error (or hitting F4) still does not jump to the source file & error line.

EBatTiVo commented 9 years ago

And BTW, double clicking the error (or hitting F4) still does not jump to the source file & error line.

IDEA can only jump to the source line when the compiler returns that line in an error message. Any line that doesn't match an error or warning pattern is output as an information line. If you don't see a file name in the output area, then IDEA didn't get the line information. There's nothing IDEA can do about a lack of information from the compiler.

The code that pattern matches the error strings is in https://github.com/TiVo/intellij-haxe/blob/master/common/src/com/intellij/plugins/haxe/compilation/HaxeCompilerError.java. Feel free to recommend better patterns or a better algorithm.

ophibox commented 9 years ago

Actually the file/line of the error is correctly returned (since we can see it in the Messages panel (when we don't use a HXML), and is the only way to know where the error is located). It might be some difference in the compiler version, the one I have probably outputting a bit differently the error and the pattern match is failing. I'll try with the last version of the compiler and report back. As you pointed out, it would be nice if the compiler had a consistent way of outputting the messages

edit: I've misread your post, I understand now what you meant by "when the compiler returns that line in an error message"

derRaab commented 9 years ago

Thank for your findings and progress! And sorry for not responding - I had to go back using Intellij 13.1.6 and Plug-in 0.8.1 to keep up with milestones. I wonder why in this old combination most seems to work as expected? Wouldn't it be an option to reuse code from back then? Anyway, I'm looking forward to 0.9.5 so I finally can use all these great improvements.

Regarding compiler output consistency: Maybe it would be a nice feature-request if you could recommend output prefixes? Just "Error:" and "Warning:" or something like that?

We then could create an issue to improve this...

derRaab commented 9 years ago

Just updated to 0.9.5 in IntellijIDEA 14.1.3 -> Works just fine! THANKS! Any known issues with 14.1.4? I'm scared so I'm avoiding updates. :)

sganapavarapu1 commented 9 years ago

I'm using 0.9.5 on 14.1.4.

EBatTiVo commented 9 years ago

@derRaab I've only used it sporadically. My normal installation is using 14.1.1 since that's what we're recommending internally. Avoid 14.1.2 as it has some issues that made it incompatible with the Haxe plugin.

derRaab commented 9 years ago

Ok thanks! I'll stick to my current setup now and will upgrade to the newest IDEA after the next TimeMachine backup. :)

derRaab commented 9 years ago

Hi there - back again! I'm still having problems with the debug console output. While it seems the error message now is always (hope so) displayed I never see the file and line reference. I simply made a screenshot with real console output vs. IntelliJ IDEA console output: bildschirmfoto 2015-10-09 um 11 21 35 Im on the latest possible setup. IntelliJ IDEA 14.1.5 and the Haxe-Plugin installable from within IntelliJ IDEA. I would love to see this fixed just because it's a pain to always recompiling using the command line just to get the full informations.