Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Unified Diff: pkg/analysis_server/test/services/completion/dart/keyword_contributor_test.dart

Issue 1509193003: suggest async* and sync* - fixes 24554 (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: merge Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analysis_server/lib/src/services/completion/dart/keyword_contributor.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8933b0a1aa0c8f120469119a6feb7c9add9bdf7c..c4d9b8b1ebcd302f0d29cde8b20d3d352021e27a 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
@@ -333,13 +333,15 @@ class KeywordContributorTest extends DartCompletionContributorTest {
addTestSource('main() {foo(() ^ {}}}');
await computeSuggestions();
assertSuggestKeywords([],
- pseudoKeywords: ['async'], relevance: DART_RELEVANCE_HIGH);
+ pseudoKeywords: ['async', 'async*', 'sync*'],
+ relevance: DART_RELEVANCE_HIGH);
}
test_anonymous_function_async2() async {
addTestSource('main() {foo(() a^ {}}}');
await computeSuggestions();
- assertSuggestKeywords(STMT_START_OUTSIDE_CLASS, pseudoKeywords: ['async']);
+ assertSuggestKeywords(STMT_START_OUTSIDE_CLASS,
+ pseudoKeywords: ['async', 'async*', 'sync*']);
}
test_anonymous_function_async3() async {
@@ -348,6 +350,20 @@ class KeywordContributorTest extends DartCompletionContributorTest {
assertSuggestKeywords([]);
}
+ test_anonymous_function_async4() async {
+ addTestSource('main() {foo(() ^ => 2}}');
+ await computeSuggestions();
+ assertSuggestKeywords([],
+ pseudoKeywords: ['async'], relevance: DART_RELEVANCE_HIGH);
+ }
+
+ test_anonymous_function_async5() async {
+ addTestSource('main() {foo(() ^}}');
+ await computeSuggestions();
+ assertSuggestKeywords(EXPRESSION_START_NO_INSTANCE,
+ pseudoKeywords: ['async', 'async*', 'sync*']);
+ }
+
test_argument() async {
addTestSource('main() {foo(^);}');
await computeSuggestions();
@@ -651,35 +667,40 @@ class KeywordContributorTest extends DartCompletionContributorTest {
addTestSource('main()^');
await computeSuggestions();
assertSuggestKeywords(DECLARATION_KEYWORDS,
- pseudoKeywords: ['async'], relevance: DART_RELEVANCE_HIGH);
+ pseudoKeywords: ['async', 'async*', 'sync*'],
+ relevance: DART_RELEVANCE_HIGH);
}
test_function_async2() async {
addTestSource('main()^{}');
await computeSuggestions();
assertSuggestKeywords([],
- pseudoKeywords: ['async'], relevance: DART_RELEVANCE_HIGH);
+ pseudoKeywords: ['async', 'async*', 'sync*'],
+ relevance: DART_RELEVANCE_HIGH);
}
test_function_async3() async {
addTestSource('main()a^');
await computeSuggestions();
assertSuggestKeywords(DECLARATION_KEYWORDS,
- pseudoKeywords: ['async'], relevance: DART_RELEVANCE_HIGH);
+ pseudoKeywords: ['async', 'async*', 'sync*'],
+ relevance: DART_RELEVANCE_HIGH);
}
test_function_async4() async {
addTestSource('main()a^{}');
await computeSuggestions();
assertSuggestKeywords(DECLARATION_KEYWORDS,
- pseudoKeywords: ['async'], relevance: DART_RELEVANCE_HIGH);
+ pseudoKeywords: ['async', 'async*', 'sync*'],
+ relevance: DART_RELEVANCE_HIGH);
}
test_function_async5() async {
addTestSource('main()a^ Foo foo;');
await computeSuggestions();
assertSuggestKeywords(DECLARATION_KEYWORDS,
- pseudoKeywords: ['async'], relevance: DART_RELEVANCE_HIGH);
+ pseudoKeywords: ['async', 'async*', 'sync*'],
+ relevance: DART_RELEVANCE_HIGH);
}
test_function_body_inClass_constructorInitializer() async {
@@ -1098,38 +1119,44 @@ main() {
test_method_async() async {
addTestSource('class A { foo() ^}');
await computeSuggestions();
- assertSuggestKeywords(CLASS_BODY_KEYWORDS, pseudoKeywords: ['async']);
+ assertSuggestKeywords(CLASS_BODY_KEYWORDS,
+ pseudoKeywords: ['async', 'async*', 'sync*']);
}
test_method_async2() async {
addTestSource('class A { foo() ^{}}');
await computeSuggestions();
assertSuggestKeywords([],
- pseudoKeywords: ['async'], relevance: DART_RELEVANCE_HIGH);
+ pseudoKeywords: ['async', 'async*', 'sync*'],
+ relevance: DART_RELEVANCE_HIGH);
}
test_method_async3() async {
addTestSource('class A { foo() a^}');
await computeSuggestions();
- assertSuggestKeywords(CLASS_BODY_KEYWORDS, pseudoKeywords: ['async']);
+ assertSuggestKeywords(CLASS_BODY_KEYWORDS,
+ pseudoKeywords: ['async', 'async*', 'sync*']);
}
test_method_async4() async {
addTestSource('class A { foo() a^{}}');
await computeSuggestions();
- assertSuggestKeywords(CLASS_BODY_KEYWORDS, pseudoKeywords: ['async']);
+ assertSuggestKeywords(CLASS_BODY_KEYWORDS,
+ pseudoKeywords: ['async', 'async*', 'sync*']);
}
test_method_async5() async {
addTestSource('class A { foo() ^ Foo foo;}');
await computeSuggestions();
- assertSuggestKeywords(CLASS_BODY_KEYWORDS, pseudoKeywords: ['async']);
+ assertSuggestKeywords(CLASS_BODY_KEYWORDS,
+ pseudoKeywords: ['async', 'async*', 'sync*']);
}
test_method_async6() async {
addTestSource('class A { foo() a^ Foo foo;}');
await computeSuggestions();
- assertSuggestKeywords(CLASS_BODY_KEYWORDS, pseudoKeywords: ['async']);
+ assertSuggestKeywords(CLASS_BODY_KEYWORDS,
+ pseudoKeywords: ['async', 'async*', 'sync*']);
}
test_method_async7() async {
@@ -1142,7 +1169,8 @@ main() {
test_method_async8() async {
addTestSource('class A { foo() a^ Foo foo;}');
await computeSuggestions();
- assertSuggestKeywords(CLASS_BODY_KEYWORDS, pseudoKeywords: ['async']);
+ assertSuggestKeywords(CLASS_BODY_KEYWORDS,
+ pseudoKeywords: ['async', 'async*', 'sync*']);
}
test_method_body() async {
« no previous file with comments | « pkg/analysis_server/lib/src/services/completion/dart/keyword_contributor.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698