The IntelliJ plugin for StrataCode supports the most important features which make IntelliJ so powerful for Java programmers. These features are supported on all of the major StrataCode language formats: .sc, .scj, .schtml, and sct. IntelliJ plugins are fairly easy to create for Parselets-based languages because features are moved down to the lowest-level possible - i.e. contained in base classes for specific types of nodes which can be shared or customized as needed for each language element.

Installation Instructions

First install the plugin itself into IntelliJ:

Option #1: Create a "StrataCode Only" project

Create a directory inside of your ~/IdeaProjects for the project called scTestProject and inside of that a bundles directory. Inside of "bundles" check out the git repositories for the coreFramework:

% cd ~/IdeaProjects/scTestProject/bundles/
% git clone

Each directory in the layers directory can contain a layer definition file, or it can be a layer group which is a directory containing other layer groups or layer directories.

Option #2: Add a StrataCode module to a Java project

You can create an empty Java project or use an existing one. Add a StrataCode module to the project which points to a directory that has one or more layer bundles using IntelliJ's New->"Module..." option (do not use "New->Module from existing sources). For example, if you have:


use IntelliJ's New->"Module..." and create a module /home/StrataCode. You can then exclude or include bundles in that directory as you'd like to be included in that project.

Option #3: Installation With StrataCode Source

To build and debug StrataCode itself from source, along with the apps built on it, download the 'sc' source distribution. Inside of it there are three directories - coreRuntime, fullRuntime, and system, each organized as separate IntelliJ modules you can import into your project.

From the Project Structure dialog, click on "Modules" and then "+", then "Import module". Import all three IntelliJ modules into your project: fullRuntime/fullRuntime.iml, coreRuntime/coreRuntime.iml and system/sc.iml. This will let you debug the StrataCode source, and ensures that StrataCode uses the debugger source when it runs an application.

In your project, select a Java SDK with version 1.6, 1.7 or 1.8

After importing all three modules, click "Ok" on the Project Structure dialog to save those modules before you try to create an SC module. If it does not find the 'sc' module when it creates a new StrataCode module, it will instead add a dependency on "SCLib" a pre-configured intelliJ library that points to the SC runtime libraries.

If you have already created an SC module and later want to add the "sc" source module, go to the module, remove the dependency on the "SCLib" library and add module dependencies on fullRuntime, coreRuntime and sc/system (in that order). The fullRuntime has to be ahead of coreRuntime in the dependency list so we pick up the complete versions of the runtime apis.

Make the project to compile the StrataCode source (so the StrataCode plugin can find the classes for StrataCode itself).

One final step - for StrataCode itself to find it's own source, edit the file StrataCodeModule/.stratacode/scSourcePath to point to the 'sc' directory you checked out from git (the one that contains coreRuntime, fullRuntime, and system). This is important so that any source code required to generate Javascript comes from your git repository, not the "scrt-core-src.jar" file that's part of SCLib.

Option #4: Installation Without StrataCode Source

The sc4idea plugin also will usually be bundled with the sc.jar file so you do not need the StrataCode source to use the IDE.

Just create your StrataCode module in the EmptyProject or create a StrataCode project in one step.

In this case, StrataCode will find the sc.jar in the plugin, it will create a library for this jar in the configuration and add a dependency on that library to each StrataCode module.

Manually Adding StrataCode Source Dependency

If you create a module without the StrataCode source and later change your mind, edit the module's dependencies and remove the SCLib library. Create three module's from existing sources - the coreRuntime, fullRuntime and system(sc) modules. Then add a dependency on the sc module in your project.

NOTE: it's important that fullRuntime be ahead of coreRuntime in the dependency list for IntelliJ.

Also add a dependency on the JLine library. If necessary, add the Jline library (version 2.x) from Maven or from the jar file included in the SC distribution.

Creating a StrataCode Module

Checkout the 'layers' git repository and place that directory inside of your module directory. Accept the defaults - including the source path of 'layers'. That name should match the name of the 'layers' directory you put in your module's directory.

Instructions for Debugging the sc4idea plugin:

To deploy the plugin:

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:


            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. ## Additional settings * In preferences, add "*.dbgidx;*.rdps;*.dep" to the Ignore files and folders in the Editor group's File Types dialog box. * Under Editor, General, Smart Keys, disable "Reformat block on typing '}'"