Fix: Inline AI Tool Does Nothing in Java / JetBrains Apps

If you live in IntelliJ IDEA, PyCharm, WebStorm, DataGrip, or Android Studio, you’ve probably hit it: every inline AI tool that works elsewhere just sits there silently in your IDE. Highlight code or a comment, hit the rewrite key, and nothing moves. The editor seems immune.

It’s not your config, and it’s not a JetBrains bug. It’s a known, specific incompatibility between how Java desktop apps render text and how inline AI tools try to read it.

The root cause: Java apps are invisible to the OS accessibility API

Inline AI editors read your selection and write the replacement through the operating system’s accessibility layer — the macOS Accessibility API (AXUIElement) or Windows UI Automation. Native apps publish their text fields to this layer automatically.

JetBrains IDEs are built on the JVM using Swing/AWT, Java’s own UI toolkit. Swing draws its components itself rather than using the OS’s native controls, so by default the OS accessibility layer sees the IDE window as a mostly opaque rectangle. The editor pane — the part you actually care about — isn’t a standard OS text field the API can read or write.

To bridge this, Java has its own accessibility framework (the Java Access Bridge on Windows; the macOS Java accessibility integration on Mac). But:

So when your AI tool asks the OS for “the selected text in the focused control,” the IDE returns nothing usable. The tool reads empty, has nothing to send, and gives up — silently. Same end result as the Electron failure: the hotkey looks broken.

Things to try first

1. Enable Java accessibility support

This may let some tools read the text — but in practice the editor pane often still doesn’t expose a writable selection, so reads might work while writes don’t.

2. Check the IDE’s own screen-reader mode

JetBrains IDEs have a Screen Reader support mode (Settings/Preferences → Appearance & Behavior → System Settings → Accessibility, or in the welcome screen). Turning it on changes how the editor exposes content to assistive tech and can occasionally help — but it also changes editor behavior, so most developers won’t want it on full-time.

3. Confirm permissions and privilege level

As with any inline tool: grant Accessibility permission (macOS) and make sure your AI tool runs at the same privilege level as the IDE (Windows can’t automate an elevated app from a non-elevated process).

Why these workarounds usually aren’t enough

Even with the Access Bridge on, the JetBrains editor component frequently won’t accept a programmatic write back into the selection. You can sometimes read; you usually can’t reliably replace. That’s the gap that leaves you stuck — and it’s why “just enable accessibility” is not a real answer for Java apps.

The fix that actually works: a clipboard fallback

The path that reliably works in Java apps is the one that doesn’t depend on the accessibility write at all:

  1. Copy the selection (Ctrl/Cmd+C is a normal keystroke every app honors, including Java apps).
  2. Send the copied text to the AI.
  3. Paste the result back with a simulated paste keystroke (Ctrl/Cmd+V — also universally honored).

JetBrains editors accept copy and paste perfectly, because those are ordinary editor commands. A tool that falls back to this clipboard path the moment the native write fails keeps working in IntelliJ and friends — without you flipping a single accessibility switch.

The catch: a naïve clipboard fallback can clobber whatever you had on your clipboard, and if the app lags during the paste it can corrupt the operation. A well-built tool snapshots and restores your clipboard around the operation so you never lose what was there. (More on that failure mode in Clipboard hijack bugs in AI text tools.)

How EditSnappy fixes this at the root

EditSnappy doesn’t bet everything on the accessibility API succeeding. It tries the fast native write first, and the instant it can’t confirm the replace, it falls back to a clean clipboard inject that JetBrains and other Java apps accept — restoring your previous clipboard contents afterward so nothing is lost. The result: rewrites, documentation, and tone fixes work inside IntelliJ, PyCharm, WebStorm and the rest of the JetBrains lineup, where pure-accessibility tools simply do nothing.

See how EditSnappy works and try it free in your IDE.


Part of the Why Inline AI Editors Fail troubleshooting hub · EditSnappy home.