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

Unified Diff: pkg/source_maps/lib/refactor.dart

Issue 421723004: Remove support for the old Span classes from source_maps. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes 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
« no previous file with comments | « pkg/source_maps/lib/printer.dart ('k') | pkg/source_maps/lib/source_maps.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/source_maps/lib/refactor.dart
diff --git a/pkg/source_maps/lib/refactor.dart b/pkg/source_maps/lib/refactor.dart
index 47ce2ed90cd9d2eef7951ea9f900c474675eb0f6..a33b86bec0d39184ba63fa0905c392ab72e00887 100644
--- a/pkg/source_maps/lib/refactor.dart
+++ b/pkg/source_maps/lib/refactor.dart
@@ -8,9 +8,9 @@
/// [guessIndent] helps to guess the appropriate indentiation for the new code.
library source_maps.refactor;
-import 'span.dart';
+import 'package:source_span/source_span.dart';
+
import 'printer.dart';
-import 'src/span_wrapper.dart';
/// Editable text transaction.
///
@@ -22,12 +22,7 @@ class TextEditTransaction {
final _edits = <_TextEdit>[];
/// Creates a new transaction.
- ///
- /// [file] can be either a `source_map` [SourceFile] or a `source_span`
- /// `SourceFile`. Using a `source_map` [SourceFile] is deprecated and will be
- /// unsupported in version 0.10.0.
- TextEditTransaction(this.original, file)
- : file = SourceFileWrapper.wrap(file);
+ TextEditTransaction(this.original, this.file);
bool get hasEdits => _edits.length > 0;
@@ -38,8 +33,8 @@ class TextEditTransaction {
_edits.add(new _TextEdit(begin, end, replacement));
}
- /// Create a source map [Location] for [offset].
- Location _loc(int offset) =>
+ /// Create a source map [SourceLocation] for [offset].
+ SourceLocation _loc(int offset) =>
file != null ? file.location(offset) : null;
/// Applies all pending [edit]s and returns a [NestedPrinter] containing the
@@ -62,7 +57,7 @@ class TextEditTransaction {
for (var edit in _edits) {
if (consumed > edit.begin) {
var sb = new StringBuffer();
- sb..write(file.location(edit.begin).formatString)
+ sb..write(file.location(edit.begin).toolString)
..write(': overlapping edits. Insert at offset ')
..write(edit.begin)
..write(' but have consumed ')
« no previous file with comments | « pkg/source_maps/lib/printer.dart ('k') | pkg/source_maps/lib/source_maps.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698