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

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

Issue 2128693002: fix code completion when enableTrailingCommas is true (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: merge Created 4 years, 5 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/dart/optype.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_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 569610cb219a389cc2efefe22474971a913bf8f2..f7cca21b8d96b746e60d1a52e2c137b1636da2d7 100644
--- a/pkg/analysis_server/test/services/completion/completion_target_test.dart
+++ b/pkg/analysis_server/test/services/completion/completion_target_test.dart
@@ -61,6 +61,16 @@ class CompletionTargetTest extends AbstractContextTest {
assertTarget(')', '()', argIndex: 0);
}
+ test_ArgumentList_InstanceCreationExpression2() {
+ // ArgumentList InstanceCreationExpression Block
+ addTestSource('main() {new Foo(a,^)}');
+ if (context.analysisOptions.enableTrailingCommas) {
+ assertTarget(')', '(a)', argIndex: 1);
+ } else {
+ assertTarget('', '(a, )', argIndex: 1);
+ }
+ }
+
test_ArgumentList_InstanceCreationExpression_functionArg2() {
// ArgumentList InstanceCreationExpression Block
addTestSource('main() {new B(^)} class B{B(f()){}}');
@@ -85,10 +95,20 @@ class CompletionTargetTest extends AbstractContextTest {
assertTarget('n', '(n)', argIndex: 0);
}
+ test_ArgumentList_MethodInvocation3a() {
+ // ArgumentList MethodInvocation Block
+ addTestSource('main() {foo((n)^)}');
+ assertTarget(')', '((n))', argIndex: 0);
+ }
+
test_ArgumentList_MethodInvocation4() {
// ArgumentList MethodInvocation Block
addTestSource('main() {foo(n,^)}');
- assertTarget('', '(n, )', argIndex: 1);
+ if (context.analysisOptions.enableTrailingCommas) {
+ assertTarget(')', '(n)', argIndex: 1);
+ } else {
+ assertTarget('', '(n, )', argIndex: 1);
+ }
}
test_ArgumentList_MethodInvocation_functionArg() {
« no previous file with comments | « pkg/analysis_server/lib/src/services/completion/dart/optype.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698