Skip to content

The IDE you know, rebuilt in Rust. IntelliJ IDEA–style keymap, tool windows and search-everywhere in a fast native app: editor, code insight, debugger, Git, terminal, database and HTTP clients for 60+ languages.

chore: v0.1.39

l0ng-ai25424465c04c
diff --git a/Cargo.lock b/Cargo.lock
index 1c3bb3101..7432746b2 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -4106,7 +4106,7 @@ checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954"
[[package]]
name = "ide-agent"
-version = "0.1.38"
+version = "0.1.39"
dependencies = [
"dunce",
"encoding_rs",
@@ -4129,7 +4129,7 @@ dependencies = [
[[package]]
name = "ide-analysis"
-version = "0.1.38"
+version = "0.1.39"
dependencies = [
"ast-grep-core",
"ide-core",
@@ -4143,7 +4143,7 @@ dependencies = [
[[package]]
name = "ide-android"
-version = "0.1.38"
+version = "0.1.39"
dependencies = [
"ide-core",
"serde",
@@ -4154,7 +4154,7 @@ dependencies = [
[[package]]
name = "ide-build"
-version = "0.1.38"
+version = "0.1.39"
dependencies = [
"blake3",
"dirs 6.0.0",
@@ -4170,7 +4170,7 @@ dependencies = [
[[package]]
name = "ide-clipboard"
-version = "0.1.38"
+version = "0.1.39"
dependencies = [
"objc2 0.6.5",
"objc2-app-kit 0.3.2",
@@ -4179,7 +4179,7 @@ dependencies = [
[[package]]
name = "ide-core"
-version = "0.1.38"
+version = "0.1.39"
dependencies = [
"dunce",
"encoding_rs",
@@ -4196,7 +4196,7 @@ dependencies = [
[[package]]
name = "ide-coverage"
-version = "0.1.38"
+version = "0.1.39"
dependencies = [
"ide-core",
"ide-run",
@@ -4210,7 +4210,7 @@ dependencies = [
[[package]]
name = "ide-dap"
-version = "0.1.38"
+version = "0.1.39"
dependencies = [
"futures",
"ide-core",
@@ -4231,7 +4231,7 @@ dependencies = [
[[package]]
name = "ide-db"
-version = "0.1.38"
+version = "0.1.39"
dependencies = [
"bb8",
"dirs 6.0.0",
@@ -4258,7 +4258,7 @@ dependencies = [
[[package]]
name = "ide-docker"
-version = "0.1.38"
+version = "0.1.39"
dependencies = [
"ide-core",
"serde",
@@ -4271,7 +4271,7 @@ dependencies = [
[[package]]
name = "ide-extension"
-version = "0.1.38"
+version = "0.1.39"
dependencies = [
"base64 0.22.1",
"blake3",
@@ -4291,7 +4291,7 @@ dependencies = [
[[package]]
name = "ide-fonts"
-version = "0.1.38"
+version = "0.1.39"
dependencies = [
"objc2-core-foundation",
"objc2-core-text",
@@ -4303,7 +4303,7 @@ dependencies = [
[[package]]
name = "ide-github"
-version = "0.1.38"
+version = "0.1.39"
dependencies = [
"ide-core",
"ide-vcs",
@@ -4316,7 +4316,7 @@ dependencies = [
[[package]]
name = "ide-host"
-version = "0.1.38"
+version = "0.1.39"
dependencies = [
"base64 0.22.1",
"blake3",
@@ -4378,7 +4378,7 @@ dependencies = [
[[package]]
name = "ide-http"
-version = "0.1.38"
+version = "0.1.39"
dependencies = [
"ide-core",
"parking_lot",
@@ -4396,7 +4396,7 @@ dependencies = [
[[package]]
name = "ide-index"
-version = "0.1.38"
+version = "0.1.39"
dependencies = [
"blake3",
"criterion",
@@ -4418,7 +4418,7 @@ dependencies = [
[[package]]
name = "ide-jsonrpc"
-version = "0.1.38"
+version = "0.1.39"
dependencies = [
"encoding_rs",
"futures",
@@ -4435,7 +4435,7 @@ dependencies = [
[[package]]
name = "ide-language"
-version = "0.1.38"
+version = "0.1.39"
dependencies = [
"blake3",
"criterion",
@@ -4491,7 +4491,7 @@ dependencies = [
[[package]]
name = "ide-lsp"
-version = "0.1.38"
+version = "0.1.39"
dependencies = [
"dunce",
"futures",
@@ -4517,7 +4517,7 @@ dependencies = [
[[package]]
name = "ide-notebook"
-version = "0.1.38"
+version = "0.1.39"
dependencies = [
"futures",
"ide-core",
@@ -4540,7 +4540,7 @@ dependencies = [
[[package]]
name = "ide-plugin"
-version = "0.1.38"
+version = "0.1.39"
dependencies = [
"blake3",
"ide-core",
@@ -4561,7 +4561,7 @@ dependencies = [
[[package]]
name = "ide-profiler"
-version = "0.1.38"
+version = "0.1.39"
dependencies = [
"ide-core",
"ide-run",
@@ -4574,7 +4574,7 @@ dependencies = [
[[package]]
name = "ide-remote"
-version = "0.1.38"
+version = "0.1.39"
dependencies = [
"globset",
"ide-core",
@@ -4592,7 +4592,7 @@ dependencies = [
[[package]]
name = "ide-run"
-version = "0.1.38"
+version = "0.1.39"
dependencies = [
"dunce",
"encoding_rs",
@@ -4616,7 +4616,7 @@ dependencies = [
[[package]]
name = "ide-sdk"
-version = "0.1.38"
+version = "0.1.39"
dependencies = [
"dunce",
"ide-core",
@@ -4635,7 +4635,7 @@ dependencies = [
[[package]]
name = "ide-search"
-version = "0.1.38"
+version = "0.1.39"
dependencies = [
"criterion",
"globset",
@@ -4655,7 +4655,7 @@ dependencies = [
[[package]]
name = "ide-spell"
-version = "0.1.38"
+version = "0.1.39"
dependencies = [
"ide-core",
"parking_lot",
@@ -4668,7 +4668,7 @@ dependencies = [
[[package]]
name = "ide-ssh"
-version = "0.1.38"
+version = "0.1.39"
dependencies = [
"dirs 6.0.0",
"flate2",
@@ -4689,7 +4689,7 @@ dependencies = [
[[package]]
name = "ide-syntax"
-version = "0.1.38"
+version = "0.1.39"
dependencies = [
"ide-core",
"ide-language",
@@ -4704,7 +4704,7 @@ dependencies = [
[[package]]
name = "ide-terminal"
-version = "0.1.38"
+version = "0.1.39"
dependencies = [
"ide-core",
"libc",
@@ -4717,7 +4717,7 @@ dependencies = [
[[package]]
name = "ide-text"
-version = "0.1.38"
+version = "0.1.39"
dependencies = [
"criterion",
"ide-core",
@@ -4730,7 +4730,7 @@ dependencies = [
[[package]]
name = "ide-tools"
-version = "0.1.38"
+version = "0.1.39"
dependencies = [
"flate2",
"hex",
@@ -4751,7 +4751,7 @@ dependencies = [
[[package]]
name = "ide-vcs"
-version = "0.1.38"
+version = "0.1.39"
dependencies = [
"blake3",
"dunce",
@@ -4772,7 +4772,7 @@ dependencies = [
[[package]]
name = "ide-vfs"
-version = "0.1.38"
+version = "0.1.39"
dependencies = [
"chardetng",
"dunce",
@@ -4796,7 +4796,7 @@ dependencies = [
[[package]]
name = "ide-web"
-version = "0.1.38"
+version = "0.1.39"
dependencies = [
"ide-core",
"open",
@@ -4812,7 +4812,7 @@ dependencies = [
[[package]]
name = "ide-workspace"
-version = "0.1.38"
+version = "0.1.39"
dependencies = [
"blake3",
"dunce",
@@ -6358,7 +6358,7 @@ dependencies = [
[[package]]
name = "openidea"
-version = "0.1.38"
+version = "0.1.39"
dependencies = [
"base64 0.22.1",
"blake3",
diff --git a/Cargo.toml b/Cargo.toml
index 73910c928..6faf0bef6 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -5,7 +5,7 @@ members = ["crates/*", "src-tauri"]
exclude = ["sdk", "plugins"]
[workspace.package]
-version = "0.1.38"
+version = "0.1.39"
edition = "2024"
rust-version = "1.96"
license = "Apache-2.0"
diff --git a/package.json b/package.json
index 1fb159a4a..f851c9ca6 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
"name": "openidea",
"private": true,
"description": "An open-source IDE inspired by IntelliJ IDEA",
- "version": "0.1.38",
+ "version": "0.1.39",
"license": "Apache-2.0",
"type": "module",
"scripts": {
diff --git a/sdk/rust/openidea-plugin/tests/api/released/commit.wit b/sdk/rust/openidea-plugin/tests/api/released/commit.wit
new file mode 100644
index 000000000..a70b889c1
--- /dev/null
+++ b/sdk/rust/openidea-plugin/tests/api/released/commit.wit
@@ -0,0 +1,75 @@
+package openidea:[email protected];
+
+/// The commit being prepared in the window the current command or event came
+/// from (the Commit tool window, or the Commit dialog while it is open): the
+/// changes it holds and its message.
+interface commit {
+ use types.{error};
+
+ /// A file the commit changes.
+ record commit-change {
+ /// Absolute path of the working tree root of its repository.
+ repository: string,
+ /// Absolute path (after a rename, the new one).
+ path: string,
+ /// The path before a rename or copy.
+ old-path: option<string>,
+ /// `added`, `modified`, `deleted`, `renamed`, `copied` or
+ /// `type-changed` (more may be added).
+ status: string,
+ /// What the commit changes in the file, in `git diff` format against
+ /// HEAD: only the changed blocks included in the commit. `none` for
+ /// binary content.
+ diff: option<string>,
+ /// `diff` was cut at the size limit (1 MiB for all the changes).
+ truncated: bool,
+ }
+
+ /// What Commit would commit right now.
+ record commit-draft {
+ /// Changes whenever the message, the included changes or Amend do.
+ revision: u64,
+ message: string,
+ /// The commit replaces the last one (Amend); `changes` are still
+ /// against HEAD, so they don't include the last commit's own.
+ amend: bool,
+ changes: list<commit-change>,
+ }
+
+ /// The commit being prepared, as Commit would make it: the included
+ /// files and changed blocks only. Unsaved editors of the included files
+ /// are saved first, as Commit does; nothing is staged or committed.
+ /// `none` when the window's project has no repository. Fails with
+ /// `invalid` outside a command or event of a window, and in a project that
+ /// is not trusted. Requires `vcs.read`.
+ pending-commit: func() -> result<option<commit-draft>, error>;
+ /// Replaces the commit message, only if the draft is still at `revision`
+ /// (else `stale`, and nothing changes): text the user typed meanwhile is
+ /// never overwritten. The user reviews it and commits. Same windows as
+ /// `pending-commit`. Requires `vcs.write`.
+ set-commit-message: func(revision: u64, message: string) -> result<_, error>;
+}
+
+/// Before-commit checks (`[[contributes.commitChecks]]`), run when the user
+/// commits, after the IDE's own checks, for the checks enabled in Commit
+/// Options. Problems stop the commit and show beside the message until the
+/// user changes it or chooses Commit Anyway. Requires `vcs.read`.
+interface commit-checker {
+ use types.{error, location};
+ use invocation.{invocation};
+ use commit.{commit-draft};
+
+ /// Something the user should look at before committing.
+ record commit-problem {
+ /// One sentence, shown after the check's title.
+ message: string,
+ /// Where it is, opened from the problem; `none` for the commit as a
+ /// whole (its message, for instance).
+ location: option<location>,
+ }
+
+ /// Runs the declared check `check` on `draft`: no problems lets the commit
+ /// go on. A call that fails or runs out of time is reported as a problem
+ /// of the check.
+ check: func(check: string, draft: commit-draft, ctx: borrow<invocation>) -> result<list<commit-problem>, error>;
+}
diff --git a/sdk/rust/openidea-plugin/tests/api/released/details.wit b/sdk/rust/openidea-plugin/tests/api/released/details.wit
new file mode 100644
index 000000000..9e889851a
--- /dev/null
+++ b/sdk/rust/openidea-plugin/tests/api/released/details.wit
@@ -0,0 +1,50 @@
+package openidea:[email protected];
+
+/// What the pane beside the Services tree shows for a plugin's node.
+interface detail-types {
+ /// A switch above a log; when on, `args` are appended and the program
+ /// starts again.
+ record log-toggle {
+ id: string,
+ label: string,
+ args: list<string>,
+ }
+
+ /// A program the IDE runs, its output followed in a log (ANSI stripped,
+ /// the last 5000 lines) until it exits or the pane closes. Needs the
+ /// plugin's `process:<program>` grant; runs in the project root.
+ record process-log {
+ program: string,
+ args: list<string>,
+ toggles: list<log-toggle>,
+ }
+
+ /// The body of a tab.
+ variant pane {
+ /// A centred message: an empty state or why there is nothing to show.
+ message(string),
+ /// Read-only text the user can select and copy, at most 1 MiB.
+ text(string),
+ log(process-log),
+ }
+
+ /// A tab of a node's pane; the IDE switches tabs without calling the plugin.
+ record tab {
+ id: string,
+ label: string,
+ body: pane,
+ }
+}
+
+/// The detail pane of the nodes of a plugin's `location = "services"` views.
+/// The nodes themselves, the toolbar and their events come from
+/// `view-provider` (`render` / `handle` of the view).
+interface detail-provider {
+ use types.{error};
+ use invocation.{invocation};
+ use detail-types.{tab};
+
+ /// The tabs of node `key` of view `view` (at most 8), rendered when the
+ /// node is selected and again after `views.refresh(view)`.
+ detail: func(view: string, key: string, ctx: borrow<invocation>) -> result<list<tab>, error>;
+}
diff --git a/sdk/rust/openidea-plugin/tests/api/released/diagnostics.wit b/sdk/rust/openidea-plugin/tests/api/released/diagnostics.wit
new file mode 100644
index 000000000..d5d62de72
--- /dev/null
+++ b/sdk/rust/openidea-plugin/tests/api/released/diagnostics.wit
@@ -0,0 +1,22 @@
+package openidea:[email protected];
+
+/// Optional export (world `plugin-diagnostics`): problems in the current,
+/// possibly unsaved document, for the languages declared with the
+/// `diagnostics` provider kind. Asked shortly after a document opens or
+/// changes, under the editor-provider budget; it can't ask the user.
+interface diagnostics-provider {
+ use diagnostics.{diagnostic};
+
+ /// The document to check (the editor's text, unsaved edits included).
+ record document {
+ /// Absolute path.
+ path: string,
+ language: string,
+ version: u64,
+ text: string,
+ }
+
+ /// The document's problems, at most 5,000; they replace what this
+ /// provider reported before, and an empty list removes them.
+ diagnostics: func(doc: document) -> list<diagnostic>;
+}
diff --git a/sdk/rust/openidea-plugin/tests/api/released/endpoints.wit b/sdk/rust/openidea-plugin/tests/api/released/endpoints.wit
new file mode 100644
index 000000000..95302fcb0
--- /dev/null
+++ b/sdk/rust/openidea-plugin/tests/api/released/endpoints.wit
@@ -0,0 +1,26 @@
+package openidea:[email protected];
+
+/// HTTP endpoints found in a project (`[[contributes.endpoints]]`).
+interface endpoints-provider {
+ use types.{error, location};
+ use invocation.{invocation};
+
+ /// One HTTP route.
+ record endpoint {
+ /// `none` accepts any HTTP method.
+ method: option<string>,
+ /// Path parameters use braces, e.g. `/photos/{id}`.
+ path: string,
+ /// Shown next to the route, e.g. `Rails`.
+ framework: string,
+ /// Display name, e.g. `PhotosController#show`.
+ handler: option<string>,
+ /// Where the route is declared, inside the project.
+ location: location,
+ }
+
+ /// The project's routes, complete. Called when the IDE first needs them and
+ /// again after a file matching `files` changes; cached in between. Runs in
+ /// the background: it can't ask the user.
+ endpoints: func(ctx: borrow<invocation>) -> result<list<endpoint>, error>;
+}
diff --git a/sdk/rust/openidea-plugin/tests/api/released/events.wit b/sdk/rust/openidea-plugin/tests/api/released/events.wit
index 0685cdf6f..8851d18a7 100644
--- a/sdk/rust/openidea-plugin/tests/api/released/events.wit
+++ b/sdk/rust/openidea-plugin/tests/api/released/events.wit
@@ -1,4 +1,4 @@
-package openidea:[email protected];
+package openidea:[email protected];
/// Workbench events, delivered in batches to `event-handler.handle`.
interface events {
@@ -29,18 +29,25 @@ interface events {
/// Delivers `kind` events from now on, for the rest of the session (also
/// across idle reclaim: an event activates the plugin again). Declare
/// `activation = ["on-event:<kind>"]` to get them before first use.
- /// Kinds: `file-opened`, `file-saved`, `editor-focused` (the focused editor
+ /// Kinds: `file-opened`, `file-saved`, `files-changed` (batched disk changes
+ /// as `other`, with created/modified/removed path lists in JSON), `editor-focused` (the focused editor
/// changed), `vcs-changed` (a repository's state changed: commit,
/// checkout, fetch…), `action-performed` (an IDE action ran) and
/// `scheduled` (the `on-schedule` period elapsed); later IDEs add more,
/// and an IDE that doesn't know one fails with `invalid`.
/// Requires `events` (`events.input` for `action-performed`).
subscribe: func(kind: string) -> result<_, error>;
+ /// Replaces this kind's subscription with project-relative globs (OR).
+ /// Empty globs pause delivery; `subscribe` restores unfiltered delivery.
+ /// Kinds: file-opened, file-saved, files-changed. Requires `events`.
+ subscribe-paths: func(kind: string, globs: list<string>) -> result<_, error>;
unsubscribe: func(kind: string);
}
/// Long-running work with a progress indicator. While a task is open, the
-/// call that began it may run for the background budget (60 s) instead of 5 s.
+/// call that began it may run for the background budget (60 s) instead of 5 s,
+/// and each `report` or `is-cancelled` renews that budget: work that keeps
+/// saying it is alive is not cut off, while work that goes quiet is.
interface tasks {
resource task {
/// `done` of `total` units (`none`: indeterminate), with a short status.
diff --git a/sdk/rust/openidea-plugin/tests/api/released/exports.wit b/sdk/rust/openidea-plugin/tests/api/released/exports.wit
index 311a61196..67d7c6060 100644
--- a/sdk/rust/openidea-plugin/tests/api/released/exports.wit
+++ b/sdk/rust/openidea-plugin/tests/api/released/exports.wit
@@ -1,4 +1,4 @@
-package openidea:[email protected];
+package openidea:[email protected];
interface lifecycle {
use types.{context, error};
diff --git a/sdk/rust/openidea-plugin/tests/api/released/file-actions.wit b/sdk/rust/openidea-plugin/tests/api/released/file-actions.wit
new file mode 100644
index 000000000..477809180
--- /dev/null
+++ b/sdk/rust/openidea-plugin/tests/api/released/file-actions.wit
@@ -0,0 +1,80 @@
+package openidea:[email protected];
+
+/// Optional export (world `plugin-file-actions`): quick fixes and
+/// refactorings that create, rename or delete files, next to the text edits
+/// `providers.code-actions` offers. Declare the `code-actions` provider kind in
+/// `[[contributes.providers]]`; the host calls `code-actions` here with the same
+/// budget and lists the results with the others.
+interface file-actions {
+ use types.{error, range, text-edit};
+
+ /// The document the actions are for (the editor's text while it is open).
+ record document {
+ /// Absolute path.
+ path: string,
+ language: string,
+ version: u64,
+ text: string,
+ }
+
+ /// Text edits to one file.
+ record file-edit {
+ path: string,
+ edits: list<text-edit>,
+ }
+
+ /// A file change, applied before the action's text edits.
+ variant file-operation {
+ /// Fails when the file exists, unless `overwrite`.
+ create(create-file),
+ rename(rename-file),
+ /// Deletes the file; undoing the action restores it.
+ delete(delete-file),
+ }
+
+ /// A new file with its text; missing parent directories are created.
+ record create-file {
+ path: string,
+ text: string,
+ overwrite: bool,
+ }
+
+ /// Moves `path` to `new-path`.
+ record rename-file {
+ path: string,
+ new-path: string,
+ }
+
+ /// The file to delete.
+ record delete-file {
+ path: string,
+ }
+
+ /// A code action that changes files. Paths are absolute or relative to the
+ /// project root, and stay inside it: a path outside disables the action.
+ record file-action {
+ title: string,
+ /// `quickfix`, `refactor`, …
+ kind: option<string>,
+ preferred: bool,
+ /// Applied first, in order, as one workspace edit with `edits`: if
+ /// any operation or edit fails, nothing is applied, and one undo
+ /// reverses all of it.
+ operations: list<file-operation>,
+ /// Applied after the operations; may target files they create.
+ edits: list<file-edit>,
+ /// Opened once the action is applied.
+ open: option<string>,
+ /// The plugin's own reference: with it and no `operations` or `edits`,
+ /// they are computed by `resolve` once the user picks the action.
+ data: option<string>,
+ }
+
+ /// Actions for `selection`, under the edit-path budget.
+ code-actions: func(doc: document, selection: range) -> list<file-action>;
+ /// The operations and edits of an action listed with `data` and nothing
+ /// to apply, once the user picks it (the command budget applies, not the
+ /// editor's 50 ms). The same four prompts as `providers.resolve-code-action`
+ /// work here, in the editor's window and excluding the wait from the budget.
+ resolve: func(doc: document, action: file-action) -> result<file-action, error>;
+}
diff --git a/sdk/rust/openidea-plugin/tests/api/released/fs.wit b/sdk/rust/openidea-plugin/tests/api/released/fs.wit
new file mode 100644
index 000000000..7cd07fd71
--- /dev/null
+++ b/sdk/rust/openidea-plugin/tests/api/released/fs.wit
@@ -0,0 +1,55 @@
+package openidea:[email protected];
+
+/// Files outside the open projects: the configuration of the program a
+/// plugin integrates with, a tool installed elsewhere, a licence file.
+///
+/// A plugin's own WASI has no preopened directory. Every path outside its
+/// own `plugin-dir` is checked against its `fs.read:<path>` (reading) or
+/// `fs.write:<path>`
+/// (writing; it doesn't imply reading) grants; without one covering the path a
+/// call returns `denied` naming the capability the manifest has to declare. A
+/// file inside a project is `workspace.project.read-file` / `write-file`.
+/// `path` is absolute, or starts with `~/` for the user's home.
+interface fs {
+ use types.{error};
+ use workspace.{file-kind, file-stat};
+
+ /// The plugin's persistent private directory, created owner-only (0700,
+ /// owner-only ACL on Windows), removed on uninstall. Reading and writing
+ /// under it needs no fs.* grant; files created there are owner-only.
+ plugin-dir: func() -> result<string, error>;
+
+ /// A text file, decoded as the editor decodes it (BOM and encoding
+ /// detection), at most 16 MiB. Unsaved editor contents win, as they do
+ /// for `project.read-file`.
+ read-file: func(path: string) -> result<string, error>;
+
+ /// The bytes of a file (images, class files, archives), at most 16 MiB.
+ read-bytes: func(path: string) -> result<list<u8>, error>;
+
+ /// Metadata of an existing path, as `project.stat` reports it; a missing
+ /// path is `not-found`.
+ stat: func(path: string) -> result<file-stat, error>;
+
+ /// An entry of a directory.
+ record dir-entry {
+ /// The entry's name, without its directory.
+ name: string,
+ kind: file-kind,
+ }
+
+ /// The entries directly under a directory, sorted by name, at most 4096
+ /// (like `find-files`); a file is `invalid`.
+ read-dir: func(path: string) -> result<list<dir-entry>, error>;
+
+ /// Replaces the text of a file, or creates it, at most 16 MiB: in one step
+ /// (a reader never sees half of it), keeping the file's encoding and BOM;
+ /// a new file is UTF-8. `invalid` when the text can't be written in that
+ /// encoding, the directory is missing, the path is a directory, or an
+ /// editor holds unsaved changes for the file (save them first).
+ write-file: func(path: string, text: string) -> result<_, error>;
+
+ /// Replaces the bytes of a file, or creates it, at most 16 MiB, in one
+ /// step; fails like `write-file`.
+ write-bytes: func(path: string, bytes: list<u8>) -> result<_, error>;
+}
diff --git a/sdk/rust/openidea-plugin/tests/api/released/host.wit b/sdk/rust/openidea-plugin/tests/api/released/host.wit
index 357a9f53e..91c3e12fc 100644
--- a/sdk/rust/openidea-plugin/tests/api/released/host.wit
+++ b/sdk/rust/openidea-plugin/tests/api/released/host.wit
@@ -1,4 +1,4 @@
-package openidea:[email protected];
+package openidea:[email protected];
/// Writes to the IDE log, tagged with the plugin id.
interface log {
@@ -33,9 +33,23 @@ interface ui {
text(string),
}
+ /// A notification button that runs one of the plugin's commands.
+ record notification-action {
+ /// Up to 256 bytes, one line.
+ label: string,
+ /// The id of a command the plugin declares.
+ command: string,
+ /// Passed to the command as its argument (up to 64 KiB).
+ argument: option<string>,
+ }
+
/// Shows a notification balloon in the window the current command or
/// event came from (every window when there is none).
show-notification: func(level: notification-level, title: string, body: string);
+ /// `show-notification` with up to three action buttons. Choosing one
+ /// dismisses the balloon and runs the command in its window. An invalid
+ /// action or an undeclared command fails the call and shows nothing.
+ notify: func(level: notification-level, title: string, body: string, actions: list<notification-action>) -> result<_, error>;
/// Shows or updates the plugin's status bar item `id` in every window.
set-status-item: func(id: string, item: status-item);
remove-status-item: func(id: string);
@@ -51,24 +65,36 @@ interface ui {
copy-to-clipboard: func(text: string) -> result<_, error>;
/// Opens an `http://` or `https://` URL in the user's default browser.
open-url: func(url: string) -> result<_, error>;
- /// Shows a list in the window the current command or event came from and
- /// waits for the key of the chosen item, or `none` when the user dismisses
- /// it. Needs no capability. Returns `invalid` outside a command or event of
- /// a window (including in editor providers). Waiting doesn't count against
- /// the call's budget.
+ /// Shows a list and waits for the chosen key, or `none` when dismissed.
+ /// Works in a command/event of a window, or while resolving a selected code
+ /// or file action in its editor's window; `invalid` otherwise.
+ /// Needs no capability. Waiting doesn't count against the call's budget.
pick: func(title: string, items: list<pick-item>) -> result<option<string>, error>;
+ /// Native folder chooser; an absolute path, or `none` when dismissed.
+ /// Only from a command or event of a window; waiting is excluded from the budget.
+ pick-directory: func(title: string, initial: option<string>) -> result<option<string>, error>;
/// Like `pick`, with any number of items chosen.
pick-many: func(title: string, items: list<pick-item>) -> result<option<list<string>>, error>;
/// Asks for a line of text, pre-filled with `value`; `none` when dismissed.
/// Same rules as `pick`.
input: func(prompt: string, value: option<string>) -> result<option<string>, error>;
+ /// Asks for text over several lines, pre-filled with `value`; `none` when
+ /// dismissed. Only from a command or event of a window; the dialog confirms
+ /// on Cmd/Ctrl+Enter.
+ input-multiline: func(prompt: string, value: option<string>) -> result<option<string>, error>;
/// Asks for confirmation with OK and Cancel: `true` on OK, `false` on
/// Cancel or Escape. Same rules as `pick`.
confirm: func(title: string, body: string) -> result<bool, error>;
+ /// The IDE's UI language as a BCP 47 tag (`en`, `fr`, `zh-CN`, …); it
+ /// follows a change of language. For the text the plugin builds itself:
+ /// the strings of its manifest and views are translated from
+ /// `locales/<tag>.json`.
+ locale: func() -> string;
}
/// Persistent key-value storage of the plugin (survives restarts and idle
-/// reclaim; instance memory does not). Requires `storage`. At most 1 MiB.
+/// reclaim; instance memory does not). Requires `storage`. At most 64 MiB,
+/// counting UTF-8 bytes of keys and values; rejected writes preserve the data.
interface storage {
use types.{error};
diff --git a/sdk/rust/openidea-plugin/tests/api/released/hover.wit b/sdk/rust/openidea-plugin/tests/api/released/hover.wit
new file mode 100644
index 000000000..a95c22758
--- /dev/null
+++ b/sdk/rust/openidea-plugin/tests/api/released/hover.wit
@@ -0,0 +1,29 @@
+package openidea:[email protected];
+
+/// Optional export (world `plugin-hover`): Markdown added to the hover of
+/// documents of the languages declared with the `hover` provider kind,
+/// including languages the plugin doesn't contribute. It shows below the
+/// language server's hover, under the edit-path budget.
+interface hover-provider {
+ use types.{position, range};
+
+ /// The document hovered (the editor's text while it is open).
+ record document {
+ /// Absolute path.
+ path: string,
+ language: string,
+ version: u64,
+ text: string,
+ }
+
+ /// What the plugin adds to the hover.
+ record hover-content {
+ /// At most 64 KiB.
+ markdown: string,
+ /// The text the hover describes; used when the server names none.
+ range: option<range>,
+ }
+
+ /// The hover at `at`, or `none` to add nothing.
+ hover: func(doc: document, at: position) -> option<hover-content>;
+}
diff --git a/sdk/rust/openidea-plugin/tests/api/released/indexing.wit b/sdk/rust/openidea-plugin/tests/api/released/indexing.wit
index e9edc27d2..4ee08d64b 100644
--- a/sdk/rust/openidea-plugin/tests/api/released/indexing.wit
+++ b/sdk/rust/openidea-plugin/tests/api/released/indexing.wit
@@ -1,4 +1,4 @@
-package openidea:[email protected];
+package openidea:[email protected];
/// Cross-file associations a plugin publishes for the files it declares under
/// `[[contributes.documentIndexers]]`. The host calls `index` in cancellable
diff --git a/sdk/rust/openidea-plugin/tests/api/released/inlay.wit b/sdk/rust/openidea-plugin/tests/api/released/inlay.wit
new file mode 100644
index 000000000..ab00b0c9b
--- /dev/null
+++ b/sdk/rust/openidea-plugin/tests/api/released/inlay.wit
@@ -0,0 +1,39 @@
+package openidea:[email protected];
+
+/// Optional export (world `plugin-inlay-hints`): inline hints in documents of
+/// the languages declared with the `inlay-hints` provider kind, including
+/// languages the plugin doesn't contribute. They are shown next to the
+/// language server's hints.
+interface inlay-hints-provider {
+ use types.{position, range};
+
+ /// The document the hints are for (the editor's text while it is open).
+ record document {
+ path: string,
+ language: string,
+ version: u64,
+ text: string,
+ }
+
+ /// A hint shown at `position`, before the character there.
+ record inlay-hint {
+ /// UTF-16 position (0-based line and column).
+ position: position,
+ /// The text shown, e.g. `GET /orders` or `: string`.
+ label: string,
+ /// `type` or `parameter` follow the Inlay Hints settings of that kind;
+ /// anything else counts as `other`.
+ kind: string,
+ /// Shown when the pointer rests on the hint.
+ tooltip: option<string>,
+ /// A space before the label.
+ padding-left: bool,
+ /// A space after the label.
+ padding-right: bool,
+ }
+
+ /// The hints within `range` (the visible part of the document), under the
+ /// edit-path budget. Hints outside `range` are dropped; at most 10,000 per
+ /// call.
+ inlay-hints: func(doc: document, range: range) -> list<inlay-hint>;
+}
diff --git a/sdk/rust/openidea-plugin/tests/api/released/io.wit b/sdk/rust/openidea-plugin/tests/api/released/io.wit
index 89bbaadbf..cffd883be 100644
--- a/sdk/rust/openidea-plugin/tests/api/released/io.wit
+++ b/sdk/rust/openidea-plugin/tests/api/released/io.wit
@@ -1,4 +1,4 @@
-package openidea:[email protected];
+package openidea:[email protected];
/// Problems in files, shown in the editor and the Problems view.
interface diagnostics {
@@ -75,8 +75,10 @@ interface secrets {
is-set: func(name: string) -> bool;
}
-/// One-off runs of programs granted with `process:<program>` (the file the
-/// user approved, checked before every run).
+/// Runs of programs granted with `process:<program>` (the file the user
+/// approved, checked before every run): once and awaited with `run`, once
+/// with an environment with `run-command`, or kept running behind a `child`
+/// handle started with `start`.
interface process {
use types.{error};
use workspace.{project};
@@ -89,8 +91,56 @@ interface process {
stderr: string,
}
+ /// What to run (API 1.3). `env` only adds variables: an existing name in
+ /// the prepared child environment (including the login-shell PATH) is an
+ /// error naming that key; nothing is replaced or removed. Names compare
+ /// case-insensitively on Windows. At most 64 entries, nonempty names of
+ /// at most 256 bytes without '=' or NUL, values at most 4 KiB without NUL.
+ record command {
+ program: string,
+ args: list<string>,
+ env: list<tuple<string, string>>,
+ }
+
+ /// What a kept-running program printed since the last call, and its exit
+ /// code once it ended (`none` while it still runs).
+ record chunk {
+ /// Up to 1 MiB per stream; unpolled output keeps the last 1 MiB.
+ /// `poll` takes up to `max-bytes`, or one whole character when that
+ /// limit is smaller. Incomplete characters wait for the next read.
+ stdout: string,
+ stderr: string,
+ status: option<s32>,
+ }
+
+ /// A program left running. Dropping the handle kills it if it still
+ /// runs, so a plugin cannot leak one; a plugin has at most 8 at a time
+ /// (the ninth `start` is `invalid`). They also end with the plugin:
+ /// stopping, disabling or reclaiming it kills what it started.
+ resource child {
+ /// What it printed since the last call, and its status once it ends.
+ poll: func(max-bytes: u32) -> result<chunk, error>;
+ /// Waits up to `timeout-ms` for it to end (0 only checks), then
+ /// reports what it printed since the last call.
+ wait: func(timeout-ms: u32) -> result<chunk, error>;
+ /// Writes to its stdin; fails once it ended or stdin was closed.
+ write: func(text: string) -> result<_, error>;
+ /// Closes stdin; fails once the program ended.
+ close-stdin: func() -> result<_, error>;
+ /// Kills it and reaps it, so its status is available afterwards.
+ kill: func() -> result<_, error>;
+ }
+
/// Runs `program` with `args` in `cwd`'s root (else the plugin's data
/// directory) and waits; cancelled with the task or call. Call it inside
/// a task for anything slow.
run: func(program: string, args: list<string>, cwd: option<borrow<project>>, stdin: option<string>) -> result<output, error>;
+
+ /// The same as `run`, with append-only environment variables (API 1.3).
+ run-command: func(cmd: command, cwd: option<borrow<project>>, stdin: option<string>) -> result<output, error>;
+
+ /// Starts `cmd` with piped stdin and stdout/stderr, and returns the
+ /// handle to it without waiting (API 1.3). Closing the invoking window
+ /// also ends its processes.
+ start: func(cmd: command, cwd: option<borrow<project>>) -> result<child, error>;
}
diff --git a/sdk/rust/openidea-plugin/tests/api/released/plugin.wit b/sdk/rust/openidea-plugin/tests/api/released/plugin.wit
index 12d2dc71b..8d1451ac3 100644
--- a/sdk/rust/openidea-plugin/tests/api/released/plugin.wit
+++ b/sdk/rust/openidea-plugin/tests/api/released/plugin.wit
@@ -3,20 +3,23 @@
/// API"); a 2.0 keeps 1.0 running through an adapter in the host.
///
/// A plugin is a WebAssembly component targeting the `plugin` world (or
-/// `plugin-syntax`). It runs sandboxed: no filesystem, network, environment
-/// or processes beyond WASI's clocks and randomness; everything else goes
-/// through the imports below, gated by the capabilities granted in
-/// `plugin.toml` (a missing one returns `error::denied`).
-package openidea:[email protected];
+/// `plugin-syntax`). It runs sandboxed: no file system, network, environment
+/// or processes beyond WASI's clocks and randomness; files are read through
+/// `fs` and `workspace`, and everything else goes through the imports below,
+/// gated by the capabilities granted in `plugin.toml` (a missing one returns
+/// `error::denied`).
+package openidea:[email protected];
world plugin {
import log;
import ui;
import storage;
+ import fs;
import workspace;
import editor;
import invocation;
import vcs;
+ import commit;
import events;
import tasks;
import diagnostics;
@@ -56,6 +59,43 @@ world plugin-indexing {
export document-indexer;
}
+/// A plugin with semantic tokens (`semantic-tokens` under `[[contributes.providers]]`).
+world plugin-semantic-tokens {
+ include plugin;
+ export semantic-tokens-provider;
+}
+
+/// A plugin adding to hovers (`hover` under `[[contributes.providers]]`).
+world plugin-hover {
+ include plugin;
+ export hover-provider;
+}
+
+/// A plugin with inlay hints (`inlay-hints` under `[[contributes.providers]]`).
+world plugin-inlay-hints {
+ include plugin;
+ export inlay-hints-provider;
+}
+
+/// A plugin whose views show in the Services tool window
+/// (`location = "services"`): their nodes' detail pane.
+world plugin-details {
+ include plugin;
+ export detail-provider;
+}
+
+/// A plugin with before-commit checks (`[[contributes.commitChecks]]`).
+world plugin-commit-checks {
+ include plugin;
+ export commit-checker;
+}
+
+/// A plugin with file-changing code actions (`file-actions`, next to `[[contributes.providers]]`).
+world plugin-file-actions {
+ include plugin;
+ export file-actions;
+}
+
/// Only the `syntax-provider` export: guests generate it next to `plugin`
/// (the component tools merge both into one component).
world syntax {
@@ -76,3 +116,55 @@ world views-provider {
world indexing {
export document-indexer;
}
+
+/// Only the `semantic-tokens-provider` export, generated next to `plugin` like `syntax`.
+world semantic-tokens {
+ export semantic-tokens-provider;
+}
+
+/// Only the `hover-provider` export, generated next to `plugin` like `syntax`.
+world hover {
+ export hover-provider;
+}
+
+/// Only the `inlay-hints-provider` export, generated next to `plugin` like `syntax`.
+world inlay-hints {
+ export inlay-hints-provider;
+}
+
+/// Only the `detail-provider` export, generated next to `plugin` like `syntax`.
+world details {
+ export detail-provider;
+}
+
+/// Only the `commit-checker` export, generated next to `plugin` like `syntax`.
+world commit-checks {
+ export commit-checker;
+}
+
+/// Only the `file-actions` export, generated next to `plugin` like `syntax`.
+world file-actions-provider {
+ export file-actions;
+}
+
+/// A plugin with project HTTP endpoints (`[[contributes.endpoints]]`).
+world plugin-endpoints {
+ include plugin;
+ export endpoints-provider;
+}
+
+/// Only the `endpoints-provider` export, generated next to `plugin` like `syntax`.
+world endpoints {
+ export endpoints-provider;
+}
+
+/// A plugin with diagnostics under `[[contributes.providers]]`.
+world plugin-diagnostics {
+ include plugin;
+ export diagnostics-provider;
+}
+
+/// `diagnostics` is already the released host interface name.
+world editor-diagnostics {
+ export diagnostics-provider;
+}
diff --git a/sdk/rust/openidea-plugin/tests/api/released/providers.wit b/sdk/rust/openidea-plugin/tests/api/released/providers.wit
index 00cb62a73..317eb81d1 100644
--- a/sdk/rust/openidea-plugin/tests/api/released/providers.wit
+++ b/sdk/rust/openidea-plugin/tests/api/released/providers.wit
@@ -1,4 +1,4 @@
-package openidea:[email protected];
+package openidea:[email protected];
/// Editor features a plugin provides for the languages it declares under
/// `[[contributes.providers]]` (the host calls only declared kinds). They run
@@ -75,6 +75,9 @@ interface providers {
code-actions: func(doc: document, selection: range) -> list<code-action>;
/// The edits of an action `code-actions` returned with `data`, when the
/// user picks it (the command budget applies, not the editor's 50 ms).
+ /// `ui.pick`, `pick-many`, `input` and `confirm` ask in the editor's window;
+ /// waiting is excluded from the budget. Other command/event-only APIs
+ /// remain unavailable.
resolve-code-action: func(doc: document, action: code-action) -> result<code-action, error>;
definition: func(doc: document, at: position) -> list<location>;
line-markers: func(doc: document) -> list<line-marker>;
diff --git a/sdk/rust/openidea-plugin/tests/api/released/semantic.wit b/sdk/rust/openidea-plugin/tests/api/released/semantic.wit
new file mode 100644
index 000000000..ec89fe405
--- /dev/null
+++ b/sdk/rust/openidea-plugin/tests/api/released/semantic.wit
@@ -0,0 +1,31 @@
+package openidea:[email protected];
+
+/// Optional export (world `plugin-semantic-tokens`): semantic colouring of
+/// documents of the languages declared with the `semantic-tokens` provider
+/// kind, including languages the plugin doesn't contribute. The tokens join
+/// the language server's and win where they overlap one.
+interface semantic-tokens-provider {
+ use types.{range};
+
+ /// The document to colour (the editor's text while it is open).
+ record document {
+ /// Absolute path.
+ path: string,
+ language: string,
+ version: u64,
+ text: string,
+ }
+
+ /// A token: part of one line.
+ record semantic-token {
+ range: range,
+ /// An LSP token type in kebab-case (`method`, `property`, `type`, …).
+ kind: string,
+ /// LSP token modifiers in kebab-case (`static`, `deprecated`, …).
+ modifiers: list<string>,
+ }
+
+ /// The document's tokens, at most 65,536; asked again after each edit,
+ /// under the edit-path budget.
+ semantic-tokens: func(doc: document) -> list<semantic-token>;
+}
diff --git a/sdk/rust/openidea-plugin/tests/api/released/types.wit b/sdk/rust/openidea-plugin/tests/api/released/types.wit
index 9a59769a8..8114a2db0 100644
--- a/sdk/rust/openidea-plugin/tests/api/released/types.wit
+++ b/sdk/rust/openidea-plugin/tests/api/released/types.wit
@@ -1,4 +1,4 @@
-package openidea:[email protected];
+package openidea:[email protected];
/// Shared types. Positions are 0-based lines and UTF-16 code unit columns,
/// as in the editor and LSP.
diff --git a/sdk/rust/openidea-plugin/tests/api/released/views.wit b/sdk/rust/openidea-plugin/tests/api/released/views.wit
index 945b600f9..78da35354 100644
--- a/sdk/rust/openidea-plugin/tests/api/released/views.wit
+++ b/sdk/rust/openidea-plugin/tests/api/released/views.wit
@@ -1,4 +1,4 @@
-package openidea:[email protected];
+package openidea:[email protected];
/// Declarative views: tool windows declared
/// under `[[contributes.views]]` and custom editors under
@@ -123,6 +123,7 @@ interface view-types {
/// What a plugin's code can ask of its views.
interface views {
use types.{error};
+ use detail-types.{process-log};
/// The view (or every custom editor of that id) shows outdated content:
/// the IDE renders it again.
@@ -136,9 +137,18 @@ interface views {
/// `program` (pinned by a `process:<program>` grant) with `args` in the
/// project root: long-running output (logs) and interactive sessions.
open-terminal: func(title: string, program: string, args: list<string>) -> result<_, error>;
+ /// Opens a read-only log tab in the editor area of the window the call
+ /// came from, following `log`'s program (pinned by a `process:<program>`
+ /// grant) in the project root, its toggles above the output: the tab a
+ /// web view opens with `open-log-tab`. Reopening `key` focuses that tab.
+ /// Only from a command or event of a window; `title` at most 256
+ /// characters, `key` 128, at most 32 toggles.
+ open-log-tab: func(key: string, title: string, log: process-log) -> result<_, error>;
/// Opens `path` (project-relative or absolute, inside the project) in an
/// editor of the window the call came from, the caret at `line` and
/// `column` (0-based; UTF-16 column): a view's links to code.
+ /// An absolute path inside the plugin's own fs.plugin-dir also works,
+ /// without project.read or an open project, from a command or event.
open-location: func(path: string, line: u32, column: u32) -> result<_, error>;
}
diff --git a/sdk/rust/openidea-plugin/tests/api/released/workspace.wit b/sdk/rust/openidea-plugin/tests/api/released/workspace.wit
index aa7214fb1..556dd0da8 100644
--- a/sdk/rust/openidea-plugin/tests/api/released/workspace.wit
+++ b/sdk/rust/openidea-plugin/tests/api/released/workspace.wit
@@ -1,7 +1,43 @@
-package openidea:[email protected];
+package openidea:[email protected];
interface workspace {
- use types.{error};
+ use types.{error, location};
+
+ /// Requests File > Open in this command/event's window (or a new window),
+ /// including the usual project trust prompt. Needs no capability.
+ /// `path` is an absolute directory path on the UI machine.
+ open-project: func(path: string, new-window: bool) -> result<_, error>;
+
+ /// The open project containing an absolute document path, or `none`.
+ /// Reading the returned project still requires `project.read`.
+ project-of: func(path: string) -> option<project>;
+
+ /// What a path inside a project is.
+ enum file-kind {
+ file,
+ directory,
+ symlink,
+ other,
+ }
+
+ /// Metadata of a path inside a project, as `stat` reports it.
+ record file-stat {
+ kind: file-kind,
+ /// Bytes, for a file.
+ size: u64,
+ /// Seconds since the Unix epoch; `none` when the file system does
+ /// not track it.
+ modified: option<u64>,
+ }
+
+ /// A symbol in the host's current in-memory project index (new in 1.3).
+ record symbol-info {
+ name: string,
+ /// Host symbol kind, in camelCase (`class`, `method`, `enumMember`, …).
+ kind: string,
+ container: option<string>,
+ location: location,
+ }
/// A project open in the IDE.
resource project {
@@ -9,12 +45,40 @@ interface workspace {
root: func() -> result<string, error>;
/// Reads a UTF-8 text file inside the project (absolute, or relative
/// to the root); paths leaving the root are refused. Unsaved editor
- /// contents win over the disk. Requires `project.read`.
+ /// contents win over the disk. A missing path is `not-found`.
+ /// Requires `project.read`.
read-file: func(path: string) -> result<string, error>;
+ /// Replaces the text of a file inside the project (absolute, or
+ /// relative to the root), or creates it with missing parent
+ /// directories; paths leaving the root are refused. Written in one
+ /// step (a reader never sees half of it), keeping the file's encoding
+ /// and BOM; a new file is UTF-8. An editor holding unsaved changes for
+ /// the file makes it `invalid` (save them first). Requires
+ /// `project.write`.
+ write-file: func(path: string, text: string) -> result<_, error>;
+ /// Whether `path` (absolute, or relative to the root) names an
+ /// existing file or directory — including hidden and ignored ones,
+ /// without reading any content. Paths leaving the root are refused.
+ /// Requires `project.read`.
+ exists: func(path: string) -> result<bool, error>;
+ /// Metadata of an existing path inside the project (absolute, or
+ /// relative to the root); a missing path is `not-found` and paths
+ /// leaving the root are refused. Requires `project.read`.
+ stat: func(path: string) -> result<file-stat, error>;
/// Project files whose root-relative path matches `glob` (`**/*Mapper.xml`),
/// at most `limit`, as absolute paths. Ignored and excluded files are
/// skipped. Requires `project.read`.
find-files: func(glob: string, limit: u32) -> result<list<string>, error>;
+ /// Fuzzy symbol search (CamelHump and container-qualified queries) over the
+ /// current index only; never starts or waits for a language server. Results
+ /// may be incomplete while indexing and ranges reflect the indexed text,
+ /// not necessarily unsaved edits. Empty queries return no symbols. Queries
+ /// over 256 UTF-8 bytes are invalid; limit is capped at 1000 (zero is
+ /// empty). Only paths readable under the root are returned; external
+ /// content roots are excluded. Cancellation returns cancelled; exceeding
+ /// the current call's deadline fails. A closed project is not-found.
+ /// Requires `project.read`.
+ symbols: func(query: string, limit: u32) -> result<list<symbol-info>, error>;
}
/// Projects open in any window. Requires `project.read`.
diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json
index 687908a3d..c3d2d8b1d 100644
--- a/src-tauri/tauri.conf.json
+++ b/src-tauri/tauri.conf.json
@@ -1,7 +1,7 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "OpenIDEA",
- "version": "0.1.38",
+ "version": "0.1.39",
"identifier": "ai.l0ng.openidea",
"build": {
"beforeDevCommand": "pnpm dev",