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

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

Issue 2034713004: improve completions in closures and switch statements (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: merge Created 4 years, 6 months 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
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 e51ed5fbaf2ce859c1beafd2217ebedeb562825b..2081aab742e993b0ea0769a08a3b5eba09a8c65a 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
@@ -371,6 +371,22 @@ class KeywordContributorTest extends DartCompletionContributorTest {
pseudoKeywords: ['async', 'async*', 'sync*']);
}
+ test_anonymous_function_async6() async {
+ addTestSource('main() {foo("bar", () as^{}}');
+ await computeSuggestions();
+ assertSuggestKeywords([],
+ pseudoKeywords: ['async', 'async*', 'sync*'],
+ relevance: DART_RELEVANCE_HIGH);
+ }
+
+ test_anonymous_function_async7() async {
+ addTestSource('main() {foo("bar", () as^ => null');
+ await computeSuggestions();
+ assertSuggestKeywords([],
+ pseudoKeywords: ['async', 'async*', 'sync*'],
+ relevance: DART_RELEVANCE_HIGH);
+ }
+
test_argument() async {
addTestSource('main() {foo(^);}');
await computeSuggestions();
@@ -1179,6 +1195,12 @@ class A {
assertSuggestKeywords([Keyword.IS], relevance: DART_RELEVANCE_HIGH);
}
+ test_is_expression_partial() async {
+ addTestSource('main() {if (x i^)}');
+ await computeSuggestions();
+ assertSuggestKeywords([Keyword.IS], relevance: DART_RELEVANCE_HIGH);
+ }
+
test_library() async {
addTestSource('library foo;^');
await computeSuggestions();
@@ -1340,6 +1362,18 @@ class A {
assertSuggestKeywords(EXPRESSION_START_INSTANCE);
}
+ test_method_invocation() async {
+ addTestSource('class A { foo() {bar.^}}');
+ await computeSuggestions();
+ assertNoSuggestions();
+ }
+
+ test_method_invocation2() async {
+ addTestSource('class A { foo() {bar.as^}}');
+ await computeSuggestions();
+ assertNoSuggestions();
+ }
+
test_method_param() async {
addTestSource('class A { foo(^) {});}');
await computeSuggestions();

Powered by Google App Engine
This is Rietveld 408576698