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

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

Issue 139263011: dartfmt line wrapping bypass option support. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/analyzer/bin/formatter.dart ('k') | pkg/analyzer/lib/src/services/writer.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/analyzer.dart'; 9 import 'package:analyzer/analyzer.dart';
10 import 'package:analyzer/src/generated/java_core.dart' show CharSequence; 10 import 'package:analyzer/src/generated/java_core.dart' show CharSequence;
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 /// Post format selection information. 381 /// Post format selection information.
382 Selection selection; 382 Selection selection;
383 383
384 384
385 /// Initialize a newly created visitor to write source code representing 385 /// Initialize a newly created visitor to write source code representing
386 /// the visited nodes to the given [writer]. 386 /// the visited nodes to the given [writer].
387 SourceVisitor(FormatterOptions options, this.lineInfo, this.source, 387 SourceVisitor(FormatterOptions options, this.lineInfo, this.source,
388 this.preSelection) 388 this.preSelection)
389 : writer = new SourceWriter(indentCount: options.initialIndentationLevel, 389 : writer = new SourceWriter(indentCount: options.initialIndentationLevel,
390 lineSeparator: options.lineSeparator, 390 lineSeparator: options.lineSeparator,
391 maxLineLength: options.pageWidth,
391 useTabs: options.tabsForIndent, 392 useTabs: options.tabsForIndent,
392 spacesPerIndent: options.spacesPerIndent), 393 spacesPerIndent: options.spacesPerIndent),
393 codeTransforms = options.codeTransforms; 394 codeTransforms = options.codeTransforms;
394 395
395 visitAdjacentStrings(AdjacentStrings node) { 396 visitAdjacentStrings(AdjacentStrings node) {
396 visitNodes(node.strings, separatedBy: space); 397 visitNodes(node.strings, separatedBy: space);
397 } 398 }
398 399
399 visitAnnotation(Annotation node) { 400 visitAnnotation(Annotation node) {
400 token(node.atSign); 401 token(node.atSign);
(...skipping 1297 matching lines...) Expand 10 before | Expand all | Expand 10 after
1698 var lastLine = 1699 var lastLine =
1699 lineInfo.getLocation(lastOffset).lineNumber; 1700 lineInfo.getLocation(lastOffset).lineNumber;
1700 var currentLine = 1701 var currentLine =
1701 lineInfo.getLocation(currentOffset).lineNumber; 1702 lineInfo.getLocation(currentOffset).lineNumber;
1702 return currentLine - lastLine; 1703 return currentLine - lastLine;
1703 } 1704 }
1704 1705
1705 String toString() => writer.toString(); 1706 String toString() => writer.toString();
1706 1707
1707 } 1708 }
OLDNEW
« no previous file with comments | « pkg/analyzer/bin/formatter.dart ('k') | pkg/analyzer/lib/src/services/writer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698