editorHoverDescriptions
editorHoverDescriptions<
T>(callback,options):BasicExtension<T>
Defined in: extensions/hover.ts:123
Utility that makes it easier to add hover descriptions to tokens.
Type Parameters
Section titled “Type Parameters”T extends object
Parameters
Section titled “Parameters”callback
Section titled “callback”Function called when a token with only textual children is hovered.
The function gets called with the following arguments:
types: Array with the token’s type as the first element, followed by any alises.language: The language at the token’s position.text: ThetextContentof the token.element: The<span>element of the hovered token.
Lastly, the function should return an array of children that get added to the tooltip.
If null or undefined is returned, no tooltip is shown for the token.
options
Section titled “options”EditorHoverOptions = {}
Options for configuring the size and position of the tooltip and the line filter for better performance.