IntelliJ IDEA inspections and quick-fixes for Event Library
This plugin provides compile-time validation, clear diagnostics, and safe quick fixes for Event Library handlers across Kotlin, Java, and Scala 3.
It helps you catch mistakes before runtime, without changing the behavior or design of the Event Library itself.
The plugin verifies that every @EventHandler method:
- Has exactly one parameter
- That parameter is assignable to
Event - Returns
Unit/void/scala.Unit
Invalid handlers are highlighted with precise error locations.
The plugin enforces all supported @ExceptionHandler shapes.
Supported signatures:
@ExceptionHandler
fun onFailure(event: MyEvent, t: Throwable)
@ExceptionHandler
fun onFailure(event: MyEvent)
@ExceptionHandler
fun onFailure(t: Throwable)What the plugin checks:
- Parameter count must be 1 or 2
- Parameters must be assignable to
Eventand/orThrowable - Two-parameter handlers must be ordered as
(Event, Throwable)
Smart quick fix:
If parameters are reversed, the plugin offers a safe swap quick fix.
Handlers must not return values.
If a handler returns a value, the plugin reports an error and offers a one-click fix:
| Language | Fix |
|---|---|
| Java | Change return type to void |
| Kotlin | Remove return type or replace with Unit |
| Scala 3 | Insert or replace return type with Unit |
Works across:
- Kotlin
- Java
- Scala 3
Inspections and quick fixes are language-aware and highlight the most relevant PSI element.
Invalid handler:
@EventHandler
fun onEvent(event: MyEvent): Int {
return 42
}Error: > Event Library handler methods must return void / Unit
Quick fix: > Change return type to void / Unit
From JetBrains Marketplace:
- Open Settings / Preferences
- Go to Plugins
- Search for Event Library Helper
- Click Install
- Restart IDE
Apache 2.0 — see the LICENSE file for details.