getDocumentHighlight method
Gets all highlights for a symbol at the specified position in the document.
Returns a list of DocumentHighlight objects, each containing a range and highlight kind. Used for highlighting all occurrences of a symbol when clicked.
Implementation
Future<List<dynamic>> getDocumentHighlight(
String filePath,
int line,
int character,
) async {
if (!capabilities.documentHighlight) return [];
final response = await _sendRequest(
method: 'textDocument/documentHighlight',
params: _commonParams(filePath, line, character),
);
final result = response['result'];
if (result is! List) return [];
return result;
}