Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Unified Diff: pkg/analysis_server/lib/src/services/refactoring/convert_getter_to_method.dart

Issue 2869083002: Convert server to use RangeFactory (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_server/lib/src/services/refactoring/convert_getter_to_method.dart
diff --git a/pkg/analysis_server/lib/src/services/refactoring/convert_getter_to_method.dart b/pkg/analysis_server/lib/src/services/refactoring/convert_getter_to_method.dart
index 0dac920f65c6f24ded500f9e392729e872890a83..110c3b48c3cbd02135a985c450fee36ff0eba4fc 100644
--- a/pkg/analysis_server/lib/src/services/refactoring/convert_getter_to_method.dart
+++ b/pkg/analysis_server/lib/src/services/refactoring/convert_getter_to_method.dart
@@ -7,7 +7,6 @@ library services.src.refactoring.convert_getter_to_getter;
import 'dart:async';
import 'package:analysis_server/src/protocol_server.dart' hide Element;
-import 'package:analysis_server/src/services/correction/source_range.dart';
import 'package:analysis_server/src/services/correction/status.dart';
import 'package:analysis_server/src/services/refactoring/refactoring.dart';
import 'package:analysis_server/src/services/refactoring/refactoring_internal.dart';
@@ -18,6 +17,7 @@ import 'package:analyzer/dart/ast/token.dart';
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/src/dart/element/ast_provider.dart';
import 'package:analyzer/src/generated/source.dart';
+import 'package:analyzer_plugin/utilities/range_factory.dart';
/**
* [ConvertMethodToGetterRefactoring] implementation.
@@ -103,13 +103,14 @@ class ConvertGetterToMethodRefactoringImpl extends RefactoringImpl
}
// remove "get "
if (getKeyword != null) {
- SourceRange getRange = rangeStartEnd(getKeyword, element.nameOffset);
+ SourceRange getRange =
+ range.offsetEndIndex(getKeyword.offset, element.nameOffset);
SourceEdit edit = newSourceEdit_range(getRange, '');
doSourceChange_addElementEdit(change, element, edit);
}
// add parameters "()"
{
- SourceEdit edit = new SourceEdit(rangeElementName(element).end, 0, '()');
+ SourceEdit edit = new SourceEdit(range.elementName(element).end, 0, '()');
doSourceChange_addElementEdit(change, element, edit);
}
}

Powered by Google App Engine
This is Rietveld 408576698