| 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'; |
| (...skipping 2641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2652 EmbedderYamlLocator embedderYamlLocator = | 2652 EmbedderYamlLocator embedderYamlLocator = |
| 2653 disposition.getEmbedderLocator(resourceProvider); | 2653 disposition.getEmbedderLocator(resourceProvider); |
| 2654 EmbedderSdk sdk = new EmbedderSdk(embedderYamlLocator.embedderYamls); | 2654 EmbedderSdk sdk = new EmbedderSdk(embedderYamlLocator.embedderYamls); |
| 2655 if (sdk.libraryMap.size() > 0) { | 2655 if (sdk.libraryMap.size() > 0) { |
| 2656 // We have some embedder dart: uri mappings, add the resolver | 2656 // We have some embedder dart: uri mappings, add the resolver |
| 2657 // to the list. | 2657 // to the list. |
| 2658 resolvers.add(new DartUriResolver(sdk)); | 2658 resolvers.add(new DartUriResolver(sdk)); |
| 2659 } | 2659 } |
| 2660 } | 2660 } |
| 2661 resolvers.addAll(disposition.createPackageUriResolvers(resourceProvider)); | 2661 resolvers.addAll(disposition.createPackageUriResolvers(resourceProvider)); |
| 2662 resolvers.add(new ResourceUriResolver(PhysicalResourceProvider.INSTANCE)); | 2662 resolvers.add(new ResourceUriResolver(resourceProvider)); |
| 2663 currentContext.analysisOptions = options; | 2663 currentContext.analysisOptions = options; |
| 2664 currentContext.sourceFactory = | 2664 currentContext.sourceFactory = |
| 2665 new SourceFactory(resolvers, disposition.packages); | 2665 new SourceFactory(resolvers, disposition.packages); |
| 2666 return currentContext; | 2666 return currentContext; |
| 2667 } | 2667 } |
| 2668 | 2668 |
| 2669 @override | 2669 @override |
| 2670 void applyChangesToContext(Folder contextFolder, ChangeSet changeSet) { | 2670 void applyChangesToContext(Folder contextFolder, ChangeSet changeSet) { |
| 2671 Map<String, int> filePaths = currentContextFilePaths[contextFolder.path]; | 2671 Map<String, int> filePaths = currentContextFilePaths[contextFolder.path]; |
| 2672 Set<Source> sources = currentContextSources[contextFolder.path]; | 2672 Set<Source> sources = currentContextSources[contextFolder.path]; |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2747 class TestUriResolver extends UriResolver { | 2747 class TestUriResolver extends UriResolver { |
| 2748 Map<Uri, Source> uriMap; | 2748 Map<Uri, Source> uriMap; |
| 2749 | 2749 |
| 2750 TestUriResolver(this.uriMap); | 2750 TestUriResolver(this.uriMap); |
| 2751 | 2751 |
| 2752 @override | 2752 @override |
| 2753 Source resolveAbsolute(Uri uri, [Uri actualUri]) { | 2753 Source resolveAbsolute(Uri uri, [Uri actualUri]) { |
| 2754 return uriMap[uri]; | 2754 return uriMap[uri]; |
| 2755 } | 2755 } |
| 2756 } | 2756 } |
| OLD | NEW |