Файли
openidea/wit/hover-actions.wit
T
Anka Tamaтаxirf 2bbba9b945 feat(plugins): overlays, web pages floating over the workbench (API 1.18) (#6046)
[[contributes.overlays]] declares a package web page that floats over the workbench at one of nine anchors while its when clause holds. It never takes the keyboard focus when shown (out of the tab order), sits under dialogs, popups and notifications, and can let every click through (interactive = false). The page moves and resizes itself with openidea.overlay.get() / place({ anchor, width, height }); sizes are clamped to 40-800 px. It needs no code and no capability, since the page sees nothing of the IDE.

Overlays are gated on plugin API 1.18.0 (package openidea:[email protected].0, engine, SDK, api_compat, rebuilt components); 1.17 is listed as shipped with 0.1.53.

Part of #6012

Co-authored-by: xirf <[email protected]>
2026-11-26 20:11:03 +08:00

41 рядки
1.4 KiB
Plaintext

package openidea:[email protected];
/// Optional export (world `plugin-hover-actions`): clickable actions rendered
/// at the left edge of a line and revealed while the pointer is in the leftmost
/// editing-area strip of the action's line range.
interface hover-actions {
use language-features.{document};
/// An action drawn at the left edge of `line`.
record hover-action {
/// The line the button is drawn on; normally the declaration line.
line: u32,
/// First line whose left strip reveals this action, inclusive.
start-line: u32,
/// Last line whose left strip reveals this action, inclusive.
end-line: u32,
/// Optional icon: a registered icon name or a declared manifest SVG path.
icon: option<string>,
/// Text shown when no icon is present, or beside the icon.
label: string,
tooltip: option<string>,
/// This plugin's declared command.
command: string,
argument: option<string>,
}
/// Actions for the visible document, under the editor-provider budget.
hover-actions: func(doc: document) -> list<hover-action>;
}
/// The optional export-only world the SDK merges with `plugin`.
world hover-actions-provider {
export hover-actions;
}
/// The host-side world used to instantiate a component that exports it.
world plugin-hover-actions {
include plugin;
export hover-actions;
}