Building & Running¶
Build Commands¶
Command |
Description |
|---|---|
|
Build the plugin (includes lexer generation, compilation, packaging) |
|
Clean build from scratch |
|
Launch a development IDE instance with the plugin loaded |
|
Run all tests |
|
Run ktlint code style checks |
|
Auto-fix ktlint issues |
|
Generate HTML code coverage report |
|
Verify plugin descriptor and structure |
|
Verify project configuration |
|
Verify binary compatibility |
Note
./gradlew runIde automatically removes stale rescript-intellij-plugin-<old>.jar files from the sandbox during prepareSandbox. This prevents PluginException failures caused by the IDE loading an outdated plugin jar after a pluginVersion bump. Use ./gradlew clean runIde only when a full sandbox reset is required.
JFlex Lexer Generation¶
The JFlex lexer (RescriptFlexLexer.java) is auto-generated from Rescript.flex during the build:
Source:
src/main/java/com/rescript/plugin/lang/Rescript.flexGenerated:
src/main/java/com/rescript/plugin/lang/RescriptFlexLexer.javaGradle task:
generateRescriptLexer
The generateRescriptLexer task is a dependency of compileJava and compileKotlin, so you never need to run it manually. The generated file is listed in .gitignore.
Warning
Never edit RescriptFlexLexer.java directly. Always modify Rescript.flex and let the build regenerate the Java file.
Plugin Packaging¶
After ./gradlew buildPlugin, the packaged plugin is at:
build/distributions/rescript-intellij-plugin-<version>.zip
This .zip can be installed in any compatible JetBrains IDE via Settings → Plugins → Install Plugin from Disk.
Gradle Configuration¶
Key configuration files:
File |
Purpose |
|---|---|
|
Build script (plugins, dependencies, tasks) |
|
Version numbers, platform settings |
|
Project name and repository configuration |
Platform Version¶
The target IntelliJ Platform version is configured in gradle.properties:
pluginSinceBuild = 253.0 # IntelliJ 2025.3+
Note: pluginUntilBuild is intentionally not set, allowing the plugin to be compatible with all future platform versions.
CI Pipeline¶
The GitHub Actions CI pipeline (.github/workflows/ci.yml) runs on every push and PR:
actionlint — Validate GitHub Actions workflow files
ktlint — Code style checks
Build — Compile and package
Test — Run tests with coverage (Kover)
Verify — Plugin structure and binary compatibility (push only)