Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler error / warning shows just default message #180

Closed
derRaab opened this issue Mar 23, 2015 · 41 comments
Closed

Compiler error / warning shows just default message #180

derRaab opened this issue Mar 23, 2015 · 41 comments

Comments

@derRaab
Copy link

derRaab commented Mar 23, 2015

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
Copy link
Contributor

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
Copy link
Contributor

@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
Copy link
Author

derRaab commented Mar 24, 2015

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
Copy link
Author

derRaab commented Mar 24, 2015

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

@derRaab
Copy link
Author

derRaab commented Mar 24, 2015

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
Copy link
Author

derRaab commented Mar 24, 2015

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

@as3boyan
Copy link
Contributor

@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
Copy link
Contributor

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

@EBatTiVo
Copy link
Contributor

@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
Copy link
Contributor

@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
Copy link
Author

derRaab commented Mar 26, 2015

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
Copy link
Contributor

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
Copy link
Author

derRaab commented Apr 14, 2015

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
Copy link
Contributor

@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
Copy link
Author

derRaab commented Apr 14, 2015

@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
Copy link
Contributor

@derRaab Your issue is probably fixed with my latest commit d498444

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
Copy link
Author

derRaab commented Apr 14, 2015

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
Copy link
Contributor

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
Copy link
Author

derRaab commented Apr 14, 2015

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
Copy link
Contributor

#160 is another report of this bug.
#129 is related.

@EBatTiVo
Copy link
Contributor

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

@derRaab
Copy link
Author

derRaab commented Apr 29, 2015

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

@derRaab
Copy link
Author

derRaab commented May 18, 2015

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
Copy link
Contributor

You'll see one on 5/27.

@derRaab
Copy link
Author

derRaab commented Jun 10, 2015

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
Copy link
Contributor

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 <Intellij_installation>/system/log/idea.log and <intellij_installation>/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
Copy link
Contributor

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

@derRaab
Copy link
Author

derRaab commented Jun 10, 2015

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
Copy link
Contributor

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
Copy link

ophibox commented Jul 6, 2015

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 added a commit that referenced this issue Jul 7, 2015
Add another pattern to recognize errors.
Remove the warning used to open the compiler output window.
Stop an NPE when we can't create a compiler output message.
@EBatTiVo
Copy link
Contributor

EBatTiVo commented Jul 7, 2015

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 EBatTiVo reopened this Jul 7, 2015
EBatTiVo added a commit that referenced this issue Jul 7, 2015
Revisit issue #180 -- compiler errors not showing in output.
@EBatTiVo
Copy link
Contributor

EBatTiVo commented Jul 7, 2015

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

@EBatTiVo EBatTiVo closed this as completed Jul 7, 2015
@ophibox
Copy link

ophibox commented Jul 7, 2015

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
Copy link
Contributor

EBatTiVo commented Jul 8, 2015

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
Copy link

ophibox commented Jul 8, 2015

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
Copy link
Author

derRaab commented Jul 8, 2015

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
Copy link
Author

derRaab commented Jul 16, 2015

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
Copy link
Contributor

I'm using 0.9.5 on 14.1.4.

@EBatTiVo
Copy link
Contributor

@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
Copy link
Author

derRaab commented Jul 17, 2015

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

@derRaab
Copy link
Author

derRaab commented Oct 9, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants