IntelliJ (WebStorm) devs, how do you read the compiler errors?

310 views
Skip to first unread message

Birowsky

unread,
Oct 23, 2016, 6:14:50 AM10/23/16
to Elm Discuss
The Elm plugin, together with a shortcut for elm-format is an amazing experience on an Intellij platform (i'm on WebStorm). The auto imports, the way I'm able to navigate around code with 

cmd + click
cmd + [
cmd + ]

is the best thing you can have from an IDE.

 
I'm missing on another best thing tho, the compiler error messages.

Intellij hilights the synthax errors, but it doesn't know about the types it seems. So the compiler messages are kind of required there. 

How do you efficiently check them out?

Keith Lazuka

unread,
Oct 23, 2016, 8:52:35 AM10/23/16
to Elm Discuss
Unfortunately there is not an elegant workflow currently. I just scan the compiler output for the filename and line number of the error, and then do a cmd+shift+O to jump to the file and cmd+L to jump to the line number.

An issue already exists on the plugin repo requesting improvements. If you would like to do research into how other IntelliJ plugins for statically typed functional languages handle this and summarize your findings, that would be very helpful.

-keith

Carlos Poon

unread,
Oct 23, 2016, 1:13:05 PM10/23/16
to Elm Discuss
@Birowsky - thanks for those keyboard shortcuts ! very useful.
I'm not sure about Elm 0.17.1 but future versions may use elm-make with --debug, which you can add to your build script, i guess.

I have setup a nice way of building any current .elm file in Webstorm, using File Watcher dialog, which builds on save (also have one for elm-format).  Note: I'm using elm as a node_module inside an Electron project to view the elm app, so other parts of my setup may differ to yours. 


In regards to your original question, can you share a small example script, with which people can test, also an example of the compiler messages that you expect to see, thanks.  I'm new, but willing to help, where possible with Webstorm (it is a great ide with a large userbase).  will check back tomorrow.

joseph ni

unread,
Oct 24, 2016, 6:32:18 PM10/24/16
to Elm Discuss
> cmd + click
> cmd + [
> cmd + ]

Amen. Godsend. Is the reason why I moved from sublime text once my project got to a certain size.

Re compile messages, I run elm-reactor which rebuilds on file change. I run http-server which turns my directory into a simple webserver serving static files like index.html and I run browser sync which updates my browser whenever my js output changes. With dual screens the net effect is that on save, elm-reactor kicks off and when that completes browser-sync refreshes the browser and i get a list of compile errors.

Birowsky

unread,
Oct 24, 2016, 7:11:26 PM10/24/16
to Elm Discuss
@Keith I have just the man for that. My colleague uses Kotlin for the backend, this is how hard his life is:

hover over the 5:


So yeah, i envy this guy :}


@Carlos, Keith has nailed what i hope for in his comment, and is nicely depicted in the scrshots above. Thanx for your approach btw, I would definitely be trying it out.

@Joseph catching the errors on the preview screen is not bad, but i'm mostly on my laptop, so i would rather try to come up with something similar to what Carlos has going on for him self.


So i know we are far from what Kotlin has going on for it's users, but i still have hope that we might be able to utilize one of the many features intellij is offering. For example, I noticed this thing in external tools:


So there is a way to open the console only if it had spit out an error. Say we succeed in that (which would be so awesome), there is also the Output Filters Dialog which reportedly lets you manage the output filters associated with an external tool. (The output filters are used to turn absolute file paths and line numbers in the tool output into hyperlinks.) It simply means that we could configure it link the compiler error line numbers to the actual line number in file.

Now I could try to come up with such configuration, but since I haven't done any serious IntelliJ tweaking, i would expect you guys to beat me to it.





Carlos Poon

unread,
Oct 24, 2016, 7:53:25 PM10/24/16
to Elm Discuss
@Birowsky - Hi Daniel,

This is as much as I can get, in terms of errors:


Also, this may be a red herring, but do you think that is might be of some use: ( it is a bit of a random guess ):


This is al guess work for me, so apologies if I'm off the mark.
Message has been deleted

Carlos Poon

unread,
Oct 24, 2016, 8:03:08 PM10/24/16
to Elm Discuss
@Birowsky - Hi Daniel, sorry last screenshot was a bit too wide:

So this is going to sound a little crazy, but it seems like we can put in custom config files for linters, so maybe this might be useful OR it might be me taking a wild stab in the dark, and looking like a fool.

Birowsky

unread,
Oct 25, 2016, 8:47:32 AM10/25/16
to Elm Discuss
Thanx to you guys, I'm so close to what I wanted to do.

I have summed up my findings here: http://stackoverflow.com/q/40240254/592641
Hop on if you have an idea!

Carlos, sorry, i'm not sure what are you doing inside ESLint : ) please elaborate your discoveries.
Reply all
Reply to author
Forward
0 new messages