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

Unified Diff: pkg/analyzer/lib/src/services/formatter_impl.dart

Issue 320503002: Tweaks for long formal parameters and method body '{' formatting. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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/analyzer/test/services/data/cu_tests.data » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/services/formatter_impl.dart
diff --git a/pkg/analyzer/lib/src/services/formatter_impl.dart b/pkg/analyzer/lib/src/services/formatter_impl.dart
index cfa81c9548c6d7ba4e0686d374724bceb2afb805..104507fbb273806a5ae1cc0e0a13f7112c76883e 100644
--- a/pkg/analyzer/lib/src/services/formatter_impl.dart
+++ b/pkg/analyzer/lib/src/services/formatter_impl.dart
@@ -808,7 +808,8 @@ class SourceVisitor implements AstVisitor {
for (var i = 0; i < size; i++) {
var parameter = parameters[i];
if (i > 0) {
- append(', ');
+ append(',');
+ space();
}
if (groupEnd == null && parameter is DefaultFormalParameter) {
if (identical(parameter.kind, ParameterKind.NAMED)) {
@@ -1061,7 +1062,7 @@ class SourceVisitor implements AstVisitor {
if (!node.isGetter) {
visit(node.parameters);
}
- visitPrefixedBody(space, node.body);
+ visitPrefixedBody(nonBreakingSpace, node.body);
}
visitMethodInvocation(MethodInvocation node) {
@@ -1180,7 +1181,7 @@ class SourceVisitor implements AstVisitor {
visitSimpleFormalParameter(SimpleFormalParameter node) {
visitMemberMetadata(node.metadata);
modifier(node.keyword);
- visitNode(node.type, followedBy: space);
+ visitNode(node.type, followedBy: nonBreakingSpace);
visit(node.identifier);
}
« no previous file with comments | « no previous file | pkg/analyzer/test/services/data/cu_tests.data » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698