mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-24 08:03:19 +00:00
Adds the optional hover-actions export (plugin API 1.14): plugins contribute a host-rendered action at the left edge of an editor line, revealed by hovering the first four columns of any line in its start-line..end-line range and anchored to its declaration line. The host keeps it left of the line's text, out of the intention bulb's row, never takes focus on hover, collapses several actions into an overflow menu, and lists them in the editor context menu for keyboard access. SDK HoverActions, a minimal fixture, API-compat tests, docs and regenerated components. Review fixes: the button is positioned on its first show (it was left unpositioned until the next mouse move), the styles use theme tokens, the overflow menu is the shared context menu, and the labels go through the text catalog. Co-authored-by: NeverKnowsTomorrow <36879844+NeverKnowsTomorrow@users.noreply.github.com>
64 lines
2.3 KiB
Plaintext
64 lines
2.3 KiB
Plaintext
package openidea:plugin@1.14.0;
|
|
|
|
/// Cross-file associations a plugin publishes for the files it declares under
|
|
/// `[[contributes.documentIndexers]]`. The host calls `index` in cancellable
|
|
/// background batches (on project open, then for changed files), keeps the
|
|
/// project-wide graph, and answers Go to Declaration and gutter markers from
|
|
/// it without calling the plugin again. Requires `project.read`; trusted
|
|
/// projects only.
|
|
interface document-indexer {
|
|
use types.{range};
|
|
|
|
/// A symbol the host's syntax support found in the document.
|
|
record symbol {
|
|
name: string,
|
|
/// class, interface, method, field, … as in the structure view.
|
|
kind: string,
|
|
/// The enclosing symbol's name.
|
|
container: option<string>,
|
|
range: range,
|
|
}
|
|
|
|
/// The document to index: the editor's text while it is open, else the file's.
|
|
record document {
|
|
/// Absolute path.
|
|
path: string,
|
|
text: string,
|
|
symbols: list<symbol>,
|
|
}
|
|
|
|
/// A range of the document tied to a key the plugin chooses
|
|
/// (`com.example.UserMapper#findById`, say). Keys are compared as is.
|
|
/// Ranges lie inside the document; an empty one marks a position (a
|
|
/// definition that is the whole file, at its start): Go to Declaration
|
|
/// lands there, Find Usages and Rename skip it.
|
|
record anchor {
|
|
key: string,
|
|
range: range,
|
|
}
|
|
|
|
/// Keys starting with `prefix` also resolve as if they started with
|
|
/// `target`; both end with `#`. A mapper that extends another finds the
|
|
/// inherited statements this way.
|
|
record alias {
|
|
prefix: string,
|
|
target: string,
|
|
}
|
|
|
|
/// What one document contributes; replaces its previous edges.
|
|
record edges {
|
|
/// Where keys are declared.
|
|
definitions: list<anchor>,
|
|
/// Ranges that go to the definitions of their key (Go to Declaration,
|
|
/// Ctrl/⌘-click). Elsewhere the language server answers as usual.
|
|
references: list<anchor>,
|
|
aliases: list<alias>,
|
|
/// Gutter icons on their first line that go to the definitions of their key.
|
|
markers: list<anchor>,
|
|
}
|
|
|
|
/// At most 4,096 definitions and references and 256 aliases per document;
|
|
/// a document over the limits is reported as not indexed.
|
|
index: func(doc: document) -> edges;
|
|
}
|