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 test.context.directory.manager; | 5 library test.context.directory.manager; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 | 8 |
9 import 'package:analysis_server/src/context_manager.dart'; | 9 import 'package:analysis_server/src/context_manager.dart'; |
10 import 'package:analyzer/file_system/file_system.dart'; | 10 import 'package:analyzer/file_system/file_system.dart'; |
| 11 import 'package:analyzer/file_system/physical_file_system.dart'; |
11 import 'package:analyzer/file_system/memory_file_system.dart'; | 12 import 'package:analyzer/file_system/memory_file_system.dart'; |
12 import 'package:analyzer/instrumentation/instrumentation.dart'; | 13 import 'package:analyzer/instrumentation/instrumentation.dart'; |
13 import 'package:analyzer/source/embedder.dart'; | 14 import 'package:analyzer/source/embedder.dart'; |
14 import 'package:analyzer/source/error_processor.dart'; | 15 import 'package:analyzer/source/error_processor.dart'; |
15 import 'package:analyzer/src/generated/engine.dart'; | 16 import 'package:analyzer/src/generated/engine.dart'; |
16 import 'package:analyzer/src/generated/error.dart'; | 17 import 'package:analyzer/src/generated/error.dart'; |
17 import 'package:analyzer/src/generated/java_io.dart'; | 18 import 'package:analyzer/src/generated/java_io.dart'; |
18 import 'package:analyzer/src/generated/sdk.dart'; | 19 import 'package:analyzer/src/generated/sdk.dart'; |
19 import 'package:analyzer/src/generated/source.dart'; | 20 import 'package:analyzer/src/generated/source.dart'; |
20 import 'package:analyzer/src/generated/source_io.dart'; | 21 import 'package:analyzer/src/generated/source_io.dart'; |
(...skipping 2639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2660 (currentContext as InternalAnalysisContext).embedderYamlLocator; | 2661 (currentContext as InternalAnalysisContext).embedderYamlLocator; |
2661 EmbedderUriResolver embedderUriResolver = | 2662 EmbedderUriResolver embedderUriResolver = |
2662 new EmbedderUriResolver(embedderYamlLocator.embedderYamls); | 2663 new EmbedderUriResolver(embedderYamlLocator.embedderYamls); |
2663 if (embedderUriResolver.length > 0) { | 2664 if (embedderUriResolver.length > 0) { |
2664 // We have some embedder dart: uri mappings, add the resolver | 2665 // We have some embedder dart: uri mappings, add the resolver |
2665 // to the list. | 2666 // to the list. |
2666 resolvers.add(embedderUriResolver); | 2667 resolvers.add(embedderUriResolver); |
2667 } | 2668 } |
2668 } | 2669 } |
2669 resolvers.addAll(disposition.createPackageUriResolvers(resourceProvider)); | 2670 resolvers.addAll(disposition.createPackageUriResolvers(resourceProvider)); |
2670 resolvers.add(new FileUriResolver()); | 2671 resolvers.add(new ResourceUriResolver(PhysicalResourceProvider.INSTANCE)); |
2671 currentContext.analysisOptions = options; | 2672 currentContext.analysisOptions = options; |
2672 currentContext.sourceFactory = | 2673 currentContext.sourceFactory = |
2673 new SourceFactory(resolvers, disposition.packages); | 2674 new SourceFactory(resolvers, disposition.packages); |
2674 return currentContext; | 2675 return currentContext; |
2675 } | 2676 } |
2676 | 2677 |
2677 @override | 2678 @override |
2678 void applyChangesToContext(Folder contextFolder, ChangeSet changeSet) { | 2679 void applyChangesToContext(Folder contextFolder, ChangeSet changeSet) { |
2679 Map<String, int> filePaths = currentContextFilePaths[contextFolder.path]; | 2680 Map<String, int> filePaths = currentContextFilePaths[contextFolder.path]; |
2680 Set<Source> sources = currentContextSources[contextFolder.path]; | 2681 Set<Source> sources = currentContextSources[contextFolder.path]; |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2768 class TestUriResolver extends UriResolver { | 2769 class TestUriResolver extends UriResolver { |
2769 Map<Uri, Source> uriMap; | 2770 Map<Uri, Source> uriMap; |
2770 | 2771 |
2771 TestUriResolver(this.uriMap); | 2772 TestUriResolver(this.uriMap); |
2772 | 2773 |
2773 @override | 2774 @override |
2774 Source resolveAbsolute(Uri uri, [Uri actualUri]) { | 2775 Source resolveAbsolute(Uri uri, [Uri actualUri]) { |
2775 return uriMap[uri]; | 2776 return uriMap[uri]; |
2776 } | 2777 } |
2777 } | 2778 } |
OLD | NEW |