HandleHints
An IntelliJ plugin providing inspections and visual enhancements for the Java MethodHandle, VarHandle, and Foreign Function & Memory APIs
Install / Use
/learn @SirYwell/HandleHintsREADME
HandleHints
<!-- ## Template ToDo list - [x] Create a new [IntelliJ Platform Plugin Template][template] project. - [ ] Get familiar with the [template documentation][template]. - [ ] Verify the [pluginGroup](./gradle.properties), [plugin ID](./src/main/resources/META-INF/plugin.xml) and [sources package](./src/main/kotlin). - [ ] Review the [Legal Agreements](https://plugins.jetbrains.com/docs/marketplace/legal-agreements.html). - [ ] [Publish a plugin manually](https://plugins.jetbrains.com/docs/intellij/publishing-plugin.html?from=IJPluginTemplate) for the first time. - [ ] Set the Plugin ID in the above README badges. - [ ] Set the [Deployment Token](https://plugins.jetbrains.com/docs/marketplace/plugin-upload.html). - [ ] Click the <kbd>Watch</kbd> button on the top of the [IntelliJ Platform Plugin Template][template] to be notified about releases containing new features and fixes. --> <!-- Plugin description -->This IntelliJ plugin helps when working with MethodHandles, VarHandles,
and the Foreign Function & Memory API by contributing type hints,
inspections, and enhanced auto completions.
Features
- Dataflow-sensitive type analysis
- Support for methods from the
MethodHandlesclass - Support for methods from the
MethodHandles.Lookupclass - Support for methods from the
MethodTypeclass - Support for methods from the
MethodHandleclass - Support for methods from
MemoryLayoutclasses (type tracking for memory layouts) - Support for methods from the
PathElementclass - Precise type tracking for parameters and return types separately
- Inspections for supported creation/transformation/combination methods
- Inspections for
invokeandinvokeExactarguments and return type checks - Inspections for invalid layout paths
- Inspections for misaligned struct layouts, with quick fixes for padding/alignment adjustment
- Inlay type hints
Installation
-
Using IDE built-in plugin system:
<kbd>Settings/Preferences</kbd> > <kbd>Plugins</kbd> > <kbd>Marketplace</kbd> > <kbd>Search for "HandleHints"</kbd> > <kbd>Install Plugin</kbd>
-
Manually:
Download the latest release and install it manually using <kbd>Settings/Preferences</kbd> > <kbd>Plugins</kbd> > <kbd>⚙️</kbd> > <kbd>Install plugin from disk...</kbd>
Plugin based on the IntelliJ Platform Plugin Template.
