Skip to content

Commit aded576

Browse files
authored
Migrate to the dart_style DartFormatter API. (#1307)
Going forward, the formatter needs to know what language version it should use to parse input code. This updates the generator to pass in a version. (In this case, since it's just used for code generation, it unconditionally passes in the latest language version, which should be fine.) Fix #1304.
1 parent dfeecf0 commit aded576

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

pkgs/http_client_conformance_tests/bin/generate_server_wrappers.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ Future<StreamChannel<Object?>> startServer() async => spawnHybridUri(Uri(
4444

4545
void main() async {
4646
final files = await Directory('lib/src').list().toList();
47-
final formatter = DartFormatter();
47+
final formatter =
48+
DartFormatter(languageVersion: DartFormatter.latestLanguageVersion);
4849

4950
files.where((file) => file.path.endsWith('_server.dart')).forEach((file) {
5051
final vmPath = file.path.replaceAll('_server.dart', '_server_vm.dart');

pkgs/http_client_conformance_tests/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ environment:
1111

1212
dependencies:
1313
async: ^2.8.2
14-
dart_style: ^2.2.3
14+
dart_style: ^2.3.7
1515
http: ^1.2.0
1616
stream_channel: ^2.1.1
1717
test: ^1.21.2

0 commit comments

Comments
 (0)