Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 47 additions & 25 deletions docs/PLUGIN_API_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,15 @@ correct `plugin.min_ide_version`.
## How to use this

Set `plugin.min_ide_version` to the **highest** version below among the
capabilities your plugin actually uses. Only `min` is enforced at install today;
`max` is parsed but advisory.
capabilities your plugin actually uses.

Neither `min` nor `max` is enforced at install today. `PluginLoader` reads both,
`PluginSecurityManager` checks only that `min` is not blank, and the Plugin Manager
shows `min` in the plugin's details; nothing compares either with the IDE's version.
So an IDE older than your floor still installs the plugin, and a call to a member it
lacks fails there with `NoSuchMethodError` (a missing class, `NoClassDefFoundError`).
Set the floor anyway: it records what the plugin needs, for users and for any check
added later.

```xml
<!-- src/main/AndroidManifest.xml -->
Expand All @@ -35,14 +42,14 @@ need a source change, a recompile, or both · `tooling` = API-stability
milestone. **[verified]** = read from the checked-in ABI dump. **[reconstructed]**
= diffed from `plugin-api/src` history (predates the dump; symbol-accurate).

### 26.48 — unreleased
### 26.49 — unreleased
- **added — Show the IDE's own documentation from a plugin** _(ADFA-7134)_
`IdeTooltipService.showTooltip(anchorView, category, tag)` now reads the IDE's documentation
when `category` is `ide`, `java`, `kotlin` or `xml`, for example
`showTooltip(view, "java", "android.widget.TextView")`. Before, every category was replaced
with the plugin's own, so those calls found nothing. Any other category still reads the
plugin's own entries, so a plugin that passes its own category under another spelling is
unaffected. Floor `plugin.min_ide_version` at `26.48` to rely on it.
unaffected. Floor `plugin.min_ide_version` at `26.49` to rely on it.
- **added — Find the SQLite debugger of the open project's apps** _(ADFA-7139)_ **[verified]**
`DebuggerEndpointService.getEndpoints()` returns an unmodifiable `List<DebuggerEndpoint>`, one per app of the open
project that has reported to the IDE: `applicationId`, `port` (on `127.0.0.1`), `token` (the bearer
Expand All @@ -63,8 +70,10 @@ milestone. **[verified]** = read from the checked-in ABI dump. **[reconstructed]
below, and does not stop a plugin from taking another plugin's service from
`PluginManager.getInstance().getLoadedPlugin(id).context.services` or `PluginFragmentHelper.getServiceRegistry`
(tracked in ADFA-7194). Floor `plugin.min_ide_version`
at `26.48`: an IDE of 26.47 or older rejects the unknown `debugger.endpoints` permission when it
at `26.49`: an IDE of 26.48 or older rejects the unknown `debugger.endpoints` permission when it
validates the manifest, so it refuses to install a plugin that declares it.

### 26.48 — 2026-11-23
- **added — Hear the editor open and close a project, and save a file** _(ADFA-3570)_ **[verified]**
`IdeProjectService.addProjectLifecycleListener(ProjectLifecycleListener)` calls
`onProjectOpened(projectDir)` when the editor starts opening a project (its sync does not wait
Expand All @@ -78,7 +87,7 @@ milestone. **[verified]** = read from the checked-in ABI dump. **[reconstructed]
first. Paths are canonical, except one the IDE cannot resolve (`getCanonicalFile()` fails),
which is absolute instead. Floor `plugin.min_ide_version` at `26.48` to use them.

### 26.43 — unreleased
### 26.47 — 2026-11-17
- **breaking — JavaScript highlighting and the IDE's grammar names are the IDE's** _(ADFA-7084)_
The IDE now highlights `js`, `mjs`, `cjs` and `jsx` itself. A `LanguageDefinition` can still
claim them, but only with a language server: its grammar is ignored for them, and its server
Expand All @@ -92,6 +101,8 @@ milestone. **[verified]** = read from the checked-in ABI dump. **[reconstructed]
server: it keeps its server and needs no change. A plugin that wants its own JavaScript grammar
used claims another extension, and builds the grammar to export `tree_sitter_<name>` under a
name of its own.

### 26.44 — 2026-10-27
- **tooling — Interface bodies are Java default methods again** _(ADFA-6560)_ **[verified]**
Since ADFA-4058 (May 2026) pinned `languageVersion`, `plugin-api` compiled each Kotlin interface
body as an abstract method plus a `DefaultImpls` static. Plugins built against an earlier
Expand All @@ -103,20 +114,23 @@ milestone. **[verified]** = read from the checked-in ABI dump. **[reconstructed]
stays for plugins built since May. A plugin that implements an interface now inherits the body
of a method added after it was built instead of failing with `AbstractMethodError`.

A plugin built against this `plugin-api` calls those bodies on the interface, and an IDE built
between ADFA-4058 and 26.42 has none: there, any interface method the plugin does not override
fails with `AbstractMethodError`. Floor `plugin.min_ide_version` at `26.43`, or override every
method of the interfaces you implement.
A plugin built against this `plugin-api` calls those bodies, and the `$default` helpers, on the
interface, and an IDE built between ADFA-4058 and 26.43 has neither: there, any interface method
the plugin does not override fails with `AbstractMethodError`, and a call that omits a defaulted
argument of an interface method (such as `IdeArchiveService.extract` or
`IdeCommandService.executeCommand`) fails with `NoSuchMethodError`. Floor
`plugin.min_ide_version` at `26.44`, or override every method of the interfaces you implement and
pass every argument when you call an interface method.

### 26.42 — unreleased
### 26.43 — 2026-10-20
- **added — Tell whether a server is on this device, the local network or the internet** _(ADFA-6536)_ **[verified]**
`net.ServerUrl.parse(url)` returns `ServerUrlParseResult.Valid(url)` or `Invalid(reason)`, where
`Invalid.Reason` is `BLANK`, `MALFORMED`, `UNSUPPORTED_SCHEME` or `NO_HOST` (more may be added). A
`ServerUrl` has `scheme` (`HTTP`/`HTTPS`, each with its URL `id` and `isEncrypted`), `host`, `port`, `isCleartext` and a `NetworkLocality`:
`LOOPBACK` (`localhost`, `127.0.0.0/8`, `::1`, `0.0.0.0`, `::`), `PRIVATE_NETWORK` (RFC 1918, link-local, IPv6
unique-local, `.local` and dotless names) or `PUBLIC`. It reads the URL as typed and never resolves
a name, so it is safe on the main thread. It only classifies; each plugin decides what it allows
for each locality. Floor `plugin.min_ide_version` at `26.42` to use it.
for each locality. Floor `plugin.min_ide_version` at `26.43` to use it.
- **added — Start Quick Build and get its result** _(ADFA-6493)_ **[verified]**
`IdeBuildService.getQuickBuildAvailability()` returns `QuickBuildAvailability.Available`, or
`Unavailable(reason, message)` with a `QuickBuildUnavailableReason`: `EXPERIMENTS_DISABLED`,
Expand All @@ -131,7 +145,7 @@ milestone. **[verified]** = read from the checked-in ABI dump. **[reconstructed]
drops a plugin's start still saving or asking the user; the start's future reports what actually
happened, usually `Cancelled`. It needs `system.commands`. `getQuickBuildStatus()` returns a `QuickBuildState`: `READY`, `BUILDING`,
`FULL_BUILD_NEXT`, `RECONNECTING`, `ERROR`, or `UNAVAILABLE`. Floor `plugin.min_ide_version` at
`26.42`: an older IDE has none of these methods or classes.
`26.43`: an older IDE has none of these methods or classes.
- **added — Context window and typed failures for LLM backends** _(ADFA-6493)_ **[verified]**
`LlmInferenceService.ContextWindowReportingBackend.getContextWindowTokens()` lets a backend report
the tokens one request may hold (for a local model, the context actually allocated), or 0 while
Expand All @@ -142,9 +156,9 @@ milestone. **[verified]** = read from the checked-in ABI dump. **[reconstructed]
`onError(error, kind)` that falls back to `onError(error)`, so consumers built before it still hear
every failure. It lives on a new `ErrorCallback` that `StreamCallback` and `ToolStreamCallback`
both extend, so one class can still implement both. Floor
`plugin.min_ide_version` at `26.42` to call or implement any of them.
`plugin.min_ide_version` at `26.43` to call or implement any of them.

### 26.41 — unreleased
### 26.42 — 2026-10-13
- **added — Terminal readiness and visible terminal commands** _(ADFA-6373, ADFA-6385)_ **[verified]**
`IdeTerminalService.isTerminalReady()` reports whether the terminal environment is installed
and bash runs; it needs no permission. `runInTerminal(command, workingDirectory, waitMillis)`
Expand All @@ -162,7 +176,7 @@ milestone. **[verified]** = read from the checked-in ABI dump. **[reconstructed]
that exited before the plugin's last 8 others did. `stopCommand(commandId, waitMillis)` interrupts
that command with Ctrl-C and returns its state as `readCommand` does after waiting up to
`waitMillis` for it to exit; it never touches a later command in the same session. All three need `system.commands`;
the working directory must lie inside the project. Floor `plugin.min_ide_version` at `26.41`:
the working directory must lie inside the project. Floor `plugin.min_ide_version` at `26.42`:
an older IDE has no `IdeTerminalService` class, so referencing it fails to load.
- **added — Run Gradle tasks with arguments, get a structured result, cancel** _(ADFA-6373)_ **[verified]**
`IdeBuildService.executeTasks(tasks: List<String>, arguments: List<String>)` runs on the
Expand All @@ -173,12 +187,12 @@ milestone. **[verified]** = read from the checked-in ABI dump. **[reconstructed]
`IdeBuildService.cancelBuild()` cancels the running build, whoever started it. Non-empty
`arguments` and `cancelBuild()` need `system.commands` and throw `SecurityException` without
it. While the build runs, a sync or build the user starts is refused. Floor
`plugin.min_ide_version` at `26.41`: an older IDE has neither method.
`plugin.min_ide_version` at `26.42`: an older IDE has neither method.
- **added — List the project's Gradle tasks** _(ADFA-6373)_ **[verified]**
`IdeBuildService.getTasks()` returns the open project's tasks, root project and modules alike,
as `GradleTaskInfo(path, name, projectPath, group, description)`. It reflects the last sync:
empty before one or with no project open, and a task added since appears after the next.
Needs no permission. Floor `plugin.min_ide_version` at `26.41`: an older IDE has no such
Needs no permission. Floor `plugin.min_ide_version` at `26.42`: an older IDE has no such
method or class.
- **breaking — `IdeBuildService.executeTasks(vararg String)` needs at least one task** _(ADFA-6373)_
With no tasks it used to run the project's default tasks; it now completes with `false`
Expand All @@ -197,6 +211,8 @@ milestone. **[verified]** = read from the checked-in ABI dump. **[reconstructed]
With no project open, a `workingDirectory` used to be accepted unchecked; `executeCommand` now
throws `SecurityException`, as it does for one outside the project. Pass null to run in the
default directory.

### 26.41 — 2026-10-06
- **added — Plugin languages: tree-sitter highlighting and a language server** _(ADFA-4851)_ **[verified]**
A plugin implementing `LanguageExtension` returns `LanguageDefinition`s, each claiming file
extensions and optionally carrying a `TreeSitterGrammar` and a `LanguageServerDefinition`.
Expand Down Expand Up @@ -329,6 +345,7 @@ milestone. **[verified]** = read from the checked-in ABI dump. **[reconstructed]
no permission: plugins run in-process under the IDE's uid, so a gate would disclose log
access, not enforce it. Purely additive (the ABI dump diff is additions only). Floor
`plugin.min_ide_version` at `26.41` to use it; an older IDE has no such service.

### 26.40 — 2026-09-29
- **added — An embedding capability a backend can declare** _(ADFA-6053)_ **[verified]**
A backend that has an embedding model can now say so. The only embedding entry point
Expand Down Expand Up @@ -440,12 +457,14 @@ milestone. **[verified]** = read from the checked-in ABI dump. **[reconstructed]

Because an older IDE's `IdeEditorService` has no `saveFile` at all, calling it
there fails with `NoSuchMethodError` at the call site — floor
`plugin.min_ide_version` at `26.36` if you call it. The Kotlin `default` body is
not a Java default method: `plugin-api` sets no `-Xjvm-default`, so the compiler
emits an abstract interface method plus a `DefaultImpls` static (both visible in
the ABI dump). It therefore rescues neither a caller nor an implementer compiled
against an older `plugin-api` — the latter gets `AbstractMethodError`. Only the
host's own implementers benefit, and they are recompiled with it.
`plugin.min_ide_version` at `26.36` if you call it. Until 26.44 the Kotlin
`default` body was not a Java default method: `plugin-api` set no `-Xjvm-default`,
so the compiler emitted an abstract interface method plus a `DefaultImpls` static
(both visible in the ABI dump). It therefore rescued neither a caller nor an
implementer compiled against an older `plugin-api` — the latter got
`AbstractMethodError`. Only the host's own implementers benefited, and they are
recompiled with it. Since 26.44 the body is a Java default method (see that
entry); it still does nothing for a caller on an IDE without `saveFile`.

- **added — Keystore-backed secret storage for plugins** _(ADFA-5269)_ **[verified]**
A plugin that stores a credential can encrypt it with AES/GCM under a hardware-backed
Expand Down Expand Up @@ -712,4 +731,7 @@ git tag --list --contains <sha> | grep -E '^[0-9]{2}\.[0-9]{2}$' | sort -V | hea
```

When a release is tagged, replace its bucket's `unreleased` with the tag date and move
any entry the tag does not contain up to the next bucket.
any entry the tag does not contain up to the next bucket. The release tags are
lightweight, so the tag date is the tagged commit's date (`git log -1 --format=%cs <tag>`).
Do this at every release tag: nothing automates or checks it, and when it was skipped
from 26.41 to 26.48, entries sat up to four releases too early (ADFA-7211).
4 changes: 3 additions & 1 deletion docs/PLUGIN_AUTHORING.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ won't fail, but the plugin will be hard to identify in the UI.

To choose `plugin.min_ide_version`, see the
[Plugin API Changelog](PLUGIN_API_CHANGELOG.md) — it maps each plugin
capability to the `YY.WW` release that first shipped it.
capability to the `YY.WW` release that first shipped it. The IDE records and
shows the value but does not enforce it at install, and does not enforce
`plugin.max_ide_version` either.

Example (adapted from `apk-viewer-plugin/src/main/AndroidManifest.xml`):

Expand Down
2 changes: 1 addition & 1 deletion docs/plugin-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The surface a plugin binds to is broader than one module. All of the following a

That is **not** license to break plugins casually. The rule for now:

> Every change to the surface above must be **deliberate, documented, and justified.** Know when you're changing the contract, say so in the PR (what breaks, who's affected, why it's worth it), and record it here or in a changelog. Prefer **additive** changes; gate behavior with `plugin.min_ide_version` / `plugin.max_ide_version` where it helps.
> Every change to the surface above must be **deliberate, documented, and justified.** Know when you're changing the contract, say so in the PR (what breaks, who's affected, why it's worth it), and record it here or in a changelog. Prefer **additive** changes, and record the IDE versions a plugin needs in `plugin.min_ide_version` / `plugin.max_ide_version`. Neither is enforced at install today (see [PLUGIN_API_CHANGELOG.md](PLUGIN_API_CHANGELOG.md#how-to-use-this)), and `plugin-api` offers no IDE version to check at runtime, so these values gate nothing: a plugin that must run on an older IDE has to guard its calls to newer API itself (for example by catching `LinkageError`).

When the API is later frozen, this doc gains a formal compatibility guarantee and (ideally) automated enforcement — see Follow-ups.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public interface ToolSourceRegistry {
* Contract revision, bumped whenever a member is added here.
*
* <p>
* It marks the revision, it does not negotiate one: javac inlines a constant into every class that reads it, so a plugin carries the value it compiled against and the host its own, and neither can read the other's. Version compatibility is enforced where the loader already enforces it, by {@code plugin.min_ide_version} in the plugin manifest.
* It marks the revision, it does not negotiate one: javac inlines a constant into every class that reads it, so a plugin carries the value it compiled against and the host its own, and neither can read the other's. Nothing enforces compatibility either: a plugin states the IDE version it needs in {@code plugin.min_ide_version}, which the loader records and the Plugin Manager shows, but the IDE does not compare it with its own version at install, so on an older IDE a member added after it fails at the call with {@code NoSuchMethodError}.
*/
int CONTRACT_VERSION = 2;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ sealed class CommandSpec {
* refused. Keep the timeout no longer than the task needs. A cancel or timeout asks Gradle to
* stop and completes once it has.
*
* Before 26.41 this ran `./gradlew` as a separate process.
* Before 26.42 this ran `./gradlew` as a separate process.
*/
data class GradleTask(
val taskPath: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ interface IdeBuildService {

/**
* Executes the given Gradle task paths (e.g. ":app:assembleDebug") and completes with
* true on success, false on failure/cancellation. Since 26.41, no tasks, or a task name
* true on success, false on failure/cancellation. Since 26.42, no tasks, or a task name
* starting with `-`, completes with false without building.
*
* Default completes with false so this addition is binary-compatible: hosts that predate
Expand All @@ -471,8 +471,8 @@ interface IdeBuildService {
* Non-empty [arguments] need the `system.commands` permission (`--init-script` runs any code
* in the IDE's Gradle daemon); without it this throws [SecurityException].
*
* The default body is not a compatibility shim: an IDE older than 26.41 has no such method
* and the call fails with `NoSuchMethodError`. Floor `plugin.min_ide_version` at 26.41 to use
* The default body is not a compatibility shim: an IDE older than 26.42 has no such method
* and the call fails with `NoSuchMethodError`. Floor `plugin.min_ide_version` at 26.42 to use
* it.
*/
fun executeTasks(
Expand All @@ -487,7 +487,7 @@ interface IdeBuildService {
* down. The cancelled run's own future then completes with [GradleTaskResult.Cancelled].
* Needs the `system.commands` permission; without it this throws [SecurityException].
*
* Floor `plugin.min_ide_version` at 26.41 to use it (see [executeTasks]).
* Floor `plugin.min_ide_version` at 26.42 to use it (see [executeTasks]).
*/
fun cancelBuild(): CompletableFuture<Boolean> = CompletableFuture.completedFuture(false)

Expand Down Expand Up @@ -518,15 +518,15 @@ interface IdeBuildService {
* reported them at the last sync. Empty when no project is open or it has not synced. A task
* added to a build script since then appears only after the next sync.
*
* Floor `plugin.min_ide_version` at 26.41 to use it (see [executeTasks]).
* Floor `plugin.min_ide_version` at 26.42 to use it (see [executeTasks]).
*/
fun getTasks(): List<GradleTaskInfo> = emptyList()

/**
* Whether [startQuickBuild] can run for the open project, and if not, why. Needs no permission.
*
* The default body is not a compatibility shim (see [executeTasks]): floor
* `plugin.min_ide_version` at 26.42 to use the Quick Build methods.
* `plugin.min_ide_version` at 26.43 to use the Quick Build methods.
*/
fun getQuickBuildAvailability(): QuickBuildAvailability =
QuickBuildAvailability.Unavailable(QuickBuildUnavailableReason.NOT_SUPPORTED, "Quick Build is not supported")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package com.itsaky.androidide.plugins.services
* Service interface for the IDE's terminal environment (bash and the packages installed with it).
*
* Use [IdeCommandService] to run a command headless; use [runInTerminal] when the user should see
* what ran. Available since 26.41.
* what ran. Available since 26.42.
*/
interface IdeTerminalService {
/**
Expand Down
Loading