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

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

Issue 2662693002: Call addFile() before getErrors() to actually get errors. (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 | « no previous file | 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 analysisDriver.addFile(path);
135 ErrorsResult errorsResult = await analysisDriver.getErrors(path); 136 ErrorsResult errorsResult = await analysisDriver.getErrors(path);
136 errorInfos.add(new AnalysisErrorInfoImpl( 137 errorInfos.add(new AnalysisErrorInfoImpl(
137 errorsResult.errors, errorsResult.lineInfo)); 138 errorsResult.errors, errorsResult.lineInfo));
138 } else { 139 } else {
139 context.computeErrors(source); 140 context.computeErrors(source);
140 errorInfos.add(context.getErrors(source)); 141 errorInfos.add(context.getErrors(source));
141 } 142 }
142 } 143 }
143 } finally { 144 } finally {
144 previous.makeCurrent(); 145 previous.makeCurrent();
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 } 380 }
380 381
381 @override 382 @override
382 void logInformation(String message, [CaughtException exception]) { 383 void logInformation(String message, [CaughtException exception]) {
383 outSink.writeln(message); 384 outSink.writeln(message);
384 if (exception != null) { 385 if (exception != null) {
385 outSink.writeln(exception); 386 outSink.writeln(exception);
386 } 387 }
387 } 388 }
388 } 389 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698