renameSymbol method

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

Renames a symbol at the given position across the workspace.

Returns a workspace edit containing all required text changes.

Implementation

Future<Map<String, dynamic>> renameSymbol(
  String filePath,
  int line,
  int character,
  String newName,
) async {
  final response = await _sendRequest(
    method: 'textDocument/rename',
    params: {..._commonParams(filePath, line, character), 'newName': newName},
  );

  return response['result'] ?? {};
}