getInlayHints method

Future<Map<String, dynamic>> getInlayHints(
  1. String filePath,
  2. int startLine,
  3. int startCharacter,
  4. int endLine,
  5. int endCharacter,
)

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