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

Unified Diff: pkg/analysis_server/lib/src/status/get_handler.dart

Issue 1625783002: Rework recent changes to LineInfo to be backward compatible. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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 | « no previous file | pkg/analyzer/lib/src/generated/source.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/status/get_handler.dart
diff --git a/pkg/analysis_server/lib/src/status/get_handler.dart b/pkg/analysis_server/lib/src/status/get_handler.dart
index b97ef3ba678916c8a9823a5119f2e6f14f049372..b20d6426102bac017c8d832cb63fc0ecce846657 100644
--- a/pkg/analysis_server/lib/src/status/get_handler.dart
+++ b/pkg/analysis_server/lib/src/status/get_handler.dart
@@ -691,15 +691,16 @@ class GetHandler {
int lineCount(Set<Source> sources, bool explicit) {
return sources.fold(0, (int previousTotal, Source source) {
LineInfo lineInfo = context.getLineInfo(source);
- if (lineInfo == null) {
- return previousTotal;
- }
- if (explicit) {
- explicitLineInfoCount++;
+ if (lineInfo is LineInfoWithCount) {
+ if (explicit) {
+ explicitLineInfoCount++;
+ } else {
+ implicitLineInfoCount++;
+ }
+ return previousTotal + lineInfo.lineCount;
} else {
- implicitLineInfoCount++;
+ return previousTotal;
}
- return previousTotal + lineInfo.lineCount;
});
}
explicitSourceCount += explicitSources.length;
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/source.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698