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.services.completion.dart.manager; | 5 library test.services.completion.dart.manager; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.
dart'; | 9 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.
dart'; |
10 import 'package:analysis_server/src/services/completion/completion_core.dart'; | 10 import 'package:analysis_server/src/services/completion/completion_core.dart'; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 import "/libA.dart" as foo; | 49 import "/libA.dart" as foo; |
50 part '$testFile'; | 50 part '$testFile'; |
51 '''); | 51 '''); |
52 addTestSource('part of libB; main() {^}'); | 52 addTestSource('part of libB; main() {^}'); |
53 | 53 |
54 // Associate part with library | 54 // Associate part with library |
55 context.computeResult(libSource, LIBRARY_CYCLE_UNITS); | 55 context.computeResult(libSource, LIBRARY_CYCLE_UNITS); |
56 | 56 |
57 // Build the request | 57 // Build the request |
58 CompletionRequestImpl baseRequest = new CompletionRequestImpl( | 58 CompletionRequestImpl baseRequest = new CompletionRequestImpl( |
| 59 null, |
59 context, | 60 context, |
60 provider, | 61 provider, |
61 searchEngine, | 62 searchEngine, |
62 testSource, | 63 testSource, |
63 completionOffset, | 64 completionOffset, |
64 new CompletionPerformance()); | 65 new CompletionPerformance()); |
65 Completer<DartCompletionRequest> requestCompleter = | 66 Completer<DartCompletionRequest> requestCompleter = |
66 new Completer<DartCompletionRequest>(); | 67 new Completer<DartCompletionRequest>(); |
67 DartCompletionRequestImpl | 68 DartCompletionRequestImpl |
68 .from(baseRequest, resultDescriptor: RESOLVED_UNIT1) | 69 .from(baseRequest, resultDescriptor: RESOLVED_UNIT1) |
(...skipping 26 matching lines...) Expand all Loading... |
95 void assertImportedLib(String expectedUri) { | 96 void assertImportedLib(String expectedUri) { |
96 ImportElement importElem = importNamed(expectedUri); | 97 ImportElement importElem = importNamed(expectedUri); |
97 expect(importElem.importedLibrary.exportNamespace, isNotNull); | 98 expect(importElem.importedLibrary.exportNamespace, isNotNull); |
98 } | 99 } |
99 | 100 |
100 // Assert that the new imports each have an export namespace | 101 // Assert that the new imports each have an export namespace |
101 assertImportedLib(null /* dart:core */); | 102 assertImportedLib(null /* dart:core */); |
102 assertImportedLib('/libA.dart'); | 103 assertImportedLib('/libA.dart'); |
103 } | 104 } |
104 } | 105 } |
OLD | NEW |