OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 import 'dart:async'; | 5 import 'dart:async'; |
6 import 'dart:typed_data'; | 6 import 'dart:typed_data'; |
7 | 7 |
| 8 import 'package:analysis_server/src/plugin/plugin_locator.dart'; |
8 import 'package:analysis_server/src/plugin/plugin_manager.dart'; | 9 import 'package:analysis_server/src/plugin/plugin_manager.dart'; |
9 import 'package:analysis_server/src/plugin/plugin_watcher.dart'; | 10 import 'package:analysis_server/src/plugin/plugin_watcher.dart'; |
10 import 'package:analyzer/context/context_root.dart'; | 11 import 'package:analyzer/context/context_root.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/source/package_map_resolver.dart'; | 13 import 'package:analyzer/source/package_map_resolver.dart'; |
13 import 'package:analyzer/src/dart/analysis/driver.dart'; | 14 import 'package:analyzer/src/dart/analysis/driver.dart'; |
14 import 'package:analyzer/src/dart/analysis/file_state.dart'; | 15 import 'package:analyzer/src/dart/analysis/file_state.dart'; |
15 import 'package:analyzer/src/generated/engine.dart' show AnalysisOptionsImpl; | 16 import 'package:analyzer/src/generated/engine.dart' show AnalysisOptionsImpl; |
16 import 'package:analyzer/src/generated/source.dart'; | 17 import 'package:analyzer/src/generated/source.dart'; |
17 import 'package:front_end/src/base/performace_logger.dart'; | 18 import 'package:front_end/src/base/performace_logger.dart'; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 await driver.computeResult('package:pkg1/test1.dart'); | 57 await driver.computeResult('package:pkg1/test1.dart'); |
57 expect(manager.addedContextRoots, isEmpty); | 58 expect(manager.addedContextRoots, isEmpty); |
58 // | 59 // |
59 // Use a file that imports a package with a plugin. | 60 // Use a file that imports a package with a plugin. |
60 // | 61 // |
61 resourceProvider.newFile( | 62 resourceProvider.newFile( |
62 resourceProvider.convertPath('/pkg2/lib/pkg2.dart'), ''); | 63 resourceProvider.convertPath('/pkg2/lib/pkg2.dart'), ''); |
63 resourceProvider.newFile( | 64 resourceProvider.newFile( |
64 resourceProvider.convertPath('/pkg2/pubspec.yaml'), 'name: pkg2'); | 65 resourceProvider.convertPath('/pkg2/pubspec.yaml'), 'name: pkg2'); |
65 resourceProvider.newFile( | 66 resourceProvider.newFile( |
66 resourceProvider | 67 resourceProvider.convertPath( |
67 .convertPath('/pkg2/tools/analysis_plugin/bin/plugin.dart'), | 68 '/pkg2/${PluginLocator.toolsFolderName}/${PluginLocator.defaultPlugi
nFolderName}/bin/plugin.dart'), |
68 ''); | 69 ''); |
69 await driver.computeResult('package:pkg2/pk2.dart'); | 70 await driver.computeResult('package:pkg2/pk2.dart'); |
70 // | 71 // |
71 // Wait until the timer associated with the driver's FileSystemState is | 72 // Wait until the timer associated with the driver's FileSystemState is |
72 // guaranteed to have expired and the list of changed files will have been | 73 // guaranteed to have expired and the list of changed files will have been |
73 // delivered. | 74 // delivered. |
74 // | 75 // |
75 await new Future.delayed(new Duration(seconds: 1)); | 76 await new Future.delayed(new Duration(seconds: 1)); |
76 expect(manager.addedContextRoots, hasLength(1)); | 77 expect(manager.addedContextRoots, hasLength(1)); |
77 } | 78 } |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 return null; | 149 return null; |
149 } | 150 } |
150 | 151 |
151 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); | 152 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); |
152 | 153 |
153 @override | 154 @override |
154 void removedContextRoot(ContextRoot contextRoot) { | 155 void removedContextRoot(ContextRoot contextRoot) { |
155 removedContextRoots.add(contextRoot); | 156 removedContextRoots.add(contextRoot); |
156 } | 157 } |
157 } | 158 } |
OLD | NEW |