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

Unified Diff: pkg/analysis_server/lib/src/services/completion/dart/local_reference_contributor.dart

Issue 2728653004: Default arg support continued (flutter-intellij#553). (Closed)
Patch Set: Review tweaks. 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
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/services/completion/dart/local_reference_contributor.dart
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/local_reference_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/local_reference_contributor.dart
index bbe9d33a09d48f826ba5f2ab02fee3ee9a8786a6..f10cd4b3055996b11e2f7409e2ab2b008a0caa06 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/local_reference_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/local_reference_contributor.dart
@@ -482,18 +482,7 @@ class _LocalVisitor extends LocalDeclarationVisitor {
suggestion.hasNamedParameters = namedParameters.isNotEmpty;
suggestion.defaultArgumentListString =
- _buildDefaultArgList(requiredParameters, namedParameters);
- }
-
- String _buildDefaultArgList(Iterable<ParameterElement> requiredParams,
- Iterable<ParameterElement> namedParams) {
- List<String> args = requiredParams.map((p) => p.name).toList();
- List<String> requiredArgs = namedParams
- .where((p) => p.isRequired)
- .map((p) => '${p.name}: null')
- .toList();
- args.addAll(requiredArgs);
- return args.join(', ');
+ buildDefaultArgList(requiredParameters, namedParameters);
}
bool _isVoid(TypeAnnotation returnType) {
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698