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

Side by Side Diff: lib/src/line_writer.dart

Issue 1257903002: Optimize splitting long, complex lines. (Closed) Base URL: https://github.com/dart-lang/dart_style.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « lib/src/line_splitting/solve_state_queue.dart ('k') | lib/src/rule_set.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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 dart_style.src.line_writer; 5 library dart_style.src.line_writer;
6 6
7 import 'chunk.dart'; 7 import 'chunk.dart';
8 import 'dart_formatter.dart'; 8 import 'dart_formatter.dart';
9 import 'debug.dart' as debug; 9 import 'debug.dart' as debug;
10 import 'line_splitter.dart'; 10 import 'line_splitting/line_splitter.dart';
11 import 'whitespace.dart'; 11 import 'whitespace.dart';
12 12
13 /// Given a series of chunks, splits them into lines and writes the result to 13 /// Given a series of chunks, splits them into lines and writes the result to
14 /// a buffer. 14 /// a buffer.
15 class LineWriter { 15 class LineWriter {
16 final _buffer = new StringBuffer(); 16 final _buffer = new StringBuffer();
17 17
18 final List<Chunk> _chunks; 18 final List<Chunk> _chunks;
19 19
20 final String _lineEnding; 20 final String _lineEnding;
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 final int selectionStart; 268 final int selectionStart;
269 269
270 /// Where in the resulting buffer the selection end point should appear if it 270 /// Where in the resulting buffer the selection end point should appear if it
271 /// was contained within this split list of chunks. 271 /// was contained within this split list of chunks.
272 /// 272 ///
273 /// Otherwise, this is `null`. 273 /// Otherwise, this is `null`.
274 final int selectionEnd; 274 final int selectionEnd;
275 275
276 FormatResult(this.text, this.cost, this.selectionStart, this.selectionEnd); 276 FormatResult(this.text, this.cost, this.selectionStart, this.selectionEnd);
277 } 277 }
OLDNEW
« no previous file with comments | « lib/src/line_splitting/solve_state_queue.dart ('k') | lib/src/rule_set.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698