want to contribute to scala plugin - need help getting started

Hi,

we want to contribute to the refactorings aspect of the scala plugin.
we have no prior intellij development experience

i've cloned the "intellij-scala" repo.

i've read the ScalaExtractMethodCaseClass to understand how you test the extract method refactorings and i want to debug them to understand how the refactorings are implemented and get to know the domain.
i attempted to run the tests but encountered the error below.

please advise.

also, running sbt compile or sbt tests always results in out of memory exceptions, and this is strange as the memory configuration is specified in the sbt build file, so i can only assume i'm building with the exact same configuration as your devs do.
do you have any advice on that?

thanks,
Nathan.

java.lang.AssertionError: assertion failed
 at scala.Predef$.assert(Predef.scala:151)
 at org.jetbrains.plugins.scala.base.ScalaLibraryLoader.addLibraryRoots(ScalaLibraryLoader.scala:153)
 at org.jetbrains.plugins.scala.base.ScalaLibraryLoader.addLibrary(ScalaLibraryLoader.scala:146)
 at org.jetbrains.plugins.scala.base.ScalaLibraryLoader.loadLibrary(ScalaLibraryLoader.scala:64)
 at org.jetbrains.plugins.scala.base.ScalaLightPlatformCodeInsightTestCaseAdapter.setUp(ScalaLightPlatformCodeInsightTestCaseAdapter.java:57)
 at org.jetbrains.plugins.scala.base.ScalaLightPlatformCodeInsightTestCaseAdapter.setUp(ScalaLightPlatformCodeInsightTestCaseAdapter.java:50)
 at com.intellij.testFramework.LightPlatformTestCase.startRunAndTear(LightPlatformTestCase.java:637)
 at com.intellij.testFramework.LightPlatformTestCase.access$500(LightPlatformTestCase.java:124)
 at com.intellij.testFramework.LightPlatformTestCase$9.run(LightPlatformTestCase.java:610)
 at com.intellij.testFramework.EdtTestUtil$Companion$runInEdtAndWait$1.invoke(EdtTestUtil.kt:25)
 at com.intellij.testFramework.EdtTestUtil$Companion$runInEdtAndWait$1.invoke(EdtTestUtil.kt:23)
 at com.intellij.testFramework.EdtTestUtilKt$sam$Runnable$a15fd9f8.run(EdtTestUtil.kt)
 at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:301)
 at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
 at java.awt.EventQueue.access$500(EventQueue.java:97)
 at java.awt.EventQueue$3.run(EventQueue.java:709)
 at java.awt.EventQueue$3.run(EventQueue.java:703)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
 at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
 at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:360)
 at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
 at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
 at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
 at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

***********************************************************************************************
***                        R O O T   M O D E L   N O T   D I S P O S E D                    ***
***********************************************************************************************
Created at:
java.lang.Throwable
 at com.intellij.openapi.roots.impl.ModuleRootManagerImpl.getModifiableModel(ModuleRootManagerImpl.java:135)
 at com.intellij.openapi.roots.impl.ModuleRootManagerImpl.getModifiableModel(ModuleRootManagerImpl.java:115)
 at org.jetbrains.plugins.scala.base.ScalaLibraryLoader.addLibrary(ScalaLibraryLoader.scala:138)
 at org.jetbrains.plugins.scala.base.ScalaLibraryLoader.loadLibrary(ScalaLibraryLoader.scala:64)
 at org.jetbrains.plugins.scala.base.ScalaLightPlatformCodeInsightTestCaseAdapter.setUp(ScalaLightPlatformCodeInsightTestCaseAdapter.java:57)
 at org.jetbrains.plugins.scala.base.ScalaLightPlatformCodeInsightTestCaseAdapter.setUp(ScalaLightPlatformCodeInsightTestCaseAdapter.java:50)
 at com.intellij.testFramework.LightPlatformTestCase.startRunAndTear(LightPlatformTestCase.java:637)
 at com.intellij.testFramework.LightPlatformTestCase.access$500(LightPlatformTestCase.java:124)
 at com.intellij.testFramework.LightPlatformTestCase$9.run(LightPlatformTestCase.java:610)
 at com.intellij.testFramework.EdtTestUtil$Companion$runInEdtAndWait$1.invoke(EdtTestUtil.kt:25)
 at com.intellij.testFramework.EdtTestUtil$Companion$runInEdtAndWait$1.invoke(EdtTestUtil.kt:23)
 at com.intellij.testFramework.EdtTestUtilKt$sam$Runnable$a15fd9f8.run(EdtTestUtil.kt)
 at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:301)
 at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
 at java.awt.EventQueue.access$500(EventQueue.java:97)
 at java.awt.EventQueue$3.run(EventQueue.java:709)
 at java.awt.EventQueue$3.run(EventQueue.java:703)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
 at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
 at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:360)
 at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
 at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
 at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
 at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
ERROR: < java sdk > is not disposed!

3 comments
Comment actions Permalink

Hi, Nathan,


Contributions are always welcome!

Tests were refactored recently. Please try to update your repository and run them again. If you cloned before November 8, you will need to do clean checkout, because we removed old binary files from the repository and history of commits was changed.



Incremental compilation with IDEA works faster, so usually we don't use SBT to build project on our machines. It is used for dependency management and CI. So you need to import project from SBT and checkout .idea to get run configurations. It seems that if you want to use sbt for compilation you need to increase heap size for your sbt process.


Usually we debug our plugin on another instance of IDEA. It is much more convenient then debugging tests. To do it use "IDEA" run configuration in the Debug mode.


Also, if you need to run tests from IDEA, make sure that your test run configurations have correct working directory and vm-options. You can check them in predefined "All tests" or "TypeInferenceTest" configurations.

What do you want to improve in refactorings?
0
Comment actions Permalink

thanks, i will try your advice later this week and report back to you.

we want to improve all sorts of things, from missing import statements after a refactor which break compilation, to some missing features, especially extracting method objects.
i don't have an exact list at the moment, first we want to see just how complex it is to contribute and if we see it's feasible we'll gather a complete feature set.

we'd like to have pretty much the functionality that exists on the java refactorings.

one extra feature that would be remarkable is the ability to define new refactors, that are chains of existing refactors applied sequentially, but that's just a dream right now.

thanks for the help!
Nathan

0
Comment actions Permalink

In reality implementing refactoring is not complex task, it just requires attention to details (in Scala too much details), so you should ready that we will find some uncovered cases during review then users will find even more uncovered cases during refactoring usage.

But in any case we will appreciate for any kind of contributions. It's great news to know that somebody want's to do something in Scala plugin sources.

Best regards,
Alexander Podkhalyuzin.

0

Please sign in to leave a comment.