Contributing¶
Thank you for your interest in contributing to the BerryCrush IntelliJ plugin!
Getting Started¶
Prerequisites¶
- JDK 21 or higher
- IntelliJ IDEA 2025.3 or later (Community or Ultimate)
- Gradle 8.x (wrapper included)
- Git
Clone the Repository¶
Open in IDE¶
- Open IntelliJ IDEA
- File → Open
- Select the
intellijdirectory - Import as Gradle project
Build¶
Run Plugin in Sandbox¶
This launches a new IntelliJ instance with the plugin installed.
Development Workflow¶
Branch Naming¶
feature/- New featuresbugfix/- Bug fixesdocs/- Documentation updatesrefactor/- Code refactoring
Example:
Making Changes¶
- Create a feature branch
- Make changes
- Write/update tests
- Run checks locally
- Commit with clear messages
- Push and create PR
Commit Messages¶
Follow conventional commits:
feat: add rename support for fragments
fix: handle null pointer in fragment resolution
docs: update navigation documentation
refactor: extract common PSI utilities
test: add tests for safe delete processor
Code Style¶
Kotlin¶
Follow Kotlin Coding Conventions.
Key points: - Use 4 spaces for indentation - Max line length: 120 characters - Use meaningful names - Add KDoc for public APIs
Run Code Style Checks¶
Auto-format¶
Configure IntelliJ to format on save: - Settings → Tools → Actions on Save - Enable Reformat code
Testing¶
Run Tests¶
Test Types¶
| Type | Location | Purpose |
|---|---|---|
| Unit | src/test/kotlin/unit/ |
Test individual components |
| Integration | src/test/kotlin/integration/ |
Test component interaction |
| UI | src/test/kotlin/ui/ |
Test UI components |
Writing Tests¶
Use BasePlatformTestCase:
class MyFeatureTest : BasePlatformTestCase() {
override fun getTestDataPath(): String = "src/test/testData/myFeature"
fun testBasicFunctionality() {
myFixture.configureByText("test.scenario", """
Feature: Test
Scenario: Test scenario
Given I call ^test
""".trimIndent())
// Test assertions
val file = myFixture.file as BerryCrushFile
assertNotNull(file.feature)
}
}
Test Data Files¶
Place test data in src/test/testData/:
src/test/testData/
├── completion/
│ ├── operationCompletion.scenario
│ └── fragmentCompletion.scenario
├── navigation/
│ ├── gotoFragment.scenario
│ └── findUsages.scenario
└── refactoring/
├── rename/
└── safeDelete/
Building¶
Full Build¶
Build Plugin Distribution¶
Output: build/distributions/berrycrush-intellij-*.zip
Run All Checks¶
Includes: - Compilation - Tests - Detekt (code style) - Spotbugs (bug detection)
Project Structure¶
intellij/
├── build.gradle.kts # Build configuration
├── settings.gradle.kts # Settings
├── gradle.properties # Gradle properties
├── src/
│ ├── main/
│ │ ├── kotlin/ # Source code
│ │ └── resources/
│ │ ├── META-INF/
│ │ │ └── plugin.xml # Plugin descriptor
│ │ └── messages/
│ │ └── Bundle.properties
│ └── test/
│ ├── kotlin/ # Test code
│ └── testData/ # Test data files
├── config/
│ ├── detekt/ # Detekt configuration
│ └── spotbugs/ # Spotbugs configuration
└── doc/ # Documentation
Plugin Configuration¶
plugin.xml¶
Main plugin descriptor at src/main/resources/META-INF/plugin.xml:
<idea-plugin>
<id>com.berrycrush.intellij</id>
<name>BerryCrush</name>
<vendor>BerryCrush</vendor>
<depends>com.intellij.modules.platform</depends>
<extensions defaultExtensionNs="com.intellij">
<!-- Extension declarations -->
</extensions>
<actions>
<!-- Action declarations -->
</actions>
</idea-plugin>
Adding New Features¶
- Create implementation classes
- Register in
plugin.xml - Add tests
- Update documentation
Pull Request Process¶
Before Submitting¶
- Rebase on latest
main - Run
./gradlew check - All tests must pass
- Code must be formatted
- Update documentation if needed
PR Description¶
Include: - Summary of changes - Related issues - Testing done - Screenshots (for UI changes)
Review Process¶
- Submit PR
- Address review comments
- Squash commits if requested
- Merge when approved
Release Process¶
Version Numbering¶
Follow semantic versioning: MAJOR.MINOR.PATCH
- MAJOR: Breaking changes
- MINOR: New features
- PATCH: Bug fixes
Release Checklist¶
- Update version in
gradle.properties - Update CHANGELOG
- Create release branch
- Build and test
- Create GitHub release
- Upload to JetBrains Marketplace
Getting Help¶
Resources¶
Contact¶
- GitHub Issues for bugs/features
- Discussions for questions
License¶
By contributing, you agree that your contributions will be licensed under the project's license.