getDefinition method

Future<Map<String, dynamic>> getDefinition(
  1. String filePath,
  2. int line,
  3. int character
)

Gets the definition location for a symbol at the specified position.

Returns a map with location information, or an empty map if not found.

Implementation

Future<Map<String, dynamic>> getDefinition(
  String filePath,
  int line,
  int character,
) async {
  final response = await _sendRequest(
    method: 'textDocument/definition',
    params: _commonParams(filePath, line, character),
  );
  if (response['result'] == null) return {};
  return response['result']?[0] ?? '';
}