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

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

Issue 1319753002: exclude instance suggestions in static context - fixes #22932 (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: merge Created 5 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
Index: pkg/analysis_server/test/services/completion/completion_test_util.dart
diff --git a/pkg/analysis_server/test/services/completion/completion_test_util.dart b/pkg/analysis_server/test/services/completion/completion_test_util.dart
index 6aabfe648f84d0613a21d2666911b091325449f2..453cdd3e317198d12baf7fb84162004302d39620 100644
--- a/pkg/analysis_server/test/services/completion/completion_test_util.dart
+++ b/pkg/analysis_server/test/services/completion/completion_test_util.dart
@@ -3481,6 +3481,46 @@ abstract class AbstractSelectorSuggestionTest extends AbstractCompletionTest {
});
}
+ test_MethodDeclaration_body_static() {
+ // Block BlockFunctionBody MethodDeclaration
+ addSource(
+ '/testC.dart',
+ '''
+ class C {
+ c1() {}
+ var c2;
+ static c3() {}
+ static var c4;}''');
+ addTestSource('''
+ import "/testC.dart";
+ class B extends C {
+ b1() {}
+ var b2;
+ static b3() {}
+ static var b4;}
+ class A extends B {
+ a1() {}
+ var a2;
+ static a3() {}
+ static var a4;
+ static a() {^}}''');
+ computeFast();
+ return computeFull((bool result) {
+ assertNotSuggested('a1');
+ assertNotSuggested('a2');
+ assertSuggestLocalMethod('a3', 'A', null);
+ assertSuggestLocalField('a4', null);
+ assertNotSuggested('b1');
+ assertNotSuggested('b2');
+ assertNotSuggested('b3');
+ assertNotSuggested('b4');
+ assertNotSuggested('c1');
+ assertNotSuggested('c2');
+ assertNotSuggested('c3');
+ assertNotSuggested('c4');
+ });
+ }
+
test_MethodDeclaration_members() {
// Block BlockFunctionBody MethodDeclaration
addTestSource('class A {@deprecated X f; Z _a() {^} var _g;}');

Powered by Google App Engine
This is Rietveld 408576698