Contributing Guide¶
Thank you for your interest in contributing to the ReScript IntelliJ Plugin!
Prerequisites¶
Requirement |
Version |
Notes |
|---|---|---|
JDK |
21+ |
Required by IntelliJ Platform 2025.3+ |
Node.js |
18+ |
Required for LSP server and |
IntelliJ IDEA |
2025.3+ |
Community or Ultimate edition |
Gradle |
9.4+ |
Wrapper included — no manual install needed |
Getting Started¶
Fork the repository on GitHub
Clone your fork:
git clone https://github.com/<your-username>/rescript-intellij-plugin.git
Set up your development environment
Create a feature branch:
git checkout -b feature/my-feature
Development Workflow¶
Branch Naming¶
Prefix |
Use |
|---|---|
|
New features |
|
Bug fixes |
|
Code refactoring |
|
Documentation |
|
Test additions |
|
Configuration, dependencies |
Commit Messages¶
Use emoji prefixes for commit messages:
Emoji |
Use |
|---|---|
✨ |
New feature |
🐛 |
Bug fix |
♻️ |
Refactoring |
📝 |
Documentation |
🎨 |
UI/style improvement |
⚡ |
Performance improvement |
🔧 |
Configuration change |
✅ |
Test addition/fix |
🗑️ |
Code deletion |
Format: <emoji> <verb> <concise description>
Examples:
✨ Add JSX token support to lexer🐛 Fix nested comment parsing📝 Update architecture documentation
Code Conventions¶
Language¶
All source code is written in Kotlin
Lexer definition is in JFlex (generates Java)
Package Structure¶
All classes go under com.rescript.plugin.*, organized by feature:
com.rescript.plugin.highlight/ # Syntax highlighting
com.rescript.plugin.lsp/ # LSP integration
com.rescript.plugin.navigation/ # Navigation features
...
Code Style¶
ktlint is enforced via CI (
./gradlew ktlintCheck)Auto-fix:
./gradlew ktlintFormatIntelliJ’s built-in Kotlin formatter generally matches ktlint
KDoc Comments¶
All classes and significant methods must have KDoc comments in English:
/**
* Provides code folding for ReScript files.
*
* Recognizes multi-line declarations, block comments,
* and custom //#region markers.
*
* @see RescriptCustomFoldingProvider for region-based folding
*/
class RescriptFoldingBuilder : CustomFoldingBuilder() {
/**
* Builds fold regions for the given PSI element.
*
* @param root the root PSI element to scan
* @param descriptors list to add fold descriptors to
* @param document the document being folded
*/
override fun buildLanguageFoldRegions(...) { ... }
}
Testing¶
Every code change must have corresponding tests
Test file naming:
<ClassName>Test.ktTests mirror the source package structure
See the Testing Guide for details
AI-Assisted Development¶
This project uses structured workflows for AI-assisted development with Claude Code. The following configuration files define the development process:
.claude/rules/steering-workflow.md— Steering workflow requiringrequirements.md,design.md, andtasklist.mdbefore implementation.claude/rules/definition-of-done.md— 5-phase Definition of Done (Planning → Implementation → Pre-commit → Pre-merge → Post-merge).claude/rules/git-conventions.md— Git worktree isolation for feature branches, emoji commit prefixes, and branch naming conventions
Steering documents are stored in .steering/[YYYYMMDD]-[NNN]-[title]/ directories and committed alongside code changes.
Quality Checks¶
The project enforces several automated quality gates via CI and custom Gradle tasks:
Check |
Command |
Description |
|---|---|---|
Code style |
|
Kotlin linting (auto-fix: |
KDoc comments |
|
All classes must have KDoc comments |
Test files |
|
Production classes must have corresponding tests |
EP registration |
|
plugin.xml must reference existing classes |
Coverage |
|
Report at |
Coverage threshold |
|
Minimum 85% line coverage enforced |
Submitting Changes¶
Run the full CI check locally:
./gradlew ktlintCheck buildPlugin test koverHtmlReport
Verify the build and all tests pass
Check code coverage for new code:
open build/reports/kover/html/index.htmlPush your branch and create a Pull Request
PR Guidelines¶
Keep PRs focused on a single feature or fix
Write a clear description of what changed and why
Include screenshots for UI changes
Reference related issues if applicable
Questions?¶
Open an issue on GitHub
Check existing issues and discussions