IntelliJ plugin for KStateMachine — visualize and navigate state machines straight from your source.
💾 Install · ✨ Features · 🗺️ Roadmap · 🏗️ Build · 💬 Discussions
KStateMachine Visual is the IDE plugin for the KStateMachine Kotlin library.
It statically analyzes your Kotlin source — including if / when branches that the runtime PlantUML export cannot see — and shows every state machine in the current file as both a navigable tree and a rendered UML state diagram.
Click any tree node to jump to its declaration; move the editor caret and the tree selection follows. Gutter icons mark every createStateMachine / state / transition call. The diagram updates live as you type, and the PlantUML source can be copied or exported as PNG / SVG.
Note
Early development — feedback on real-world DSL usage especially welcome.
- Recursive parsing of nested DSL — any depth, including states inside
if/whenbranches - Tree view with per-kind icons (initial, final, choice, history, data, mutable data, parallel, …)
- Bidirectional editor ↔ tree navigation
- Rendered PlantUML state diagram in-panel (Smetana layout — no Graphviz needed)
- Editable Playground tab for ad-hoc PlantUML (e.g. runtime exports)
- Editor gutter icons next to every KStateMachine DSL call
- Live, debounced refresh while typing
- Copy PlantUML source / Export diagram as PNG or SVG
From Marketplace (once published) — Settings → Plugins → Marketplace → search "KStateMachine Visual".
Manual — download the .zip from Releases and use Settings → Plugins → ⚙️ → Install plugin from disk….
Compatibility: IntelliJ Platform 2026.1+ (Community or Ultimate), bundled Kotlin + Java plugins required.
Planned
- Project-wide tab listing every machine across the project
- Rename refactoring of state names via the tree
- "Find Usages" for states
- Inspection: unreachable states and missing initial states
- Open generated PlantUML in browser (kroki.io / plantuml.com)
- In-editor preview balloon anchored to the machine
./gradlew buildPlugin # marketplace-ready ZIP in build/distributions/
./gradlew runIde # launch sandbox IDE with the plugin loaded
./gradlew verifyPlugin # check against IntelliJ guidelinesPRs and issues welcome. Reports with a minimal reproducible DSL snippet are the most actionable.
| Channel | Best for |
|---|---|
Slack #kstatemachine |
Quick questions |
| GitHub Issues | Bug reports, features |
| GitHub Discussions | Longer-form questions |
| KStateMachine library | Questions about the library |
Maintainer checklist (template setup todos)
- Create a new IntelliJ Platform Plugin Template project.
- Get familiar with the template documentation.
- Adjust the pluginGroup and pluginName, as well as the id and sources package.
- Adjust the plugin description in
README(see Tips) - Review the Legal Agreements.
- Publish a plugin manually for the first time.
- Set the
MARKETPLACE_IDin the badges above. Obtainable once the plugin is published. - Set the Plugin Signing related secrets.
- Set the Deployment Token.
- Click Watch on the IntelliJ Platform Plugin Template repo to get release notifications.
Built on the IntelliJ Platform Plugin Template.