Index: pkg/analysis_server/test/services/completion/dart/keyword_contributor_test.dart |
diff --git a/pkg/analysis_server/test/services/completion/dart/keyword_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/keyword_contributor_test.dart |
index c4d9b8b1ebcd302f0d29cde8b20d3d352021e27a..1d3549d21ae4a642082b4d97846b695e30f4d420 100644 |
--- a/pkg/analysis_server/test/services/completion/dart/keyword_contributor_test.dart |
+++ b/pkg/analysis_server/test/services/completion/dart/keyword_contributor_test.dart |
@@ -727,6 +727,19 @@ class A { |
assertSuggestKeywords(STMT_START_OUTSIDE_CLASS, pseudoKeywords: ['await']); |
} |
+ test_function_body_inClass_constructorInitializer_async_star() async { |
+ addTestSource(r''' |
+ foo(p) {} |
+ class A { |
+ final f; |
+ A() : f = foo(() async* {^}); |
+ } |
+ '''); |
+ await computeSuggestions(); |
+ assertSuggestKeywords(STMT_START_OUTSIDE_CLASS, |
+ pseudoKeywords: ['await', 'yield', 'yield*']); |
+ } |
+ |
test_function_body_inClass_field() async { |
addTestSource(r''' |
class A { |
@@ -777,6 +790,21 @@ class A { |
assertSuggestKeywords(STMT_START_IN_CLASS, pseudoKeywords: ['await']); |
} |
+ test_function_body_inClass_methodBody_inFunction_async_star() async { |
+ addTestSource(r''' |
+ class A { |
+ m() { |
+ f() { |
+ f2() async* {^}; |
+ }; |
+ } |
+ } |
+ '''); |
+ await computeSuggestions(); |
+ assertSuggestKeywords(STMT_START_IN_CLASS, |
+ pseudoKeywords: ['await', 'yield', 'yield*']); |
+ } |
+ |
test_function_body_inUnit() async { |
addTestSource('main() {^}'); |
await computeSuggestions(); |
@@ -795,6 +823,34 @@ class A { |
assertSuggestKeywords(STMT_START_OUTSIDE_CLASS, pseudoKeywords: ['await']); |
} |
+ test_function_body_inUnit_async_star() async { |
+ addTestSource('main() async* {n^}'); |
+ await computeSuggestions(); |
+ assertSuggestKeywords(STMT_START_OUTSIDE_CLASS, |
+ pseudoKeywords: ['await', 'yield', 'yield*']); |
+ } |
+ |
+ test_function_body_inUnit_async_star2() async { |
+ addTestSource('main() async* {n^ foo}'); |
+ await computeSuggestions(); |
+ assertSuggestKeywords(STMT_START_OUTSIDE_CLASS, |
+ pseudoKeywords: ['await', 'yield', 'yield*']); |
+ } |
+ |
+ test_function_body_inUnit_sync_star() async { |
+ addTestSource('main() sync* {n^}'); |
+ await computeSuggestions(); |
+ assertSuggestKeywords(STMT_START_OUTSIDE_CLASS, |
+ pseudoKeywords: ['await', 'yield', 'yield*']); |
+ } |
+ |
+ test_function_body_inUnit_sync_star2() async { |
+ addTestSource('main() sync* {n^ foo}'); |
+ await computeSuggestions(); |
+ assertSuggestKeywords(STMT_START_OUTSIDE_CLASS, |
+ pseudoKeywords: ['await', 'yield', 'yield*']); |
+ } |
+ |
test_if_expression_in_class() async { |
addTestSource('class A {foo() {if (^) }}'); |
await computeSuggestions(); |
@@ -1203,6 +1259,13 @@ main() { |
assertSuggestKeywords(STMT_START_IN_CLASS, pseudoKeywords: ['await']); |
} |
+ test_method_body_async_star() async { |
+ addTestSource('class A { foo() async* {^}}'); |
+ await computeSuggestions(); |
+ assertSuggestKeywords(STMT_START_IN_CLASS, |
+ pseudoKeywords: ['await', 'yield', 'yield*']); |
+ } |
+ |
test_method_body_async2() async { |
addTestSource('class A { foo() async => ^}'); |
await computeSuggestions(); |