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

Unified Diff: pkg/analysis_server/lib/src/services/correction/flutter_util.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/correction/flutter_util.dart
diff --git a/pkg/analysis_server/lib/src/services/correction/flutter_util.dart b/pkg/analysis_server/lib/src/services/correction/flutter_util.dart
index 469263e4c89616314c03992c09108a549c75b7ce..3f866b107802c28da6299ae14843dbc1ccfe129c 100644
--- a/pkg/analysis_server/lib/src/services/correction/flutter_util.dart
+++ b/pkg/analysis_server/lib/src/services/correction/flutter_util.dart
@@ -7,6 +7,7 @@ library services.src.correction.flutter_util;
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/type.dart';
+import 'package:analyzer/src/generated/source.dart';
const _FLUTTER_WIDGET_NAME = "Widget";
const _FLUTTER_WIDGET_URI = "package:flutter/src/widgets/framework.dart";
@@ -22,7 +23,6 @@ void convertFlutterChildToChildren(
Function _addInsertEdit,
Function _addRemoveEdit,
Function _addReplaceEdit,
- Function rangeStartLength,
Function rangeNode) {
int childLoc = namedExp.offset + 'child'.length;
_addInsertEdit(childLoc, 'ren');
@@ -44,7 +44,7 @@ void convertFlutterChildToChildren(
String prefix = separator.contains(eol) ? "" : "$eol$indentNew";
if (prefix.isEmpty) {
_addInsertEdit(namedExp.offset + 'child:'.length, ' <Widget>[');
- _addRemoveEdit(rangeStartLength(childArg.offset - 2, 2));
+ _addRemoveEdit(new SourceRange(childArg.offset - 2, 2));
} else {
_addInsertEdit(listLoc, '<Widget>[');
}

Powered by Google App Engine
This is Rietveld 408576698