getDefinition method

Future<Map<String, dynamic>> getDefinition(
  1. int line,
  2. 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(int line, int character) async {
  final response = await _sendRequest(
    method: 'textDocument/definition',
    params: _commonParams(line, character),
  );
  if (response['result'] == null) return {};
  return response['result']?[0] ?? '';
}