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

Unified Diff: packages/dart_style/lib/src/line_splitting/line_splitter.dart

Issue 1521693002: Roll Observatory deps (charted -> ^0.3.0) (Closed) Base URL: https://chromium.googlesource.com/external/github.com/dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « packages/dart_style/lib/src/io.dart ('k') | packages/dart_style/lib/src/line_splitting/rule_set.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/dart_style/lib/src/line_splitting/line_splitter.dart
diff --git a/packages/dart_style/lib/src/line_splitting/line_splitter.dart b/packages/dart_style/lib/src/line_splitting/line_splitter.dart
index f562ca40dc699dc45f96e404f1b4ae7c2b66d207..420c509fe381fe06e9ebdb49ab09a2440cf80022 100644
--- a/packages/dart_style/lib/src/line_splitting/line_splitter.dart
+++ b/packages/dart_style/lib/src/line_splitting/line_splitter.dart
@@ -130,10 +130,10 @@ class LineSplitter {
int firstLineIndent,
{bool flushLeft: false})
: chunks = chunks,
- // Collect the set of soft rules that we need to select values for.
+ // Collect the set of rules that we need to select values for.
rules = chunks
.map((chunk) => chunk.rule)
- .where((rule) => rule != null && rule is! HardSplitRule)
+ .where((rule) => rule != null)
.toSet()
.toList(growable: false),
blockIndentation = blockIndentation,
@@ -145,6 +145,12 @@ class LineSplitter {
for (var i = 0; i < rules.length; i++) {
rules[i].index = i;
}
+
+ // Now that every used rule has an index, tell the rules to discard any
+ // constraints on unindexed rules.
+ for (var rule in rules) {
+ rule.forgetUnusedRules();
+ }
}
/// Determine the best way to split the chunks into lines that fit in the
« no previous file with comments | « packages/dart_style/lib/src/io.dart ('k') | packages/dart_style/lib/src/line_splitting/rule_set.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698