diff --git a/CHANGELOG.md b/CHANGELOG.md index 19d2c552..149d8c9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 2.0.1 + +* Support triple-shift `>>>` and `>>>=` operators (#992). + # 2.0.0 * Migrate to null safety. diff --git a/lib/src/dart_formatter.dart b/lib/src/dart_formatter.dart index eac93775..d88af89a 100644 --- a/lib/src/dart_formatter.dart +++ b/lib/src/dart_formatter.dart @@ -87,8 +87,8 @@ class DartFormatter { // TODO(paulberry): consider plumbing in experiment enable flags from the // command line. var featureSet = FeatureSet.fromEnableFlags2( - sdkLanguageVersion: Version(2, 10, 0), - flags: ['non-nullable', 'generic-metadata']); + sdkLanguageVersion: Version(2, 13, 0), + flags: ['non-nullable', 'generic-metadata', 'triple-shift']); var inputOffset = 0; var text = source.text; diff --git a/lib/src/line_splitting/solve_state.dart b/lib/src/line_splitting/solve_state.dart index 6701c7a1..a90a2469 100644 --- a/lib/src/line_splitting/solve_state.dart +++ b/lib/src/line_splitting/solve_state.dart @@ -569,7 +569,7 @@ class SolveState { buffer.write(' \$${splits.cost}'); - if (overflowChars > 0) buffer.write(' (${overflowChars} over)'); + if (overflowChars > 0) buffer.write(' ($overflowChars over)'); if (!_isComplete) buffer.write(' (incomplete)'); return buffer.toString(); diff --git a/pubspec.lock b/pubspec.lock index 35fc3e43..6a4251ed 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -7,14 +7,14 @@ packages: name: _fe_analyzer_shared url: "https://pub.dartlang.org" source: hosted - version: "17.0.0" + version: "19.0.0" analyzer: dependency: "direct main" description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.3.0" args: dependency: "direct main" description: @@ -70,7 +70,7 @@ packages: name: coverage url: "https://pub.dartlang.org" source: hosted - version: "0.15.2" + version: "1.0.2" crypto: dependency: transitive description: @@ -91,21 +91,21 @@ packages: name: glob url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.0.1" grinder: dependency: "direct dev" description: name: grinder url: "https://pub.dartlang.org" source: hosted - version: "0.9.0-nullsafety.0" + version: "0.9.0" http_multi_server: dependency: transitive description: name: http_multi_server url: "https://pub.dartlang.org" source: hosted - version: "2.2.0" + version: "3.0.0" http_parser: dependency: transitive description: @@ -119,7 +119,7 @@ packages: name: io url: "https://pub.dartlang.org" source: hosted - version: "0.3.5" + version: "1.0.0" js: dependency: "direct dev" description: @@ -133,7 +133,7 @@ packages: name: logging url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.0.1" matcher: dependency: transitive description: @@ -161,7 +161,7 @@ packages: name: node_preamble url: "https://pub.dartlang.org" source: hosted - version: "1.4.13" + version: "2.0.0" package_config: dependency: transitive description: @@ -182,7 +182,7 @@ packages: name: pedantic url: "https://pub.dartlang.org" source: hosted - version: "1.10.0" + version: "1.11.0" pool: dependency: transitive description: @@ -203,28 +203,28 @@ packages: name: shelf url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.1.0" shelf_packages_handler: dependency: transitive description: name: shelf_packages_handler url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "3.0.0" shelf_static: dependency: transitive description: name: shelf_static url: "https://pub.dartlang.org" source: hosted - version: "0.2.9+2" + version: "1.0.0" shelf_web_socket: dependency: transitive description: name: shelf_web_socket url: "https://pub.dartlang.org" source: hosted - version: "0.2.4+1" + version: "1.0.1" source_map_stack_trace: dependency: transitive description: @@ -280,21 +280,21 @@ packages: name: test url: "https://pub.dartlang.org" source: hosted - version: "1.16.4" + version: "1.16.8" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.19" + version: "0.3.0" test_core: dependency: transitive description: name: test_core url: "https://pub.dartlang.org" source: hosted - version: "0.3.14" + version: "0.3.19" test_descriptor: dependency: "direct dev" description: @@ -343,7 +343,7 @@ packages: name: webkit_inspection_protocol url: "https://pub.dartlang.org" source: hosted - version: "0.7.5" + version: "1.0.0" yaml: dependency: "direct dev" description: @@ -352,4 +352,4 @@ packages: source: hosted version: "3.1.0" sdks: - dart: ">=2.12.0-0.0 <3.0.0" + dart: ">=2.12.0 <3.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 13586edf..cfcc9d35 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: dart_style # Note: See tool/grind.dart for how to bump the version. -version: 2.0.0 +version: 2.0.1-dev description: >- Opinionated, automatic Dart source code formatter. Provides an API and a CLI tool. @@ -10,7 +10,7 @@ environment: sdk: '>=2.12.0-0 <3.0.0' dependencies: - analyzer: ^1.1.0 + analyzer: ^1.3.0 args: '>=1.0.0 <3.0.0' path: ^1.0.0 pub_semver: '>=1.4.4 <3.0.0' @@ -23,7 +23,7 @@ dev_dependencies: # and publishing to npm hasn't been used in a while. # node_preamble: ^1.0.0 pedantic: ^1.0.0 - test: ^1.16.0 + test: ^1.16.8 test_descriptor: ^2.0.0 test_process: ^2.0.0 yaml: '>=2.0.0 <4.0.0' diff --git a/test/splitting/mixed.stmt b/test/splitting/mixed.stmt index 97ba5075..7d8dfff1 100644 --- a/test/splitting/mixed.stmt +++ b/test/splitting/mixed.stmt @@ -170,12 +170,12 @@ longName + longName - longName; >>> mixed shift operators -longName >> longName << longName >> longName << longName; +longName >> longName << longName >> longName >>> longName; <<< longName >> longName << longName >> - longName << + longName >>> longName; >>> mixture of same and different precedence veryLongIdentifier + veryLongIdentifier / veryLongIdentifier * diff --git a/test/whitespace/expressions.stmt b/test/whitespace/expressions.stmt index 0d300e9c..1a138dcf 100644 --- a/test/whitespace/expressions.stmt +++ b/test/whitespace/expressions.stmt @@ -3,6 +3,10 @@ var a=1+2/(3*-b~/4); <<< var a = 1 + 2 / (3 * -b ~/ 4); +>>> triple-shift +a>>>=1>>>-2>>>3; +<<< +a >>>= 1 >>> -2 >>> 3; >>> conditional operator var c=!condition==a>b; <<<