Skip to content

Commit 03270f7

Browse files
bwilkersonCommit Queue
authored and
Commit Queue
committed
Convert the tests for the combinator contributor
Change-Id: Ic165bf7fed1f045f489998ecf9dec9edbd516274 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/298480 Commit-Queue: Brian Wilkerson <[email protected]> Reviewed-by: Konstantin Shcheglov <[email protected]>
1 parent 7a5061e commit 03270f7

File tree

5 files changed

+211
-177
lines changed

5 files changed

+211
-177
lines changed

pkg/analysis_server/test/services/completion/dart/combinator_contributor_test.dart

Lines changed: 0 additions & 172 deletions
This file was deleted.

pkg/analysis_server/test/services/completion/dart/completion_printer.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ class CompletionResponsePrinter {
9696
return 'extension';
9797
} else if (elementKind == ElementKind.FIELD) {
9898
return 'field';
99+
} else if (elementKind == ElementKind.FUNCTION) {
100+
return 'function';
99101
} else if (elementKind == ElementKind.GETTER) {
100102
return 'getter';
101103
} else if (elementKind == ElementKind.LIBRARY) {

pkg/analysis_server/test/services/completion/dart/location/block_test.dart

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1114,10 +1114,36 @@ suggestions
11141114
mixin MethodBodyTestCases on AbstractCompletionDriverTest {
11151115
Future<void> test_afterLeftBrace_beforeRightBrace() async {
11161116
await computeSuggestions('''
1117-
class A { foo() {^}}
1117+
class F0 { var f1; f2() {} }
1118+
class E0 extends F0 { var e1; e2() {} }
1119+
class I0 { int i1; i2() {} }
1120+
class M0 { var m1; int m2() {} }
1121+
class A0 extends E0 implements I0 with M0 {a() {^}}
11181122
''');
1123+
// Part of the purpose of this test is to ensure that none of the top-level
1124+
// names are duplicated.
11191125
assertResponse(r'''
11201126
suggestions
1127+
A0
1128+
kind: class
1129+
A0
1130+
kind: constructorInvocation
1131+
E0
1132+
kind: class
1133+
E0
1134+
kind: constructorInvocation
1135+
F0
1136+
kind: class
1137+
F0
1138+
kind: constructorInvocation
1139+
I0
1140+
kind: class
1141+
I0
1142+
kind: constructorInvocation
1143+
M0
1144+
kind: class
1145+
M0
1146+
kind: constructorInvocation
11211147
assert
11221148
kind: keyword
11231149
const
@@ -1126,14 +1152,30 @@ suggestions
11261152
kind: keyword
11271153
dynamic
11281154
kind: keyword
1155+
e1
1156+
kind: field
1157+
e2
1158+
kind: methodInvocation
1159+
f1
1160+
kind: field
1161+
f2
1162+
kind: methodInvocation
11291163
final
11301164
kind: keyword
11311165
for
11321166
kind: keyword
1167+
i1
1168+
kind: field
1169+
i2
1170+
kind: methodInvocation
11331171
if
11341172
kind: keyword
11351173
late
11361174
kind: keyword
1175+
m1
1176+
kind: field
1177+
m2
1178+
kind: methodInvocation
11371179
return
11381180
kind: keyword
11391181
super

0 commit comments

Comments
 (0)