Skip to content

Tornadify: gutter icon, toolbar button and new name for the AI transformation - #84

Merged
stratika merged 7 commits into
mainfrom
feature/tornadify-entry-point
Nov 27, 2026
Merged

stratika merged 7 commits into
mainfrom
feature/tornadify-entry-point

Conversation

@stratika

@stratika stratika commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The AI-assisted transformation is renamed Tornadify, and it is easier to find and start.

1. Brain gutter icon on transformable methods

A brain icon in the gutter of a method starts the transformation of that method. The icon is shown only when:

  • the transformation is enabled in settings;
  • the module has the TornadoVM API;
  • the method can be transformed (a body, in a class, not a kernel yet) and has a loop, since a method without one has no work to spread over GPU threads.

The checks resolve types and read the index, so they run in the line-marker daemon's background pass, not on the EDT. Users can hide the icon under Settings | Editor | General | Gutter Icons. Turning the transformation on or off in its settings restarts highlighting, so the icons appear or disappear at once.

2. The action is called "Tornadify"

  • Editor menu: Tornadify..., with Transform into TornadoVM Kernel (AI) as its description; without tornado-api it reads Tornadify (needs tornado-api).
  • Alt+Enter, and the gutter icon's tooltip: Tornadify: Transform into TornadoVM Kernel (AI).

The preview dialog and progress texts are unchanged.

3. Tornadify button in the TornadoVM tool window

The tool window toolbar has a Tornadify button with the brain icon, right after Run and Debug (dynamic inspection). It transforms the method at the caret of the selected editor. The tool window has the focus when the button is clicked, so the editor comes from the selected TextEditor when the data context has none.

The tooltip says what the button will do, or why it can't:

  • on a method that can be transformed, the button reads Tornadify <method>, so it is clear it acts on that method alone;
  • otherwise it is disabled, and the tooltip says to click inside a method first (and that the gutter icon works too);
  • while the transformation is off, the tooltip says so, with an Open settings link;
  • without tornado-api, the tooltip gives the Maven dependency to add, for JDK 21 and for JDK 22+.

Testing

  • ./gradlew test: all 329 tests pass. New tests cover the gutter marker (shown only on methods with a loop, hidden while the transformation is off or without the TornadoVM API, icon variants) and the toolbar button (its place after Run and Debug, enabled with the method's name for the selected editor's caret, and each disabled reason).
  • The gutter icon was tried in a sandbox IDE: clicking it on a method starts the transformation.
  • The toolbar button is not yet tried by hand in the IDE.

This PR is independent of #83 (rewriting the calls to a transformed method); the two merge without conflicts.

A gutter icon on each method that AI-assisted transformation can turn into
a TornadoVM kernel starts it on click. It is shown only while the
transformation is enabled, in modules with the TornadoVM API, and on
convertible methods with a loop; the checks run in the slow line-marker
pass, in the background. It can be hidden under Gutter Icons. The editor
menu item gets the same icon, and the gutter is refreshed when the
transformation is switched on or off in Settings.
The editor menu item is "Tornadify..." with "Transform into TornadoVM
Kernel (AI)" as its description, and Alt+Enter and the gutter icon say
"Tornadify: Transform into TornadoVM Kernel (AI)". The preview dialog and
progress texts are unchanged.
A Tornadify button with the brain icon, after the dynamic inspection
buttons, transforms the method at the caret of the selected editor. The
tool window has the focus when it is clicked, so the editor comes from
the selected TextEditor when the data context has none. It is disabled,
with the reason in its tooltip, while the transformation is off, there is
no editor, the caret is not in a convertible method, or the module lacks
the TornadoVM API.
…to use it

While the caret is in a method it can transform, the button's tooltip is
"Tornadify <method>", so it is clear that it acts on that method alone.
While it is disabled, the tooltip says how to use it: click inside the
method, then the button, or right-click the method or click the brain icon
in the gutter.
…rnado-api

A toolbar button shows the description under the tooltip's title only for
actions that implement TooltipDescriptionProvider, so the how-to and the
method's description were not shown. With the transformation on and no
TornadoVM API in the module, the tooltip says to add the tornado-api
dependency to the pom.xml, wherever the caret is.
The tooltips of the Tornadify button in the TornadoVM tool window are
shorter and friendlier. While AI-assisted transformation is off, the
tooltip has an Open settings link to its settings page.
…ice, own loops only

- The Tornadify button commits the editor's document before it looks for
  the method at the caret, so it never transforms the wrong method after
  typing. While the document is not committed, its tooltip names no method
  and no PSI is read.
- Without tornado-api, the button gives the same advice as the editor
  menu, for the JDK of the module (ConversionLauncher.missingApiMessage now
  takes any element of the module, such as the file), without assuming
  Maven.
- The gutter icon counts only loops of the method itself, not those in
  lambdas or in anonymous or local classes, and is not shown on main.
@stratika
stratika merged commit ec0b87d into main Nov 27, 2026
4 checks passed
@stratika
stratika deleted the feature/tornadify-entry-point branch November 27, 2026 10:02
@stratika stratika mentioned this pull request Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant