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

Side by Side Diff: pkg/analyzer_cli/lib/src/analyzer_impl.dart

Issue 2656233004: Use AnalysisDriver.getErrors() to get cached errors for already analyzed files. (Closed)
Patch Set: Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « pkg/analyzer/test/src/dart/analysis/driver_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer_cli.src.analyzer_impl; 5 library analyzer_cli.src.analyzer_impl;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 import 'dart:io'; 9 import 'dart:io';
10 10
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 return await _analyze(printMode); 125 return await _analyze(printMode);
126 } 126 }
127 127
128 /// Fills [errorInfos] using [sources]. 128 /// Fills [errorInfos] using [sources].
129 Future<Null> prepareErrors() async { 129 Future<Null> prepareErrors() async {
130 PerformanceTag previous = _prepareErrorsTag.makeCurrent(); 130 PerformanceTag previous = _prepareErrorsTag.makeCurrent();
131 try { 131 try {
132 for (Source source in sources) { 132 for (Source source in sources) {
133 if (analysisDriver != null) { 133 if (analysisDriver != null) {
134 String path = source.fullName; 134 String path = source.fullName;
135 AnalysisResult analysisResult = await analysisDriver.getResult(path); 135 ErrorsResult errorsResult = await analysisDriver.getErrors(path);
136 errorInfos.add(new AnalysisErrorInfoImpl( 136 errorInfos.add(new AnalysisErrorInfoImpl(
137 analysisResult.errors, analysisResult.lineInfo)); 137 errorsResult.errors, errorsResult.lineInfo));
138 } else { 138 } else {
139 context.computeErrors(source); 139 context.computeErrors(source);
140 errorInfos.add(context.getErrors(source)); 140 errorInfos.add(context.getErrors(source));
141 } 141 }
142 } 142 }
143 } finally { 143 } finally {
144 previous.makeCurrent(); 144 previous.makeCurrent();
145 } 145 }
146 } 146 }
147 147
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 } 379 }
380 380
381 @override 381 @override
382 void logInformation(String message, [CaughtException exception]) { 382 void logInformation(String message, [CaughtException exception]) {
383 outSink.writeln(message); 383 outSink.writeln(message);
384 if (exception != null) { 384 if (exception != null) {
385 outSink.writeln(exception); 385 outSink.writeln(exception);
386 } 386 }
387 } 387 }
388 } 388 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/src/dart/analysis/driver_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698