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

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

Issue 2525553003: Tighten the span around index operators. (Closed)
Patch Set: Created 4 years 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 | « CHANGELOG.md ('k') | lib/src/source_visitor.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.chunk; 5 library dart_style.src.chunk;
6 6
7 import 'fast_hash.dart'; 7 import 'fast_hash.dart';
8 import 'nesting_level.dart'; 8 import 'nesting_level.dart';
9 import 'rule/rule.dart'; 9 import 'rule/rule.dart';
10 10
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 322
323 /// Splitting the internals of collection literal arguments. 323 /// Splitting the internals of collection literal arguments.
324 /// 324 ///
325 /// Used to prefer splitting at the argument boundary over splitting the 325 /// Used to prefer splitting at the argument boundary over splitting the
326 /// collection contents. 326 /// collection contents.
327 static const splitCollections = 2; 327 static const splitCollections = 2;
328 328
329 /// Splitting on the "." in a named constructor. 329 /// Splitting on the "." in a named constructor.
330 static const constructorName = 3; 330 static const constructorName = 3;
331 331
332 /// Splitting a `[...]` index operator.
333 static const index = 3;
334
332 /// Splitting before a type argument or type parameter. 335 /// Splitting before a type argument or type parameter.
333 static const typeArgument = 4; 336 static const typeArgument = 4;
334 } 337 }
335 338
336 /// The in-progress state for a [Span] that has been started but has not yet 339 /// The in-progress state for a [Span] that has been started but has not yet
337 /// been completed. 340 /// been completed.
338 class OpenSpan { 341 class OpenSpan {
339 /// Index of the first chunk contained in this span. 342 /// Index of the first chunk contained in this span.
340 int get start => _start; 343 int get start => _start;
341 int _start; 344 int _start;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 /// output. This way, commented out chunks of code do not get erroneously 392 /// output. This way, commented out chunks of code do not get erroneously
390 /// re-indented. 393 /// re-indented.
391 final bool flushLeft; 394 final bool flushLeft;
392 395
393 /// Whether this comment is an inline block comment. 396 /// Whether this comment is an inline block comment.
394 bool get isInline => linesBefore == 0 && !isLineComment; 397 bool get isInline => linesBefore == 0 && !isLineComment;
395 398
396 SourceComment(this.text, this.linesBefore, 399 SourceComment(this.text, this.linesBefore,
397 {this.isLineComment, this.flushLeft}); 400 {this.isLineComment, this.flushLeft});
398 } 401 }
OLDNEW
« no previous file with comments | « CHANGELOG.md ('k') | lib/src/source_visitor.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698