ui5-language-assistant
ui5-language-assistant copied to clipboard
Add range information to Hover result
The range for which the hover applies to should be returned. For example, the entire tag name (including the prefix) should be returned for tags. This improves the UX as it lets the user know what the hover describes (by default it shows the word that the cursor is on). The hover result is calculated here: https://github.com/SAP/ui5-language-assistant/blob/d8eb81a52956280f6fd0afffd6ee7f76cffd9f68/packages/language-server/src/hover.ts#L38
In the LSP specs this matches Hover.range
- https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_hover
/**
* The result of a hover request.
*/
export interface Hover {
/**
* The hover's content
*/
contents: MarkedString | MarkedString[] | MarkupContent;
/**
* An optional range is a range inside a text document
* that is used to visualize a hover, e.g. by changing the background color.
*/
range?: Range;
}