Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pigeon] Update analyzer and formatter #8456

Merged
merged 1 commit into from
Jan 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/pigeon/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 22.7.3

* Adds compatibility with `analyzer` 7.x.*.

## 22.7.2

* Updates README to discuss best practices for using Pigeon-generated code.
Expand Down
7 changes: 5 additions & 2 deletions packages/pigeon/lib/dart_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import 'package:code_builder/code_builder.dart' as cb;
import 'package:dart_style/dart_style.dart';
import 'package:path/path.dart' as path;
import 'package:pub_semver/pub_semver.dart';

import 'ast.dart';
import 'dart/templates.dart';
Expand Down Expand Up @@ -779,7 +780,8 @@ final BinaryMessenger? ${varNamePrefix}binaryMessenger;

final cb.DartEmitter emitter = cb.DartEmitter(useNullSafetySyntax: true);
indent.format(
DartFormatter().format('${instanceManagerApi.accept(emitter)}'),
DartFormatter(languageVersion: Version(3, 6, 0))
.format('${instanceManagerApi.accept(emitter)}'),
);
}

Expand Down Expand Up @@ -899,7 +901,8 @@ final BinaryMessenger? ${varNamePrefix}binaryMessenger;
);

final cb.DartEmitter emitter = cb.DartEmitter(useNullSafetySyntax: true);
indent.format(DartFormatter().format('${proxyApi.accept(emitter)}'));
indent.format(DartFormatter(languageVersion: Version(3, 6, 0))
.format('${proxyApi.accept(emitter)}'));
}

/// Generates Dart source code for test support libraries based on the given AST
Expand Down
2 changes: 1 addition & 1 deletion packages/pigeon/lib/generator_tools.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import 'ast.dart';
/// The current version of pigeon.
///
/// This must match the version in pubspec.yaml.
const String pigeonVersion = '22.7.2';
const String pigeonVersion = '22.7.3';

/// Read all the content from [stdin] to a String.
String readStdin() {
Expand Down
6 changes: 3 additions & 3 deletions packages/pigeon/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ name: pigeon
description: Code generator tool to make communication between Flutter and the host platform type-safe and easier.
repository: https://github.com/flutter/packages/tree/main/packages/pigeon
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+pigeon%22
version: 22.7.2 # This must match the version in lib/generator_tools.dart
version: 22.7.3 # This must match the version in lib/generator_tools.dart

environment:
sdk: ^3.4.0

dependencies:
analyzer: ">=5.13.0 <7.0.0"
analyzer: ">=6.0.0 <8.0.0"
args: ^2.1.0
code_builder: ^4.10.0
collection: ^1.15.0
dart_style: ^2.3.4
dart_style: ^3.0.0
graphs: ^2.3.1
meta: ^1.9.0
path: ^1.8.0
Expand Down
Loading