Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
3 changes: 2 additions & 1 deletion packages/pigeon/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## NEXT
## 26.1.1

* Updates supported `analyzer` versions to 8.x or 9.x.
* Updates minimum supported SDK version to Flutter 3.32/Dart 3.8.

## 26.1.0
Expand Down
14 changes: 7 additions & 7 deletions packages/pigeon/lib/src/pigeon_lib.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import 'package:analyzer/dart/analysis/analysis_context_collection.dart'
import 'package:analyzer/dart/analysis/results.dart' show ParsedUnitResult;
import 'package:analyzer/dart/analysis/session.dart' show AnalysisSession;
import 'package:analyzer/dart/ast/ast.dart' as dart_ast;
import 'package:analyzer/error/error.dart' show AnalysisError;
import 'package:analyzer/diagnostic/diagnostic.dart' show Diagnostic;
import 'package:args/args.dart';
import 'package:meta/meta.dart' show visibleForTesting;
import 'package:path/path.dart' as path;
Expand Down Expand Up @@ -467,18 +467,18 @@ class Pigeon {
final AnalysisSession session = context.currentSession;
final ParsedUnitResult result =
session.getParsedUnit(path) as ParsedUnitResult;
if (result.errors.isEmpty) {
if (result.diagnostics.isEmpty) {
final dart_ast.CompilationUnit unit = result.unit;
unit.accept(rootBuilder);
} else {
for (final AnalysisError error in result.errors) {
for (final Diagnostic diagnostic in result.diagnostics) {
compilationErrors.add(
Error(
message: error.message,
filename: error.source.fullName,
message: diagnostic.message,
filename: diagnostic.source.fullName,
lineNumber: calculateLineNumber(
error.source.contents.data,
error.offset,
diagnostic.source.contents.data,
diagnostic.offset,
),
),
);
Expand Down
12 changes: 6 additions & 6 deletions packages/pigeon/lib/src/pigeon_lib_internal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1656,7 +1656,7 @@ class RootBuilder extends dart_ast_visitor.RecursiveAstVisitor<Object?> {
);
} else if (node.extendsClause != null) {
superClass = TypeDeclaration(
baseName: node.extendsClause!.superclass.name2.lexeme,
baseName: node.extendsClause!.superclass.name.lexeme,
isNullable: false,
);
}
Expand All @@ -1666,7 +1666,7 @@ class RootBuilder extends dart_ast_visitor.RecursiveAstVisitor<Object?> {
for (final dart_ast.NamedType type
in node.implementsClause!.interfaces) {
interfaces.add(
TypeDeclaration(baseName: type.name2.lexeme, isNullable: false),
TypeDeclaration(baseName: type.name.lexeme, isNullable: false),
);
}
}
Expand Down Expand Up @@ -1777,8 +1777,8 @@ class RootBuilder extends dart_ast_visitor.RecursiveAstVisitor<Object?> {
name: node.name.lexeme,
fields: <NamedType>[],
superClassName:
node.implementsClause?.interfaces.first.name2.toString() ??
node.extendsClause?.superclass.name2.toString(),
node.implementsClause?.interfaces.first.name.toString() ??
node.extendsClause?.superclass.name.toString(),
isSealed: node.sealedKeyword != null,
isSwiftClass: _hasMetadata(node.metadata, 'SwiftClass'),
documentationComments: _documentationCommentsParser(
Expand Down Expand Up @@ -2137,9 +2137,9 @@ class RootBuilder extends dart_ast_visitor.RecursiveAstVisitor<Object?> {
static String _getNamedTypeQualifiedName(dart_ast.NamedType node) {
final dart_ast.ImportPrefixReference? importPrefix = node.importPrefix;
if (importPrefix != null) {
return '${importPrefix.name.lexeme}.${node.name2.lexeme}';
return '${importPrefix.name.lexeme}.${node.name.lexeme}';
}
return node.name2.lexeme;
return node.name.lexeme;
}

void _addProxyApiField(
Expand Down
4 changes: 2 additions & 2 deletions packages/pigeon/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ 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: 26.1.0 # This must match the version in lib/src/generator_tools.dart
version: 26.1.1 # This must match the version in lib/src/generator_tools.dart
Comment thread
stuartmorgan-g marked this conversation as resolved.

environment:
sdk: ^3.8.0

dependencies:
analyzer: ">=6.0.0 <9.0.0"
analyzer: ">=8.0.0 <10.0.0"
args: ^2.1.0
code_builder: ^4.10.0
collection: ^1.15.0
Expand Down