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

Side by Side Diff: pkg/analyzer_experimental/lib/src/services/formatter_impl.dart

Issue 26164007: Formatter method cascade indents. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analyzer_experimental/test/services/formatter_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library formatter_impl; 5 library formatter_impl;
6 6
7 import 'dart:math'; 7 import 'dart:math';
8 8
9 import 'package:analyzer_experimental/analyzer.dart'; 9 import 'package:analyzer_experimental/analyzer.dart';
10 import 'package:analyzer_experimental/src/generated/parser.dart'; 10 import 'package:analyzer_experimental/src/generated/parser.dart';
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 } 446 }
447 447
448 visitBreakStatement(BreakStatement node) { 448 visitBreakStatement(BreakStatement node) {
449 token(node.keyword); 449 token(node.keyword);
450 visitNode(node.label, precededBy: space); 450 visitNode(node.label, precededBy: space);
451 token(node.semicolon); 451 token(node.semicolon);
452 } 452 }
453 453
454 visitCascadeExpression(CascadeExpression node) { 454 visitCascadeExpression(CascadeExpression node) {
455 visit(node.target); 455 visit(node.target);
456 indent(2);
456 visitNodes(node.cascadeSections); 457 visitNodes(node.cascadeSections);
458 unindent(2);
457 } 459 }
458 460
459 visitCatchClause(CatchClause node) { 461 visitCatchClause(CatchClause node) {
460 462
461 token(node.onKeyword, precededBy: space, followedBy: space); 463 token(node.onKeyword, precededBy: space, followedBy: space);
462 visit(node.exceptionType); 464 visit(node.exceptionType);
463 465
464 if (node.catchKeyword != null) { 466 if (node.catchKeyword != null) {
465 if (node.exceptionType != null) { 467 if (node.exceptionType != null) {
466 space(); 468 space();
(...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after
1522 var lastLine = 1524 var lastLine =
1523 lineInfo.getLocation(lastOffset).lineNumber; 1525 lineInfo.getLocation(lastOffset).lineNumber;
1524 var currentLine = 1526 var currentLine =
1525 lineInfo.getLocation(currentOffset).lineNumber; 1527 lineInfo.getLocation(currentOffset).lineNumber;
1526 return currentLine - lastLine; 1528 return currentLine - lastLine;
1527 } 1529 }
1528 1530
1529 String toString() => writer.toString(); 1531 String toString() => writer.toString();
1530 1532
1531 } 1533 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer_experimental/test/services/formatter_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698