Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: dart-lang/dart_style
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2.1.0
Choose a base ref
...
head repository: dart-lang/dart_style
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2.1.1
Choose a head ref
  • 1 commit
  • 8 files changed
  • 1 contributor

Commits on Sep 21, 2021

  1. Revert support for constructor tear-offs and republish as 2.1.1. (#1058)

    This enables pub to avoid selecting 2.1.0, which has a bad constraint
    on analyzer (#1051).
    munificent authored Sep 21, 2021
    Copy the full SHA
    7660eaa View commit details
Showing with 10 additions and 75 deletions.
  1. +5 −0 CHANGELOG.md
  2. +1 −1 lib/src/cli/formatter_options.dart
  3. +0 −1 lib/src/dart_formatter.dart
  4. +0 −6 lib/src/source_visitor.dart
  5. +1 −1 pubspec.yaml
  6. +1 −9 test/splitting/mixed.stmt
  7. +1 −40 test/splitting/type_arguments.stmt
  8. +1 −17 test/whitespace/expressions.stmt
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 2.1.1

* Republish 2.0.3 as 2.1.1 in order to avoid users getting 2.1.0, which has a
bad dependency constraint (#1051).

# 2.1.0

* Support generic function references and constructor tear-offs (#1028).
2 changes: 1 addition & 1 deletion lib/src/cli/formatter_options.dart
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ import 'show.dart';
import 'summary.dart';

// Note: The following line of code is modified by tool/grind.dart.
const dartStyleVersion = '2.1.0';
const dartStyleVersion = '2.1.1';

/// Global options that affect how the formatter produces and uses its outputs.
class FormatterOptions {
1 change: 0 additions & 1 deletion lib/src/dart_formatter.dart
Original file line number Diff line number Diff line change
@@ -89,7 +89,6 @@ class DartFormatter {
var featureSet = FeatureSet.fromEnableFlags2(
sdkLanguageVersion: Version(2, 13, 0),
flags: [
'constructor-tearoffs',
'generic-metadata',
'nonfunction-type-aliases',
'triple-shift'
6 changes: 0 additions & 6 deletions lib/src/source_visitor.dart
Original file line number Diff line number Diff line change
@@ -1805,12 +1805,6 @@ class SourceVisitor extends ThrowingAstVisitor {
builder.endSpan();
}

@override
void visitFunctionReference(FunctionReference node) {
visit(node.function);
visit(node.typeArguments);
}

@override
void visitFunctionTypeAlias(FunctionTypeAlias node) {
visitMetadata(node.metadata);
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: dart_style
# Note: See tool/grind.dart for how to bump the version.
version: 2.1.0
version: 2.1.1
description: >-
Opinionated, automatic Dart source code formatter.
Provides an API and a CLI tool.
10 changes: 1 addition & 9 deletions test/splitting/mixed.stmt
Original file line number Diff line number Diff line change
@@ -222,12 +222,4 @@ var longVariableName = identifierSoLongItWraps is SomeClassName;
<<<
var longVariableName =
identifierSoLongItWraps
is SomeClassName;
>>> generic function reference nested inside expression
veryLongFunction(argument, ConstructorTearOff<First, Second, Third, Fourth>, argument);
<<<
veryLongFunction(
argument,
ConstructorTearOff<First, Second,
Third, Fourth>,
argument);
is SomeClassName;
41 changes: 1 addition & 40 deletions test/splitting/type_arguments.stmt
Original file line number Diff line number Diff line change
@@ -94,43 +94,4 @@ new SomeClass<
fifth,
sixth,
seventh,
eighth);
>>> generic instantiation all fit on one line
Foo<A,B,C,D>;
<<<
Foo<A, B, C, D>;
>>> generic instantiation split between args
LongClassName<First, Second, Third, Fourth>;
<<<
LongClassName<First, Second, Third,
Fourth>;
>>> generic instantiation split before first if needed
LongClassName<FirstTypeArgumentIsTooLong, Second>;
<<<
LongClassName<
FirstTypeArgumentIsTooLong, Second>;
>>> generic instantiation split in middle if fit in two lines
LongClassName<First, Second, Third, Fourth, Fifth, Sixth, Seventh>;
<<<
LongClassName<First, Second, Third,
Fourth, Fifth, Sixth, Seventh>;
>>> generic instantiation split one per line if they don't fit in two lines
LongClassName<First, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth>;
<<<
LongClassName<
First,
Second,
Third,
Fourth,
Fifth,
Sixth,
Seventh,
Eighth>;
>>> generic instantiation indent nested type arguments
LongClassName<First, Inner<Second, Third, Fourth, Fifth, Sixth, Seventh>, Eighth>;
<<<
LongClassName<
First,
Inner<Second, Third, Fourth, Fifth,
Sixth, Seventh>,
Eighth>;
eighth);
18 changes: 1 addition & 17 deletions test/whitespace/expressions.stmt
Original file line number Diff line number Diff line change
@@ -170,20 +170,4 @@ obj?[foo];
>>> generic function expression
var generic = < T,S >(){};
<<<
var generic = <T, S>() {};
>>> generic method instantiation
void main() => id < int > ;
<<<
void main() => id<int>;
>>> generic method instantiation
void main() => id < int , String , bool > ;
<<<
void main() => id<int, String, bool>;
>>> generic constructor tear-off
var x = Class < int >;
<<<
var x = Class<int>;
>>> generic name constructor tear-off
var x = Class < int > . named;
<<<
var x = Class<int>.named;
var generic = <T, S>() {};