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

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

Issue 1147213008: suggest keywords in if expression (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: merge Created 5 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
« no previous file with comments | « pkg/analysis_server/lib/src/services/completion/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/keyword_contributor_test.dart
diff --git a/pkg/analysis_server/test/services/completion/keyword_contributor_test.dart b/pkg/analysis_server/test/services/completion/keyword_contributor_test.dart
index 55cf65959098d80d04de50ba39721ed3c8dc0978..b38c461448539606a194a14c0faee7d28a057206 100644
--- a/pkg/analysis_server/test/services/completion/keyword_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/keyword_contributor_test.dart
@@ -646,6 +646,30 @@ class A {
assertSuggestKeywords(STMT_START_OUTSIDE_CLASS, pseudoKeywords: ['await']);
}
+ test_if_expression_in_class() {
+ addTestSource('class A {foo() {if (^) }}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(EXPRESSION_START_INSTANCE);
+ }
+
+ test_if_expression_in_class2() {
+ addTestSource('class A {foo() {if (n^) }}');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(EXPRESSION_START_INSTANCE);
+ }
+
+ test_if_expression_in_function() {
+ addTestSource('foo() {if (^) }');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(EXPRESSION_START_NO_INSTANCE);
+ }
+
+ test_if_expression_in_function2() {
+ addTestSource('foo() {if (n^) }');
+ expect(computeFast(), isTrue);
+ assertSuggestKeywords(EXPRESSION_START_NO_INSTANCE);
+ }
+
test_if_in_class() {
addTestSource('class A {foo() {if (true) ^}}');
expect(computeFast(), isTrue);
« no previous file with comments | « pkg/analysis_server/lib/src/services/completion/keyword_contributor.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698