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

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

Issue 2250873002: fix completion in switch case (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: merge Created 4 years, 4 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/local_declaration_visitor.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/local_reference_contributor_test.dart
diff --git a/pkg/analysis_server/test/services/completion/dart/local_reference_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/local_reference_contributor_test.dart
index 5740cadb2eca9c7ab5af76157a71f7d536eda409..8cbed55e7f9c835e9c50e44446f842ba07dd1477 100644
--- a/pkg/analysis_server/test/services/completion/dart/local_reference_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/local_reference_contributor_test.dart
@@ -4043,6 +4043,21 @@ class X {foo(){A^.bar}}''');
assertNotSuggested('String');
}
+ test_SwitchStatement_case_var() async {
+ // SwitchStatement Block BlockFunctionBody MethodDeclaration
+ addTestSource('g(int x) {var t; switch(x) {case 0: var bar; b^}}');
+ await computeSuggestions();
+
+ assertSuggestFunction('g', 'dynamic',
+ relevance: DART_RELEVANCE_LOCAL_FUNCTION);
+ assertSuggestLocalVariable('t', 'dynamic',
+ relevance: DART_RELEVANCE_LOCAL_VARIABLE);
+ assertSuggestParameter('x', 'int', relevance: DART_RELEVANCE_PARAMETER);
+ assertSuggestLocalVariable('bar', 'dynamic',
+ relevance: DART_RELEVANCE_LOCAL_VARIABLE);
+ assertNotSuggested('String');
+ }
+
test_SwitchStatement_empty() async {
// SwitchStatement Block BlockFunctionBody MethodDeclaration
addTestSource('class A {String g(int x) {switch(x) {^}}}');
« no previous file with comments | « pkg/analysis_server/lib/src/services/completion/dart/local_declaration_visitor.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698