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

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

Issue 2679503002: suggest method references in named expressions (Closed)
Patch Set: merge Created 3 years, 10 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_target_test.dart
diff --git a/pkg/analysis_server/test/services/completion/completion_target_test.dart b/pkg/analysis_server/test/services/completion/completion_target_test.dart
index e796abbeb50c324da32abc73806dc96504c8a862..c553188b576062e8fd69ae4d6edbc0be112b1fbe 100644
--- a/pkg/analysis_server/test/services/completion/completion_target_test.dart
+++ b/pkg/analysis_server/test/services/completion/completion_target_test.dart
@@ -74,6 +74,12 @@ class CompletionTargetTest extends AbstractContextTest {
assertTarget(')', '()', argIndex: 0, isFunctionalArgument: true);
}
+ test_ArgumentList_InstanceCreationExpression_functionArg3() {
+ // ArgumentList InstanceCreationExpression Block
+ addTestSource('main() {new B(1, f: ^)} class B{B(int i, {f()}){}}');
+ assertTarget('', 'f: ', argIndex: 1, isFunctionalArgument: true);
+ }
+
test_ArgumentList_MethodInvocation() {
// ArgumentList MethodInvocation Block
addTestSource('main() {foo(^)}');
@@ -116,6 +122,18 @@ class CompletionTargetTest extends AbstractContextTest {
assertTarget(')', '()', argIndex: 0, isFunctionalArgument: true);
}
+ test_ArgumentList_MethodInvocation_functionArg3() {
+ // ArgumentList MethodInvocation Block
+ addTestSource('main() {foo(f: ^)} foo({f()}) {}');
+ assertTarget('', 'f: ', argIndex: 0, isFunctionalArgument: true);
+ }
+
+ test_ArgumentList_MethodInvocation_functionArg4() {
+ // ArgumentList MethodInvocation Block
+ addTestSource('main() {new B().boo(f: ^)} class B{boo({f()}){}}');
+ assertTarget('', 'f: ', argIndex: 0, isFunctionalArgument: true);
+ }
+
test_AsExpression_identifier() {
// SimpleIdentifier TypeName AsExpression
addTestSource('class A {var b; X _c; foo() {var a; (a^ as String).foo();}');

Powered by Google App Engine
This is Rietveld 408576698