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

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

Issue 1968883002: Improve completion after IfStatement. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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/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 a52a8621a181cb8583177f811e47cf17a33e220c..e51ed5fbaf2ce859c1beafd2217ebedeb562825b 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
@@ -870,6 +870,34 @@ class A {
pseudoKeywords: ['await', 'yield', 'yield*']);
}
+ test_if_after_else() async {
+ addTestSource('main() { if (true) {} else ^ }');
+ await computeSuggestions();
+ assertSuggestKeywords(STMT_START_OUTSIDE_CLASS,
+ relevance: DART_RELEVANCE_KEYWORD);
+ }
+
+ test_if_afterThen_nextCloseCurlyBrace0() async {
+ addTestSource('main() { if (true) {} ^ }');
+ await computeSuggestions();
+ assertSuggestKeywords(STMT_START_OUTSIDE_CLASS.toList()..add(Keyword.ELSE),
+ relevance: DART_RELEVANCE_KEYWORD);
+ }
+
+ test_if_afterThen_nextCloseCurlyBrace1() async {
+ addTestSource('main() { if (true) {} e^ }');
+ await computeSuggestions();
+ assertSuggestKeywords(STMT_START_OUTSIDE_CLASS.toList()..add(Keyword.ELSE),
+ relevance: DART_RELEVANCE_KEYWORD);
+ }
+
+ test_if_afterThen_nextStatement0() async {
+ addTestSource('main() { if (true) {} ^ print(0); }');
+ await computeSuggestions();
+ assertSuggestKeywords(STMT_START_OUTSIDE_CLASS.toList()..add(Keyword.ELSE),
+ relevance: DART_RELEVANCE_KEYWORD);
+ }
+
test_if_condition_isKeyword() async {
addTestSource('main() { if (v i^) {} }');
await computeSuggestions();
« 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