getRefactoring method

Future<RefactoringResult?> getRefactoring(
  1. String? kind,
  2. String? file,
  3. int? offset,
  4. int? length,
  5. bool? validateOnly, {
  6. RefactoringOptions? options,
})

Get the changes required to perform a refactoring.

If another refactoring request is received during the processing of this one, an error of type REFACTORING_REQUEST_CANCELLED will be generated.

Implementation

Future<RefactoringResult?> getRefactoring(
    String? kind, String? file, int? offset, int? length, bool? validateOnly,
    {RefactoringOptions? options}) {
  final Map m = {
    'kind': kind,
    'file': file,
    'offset': offset,
    'length': length,
    'validateOnly': validateOnly
  };
  if (options != null) m['options'] = options;
  return _call('edit.getRefactoring', m)
      .then((m) => RefactoringResult.parse(kind, m));
}