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.local; | 5 library test.services.completion.dart.local; |
6 | 6 |
7 import 'package:analysis_server/src/protocol.dart' as protocol | 7 import 'package:analysis_server/src/protocol.dart' as protocol |
8 show Element, ElementKind; | 8 show Element, ElementKind; |
9 import 'package:analysis_server/src/protocol.dart' hide Element, ElementKind; | 9 import 'package:analysis_server/src/protocol.dart' hide Element, ElementKind; |
10 import 'package:analysis_server/src/services/completion/dart_completion_manager.
dart'; | 10 import 'package:analysis_server/src/services/completion/dart_completion_manager.
dart'; |
11 import 'package:analysis_server/src/services/completion/local_reference_contribu
tor.dart'; | 11 import 'package:analysis_server/src/services/completion/local_reference_contribu
tor.dart'; |
12 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 12 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
13 import 'package:unittest/unittest.dart'; | 13 import 'package:unittest/unittest.dart'; |
14 | 14 |
15 import '../../utils.dart'; | 15 import '../../utils.dart'; |
16 import 'completion_test_util.dart'; | 16 import 'completion_test_util.dart'; |
17 | 17 |
18 main() { | 18 main() { |
19 initializeTestEnvironment(); | 19 initializeTestEnvironment(); |
20 defineReflectiveTests(LocalReferenceContributorTest); | 20 defineReflectiveTests(LocalReferenceContributorTest); |
21 } | 21 } |
22 | 22 |
23 @reflectiveTest | 23 @reflectiveTest |
24 class LocalReferenceContributorTest extends AbstractSelectorSuggestionTest { | 24 class LocalReferenceContributorTest extends AbstractSelectorSuggestionTest { |
25 @override | 25 @override |
26 CompletionSuggestion assertSuggestLocalClass(String name, | 26 CompletionSuggestion assertSuggestLocalClass(String name, |
27 {CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION, | 27 {CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION, |
28 int relevance: DART_RELEVANCE_DEFAULT, bool isDeprecated: false, | 28 int relevance: DART_RELEVANCE_DEFAULT, |
29 String elemFile, int elemOffset}) { | 29 bool isDeprecated: false, |
| 30 String elemFile, |
| 31 int elemOffset}) { |
30 return assertSuggestClass(name, | 32 return assertSuggestClass(name, |
31 elemFile: elemFile, | 33 elemFile: elemFile, |
32 elemOffset: elemOffset, | 34 elemOffset: elemOffset, |
33 isDeprecated: isDeprecated, | 35 isDeprecated: isDeprecated, |
34 kind: kind, | 36 kind: kind, |
35 relevance: relevance); | 37 relevance: relevance); |
36 } | 38 } |
37 | 39 |
38 @override | 40 @override |
39 CompletionSuggestion assertSuggestLocalClassTypeAlias(String name, | 41 CompletionSuggestion assertSuggestLocalClassTypeAlias(String name, |
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 expect(computeFast(), isTrue); | 792 expect(computeFast(), isTrue); |
791 assertSuggestMethod('m', 'B', null, relevance: DART_RELEVANCE_LOCAL_METHOD); | 793 assertSuggestMethod('m', 'B', null, relevance: DART_RELEVANCE_LOCAL_METHOD); |
792 } | 794 } |
793 | 795 |
794 test_shadowed_name() { | 796 test_shadowed_name() { |
795 addTestSource('var a; class A { var a; m() { ^ } }'); | 797 addTestSource('var a; class A { var a; m() { ^ } }'); |
796 expect(computeFast(), isTrue); | 798 expect(computeFast(), isTrue); |
797 assertSuggestLocalField('a', null); | 799 assertSuggestLocalField('a', null); |
798 } | 800 } |
799 } | 801 } |
OLD | NEW |