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

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

Issue 1454813002: Add server utilities for the stress test (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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/test/stress/utilities/server.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 1a4751678597008be0e04437eaa118bd5e69fd35..5327c984988ba4c498347c3aa6829290bf119987 100644
--- a/pkg/analyzer/lib/src/generated/source.dart
+++ b/pkg/analyzer/lib/src/generated/source.dart
@@ -209,6 +209,17 @@ class LineInfo {
}
/**
+ * Return the offset of the first character on the line with the given
+ * [lineNumber].
+ */
+ int getLineOffset(int lineNumber) {
+ if (lineNumber < 0 || lineNumber >= _lineStarts.length) {
+ throw new ArgumentError('Invalid line number: $lineNumber');
+ }
+ return _lineStarts[lineNumber];
+ }
+
+ /**
* 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
« no previous file with comments | « pkg/analysis_server/test/stress/utilities/server.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698