commit | 15c5e383376bd8748b3b24870f0a4ed2dad4460a | [log] [tgz] |
---|---|---|
author | Konstantin Shcheglov <scheglov@google.com> | Fri Dec 10 01:53:52 2021 +0000 |
committer | Konstantin Shcheglov <scheglov@google.com> | Fri Dec 10 01:53:52 2021 +0000 |
tree | 9f7ee880c1c24ab867ca6c6ef72bc185e2b71001 | |
parent | 005aa0b81a93d75c7240e4a0af07d16774b06162 [diff] |
Support RedirectingConstructorInvocation in ArgListContributor. Change-Id: I969c536b5a4089bfb13fdb5f6cd4dae2e486cc4c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/222580 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
diff --git a/pkg/analysis_server/test/services/completion/dart/arglist_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/arglist_contributor_test.dart index 7ed981d..fc2016f 100644 --- a/pkg/analysis_server/test/services/completion/dart/arglist_contributor_test.dart +++ b/pkg/analysis_server/test/services/completion/dart/arglist_contributor_test.dart
@@ -882,16 +882,15 @@ check(); // This constructor invocation. - // TODO(scheglov) implement -// addTestSource2(''' -// $languageVersionLine -// class A { -// A$parameters; -// A.named() : this$arguments; -// } -// '''); -// await computeSuggestions(); -// check(); + addTestSource2(''' +$languageVersionLine +class A { + A$parameters; + A.named() : this$arguments; +} +'''); + await computeSuggestions(); + check(); // Invalid: getter invocation. // Parameters not used. Check not used.
diff --git a/pkg/analyzer_plugin/lib/src/utilities/completion/completion_target.dart b/pkg/analyzer_plugin/lib/src/utilities/completion/completion_target.dart index 77ea08e..24e9359 100644 --- a/pkg/analyzer_plugin/lib/src/utilities/completion/completion_target.dart +++ b/pkg/analyzer_plugin/lib/src/utilities/completion/completion_target.dart
@@ -286,6 +286,8 @@ executable = invocation.constructorName.staticElement; } else if (invocation is MethodInvocation) { executable = invocation.methodName.staticElement; + } else if (invocation is RedirectingConstructorInvocation) { + executable = invocation.staticElement; } else if (invocation is SuperConstructorInvocation) { executable = invocation.staticElement; }