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

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

Issue 22928013: Formatter fixes and tweaks. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 4 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
Index: pkg/analyzer_experimental/lib/src/services/formatter_impl.dart
===================================================================
--- pkg/analyzer_experimental/lib/src/services/formatter_impl.dart (revision 26430)
+++ pkg/analyzer_experimental/lib/src/services/formatter_impl.dart (working copy)
@@ -387,7 +387,8 @@
visitDeclaredIdentifier(DeclaredIdentifier node) {
token(node.keyword);
space();
- visitSuffixed(node.type, ' ');
+ visit(node.type);
+ space();
Brian Wilkerson 2013/08/21 18:18:53 Do you want to mark somehow (comment perhaps) that
pquitslund 2013/08/21 19:40:40 Good catch. Fixed!
visit(node.identifier);
}
@@ -461,7 +462,8 @@
visitFieldFormalParameter(FieldFormalParameter node) {
token(node.keyword);
space();
- visitSuffixed(node.type, ' ');
+ visit(node.type);
+ space();
token(node.thisToken);
token(node.period);
visit(node.identifier);
@@ -477,7 +479,7 @@
token(node.inKeyword);
space();
visit(node.iterator);
- token(node.leftParenthesis);
+ token(node.rightParenthesis);
space();
visit(node.body);
}
@@ -834,8 +836,7 @@
}
visitSimpleFormalParameter(SimpleFormalParameter node) {
- token(node.keyword);
- space();
+ modifier(node.keyword);
visitSuffixed(node.type, ' ');
visit(node.identifier);
}
@@ -914,7 +915,9 @@
}
visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) {
- visitSuffixed(node.variables, ';');
+ preservePrecedingNewlines = true;
+ visit(node.variables);
+ token(node.semicolon);
}
visitTryStatement(TryStatement node) {
@@ -950,7 +953,10 @@
visitVariableDeclaration(VariableDeclaration node) {
visit(node.name);
- visitPrefixed(' = ', node.initializer);
+ space();
Brian Wilkerson 2013/08/21 18:18:53 Similarly here, the spaces and equals are only wan
pquitslund 2013/08/21 19:40:40 Exactly right. Thanks!
+ token(node.equals);
+ space();
+ visit(node.initializer);
}
visitVariableDeclarationList(VariableDeclarationList node) {
@@ -963,6 +969,7 @@
visitVariableDeclarationStatement(VariableDeclarationStatement node) {
visit(node.variables);
token(node.semicolon);
+ needsNewline = true;
}
visitWhileStatement(WhileStatement node) {

Powered by Google App Engine
This is Rietveld 408576698