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

Side by Side Diff: pkg/analyzer/lib/src/task/dart_work_manager.dart

Issue 1155473003: Don't schedule LIBRARY_ERRORS_READY for libraries that should not be analyzed. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 7 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
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.src.task.dart_work_manager; 5 library analyzer.src.task.dart_work_manager;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/src/context/cache.dart'; 9 import 'package:analyzer/src/context/cache.dart';
10 import 'package:analyzer/src/generated/engine.dart' 10 import 'package:analyzer/src/generated/engine.dart'
11 show 11 show
12 AnalysisEngine, 12 AnalysisEngine,
13 AnalysisErrorInfo, 13 AnalysisErrorInfo,
14 AnalysisErrorInfoImpl, 14 AnalysisErrorInfoImpl,
15 AnalysisOptions,
15 CacheState, 16 CacheState,
16 InternalAnalysisContext; 17 InternalAnalysisContext;
17 import 'package:analyzer/src/generated/error.dart'; 18 import 'package:analyzer/src/generated/error.dart';
18 import 'package:analyzer/src/generated/source.dart'; 19 import 'package:analyzer/src/generated/source.dart';
19 import 'package:analyzer/src/generated/utilities_collection.dart'; 20 import 'package:analyzer/src/generated/utilities_collection.dart';
20 import 'package:analyzer/src/task/dart.dart'; 21 import 'package:analyzer/src/task/dart.dart';
21 import 'package:analyzer/src/task/driver.dart'; 22 import 'package:analyzer/src/task/driver.dart';
22 import 'package:analyzer/task/dart.dart'; 23 import 'package:analyzer/task/dart.dart';
23 import 'package:analyzer/task/general.dart'; 24 import 'package:analyzer/task/general.dart';
24 import 'package:analyzer/task/model.dart'; 25 import 'package:analyzer/task/model.dart';
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 } 248 }
248 249
249 @override 250 @override
250 void resultsComputed( 251 void resultsComputed(
251 AnalysisTarget target, Map<ResultDescriptor, dynamic> outputs) { 252 AnalysisTarget target, Map<ResultDescriptor, dynamic> outputs) {
252 // Organize sources. 253 // Organize sources.
253 if (_isDartSource(target)) { 254 if (_isDartSource(target)) {
254 SourceKind kind = outputs[SOURCE_KIND]; 255 SourceKind kind = outputs[SOURCE_KIND];
255 if (kind != null) { 256 if (kind != null) {
256 unknownSourceQueue.remove(target); 257 unknownSourceQueue.remove(target);
257 if (kind == SourceKind.LIBRARY) { 258 if (kind == SourceKind.LIBRARY &&
259 context.shouldErrorsBeAnalyzed(target, null)) {
258 librarySourceQueue.add(target); 260 librarySourceQueue.add(target);
259 } 261 }
260 } 262 }
261 } 263 }
262 // Update parts in libraries. 264 // Update parts in libraries.
263 if (_isDartSource(target)) { 265 if (_isDartSource(target)) {
264 Source library = target; 266 Source library = target;
265 List<Source> includedParts = outputs[INCLUDED_PARTS]; 267 List<Source> includedParts = outputs[INCLUDED_PARTS];
266 if (includedParts != null) { 268 if (includedParts != null) {
267 libraryPartsMap[library] = includedParts; 269 libraryPartsMap[library] = includedParts;
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 339
338 static bool _isDartSource(AnalysisTarget target) { 340 static bool _isDartSource(AnalysisTarget target) {
339 return target is Source && AnalysisEngine.isDartFileName(target.fullName); 341 return target is Source && AnalysisEngine.isDartFileName(target.fullName);
340 } 342 }
341 343
342 static bool _isErrorResult(ResultDescriptor descriptor) { 344 static bool _isErrorResult(ResultDescriptor descriptor) {
343 return _SOURCE_ERRORS.contains(descriptor) || 345 return _SOURCE_ERRORS.contains(descriptor) ||
344 _UNIT_ERRORS.contains(descriptor); 346 _UNIT_ERRORS.contains(descriptor);
345 } 347 }
346 } 348 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/engine.dart ('k') | pkg/analyzer/test/generated/engine_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698