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

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

Issue 1871073003: Fix for issue 22357: use type information on the RHS of is expressions to improve quality of comple… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Comments from DanR- only resolve if the request containing node is an Expression Created 4 years, 8 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/optype.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 a9389c09ff440860be1bc6e2d98153c480026c13..9edbe26b147558b50ca3ad974f450df5fed3192b 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
@@ -2750,6 +2750,38 @@ main(){var a; if (a is Obj^)}''');
assertNotSuggested('Object');
}
+ test_IsExpression_type_subtype_extends_filter() async {
+ // SimpleIdentifier TypeName IsExpression IfStatement
+ addTestSource('''
+class A {} class B extends A {} class C extends A {} class D {}
+f(A a){ if (a is ^) {}}''');
+ await computeSuggestions();
+
+ expect(replacementOffset, completionOffset);
+ expect(replacementLength, 0);
+ assertSuggestClass('B');
+ assertSuggestClass('C');
+ assertNotSuggested('A');
+ assertNotSuggested('D');
+ assertNotSuggested('Object');
+ }
+
+ test_IsExpression_type_subtype_implements_filter() async {
+ // SimpleIdentifier TypeName IsExpression IfStatement
+ addTestSource('''
+class A {} class B extends A {} class C implements A {} class D {}
+f(A a){ if (a is ^) {}}''');
+ await computeSuggestions();
+
+ expect(replacementOffset, completionOffset);
+ expect(replacementLength, 0);
+ assertSuggestClass('B');
+ assertSuggestClass('C');
+ assertNotSuggested('A');
+ assertNotSuggested('D');
+ assertNotSuggested('Object');
+ }
+
test_keyword() async {
addSource(
'/testB.dart',
« no previous file with comments | « pkg/analysis_server/lib/src/services/completion/dart/optype.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698