getInlayHints method
Requests inlay hints for a specific range in the document.
Sends a textDocument/inlayHint request for filePath covering the
range from (startLine, startCharacter) to (endLine, endCharacter).
Inlay hints are small inline annotations (such as parameter names or
inferred types) provided by the server. This method returns the raw
server response as a map; callers should inspect response['result'] to
obtain the list of inlay hints.
Implementation
Future<Map<String, dynamic>> getInlayHints(
String filePath,
int startLine,
int startCharacter,
int endLine,
int endCharacter,
) async {
if (!capabilities.inlayHint) return {'result': []};
final response = await _sendRequest(
method: "textDocument/inlayHint",
params: {
'textDocument': {'uri': Uri.file(filePath).toString()},
'range': {
'start': {'line': startLine, 'character': startCharacter},
'end': {'line': endLine, 'character': endCharacter},
},
},
);
return response;
}