Файли
openidea/wit/syntax-decorations.wit
T
RuyimgByCN b83c1a60c2 feat(plugins): run lifecycle events, run.stop, configuration upsert, Java debug attach, log tail tabs and console toolbar (API 1.21) (#7776)
Plugin API 1.21:
- run-started events, and run-exited for user-launched plugin configurations (plugins on API 1.21 only).
- run.stop(id) for runs of the plugin's own configurations; run.upsert-configuration and run.open-edit-configurations for the plugin's own run configuration types.
- prepareCommand receives the run/debug mode; plugin configurations can declare a loopback JDWP attach target.
- runConfigTypes.ownsBeforeLaunch, log file tabs in the run console (plugin_run_log_tail, authorised by the plugin's project.read / fs.read grants), and the runConsole.toolbar menu in the Run and Debug consoles.

Review fixes: RunView log tab state keyed by the string session id, tail chunks cut on a UTF-8 boundary, user-run exits gated to API 1.21.

Co-authored-by: RuyimgByCN <[email protected]>
2026-12-03 20:29:31 +08:00

70 рядки
2.7 KiB
Plaintext

package openidea:[email protected];
/// Optional export (world `plugin-syntax-decorations`): foreground marks for
/// documents of the languages declared with the `syntax-decorations` provider
/// kind. The host sends the ranges it is painting and a bounded slice of the
/// editor's existing syntax tree. The plugin does not parse, and the host does
/// not run a second parser.
///
/// Node `name`s come from that editor's parser. They are not a stable
/// vocabulary across languages or parser implementations. Ranges use the
/// shared UTF-16 `types.range` (0-based line, UTF-16 column).
///
/// A mark paints its `foreground` colours when it has them, otherwise its
/// `token`: `rainbow-1` … `rainbow-5`, which the host maps onto the theme's
/// existing `--syn-rainbow-1` … `--syn-rainbow-5` colours. A mark with an
/// invalid colour or an unknown token is dropped. Only the foreground changes.
/// API 1.20.
interface syntax-decorations-provider {
use types.{range};
/// The open editor the host is asking about. `version` is the host
/// buffer version at the start of this call.
record document {
path: string,
language: string,
version: u64,
}
/// One node of the editor's current syntax tree. `parent` is an index
/// into `decoration-request.nodes`. Index 0 is a real node. The index
/// may be greater than the child's, because the list is ordered by
/// position, not parent-before-child. `parent` is none when that
/// ancestor was not included: the tree may be partial, and the node
/// budget can drop an ancestor while keeping the child. None does not
/// mean the node is the root of the real tree. `name` belongs to the
/// editor's parser and is not stable across parsers.
record syntax-node {
name: string,
range: range,
parent: option<u32>,
}
record decoration-request {
document: document,
/// Ranges the host wants marks for (visible ranges and sticky header
/// lines). At most 32.
ranges: list<range>,
/// At most 8192 nodes.
nodes: list<syntax-node>,
}
/// Foreground colours of a mark: `#rrggbb`, or `#rrggbbaa` with an alpha
/// (`ff` fully opaque), one for dark themes and one for light themes.
record syntax-foreground {
dark: string,
light: string,
}
/// A foreground mark. `token` is `rainbow-1` … `rainbow-5`, and may be
/// empty when `foreground` is set.
record syntax-mark {
range: range,
token: string,
foreground: option<syntax-foreground>,
}
/// Marks for `request`, under the edit-path budget. At most 10,000 are kept.
syntax-decorations: func(request: decoration-request) -> list<syntax-mark>;
}