intellij-haskell/CONTRIBUTING.md
2019-06-01 18:46:09 -07:00

2.0 KiB

How to build project

  1. Clone this project;
  2. Go to root of project and start sbt;
  3. Run task updateIdea from the sbt console;
  4. Run task compile from the sbt console;
  5. Install/enable the following plugins in IntelliJ: Plugin Devkit, Grammar-Kit and PsiViewer;
  6. Import this project as an sbt project in IntelliJ;
  7. Be sure JVM SDK inside Languages & Frameworks>Scala Compiler Server is set to 1.8, since the Scala compiler version (2.12.3) which this plugin is currently using is not compatible with Java 7 or lower, Java 9 is not yet supported;
  8. Select Build>Build Project;

How to prepare plugin for deployment

  1. Right click on top of intellij-haskell.iml inside intellij-haskell folder;
  2. Select Import module;
  3. Be sure unmanaged-jars dependency is set to provided inside Project structure>Project settings>Modules>Dependencies (btw, setting provided inside sbt file gives error);
  4. Right click on top of intellij-haskell plugin module and select Prepare Plugin Module 'intellij-haskell' for deployment;

How to run/debug plugin inside IntelliJ

  1. Set Plugin SDK settings right inside Project structure>Platform settings>SDKs. For example to, set SDK home path to idea/142.5239.7 inside project root folder;
  2. Set Module-SDK right for intellij-haskell plugin module inside Project structure>Project structure>Project settings>Modules;
  3. To run plugin inside IntelliJ, first run configuration has to be created. Navigate to Run>Edit configurations and create plugin configuration for intellij-haskell;

Development remarks

  1. After making changes to _HaskellLexer.flex, run Run Flex Generator. This will generate _HaskellLexer.java;
  2. After making changes to haskell.bnf, run Generate Parser Code. This will generate parser Java files in gen directory;
  3. Never touch the generated code. They should be committed as-is.
  4. Add sources.zip inside idea>[idea build #] to Project structure>Project settings>Modules>Dependencies>unmanaged-jars to see IntelliJ sources;