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/error/error.dart'; | 10 import 'package:analyzer/error/error.dart'; |
11 import 'package:analyzer/file_system/file_system.dart'; | 11 import 'package:analyzer/file_system/file_system.dart'; |
12 import 'package:analyzer/file_system/memory_file_system.dart'; | 12 import 'package:analyzer/file_system/memory_file_system.dart'; |
13 import 'package:analyzer/instrumentation/instrumentation.dart'; | 13 import 'package:analyzer/instrumentation/instrumentation.dart'; |
14 import 'package:analyzer/source/error_processor.dart'; | 14 import 'package:analyzer/source/error_processor.dart'; |
15 import 'package:analyzer/src/context/builder.dart'; | 15 import 'package:analyzer/src/context/builder.dart'; |
16 import 'package:analyzer/src/dart/analysis/driver.dart'; | 16 import 'package:analyzer/src/dart/analysis/driver.dart'; |
17 import 'package:analyzer/src/error/codes.dart'; | 17 import 'package:analyzer/src/error/codes.dart'; |
18 import 'package:analyzer/src/generated/engine.dart'; | 18 import 'package:analyzer/src/generated/engine.dart'; |
19 import 'package:analyzer/src/generated/sdk.dart'; | 19 import 'package:analyzer/src/generated/sdk.dart'; |
20 import 'package:analyzer/src/generated/source.dart'; | 20 import 'package:analyzer/src/generated/source.dart'; |
21 import 'package:analyzer/src/generated/source_io.dart'; | 21 import 'package:analyzer/src/generated/source_io.dart'; |
22 import 'package:analyzer/src/services/lint.dart'; | 22 import 'package:analyzer/src/services/lint.dart'; |
23 import 'package:analyzer/src/util/glob.dart'; | 23 import 'package:analyzer/src/util/glob.dart'; |
24 import 'package:linter/src/plugin/linter_plugin.dart'; | 24 import 'package:linter/src/plugin/linter_plugin.dart'; |
25 import 'package:linter/src/rules.dart'; | |
26 import 'package:linter/src/rules/avoid_as.dart'; | 25 import 'package:linter/src/rules/avoid_as.dart'; |
27 import 'package:path/path.dart' as path; | 26 import 'package:path/path.dart' as path; |
28 import 'package:plugin/manager.dart'; | 27 import 'package:plugin/manager.dart'; |
29 import 'package:plugin/plugin.dart'; | 28 import 'package:plugin/plugin.dart'; |
30 import 'package:test/test.dart'; | 29 import 'package:test/test.dart'; |
31 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 30 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
32 | 31 |
33 import 'mock_sdk.dart'; | 32 import 'mock_sdk.dart'; |
34 import 'mocks.dart'; | 33 import 'mocks.dart'; |
35 | 34 |
(...skipping 1740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1776 } | 1775 } |
1777 | 1776 |
1778 void processRequiredPlugins() { | 1777 void processRequiredPlugins() { |
1779 List<Plugin> plugins = <Plugin>[]; | 1778 List<Plugin> plugins = <Plugin>[]; |
1780 plugins.addAll(AnalysisEngine.instance.requiredPlugins); | 1779 plugins.addAll(AnalysisEngine.instance.requiredPlugins); |
1781 plugins.add(AnalysisEngine.instance.commandLinePlugin); | 1780 plugins.add(AnalysisEngine.instance.commandLinePlugin); |
1782 plugins.add(AnalysisEngine.instance.optionsPlugin); | 1781 plugins.add(AnalysisEngine.instance.optionsPlugin); |
1783 plugins.add(linterPlugin); | 1782 plugins.add(linterPlugin); |
1784 ExtensionManager manager = new ExtensionManager(); | 1783 ExtensionManager manager = new ExtensionManager(); |
1785 manager.processPlugins(plugins); | 1784 manager.processPlugins(plugins); |
1786 | |
1787 registerLintRules(); | |
1788 } | 1785 } |
1789 | 1786 |
1790 UriResolver providePackageResolver(Folder folder) => packageResolver; | 1787 UriResolver providePackageResolver(Folder folder) => packageResolver; |
1791 | 1788 |
1792 void setUp() { | 1789 void setUp() { |
1793 processRequiredPlugins(); | 1790 processRequiredPlugins(); |
1794 resourceProvider = new MemoryResourceProvider(); | 1791 resourceProvider = new MemoryResourceProvider(); |
1795 packageMapProvider = new MockPackageMapProvider(); | 1792 packageMapProvider = new MockPackageMapProvider(); |
1796 // Create an SDK in the mock file system. | 1793 // Create an SDK in the mock file system. |
1797 new MockSdk(resourceProvider: resourceProvider); | 1794 new MockSdk(resourceProvider: resourceProvider); |
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2598 class TestUriResolver extends UriResolver { | 2595 class TestUriResolver extends UriResolver { |
2599 Map<Uri, Source> uriMap; | 2596 Map<Uri, Source> uriMap; |
2600 | 2597 |
2601 TestUriResolver(this.uriMap); | 2598 TestUriResolver(this.uriMap); |
2602 | 2599 |
2603 @override | 2600 @override |
2604 Source resolveAbsolute(Uri uri, [Uri actualUri]) { | 2601 Source resolveAbsolute(Uri uri, [Uri actualUri]) { |
2605 return uriMap[uri]; | 2602 return uriMap[uri]; |
2606 } | 2603 } |
2607 } | 2604 } |
OLD | NEW |