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

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

Issue 480413003: more invocation code completion improvements (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 fe803acd161f348dbb5f384025c5310d6a00d7d4..fe48ef8232475d4f9cfd80ec4d4f9c6edbc7ff48 100644
--- a/pkg/analysis_server/test/services/completion/invocation_computer_test.dart
+++ b/pkg/analysis_server/test/services/completion/invocation_computer_test.dart
@@ -25,31 +25,79 @@ 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 {A b;} main() {A a; a.^}');
+ addTestSource('class A {var b; var _c;} main() {A a; a.^}');
return computeFull().then((_) {
assertSuggestField('b');
+ assertSuggestField('_c');
+ });
+ }
+
+ test_field_imported() {
+ addSource('/testB.dart', 'lib B; class X {var y; var _z;}');
+ addTestSource('import "/testB.dart"; main() {X x; x.^}');
+ return computeFull().then((_) {
+ assertSuggestField('y');
+ assertNotSuggested('_z');
});
}
test_getter() {
- addTestSource('class A {A get b => 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');
+ });
+ }
+
+ test_getter_imported() {
+ 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');
+ assertNotSuggested('_z');
});
}
test_method() {
- addTestSource('class A {b(X x) {}} main() {A a; a.^}');
+ addTestSource('class A {b(X x) {} _c(X x) {}} main() {A a; a.^}');
return computeFull().then((_) {
assertSuggestMethod('b');
+ assertSuggestMethod('_c');
+ });
+ }
+
+ test_method_imported() {
+ addSource('/testB.dart', 'lib B; class X {y(X x) {} _z(X x) {}}');
+ addTestSource('import "/testB.dart"; main() {X x; x.^}');
+ return computeFull().then((_) {
+ assertSuggestMethod('y');
+ assertNotSuggested('_z');
});
}
test_setter() {
- addTestSource('class A {set b(X x) {}} main() {A a; a.^}');
+ addTestSource('class A {set b(X x) {} set _c(X x) {}} main() {A a; a.^}');
return computeFull().then((_) {
assertSuggestSetter('b');
+ assertSuggestSetter('_c');
+ });
+ }
+
+ test_setter_imported() {
+ addSource('/testB.dart', 'lib B; class X {set y(X x) {} set _z(X x) {}}');
+ addTestSource('import "/testB.dart"; main() {X x; x.^}');
+ return computeFull().then((_) {
+ assertSuggestSetter('y');
+ assertNotSuggested('_z');
});
}
}
« 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