| OLD | NEW |
| 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.context.context; | 5 library analyzer.src.context.context; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 | 9 |
| 10 import 'package:analyzer/src/cancelable_future.dart'; | 10 import 'package:analyzer/src/cancelable_future.dart'; |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 AnalysisContextImpl() { | 183 AnalysisContextImpl() { |
| 184 _privatePartition = new cache.UniversalCachePartition(this); | 184 _privatePartition = new cache.UniversalCachePartition(this); |
| 185 _cache = createCacheFromSourceFactory(null); | 185 _cache = createCacheFromSourceFactory(null); |
| 186 _taskManager = AnalysisEngine.instance.taskManager; | 186 _taskManager = AnalysisEngine.instance.taskManager; |
| 187 _driver = new AnalysisDriver(_taskManager, this); | 187 _driver = new AnalysisDriver(_taskManager, this); |
| 188 _onSourcesChangedController = | 188 _onSourcesChangedController = |
| 189 new StreamController<SourcesChangedEvent>.broadcast(); | 189 new StreamController<SourcesChangedEvent>.broadcast(); |
| 190 } | 190 } |
| 191 | 191 |
| 192 @override | 192 @override |
| 193 cache.AnalysisCache get analysisCache => _cache; |
| 194 |
| 195 @override |
| 193 AnalysisOptions get analysisOptions => _options; | 196 AnalysisOptions get analysisOptions => _options; |
| 194 | 197 |
| 195 @override | 198 @override |
| 196 void set analysisOptions(AnalysisOptions options) { | 199 void set analysisOptions(AnalysisOptions options) { |
| 197 bool needsRecompute = this._options.analyzeFunctionBodiesPredicate != | 200 bool needsRecompute = this._options.analyzeFunctionBodiesPredicate != |
| 198 options.analyzeFunctionBodiesPredicate || | 201 options.analyzeFunctionBodiesPredicate || |
| 199 this._options.generateImplicitErrors != | 202 this._options.generateImplicitErrors != |
| 200 options.generateImplicitErrors || | 203 options.generateImplicitErrors || |
| 201 this._options.generateSdkErrors != options.generateSdkErrors || | 204 this._options.generateSdkErrors != options.generateSdkErrors || |
| 202 this._options.dart2jsHint != options.dart2jsHint || | 205 this._options.dart2jsHint != options.dart2jsHint || |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 String name = source.shortName; | 562 String name = source.shortName; |
| 560 if (AnalysisEngine.isDartFileName(name)) { | 563 if (AnalysisEngine.isDartFileName(name)) { |
| 561 return _computeResult(source, SOURCE_KIND); | 564 return _computeResult(source, SOURCE_KIND); |
| 562 } else if (AnalysisEngine.isHtmlFileName(name)) { | 565 } else if (AnalysisEngine.isHtmlFileName(name)) { |
| 563 return SourceKind.HTML; | 566 return SourceKind.HTML; |
| 564 } | 567 } |
| 565 return SourceKind.UNKNOWN; | 568 return SourceKind.UNKNOWN; |
| 566 } | 569 } |
| 567 | 570 |
| 568 @override | 571 @override |
| 569 LibraryElement computeLibraryElement(Source source) => _computeResult( | 572 LibraryElement computeLibraryElement(Source source) { |
| 570 source, LIBRARY_ELEMENT); //_computeResult(source, HtmlEntry.ELEMENT); | 573 //_computeResult(source, HtmlEntry.ELEMENT); |
| 574 return _computeResult(source, LIBRARY_ELEMENT); |
| 575 } |
| 571 | 576 |
| 572 @override | 577 @override |
| 573 LineInfo computeLineInfo(Source source) => _computeResult(source, LINE_INFO); | 578 LineInfo computeLineInfo(Source source) => _computeResult(source, LINE_INFO); |
| 574 | 579 |
| 575 @override | 580 @override |
| 576 @deprecated | 581 @deprecated |
| 577 CompilationUnit computeResolvableCompilationUnit(Source source) { | 582 CompilationUnit computeResolvableCompilationUnit(Source source) { |
| 578 return null; | 583 return null; |
| 579 } | 584 } |
| 580 | 585 |
| (...skipping 1541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2122 PendingFuture pendingFuture = | 2127 PendingFuture pendingFuture = |
| 2123 new PendingFuture<T>(_context, target, computeValue); | 2128 new PendingFuture<T>(_context, target, computeValue); |
| 2124 if (!pendingFuture.evaluate(entry)) { | 2129 if (!pendingFuture.evaluate(entry)) { |
| 2125 _context._pendingFutureTargets | 2130 _context._pendingFutureTargets |
| 2126 .putIfAbsent(target, () => <PendingFuture>[]) | 2131 .putIfAbsent(target, () => <PendingFuture>[]) |
| 2127 .add(pendingFuture); | 2132 .add(pendingFuture); |
| 2128 } | 2133 } |
| 2129 return pendingFuture.future; | 2134 return pendingFuture.future; |
| 2130 } | 2135 } |
| 2131 } | 2136 } |
| OLD | NEW |