| Index: pkg/analyzer/lib/src/generated/source.dart
|
| diff --git a/pkg/analyzer/lib/src/generated/source.dart b/pkg/analyzer/lib/src/generated/source.dart
|
| index 8d5d3fde643866a2d7d5c6141faf7ce670766b64..0fae83a01853d234957ecf8969010ff3314a0e34 100644
|
| --- a/pkg/analyzer/lib/src/generated/source.dart
|
| +++ b/pkg/analyzer/lib/src/generated/source.dart
|
| @@ -197,7 +197,13 @@ class LineInfo {
|
| * Initialize a newly created set of line information to represent the data
|
| * encoded in the given list of [_lineStarts].
|
| */
|
| - LineInfo(this._lineStarts) {
|
| + factory LineInfo(List<int> _lineStarts) => new LineInfoWithCount(_lineStarts);
|
| +
|
| + /**
|
| + * Initialize a newly created set of line information to represent the data
|
| + * encoded in the given list of [_lineStarts].
|
| + */
|
| + LineInfo._(this._lineStarts) {
|
| if (_lineStarts == null) {
|
| throw new IllegalArgumentException("lineStarts must be non-null");
|
| } else if (_lineStarts.length < 1) {
|
| @@ -206,11 +212,6 @@ class LineInfo {
|
| }
|
|
|
| /**
|
| - * Return the number of lines in the file.
|
| - */
|
| - int get lineCount => _lineStarts.length;
|
| -
|
| - /**
|
| * Return the location information for the character at the given [offset].
|
| */
|
| LineInfo_Location getLocation(int offset) {
|
| @@ -288,6 +289,26 @@ class LineInfo_Location {
|
| }
|
|
|
| /**
|
| + * Information about line and column information within a source file,
|
| + * including a count of the total number of lines.
|
| + *
|
| + * TODO(paulberry): in the next major version roll of analyzer, merge this
|
| + * class into [LineInfo].
|
| + */
|
| +class LineInfoWithCount extends LineInfo {
|
| + /**
|
| + * Initialize a newly created set of line information to represent the data
|
| + * encoded in the given list of [_lineStarts].
|
| + */
|
| + LineInfoWithCount(List<int> _lineStarts) : super._(_lineStarts);
|
| +
|
| + /**
|
| + * Return the number of lines in the file.
|
| + */
|
| + int get lineCount => _lineStarts.length;
|
| +}
|
| +
|
| +/**
|
| * Instances of interface `LocalSourcePredicate` are used to determine if the given
|
| * [Source] is "local" in some sense, so can be updated.
|
| */
|
|
|