Files
openidea/wit/decorations.wit
T
l0ng-ai a8036ce6fa feat(plugins): open two texts in the diff viewer (API 1.7) (#3055)
Plugins could show their own content in an editor tab (open-content-tab) but
could open the diff viewer only as the reply to one of that tab's actions. A
review plugin (a merge request's files, say) had no way to show a file's
before and after.

views.open-diff opens two texts in the invoking window's diff viewer, with
optional labels and title and a file name that picks the syntax highlighting;
web views send { op: "open-diff", ... }. The SDK wraps it as host::open_diff
with a mock. The plugin API moves to 1.7.0 (1.6.0 is released) and the checked-in
components are rebuilt.
2026-11-13 12:02:36 +08:00

23 lines
1.4 KiB
Plaintext

package openidea:plugin@1.7.0;
/// Project-scoped decorations (API 1.4). Requires project.read; paths must be inside
/// an open project. Sets belong to the plugin and disappear when it stops.
/// Styles: highlight, search, added, modified, removed, warning, error, info,
/// underline, strikethrough, muted. Unknown styles are ignored. Theme tokens only.
interface decorations {
use types.{error, range};
/// An editor annotation; after is plain text shown after the range.
record decoration { range: range, style: string, hover: option<string>, after: option<string> }
/// A project-tree annotation; badge is at most two Unicode characters.
record file-decoration { badge: option<string>, style: string, tooltip: option<string> }
/// Replace this set for a file. At most 10,000 items/file and 50 editor sets/plugin.
/// Metadata is bounded to 4 MiB per plugin. Unknown styles are ignored.
set: func(path: string, set-id: string, items: list<decoration>) -> result<_, error>;
/// Remove this editor set from every file/project.
clear: func(set-id: string) -> result<_, error>;
/// Replace this set's tree annotation for a file; at most 50 tree sets/plugin.
set-file: func(path: string, set-id: string, item: file-decoration) -> result<_, error>;
/// Remove this tree set from every file/project.
clear-file: func(set-id: string) -> result<_, error>;
}