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

Unified Diff: pkg/analyzer/lib/src/generated/source.dart

Issue 1622713002: Add a count of total lines to status performance page (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fixed bug Created 4 years, 11 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/analysis_server/lib/src/status/get_handler.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 950f36e0abf325bacace6e47493e8f3f2bababef..8d5d3fde643866a2d7d5c6141faf7ce670766b64 100644
--- a/pkg/analyzer/lib/src/generated/source.dart
+++ b/pkg/analyzer/lib/src/generated/source.dart
@@ -178,12 +178,12 @@ class DartUriResolver extends UriResolver {
}
/**
- * Instances of the class `LineInfo` encapsulate information about line and column information
- * within a source file.
+ * Information about line and column information within a source file.
*/
class LineInfo {
/**
- * An array containing the offsets of the first character of each line in the source code.
+ * A list containing the offsets of the first character of each line in the
+ * source code.
*/
final List<int> _lineStarts;
@@ -194,10 +194,8 @@ class LineInfo {
int _previousLine = 0;
/**
- * Initialize a newly created set of line information to represent the data encoded in the given
- * array.
- *
- * @param lineStarts the offsets of the first character of each line in the source code
+ * 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) {
@@ -208,10 +206,12 @@ class LineInfo {
}
/**
- * Return the location information for the character at the given offset.
- *
- * @param offset the offset of the character for which location information is to be returned
- * @return the location information for the character at the given offset
+ * 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) {
var min = 0;
« no previous file with comments | « pkg/analysis_server/lib/src/status/get_handler.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698