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

Unified Diff: pkg/analysis_services/lib/src/correction/source_range.dart

Issue 438453002: Port and test more assists. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 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_services/lib/src/correction/source_range.dart
diff --git a/pkg/analysis_services/lib/src/correction/source_range.dart b/pkg/analysis_services/lib/src/correction/source_range.dart
index a0c3a46c5eedc42aab3b2f6159d12d8b973c9b23..f0bc18c10855aefb6c83c2ee2e2ef45f54b07d09 100644
--- a/pkg/analysis_services/lib/src/correction/source_range.dart
+++ b/pkg/analysis_services/lib/src/correction/source_range.dart
@@ -24,9 +24,14 @@ SourceRange rangeEndEnd(a, b) {
return new SourceRange(offset, length);
}
+SourceRange rangeEndLength(a, int length) {
+ int offset = a is int ? a : a.end;
+ return new SourceRange(offset, length);
+}
+
SourceRange rangeEndStart(a, b) {
int offset = a.end;
- var length = b.offset - offset;
+ var length = (b is int ? b : b.offset) - offset;
return new SourceRange(offset, length);
}

Powered by Google App Engine
This is Rietveld 408576698