package openidea:plugin@1.21.0; /// 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, } record decoration-request { document: document, /// Ranges the host wants marks for (visible ranges and sticky header /// lines). At most 32. ranges: list, /// At most 8192 nodes. nodes: list, } /// 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, } /// Marks for `request`, under the edit-path budget. At most 10,000 are kept. syntax-decorations: func(request: decoration-request) -> list; }