Using fsc with Intellij idea

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Using fsc with Intellij idea

Ken Egervari
Hi!

I was wondering if any of you are using the fsc compiler with IntelliJ IDEA. When I go into the settings and turn it on and try to compile something, I get the following error:

Scalac internal error: class java.lang.reflect.InvocationTargetException [sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method), sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39), sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25), java.lang.reflect.Method.invoke(Method.java:597), org.jetbrains.plugins.scala.compiler.rt.FastScalacRunner.main(FastScalacRunner.java:61)][scala.tools.nsc.CompileSocket.fatal(CompileSocket.scala:51), scala.tools.nsc.CompileSocket.startNewServer(CompileSocket.scala:90), scala.tools.nsc.CompileSocket.getPort(CompileSocket.scala:114), scala.tools.nsc.CompileSocket.getsock$1(CompileSocket.scala:153), scala.tools.nsc.CompileSocket.getOrCreateSocket(CompileSocket.scala:171), scala.tools.nsc.StandardCompileClient.main0(CompileClient.scala:86), scala.tools.nsc.CompileClient.main0(CompileClient.scala), sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method), sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39), sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25), java.lang.reflect.Method.invoke(Method.java:597), org.jetbrains.plugins.scala.compiler.rt.FastScalacRunner.main(FastScalacRunner.java:61)]

Resetting the fsc server doesn't seem to do anything, and shutting it down just doesn't do anything ;) Is that to be expected? I'm using scala 2.8-snapshot, but I had the same problem with 2.7.7 as well.

I just noticed that as my program gets to be about 4000-4500 lines long, compile times are getting fairly large. It would be nice to turn this on ;)

Thanks!

Ken
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using fsc with Intellij idea

LouisJB
Hi.

I noticed a similar thing recently but I thought maybe it was something to do with using OS-X, are you using the same?

I was using CE 9.02 and have tried a few versions of Scala, doesn't look like the problem is in Scala itself as far as I can tell.

If there's a solution then it would be great to know, as you say compile times can get quite extended when not using fsc (which appears interestingly to be the default setting!).

cheers, Louis


--
Web: www.chillipower.com
Blog: http://louisbotterill.blogspot.com/
Twitter: http://twitter.com/BinaryJunkie
LinkedIn: http://uk.linkedin.com/pub/louis-botterill/10/3b2/265

“The trouble with the world is that the stupid are cocksure and the intelligent are full of doubt.” –Bertrand Russell

Please consider your environmental responsibility before printing this e-mail

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using fsc with Intellij idea

Ken Egervari
Actually, I got it to work. Here's the instructions. Wish it said this in the section where you turn it on ;)

Okay, Idea has this thing compiler server, which needs to be running. The scala plugin expects that server to be running in the background. That's why it throws the exception. It should have just said, "Run the compilation server", but it didn't. Such is life.

To run a compiler server, you need to go to "Run/Debug COnfigurations" -> you know, the thing where you run your main applications, unit tests, etc. Click the "+" and go down to the bottom and select "Scala Compilation Server".

Basically, I just put in a name for it and ran it.

Now, go into your Scala Compiler settings for the project and check "use fsc". Now do a clean and compile.

The first compile is going to take forever, but subsequent compiles seem to be faster! Mission accomplished!

I don't know how stable this is, and I'm a little uncomfortable having the server running where my unit tests run... I may accidentally close it. I hope one day they just shelve this into the background and not even mention that it's required, as I don't think we need to care ;)

Enjoy!

Ken


On Fri, Apr 30, 2010 at 9:33 AM, Louis Botterill <chillipower.uk@gmail.com> wrote:
Hi.

I noticed a similar thing recently but I thought maybe it was something to do with using OS-X, are you using the same?

I was using CE 9.02 and have tried a few versions of Scala, doesn't look like the problem is in Scala itself as far as I can tell.

If there's a solution then it would be great to know, as you say compile times can get quite extended when not using fsc (which appears interestingly to be the default setting!).

cheers, Louis


--
Web: www.chillipower.com
Blog: http://louisbotterill.blogspot.com/
Twitter: http://twitter.com/BinaryJunkie
LinkedIn: http://uk.linkedin.com/pub/louis-botterill/10/3b2/265

“The trouble with the world is that the stupid are cocksure and the intelligent are full of doubt.” –Bertrand Russell

Please consider your environmental responsibility before printing this e-mail


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using fsc with Intellij idea

Ken Egervari
Oh yeah, one more thing.

When you add the Compilation Server, make sure to uncheck "make", otherwise you'll get into a catch-22 later on ;)

Ken


On Fri, Apr 30, 2010 at 9:44 AM, Ken Egervari <[hidden email]> wrote:
Actually, I got it to work. Here's the instructions. Wish it said this in the section where you turn it on ;)

Okay, Idea has this thing compiler server, which needs to be running. The scala plugin expects that server to be running in the background. That's why it throws the exception. It should have just said, "Run the compilation server", but it didn't. Such is life.

To run a compiler server, you need to go to "Run/Debug COnfigurations" -> you know, the thing where you run your main applications, unit tests, etc. Click the "+" and go down to the bottom and select "Scala Compilation Server".

Basically, I just put in a name for it and ran it.

Now, go into your Scala Compiler settings for the project and check "use fsc". Now do a clean and compile.

The first compile is going to take forever, but subsequent compiles seem to be faster! Mission accomplished!

I don't know how stable this is, and I'm a little uncomfortable having the server running where my unit tests run... I may accidentally close it. I hope one day they just shelve this into the background and not even mention that it's required, as I don't think we need to care ;)

Enjoy!

Ken



On Fri, Apr 30, 2010 at 9:33 AM, Louis Botterill <chillipower.uk@gmail.com> wrote:
Hi.

I noticed a similar thing recently but I thought maybe it was something to do with using OS-X, are you using the same?

I was using CE 9.02 and have tried a few versions of Scala, doesn't look like the problem is in Scala itself as far as I can tell.

If there's a solution then it would be great to know, as you say compile times can get quite extended when not using fsc (which appears interestingly to be the default setting!).

cheers, Louis


--
Web: www.chillipower.com
Blog: http://louisbotterill.blogspot.com/
Twitter: http://twitter.com/BinaryJunkie
LinkedIn: http://uk.linkedin.com/pub/louis-botterill/10/3b2/265

“The trouble with the world is that the stupid are cocksure and the intelligent are full of doubt.” –Bertrand Russell

Please consider your environmental responsibility before printing this e-mail



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using fsc with Intellij idea

Lukas Rytz
In reply to this post by LouisJB
see here: http://www.jetbrains.net/devnet/thread/287179
create an "fsc" run configuration, run it, then you should see the command you need to run in your console.



On Fri, Apr 30, 2010 at 15:33, Louis Botterill <chillipower.uk@gmail.com> wrote:
Hi.

I noticed a similar thing recently but I thought maybe it was something to do with using OS-X, are you using the same?

I was using CE 9.02 and have tried a few versions of Scala, doesn't look like the problem is in Scala itself as far as I can tell.

If there's a solution then it would be great to know, as you say compile times can get quite extended when not using fsc (which appears interestingly to be the default setting!).

cheers, Louis


--
Web: www.chillipower.com
Blog: http://louisbotterill.blogspot.com/
Twitter: http://twitter.com/BinaryJunkie
LinkedIn: http://uk.linkedin.com/pub/louis-botterill/10/3b2/265

“The trouble with the world is that the stupid are cocksure and the intelligent are full of doubt.” –Bertrand Russell

Please consider your environmental responsibility before printing this e-mail


Loading...