| 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/dart/ast/ast.dart'; | 10 import 'package:analyzer/dart/ast/ast.dart'; |
| (...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 826 } | 826 } |
| 827 | 827 |
| 828 @override | 828 @override |
| 829 CompilationUnitElement getCompilationUnitElement( | 829 CompilationUnitElement getCompilationUnitElement( |
| 830 Source unitSource, Source librarySource) { | 830 Source unitSource, Source librarySource) { |
| 831 AnalysisTarget target = new LibrarySpecificUnit(librarySource, unitSource); | 831 AnalysisTarget target = new LibrarySpecificUnit(librarySource, unitSource); |
| 832 return getResult(target, COMPILATION_UNIT_ELEMENT); | 832 return getResult(target, COMPILATION_UNIT_ELEMENT); |
| 833 } | 833 } |
| 834 | 834 |
| 835 @override | 835 @override |
| 836 Object getConfigurationData(ResultDescriptor key) => | 836 Object/*=V*/ getConfigurationData/*<V>*/(ResultDescriptor/*<V>*/ key) => |
| 837 _configurationData[key] ?? key?.defaultValue; | 837 (_configurationData[key] ?? key?.defaultValue) as Object/*=V*/; |
| 838 | 838 |
| 839 @override | 839 @override |
| 840 TimestampedData<String> getContents(Source source) { | 840 TimestampedData<String> getContents(Source source) { |
| 841 String contents = _contentCache.getContents(source); | 841 String contents = _contentCache.getContents(source); |
| 842 if (contents != null) { | 842 if (contents != null) { |
| 843 return new TimestampedData<String>( | 843 return new TimestampedData<String>( |
| 844 _contentCache.getModificationStamp(source), contents); | 844 _contentCache.getModificationStamp(source), contents); |
| 845 } | 845 } |
| 846 return source.contents; | 846 return source.contents; |
| 847 } | 847 } |
| (...skipping 1349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2197 } | 2197 } |
| 2198 DartSdk sdk = factory.dartSdk; | 2198 DartSdk sdk = factory.dartSdk; |
| 2199 if (sdk == null) { | 2199 if (sdk == null) { |
| 2200 throw new IllegalArgumentException( | 2200 throw new IllegalArgumentException( |
| 2201 "The source factory for an SDK analysis context must have a DartUriRes
olver"); | 2201 "The source factory for an SDK analysis context must have a DartUriRes
olver"); |
| 2202 } | 2202 } |
| 2203 return new AnalysisCache( | 2203 return new AnalysisCache( |
| 2204 <CachePartition>[AnalysisEngine.instance.partitionManager.forSdk(sdk)]); | 2204 <CachePartition>[AnalysisEngine.instance.partitionManager.forSdk(sdk)]); |
| 2205 } | 2205 } |
| 2206 } | 2206 } |
| OLD | NEW |