Home

Awesome

IntelliJ Support for Frege

This is an experiment to see how well Frege works for developing IntelliJ plugins. The plan is to develop the plugin in Frege and, once it proves feasible, add the new functionality to HaskForce, allowing HaskForce itself to be written in Frege.

Note that there seems to be an existing Frege plugin in the works. Hopefully, if this experiment proves a success, we can merge the two projects together.

Building

The simplest way to build is to run make from the command line. The Makefile is just a temporary convenience to hold us over until we get something like Gradle configured.

Here's the long way -

  1. Configure the Project SDK.
  1. Generate JFlex lexers by running tools/jflex/generate-sources

  2. Download and copy a Frege jar to the lib/ directory.

  3. Generate the Frege parser tokens by running tools/gen-tokens

  4. Highlight the following modules and choose Build > Make Selected Modules

  1. Compile Frege sources by running tools/fregec with the following environment variables -

    • FREGE_JAR - (optional) path to Frege jar (defaults to lib/frege*.jar)
    • IDEA_HOME - path to IntelliJ installation (defaults to ~/opt/idea)
    • JAVA - path to java executable
    • JAVAC - path to javac executable
  2. Compile the remaining Java sources using the IDE (Build > Make Project)

Running the Test Suite

Open FregeTestCase.java, right-click on the class name, and choose Run 'FregeTestCase'

You can do the same with any of the other test classes.