| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 engine; | 5 library engine; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 import 'dart:math' as math; | 9 import 'dart:math' as math; |
| 10 | 10 |
| 11 import 'package:analyzer/src/cancelable_future.dart'; | 11 import 'package:analyzer/src/cancelable_future.dart'; |
| 12 import 'package:analyzer/src/context/cache.dart' as cache; | 12 import 'package:analyzer/src/context/cache.dart' as cache; |
| 13 import 'package:analyzer/src/context/context.dart' as newContext; | 13 import 'package:analyzer/src/context/context.dart' as newContext; |
| 14 import 'package:analyzer/src/generated/incremental_resolution_validator.dart'; | 14 import 'package:analyzer/src/generated/incremental_resolution_validator.dart'; |
| 15 import 'package:analyzer/src/plugin/command_line_plugin.dart'; | 15 import 'package:analyzer/src/plugin/command_line_plugin.dart'; |
| 16 import 'package:analyzer/src/plugin/engine_plugin.dart'; | 16 import 'package:analyzer/src/plugin/engine_plugin.dart'; |
| 17 import 'package:analyzer/src/plugin/options_plugin.dart'; | 17 import 'package:analyzer/src/plugin/options_plugin.dart'; |
| 18 import 'package:analyzer/src/services/lint.dart'; | 18 import 'package:analyzer/src/services/lint.dart'; |
| 19 import 'package:analyzer/src/task/manager.dart'; | 19 import 'package:analyzer/src/task/manager.dart'; |
| 20 import 'package:analyzer/task/dart.dart'; | 20 import 'package:analyzer/task/dart.dart'; |
| 21 import 'package:analyzer/task/model.dart' as newContext; |
| 21 import 'package:analyzer/task/model.dart'; | 22 import 'package:analyzer/task/model.dart'; |
| 22 import 'package:html/dom.dart' show Document; | 23 import 'package:html/dom.dart' show Document; |
| 23 import 'package:plugin/manager.dart'; | 24 import 'package:plugin/manager.dart'; |
| 24 import 'package:plugin/plugin.dart'; | 25 import 'package:plugin/plugin.dart'; |
| 25 | 26 |
| 26 import '../../instrumentation/instrumentation.dart'; | 27 import '../../instrumentation/instrumentation.dart'; |
| 27 import 'ast.dart'; | 28 import 'ast.dart'; |
| 28 import 'constant.dart'; | 29 import 'constant.dart'; |
| 29 import 'element.dart'; | 30 import 'element.dart'; |
| 30 import 'error.dart'; | 31 import 'error.dart'; |
| (...skipping 1530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1561 | 1562 |
| 1562 @override | 1563 @override |
| 1563 TypeSystem get typeSystem { | 1564 TypeSystem get typeSystem { |
| 1564 if (_typeSystem == null) { | 1565 if (_typeSystem == null) { |
| 1565 _typeSystem = TypeSystem.create(this); | 1566 _typeSystem = TypeSystem.create(this); |
| 1566 } | 1567 } |
| 1567 return _typeSystem; | 1568 return _typeSystem; |
| 1568 } | 1569 } |
| 1569 | 1570 |
| 1570 @override | 1571 @override |
| 1572 List<newContext.WorkManager> get workManagers { |
| 1573 throw new NotImplementedException('In not task-based AnalysisContext.'); |
| 1574 } |
| 1575 |
| 1576 @override |
| 1571 void addListener(AnalysisListener listener) { | 1577 void addListener(AnalysisListener listener) { |
| 1572 if (!_listeners.contains(listener)) { | 1578 if (!_listeners.contains(listener)) { |
| 1573 _listeners.add(listener); | 1579 _listeners.add(listener); |
| 1574 } | 1580 } |
| 1575 } | 1581 } |
| 1576 | 1582 |
| 1577 @override | 1583 @override |
| 1578 void applyAnalysisDelta(AnalysisDelta delta) { | 1584 void applyAnalysisDelta(AnalysisDelta delta) { |
| 1579 ChangeSet changeSet = new ChangeSet(); | 1585 ChangeSet changeSet = new ChangeSet(); |
| 1580 delta.analysisLevels.forEach((Source source, AnalysisLevel level) { | 1586 delta.analysisLevels.forEach((Source source, AnalysisLevel level) { |
| (...skipping 7807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9388 * Sets the [TypeProvider] for this context. | 9394 * Sets the [TypeProvider] for this context. |
| 9389 */ | 9395 */ |
| 9390 void set typeProvider(TypeProvider typeProvider); | 9396 void set typeProvider(TypeProvider typeProvider); |
| 9391 | 9397 |
| 9392 /** | 9398 /** |
| 9393 * A factory to override how [TypeResolverVisitor] is created. | 9399 * A factory to override how [TypeResolverVisitor] is created. |
| 9394 */ | 9400 */ |
| 9395 TypeResolverVisitorFactory get typeResolverVisitorFactory; | 9401 TypeResolverVisitorFactory get typeResolverVisitorFactory; |
| 9396 | 9402 |
| 9397 /** | 9403 /** |
| 9404 * A list of all [WorkManager]s used by this context. |
| 9405 */ |
| 9406 List<newContext.WorkManager> get workManagers; |
| 9407 |
| 9408 /** |
| 9398 * Return a list containing the sources of the libraries that are exported by | 9409 * Return a list containing the sources of the libraries that are exported by |
| 9399 * the library with the given [source]. The list will be empty if the given | 9410 * the library with the given [source]. The list will be empty if the given |
| 9400 * source is invalid, if the given source does not represent a library, or if | 9411 * source is invalid, if the given source does not represent a library, or if |
| 9401 * the library does not export any other libraries. | 9412 * the library does not export any other libraries. |
| 9402 * | 9413 * |
| 9403 * Throws an [AnalysisException] if the exported libraries could not be | 9414 * Throws an [AnalysisException] if the exported libraries could not be |
| 9404 * computed. | 9415 * computed. |
| 9405 */ | 9416 */ |
| 9406 List<Source> computeExportedLibraries(Source source); | 9417 List<Source> computeExportedLibraries(Source source); |
| 9407 | 9418 |
| (...skipping 2645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12053 PendingFuture pendingFuture = | 12064 PendingFuture pendingFuture = |
| 12054 new PendingFuture<T>(_context, source, computeValue); | 12065 new PendingFuture<T>(_context, source, computeValue); |
| 12055 if (!pendingFuture.evaluate(sourceEntry)) { | 12066 if (!pendingFuture.evaluate(sourceEntry)) { |
| 12056 _context._pendingFutureSources | 12067 _context._pendingFutureSources |
| 12057 .putIfAbsent(source, () => <PendingFuture>[]) | 12068 .putIfAbsent(source, () => <PendingFuture>[]) |
| 12058 .add(pendingFuture); | 12069 .add(pendingFuture); |
| 12059 } | 12070 } |
| 12060 return pendingFuture.future; | 12071 return pendingFuture.future; |
| 12061 } | 12072 } |
| 12062 } | 12073 } |
| OLD | NEW |