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

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

Issue 489813002: include inherited members in invocation suggestions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 6 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/suggestion_builder.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/invocation_computer_test.dart
diff --git a/pkg/analysis_server/test/services/completion/invocation_computer_test.dart b/pkg/analysis_server/test/services/completion/invocation_computer_test.dart
index fe48ef8232475d4f9cfd80ec4d4f9c6edbc7ff48..e191a9aee49a5fc698b0e6a1ec144499b8164d88 100644
--- a/pkg/analysis_server/test/services/completion/invocation_computer_test.dart
+++ b/pkg/analysis_server/test/services/completion/invocation_computer_test.dart
@@ -25,14 +25,6 @@ class InvocationComputerTest extends AbstractCompletionTest {
computer = new InvocationComputer();
}
- test_library_prefix() {
- addSource('/testB.dart', 'lib B; class X { }');
- addTestSource('import "/testB.dart" as b; main() {b.^}');
- return computeFull().then((_) {
- assertSuggestClass('X');
- });
- }
-
test_field() {
addTestSource('class A {var b; var _c;} main() {A a; a.^}');
return computeFull().then((_) {
@@ -50,8 +42,18 @@ class InvocationComputerTest extends AbstractCompletionTest {
});
}
+ test_field_superclass() {
+ addTestSource(
+ 'class A {var b; var _c;} class B extends A {} main() {B b; b.^}');
+ return computeFull().then((_) {
+ assertSuggestField('b');
+ assertSuggestField('_c');
+ });
+ }
+
test_getter() {
- addTestSource('class A {A get b => new A();A get _c => new A();} main() {A a; a.^}');
+ addTestSource(
+ 'class A {A get b => new A();A get _c => new A();} main() {A a; a.^}');
return computeFull().then((_) {
assertSuggestGetter('b');
assertSuggestGetter('_c');
@@ -59,7 +61,9 @@ class InvocationComputerTest extends AbstractCompletionTest {
}
test_getter_imported() {
- addSource('/testB.dart', 'lib B; class X {X get y => new X(); X get _z => new X();}');
+ addSource(
+ '/testB.dart',
+ 'lib B; class X {X get y => new X(); X get _z => new X();}');
addTestSource('import "/testB.dart"; main() {X x; x.^}');
return computeFull().then((_) {
assertSuggestGetter('y');
@@ -67,6 +71,25 @@ class InvocationComputerTest extends AbstractCompletionTest {
});
}
+ test_getter_interface() {
+ addTestSource(
+ '''class A {A get b => new A();A get _c => new A();}
+ class B implements A {A get b => new A();}
+ main() {B b; b.^}''');
+ return computeFull().then((_) {
+ assertSuggestGetter('b');
+ assertSuggestGetter('_c');
+ });
+ }
+
+ test_library_prefix() {
+ addSource('/testB.dart', 'lib B; class X { }');
+ addTestSource('import "/testB.dart" as b; main() {b.^}');
+ return computeFull().then((_) {
+ assertSuggestClass('X');
+ });
+ }
+
test_method() {
addTestSource('class A {b(X x) {} _c(X x) {}} main() {A a; a.^}');
return computeFull().then((_) {
@@ -84,6 +107,17 @@ class InvocationComputerTest extends AbstractCompletionTest {
});
}
+ test_method_imported_mixin() {
+ addSource('/testB.dart', 'lib B; class X {y(X x) {} _z(X x) {}}');
+ addTestSource('''import "/testB.dart";
+ class A extends Object with X {}
+ main() {A a; a.^}''');
+ return computeFull().then((_) {
+ assertSuggestMethod('y');
+ assertNotSuggested('_z');
+ });
+ }
+
test_setter() {
addTestSource('class A {set b(X x) {} set _c(X x) {}} main() {A a; a.^}');
return computeFull().then((_) {
« no previous file with comments | « pkg/analysis_server/lib/src/services/completion/suggestion_builder.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698