Skip to content
Patrick Scheibe edited this page Nov 28, 2016 · 4 revisions

In this section, I will publish some ideas that I need to discuss as the best course of action is often not clear until you implemented a feature. In such cases, I often like to share my ideas and write down how I think a feature should work and then I'll discuss it.

Additionally, this section will give you a head-start if you want to compile the plugin yourself (which is easier than you think).

Preparing your environment to compile the plugin yourself

Note: This section explains how to set up your environment for IDEA 2016.3. The screencasts, on the other hand, are a bit outdated, so they probably contain older information.

If you are interested in compiling the plugin for yourself and probably implement features or fix bugs, then the first thing you need is to set up the development environment. I created two screencasts for this purpose where the first explains how to download and install Java and IDEA and the second shows how to set up IDEA properly.

  • Screencast (Part 1)
  • Screencast (Part 2)

Here is a detailed step-by-step explanation:

  • Download and install the latest Java SE 8 Development Kit
  • Download and install the Community Edition of IntelliJ IDEA and download the sources of IDEA its GitHub repository. When you checked it out from the repository, you first need to find your IntelliJ IDEA application version. This is shown in the About dialog under the Help menu. Now you should checkout a version of the IDEA sources which is close to your IDEA version. For this, you can use e.g. git checkout idea/163.7743.44 on the commandline. To find all possible tags, you can look at the list (and filter it) with git tag | grep idea/163.
  • On Linux you might have to set IDEA_JDK to the extracted JDK in the file bin/idea.sh in the folder of the Community Edition.
  • When IDEA is started, go to Settings → Plugins and install the Plugin DevKit and restart IDEA
  • Check out the sources of the Mathematica IntelliJ IDEA Plugin by using (in menu VCS) Check out from Version Control. As the source, you give https://github.com/halirutan/Mathematica-IntelliJ-Plugin.git (If you use GitHub regularly you should fork your own repo).
  • When the project is open, you need to define the SDK which is used for compiling the plugin. Go to Project StructureSDKs and add (+) a new JDK which points to the downloaded Java. If you have downloaded the JDK API doc as well as zip-file, then click on the Documentation Paths tab and attach it.
  • In SDKs click add (+) again and select IntelliJ Platform Plugin SDK. As location you choose the install-path of the IDEA application you are running! Go then to the tab Sourcepath, click add (+) an find the location of the IDEA sources you have downloaded.
  • Go to Project on the left side and assign this IntelliJ SDK as Project SDK. Close theProject Structure settings and build the project.
  • To Run/Debug the plugin you need to create a Run Configuration. Go to Run → Edit Configurations and add (+) a new Plugin configuration. Name it and ensure that the Use classpath of module points to Mathematica-IntelliJ-Plugin.
  • Now you can Debug ( Shift+F9) or Run ( Shift+F10) the plugin.
  • If you do this the first time, then a new Sandbox IDEA is started. The sandbox is basically a second instance of IDEA where the plugin you are currently working on is enabled and can be tested. When your sandbox IDEA is started, you should be able to create a New Project and select Mathematica. In the context menu for New File there should now be a button for Mathematica files.
  • If something goes wrong, please check in the sandbox IDEA whether the Mathematica Language Plugin is selected under SettingsPlugins.