ui5-language-assistant icon indicating copy to clipboard operation
ui5-language-assistant copied to clipboard

Add range information to Hover result

Open tal-sapan opened this issue 4 years ago • 1 comments

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

tal-sapan avatar Jul 20 '20 14:07 tal-sapan

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;
}

bd82 avatar Jul 21 '20 08:07 bd82