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

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

Issue 651443006: filter invalid method invocation suggestions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 6 years, 2 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/local_computer.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/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 b7101ca91d4e250c817223a2a33b6ef343fa47ea..0931a4e84a2a00a775695c70e498b5b884e9252d 100644
--- a/pkg/analysis_server/test/services/completion/completion_test_util.dart
+++ b/pkg/analysis_server/test/services/completion/completion_test_util.dart
@@ -1312,7 +1312,7 @@ class AbstractSelectorSuggestionTest extends AbstractCompletionTest {
test_MethodDeclaration_parameters_named() {
// Block BlockFunctionBody MethodDeclaration
- addTestSource('class A {@deprecated Z a(X x, {y: boo}) {^}}');
+ addTestSource('class A {@deprecated Z a(X x, _, b, {y: boo}) {^}}');
computeFast();
return computeFull(true).then((_) {
CompletionSuggestion methodA = assertSuggestLocalMethod('a', 'A', 'Z');
@@ -1322,7 +1322,9 @@ class AbstractSelectorSuggestionTest extends AbstractCompletionTest {
}
assertSuggestParameter('x', 'X');
assertSuggestParameter('y', null);
+ assertSuggestParameter('b', null);
assertSuggestImportedClass('int');
+ assertNotSuggested('_');
});
}
@@ -1343,6 +1345,38 @@ class AbstractSelectorSuggestionTest extends AbstractCompletionTest {
});
}
+ test_MethodInvocation_no_semicolon() {
+ // MethodInvocation ExpressionStatement Block
+ addTestSource('''
+ main() { }
+ class I {X get f => new A();get _g => new A();}
+ class A implements I {
+ var b; X _c;
+ X get d => new A();get _e => new A();
+ // no semicolon between completion point and next statement
+ set s1(I x) {} set _s2(I x) {x.^ m(null);}
+ m(X x) {} I _n(X x) {}}
+ class X{}''');
+ computeFast();
+ return computeFull(true).then((_) {
+ assertSuggestInvocationGetter('f', 'X');
+ assertSuggestInvocationGetter('_g', null);
+ assertNotSuggested('b');
+ assertNotSuggested('_c');
+ assertNotSuggested('d');
+ assertNotSuggested('_e');
+ assertNotSuggested('s1');
+ assertNotSuggested('_s2');
+ assertNotSuggested('m');
+ assertNotSuggested('_n');
+ assertNotSuggested('a');
+ assertNotSuggested('A');
+ assertNotSuggested('X');
+ assertNotSuggested('Object');
+ assertNotSuggested('==');
+ });
+ }
+
test_PrefixedIdentifier_class_imported() {
// SimpleIdentifier PrefixedIdentifier ExpressionStatement
addSource('/testB.dart', '''
« no previous file with comments | « pkg/analysis_server/lib/src/services/completion/local_computer.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698