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

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

Issue 1867063003: show only named argument suggestions - fixes #25198, fixes #23992 (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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/test/domain_completion_test.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/dart/optype_test.dart
diff --git a/pkg/analysis_server/test/services/completion/dart/optype_test.dart b/pkg/analysis_server/test/services/completion/dart/optype_test.dart
index 14cc3a8bbbee51f26c76bfdf4a2609446fd49ba1..455495cf63baac764120f1a11c3842593a56c53c 100644
--- a/pkg/analysis_server/test/services/completion/dart/optype_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/optype_test.dart
@@ -48,6 +48,7 @@ class OpTypeTest {
void assertOpType(
{bool caseLabel: false,
bool constructors: false,
+ bool namedArgs: false,
bool prefixed: false,
bool returnValue: false,
bool statementLabel: false,
@@ -58,6 +59,8 @@ class OpTypeTest {
expect(visitor.includeCaseLabelSuggestions, caseLabel, reason: 'caseLabel');
expect(visitor.includeConstructorSuggestions, constructors,
reason: 'constructors');
+ expect(visitor.includeNamedArgumentSuggestions, namedArgs,
+ reason: 'namedArgs');
expect(visitor.includeReturnValueSuggestions, returnValue,
reason: 'returnValue');
expect(visitor.includeStatementLabelSuggestions, statementLabel,
@@ -88,10 +91,36 @@ class OpTypeTest {
test_ArgumentList() {
// ArgumentList MethodInvocation ExpressionStatement Block
- addTestSource('void main() {expect(^)}');
+ addTestSource('void main() {expect(^)}', resolved: false);
+ // If "expect()" were resolved, then either namedArgs would be true
+ // or returnValue and typeNames would be true.
+ assertOpType(namedArgs: true, returnValue: true, typeNames: true);
+ }
+
+ test_ArgumentList_resolved() {
+ // ArgumentList MethodInvocation ExpressionStatement Block
+ addTestSource('void main() {int.parse(^)}', resolved: true);
assertOpType(returnValue: true, typeNames: true);
}
+ test_ArgumentList_resolved_1_0() {
+ // ArgumentList MethodInvocation ExpressionStatement Block
+ addTestSource('main() { foo(^);} foo({one, two}) {}', resolved: true);
+ assertOpType(namedArgs: true);
+ }
+
+ test_ArgumentList_resolved_1_1() {
+ // ArgumentList MethodInvocation ExpressionStatement Block
+ addTestSource('main() { foo(o^);} foo({one, two}) {}', resolved: true);
+ assertOpType(namedArgs: true);
+ }
+
+ test_ArgumentList_resolved_2_0() {
+ // ArgumentList MethodInvocation ExpressionStatement Block
+ addTestSource('void main() {int.parse("16", ^)}', resolved: true);
+ assertOpType(namedArgs: true);
+ }
+
test_ArgumentList_namedParam() {
// SimpleIdentifier NamedExpression ArgumentList MethodInvocation
// ExpressionStatement
« no previous file with comments | « pkg/analysis_server/test/domain_completion_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698