| 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/memory_file_system.dart'; | 11 import 'package:analyzer/file_system/memory_file_system.dart'; |
| 12 import 'package:analyzer/instrumentation/instrumentation.dart'; | 12 import 'package:analyzer/instrumentation/instrumentation.dart'; |
| 13 import 'package:analyzer/source/embedder.dart'; | |
| 14 import 'package:analyzer/source/error_processor.dart'; | 13 import 'package:analyzer/source/error_processor.dart'; |
| 14 import 'package:analyzer/src/context/builder.dart'; |
| 15 import 'package:analyzer/src/dart/sdk/sdk.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'; |
| 21 import 'package:analyzer/src/services/lint.dart'; | 22 import 'package:analyzer/src/services/lint.dart'; |
| 22 import 'package:analyzer/src/util/glob.dart'; | 23 import 'package:analyzer/src/util/glob.dart'; |
| 23 import 'package:linter/src/plugin/linter_plugin.dart'; | 24 import 'package:linter/src/plugin/linter_plugin.dart'; |
| 24 import 'package:linter/src/rules/avoid_as.dart'; | 25 import 'package:linter/src/rules/avoid_as.dart'; |
| (...skipping 2618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2643 String path = folder.path; | 2644 String path = folder.path; |
| 2644 expect(currentContextPaths, isNot(contains(path))); | 2645 expect(currentContextPaths, isNot(contains(path))); |
| 2645 currentContextTimestamps[path] = now; | 2646 currentContextTimestamps[path] = now; |
| 2646 currentContextFilePaths[path] = <String, int>{}; | 2647 currentContextFilePaths[path] = <String, int>{}; |
| 2647 currentContextSources[path] = new HashSet<Source>(); | 2648 currentContextSources[path] = new HashSet<Source>(); |
| 2648 currentContext = AnalysisEngine.instance.createAnalysisContext(); | 2649 currentContext = AnalysisEngine.instance.createAnalysisContext(); |
| 2649 List<UriResolver> resolvers = []; | 2650 List<UriResolver> resolvers = []; |
| 2650 if (currentContext is InternalAnalysisContext) { | 2651 if (currentContext is InternalAnalysisContext) { |
| 2651 EmbedderYamlLocator embedderYamlLocator = | 2652 EmbedderYamlLocator embedderYamlLocator = |
| 2652 disposition.getEmbedderLocator(resourceProvider); | 2653 disposition.getEmbedderLocator(resourceProvider); |
| 2653 EmbedderSdk sdk = new EmbedderSdk(embedderYamlLocator.embedderYamls); | 2654 EmbedderSdk sdk = |
| 2655 new EmbedderSdk(resourceProvider, embedderYamlLocator.embedderYamls); |
| 2654 if (sdk.libraryMap.size() > 0) { | 2656 if (sdk.libraryMap.size() > 0) { |
| 2655 // We have some embedder dart: uri mappings, add the resolver | 2657 // We have some embedder dart: uri mappings, add the resolver |
| 2656 // to the list. | 2658 // to the list. |
| 2657 resolvers.add(new DartUriResolver(sdk)); | 2659 resolvers.add(new DartUriResolver(sdk)); |
| 2658 } | 2660 } |
| 2659 } | 2661 } |
| 2660 resolvers.addAll(disposition.createPackageUriResolvers(resourceProvider)); | 2662 resolvers.addAll(disposition.createPackageUriResolvers(resourceProvider)); |
| 2661 resolvers.add(new ResourceUriResolver(resourceProvider)); | 2663 resolvers.add(new ResourceUriResolver(resourceProvider)); |
| 2662 currentContext.analysisOptions = options; | 2664 currentContext.analysisOptions = options; |
| 2663 currentContext.sourceFactory = | 2665 currentContext.sourceFactory = |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2746 class TestUriResolver extends UriResolver { | 2748 class TestUriResolver extends UriResolver { |
| 2747 Map<Uri, Source> uriMap; | 2749 Map<Uri, Source> uriMap; |
| 2748 | 2750 |
| 2749 TestUriResolver(this.uriMap); | 2751 TestUriResolver(this.uriMap); |
| 2750 | 2752 |
| 2751 @override | 2753 @override |
| 2752 Source resolveAbsolute(Uri uri, [Uri actualUri]) { | 2754 Source resolveAbsolute(Uri uri, [Uri actualUri]) { |
| 2753 return uriMap[uri]; | 2755 return uriMap[uri]; |
| 2754 } | 2756 } |
| 2755 } | 2757 } |
| OLD | NEW |