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 import 'dart:async'; | 5 import 'dart:async'; |
6 | 6 |
7 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.
dart'; | 7 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.
dart'; |
8 import 'package:analysis_server/src/services/completion/completion_core.dart'; | 8 import 'package:analysis_server/src/services/completion/completion_core.dart'; |
9 import 'package:analysis_server/src/services/completion/completion_performance.d
art'; | 9 import 'package:analysis_server/src/services/completion/completion_performance.d
art'; |
10 import 'package:analysis_server/src/services/completion/dart/completion_manager.
dart'; | 10 import 'package:analysis_server/src/services/completion/dart/completion_manager.
dart'; |
(...skipping 12 matching lines...) Expand all Loading... |
23 } | 23 } |
24 | 24 |
25 @reflectiveTest | 25 @reflectiveTest |
26 class CompletionManagerTest extends DartCompletionContributorTest { | 26 class CompletionManagerTest extends DartCompletionContributorTest { |
27 @override | 27 @override |
28 DartCompletionContributor createContributor() { | 28 DartCompletionContributor createContributor() { |
29 return new ImportedReferenceContributor(); | 29 return new ImportedReferenceContributor(); |
30 } | 30 } |
31 | 31 |
32 test_resolveDirectives() async { | 32 test_resolveDirectives() async { |
33 addSource( | 33 addSource('/libA.dart', ''' |
34 '/libA.dart', | |
35 ''' | |
36 library libA; | 34 library libA; |
37 /// My class. | 35 /// My class. |
38 /// Short description. | 36 /// Short description. |
39 /// | 37 /// |
40 /// Longer description. | 38 /// Longer description. |
41 class A {} | 39 class A {} |
42 '''); | 40 '''); |
43 addSource( | 41 addSource('/libB.dart', ''' |
44 '/libB.dart', | |
45 ''' | |
46 library libB; | 42 library libB; |
47 import "/libA.dart" as foo; | 43 import "/libA.dart" as foo; |
48 part '$testFile'; | 44 part '$testFile'; |
49 '''); | 45 '''); |
50 addTestSource('part of libB; main() {^}'); | 46 addTestSource('part of libB; main() {^}'); |
51 | 47 |
52 // Build the request | 48 // Build the request |
53 CompletionRequestImpl baseRequest = new CompletionRequestImpl( | 49 CompletionRequestImpl baseRequest = new CompletionRequestImpl( |
54 await driver.getResult(testFile), | 50 await driver.getResult(testFile), |
55 provider, | 51 provider, |
(...skipping 24 matching lines...) Expand all Loading... |
80 void assertImportedLib(String expectedUri) { | 76 void assertImportedLib(String expectedUri) { |
81 ImportElement importElem = importNamed(expectedUri); | 77 ImportElement importElem = importNamed(expectedUri); |
82 expect(importElem.importedLibrary.exportNamespace, isNotNull); | 78 expect(importElem.importedLibrary.exportNamespace, isNotNull); |
83 } | 79 } |
84 | 80 |
85 // Assert that the new imports each have an export namespace | 81 // Assert that the new imports each have an export namespace |
86 assertImportedLib(null /* dart:core */); | 82 assertImportedLib(null /* dart:core */); |
87 assertImportedLib('/libA.dart'); | 83 assertImportedLib('/libA.dart'); |
88 } | 84 } |
89 } | 85 } |
OLD | NEW |