IntelliJ plugin for the Jakt programming language
Jakt IntelliJ Plugin
A fully-featured plugin for the Jakt programming language.
Features
- Highlighting
- Fully-configurable via a Color Scheme page
- Material-like defaults for Darcula
- Semantic-based. Examples:
- Static method calls vs instance method calls
- Mutable vs immutable local variables
- Validation
- Flexible BNF-based language description detects parsing errors early
- Displays type-checking and advanced parsing errors from the Jakt compiler
- Completions
- Intentions
- Basic intention support (currently only has one very simple intention)
- Resolution
- Two-way resolution (ref -> decl, decl -> all refs)
- Sees through import statements
- Complex resolution support. Example:
- Function argument labels resolve to the respective parameter
- Function parameters resolve to their usages in the function body (and not the aformentioned argument lables)
- Shorthand enum names in match cases and
is
expressions
- Type declaration from identifiers when ctrl-clicking
- Rename refactoring
- Works for any identifier that supports resolution (declaration, local variable, imports, etc)
Contributing
The plugin uses JNA to communicate directly with the Jakt compiler. This requires custom Rust bindings. To compile the bindings:
- Enter the
jakt-jna-binding
directory - Execute
cargo update
- This has to be done every time the upstream Jakt repository changes to update the bindings
- Run
build_bindings.sh
- This compiles the bindings and the Jakt compiler into a
libjakt.so
, which is copied tosrc/main/resources/
and used by the JNA interface.
- This compiles the bindings and the Jakt compiler into a
After compiling the bindings, it is as simple as running the Run IDE for UI Tests
launch configuration.
TODO (in order of importance)
- Github Actions: Automatically run tests for commits and PRs
- Grammar
- Improve parsing errors
- Implement error recovery (currently highlighting breaks for invalid files)
- Nav bar
- Inlay hints? Perhaps for local variable whose type isn’t obvious (i.e. not
let a = Foo()
) - Move left/right handler
- More intentions
- Function arrow body to block body
- Match arrow body to block body
- etc…
- Complex refactoring (move/delete)
- More complex tests (completion/intentions)
- Most of the features mentioned in the IntelliJ Custom Language Support tutorial
- Anything required for publishing the plugin to the JetBrains Marketplace (icons, metadata, CLion compat, etc)