IntelliJ plugin topics:

Debug the sc4idea plugin:

TODO: these instructions probably need some updating but they are based on the normal instructions for debugging an IntelliJ plugin.

  • Clone https://github.com/stratacode/sc4idea
  • From IntelliJ's "Project Structure" dialog, go to modules and import the sc4idea.iml file
  • Create a new SDK of type "Plugin" (in "Project Structure", select "SDKs" and "+")
  • (optional - to debug the IntelliJ source too) Get a copy of the community source for IntelliiJ - check the 'About' for the precise built tag of the version of IntelliJ you are running so the source and binaries match up. Add the source of the intelliJ community editor to the source path of that plugin

  • Make sc4idea depend on the "sc" module for the StrataCode source (or create a Library in IntelliJ called sclib that points to the sc.jar file)

  • Create a run configuration of type "plugin" for sc4idea

To deploy the plugin:

  • in Project View, right click on the sc4idea module and select the Prepare plugin module for deployment menu. The results are in the sc4idea/sc4idea.jar or sc4idea.zip depending on whether or not the sc.jar is a dependency. Note however that the sc4idea.zip is built from scc not intelliJ. See the system/bin/makeSC4Idea script for details

NOTE:

  • If you build from source, note that IntelliJ SDK or someone copies the class files from the intelliJ build directory into some sandbox directory in your home directory (on mac it is:

    ./Library/Caches/IntelliJIdea13/plugins-sandbox/plugins/sc4idea/classes/
    
    • Also note that when you use sclib and enable a Compile dependency, it will put the library into sandboxDir/.../sc4idea/lib
  • There's a problem because coreRuntime and fullRuntime have overlapping files. During the copy this classes folder might end up with the wrong run. Whe installed a simple shell script to workaround this problem - the run configuration for the sc4idea

        #!/bin/sh
        PLUGINDIR=/Users/jvroom/Library/Caches/IntelliJIdea13/plugins-sandbox/plugins/sc4idea/classes
        BUILDDIR=/jjv/vroomsys/out/production/fullRuntime
        cp $BUILDDIR/sc/type/PTypeUtil*.class $PLUGINDIR/sc/type/
        cp $BUILDDIR/sc/type/Type*.class $PLUGINDIR/sc/type/
    
  • There are cases where you need to clean out this directory, like if you rename the module - the one for the old module might still get loaded into the classpath and precede the one you are building.