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

Support analyzer 7 #66

Merged
merged 5 commits into from
Jan 9, 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
6 changes: 4 additions & 2 deletions benchmarks/storage/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ dependencies:
csv: ^6.0.0

dev_dependencies:
rexios_lints: ^8.2.0
build_runner: ^2.4.13
rexios_lints: ^9.2.0
# build_runner: ^2.4.13 # TODO: Fix this
json_serializable: ^6.8.0
hive_ce_generator: any

Expand All @@ -22,3 +22,5 @@ dependency_overrides:
path: ../../hive
hive_ce_generator:
path: ../../hive_generator
source_gen: ^2.0.0
analyzer: ^7.0.0
4 changes: 4 additions & 0 deletions hive_generator/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.8.2

- Supports analyzer 7

## 1.8.1

- Fixes a bug in the migrator affecting `freezed` classes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@ class ClassAdapterBuilder extends AdapterBuilder {
String buildWrite() {
final code = StringBuffer();
code.writeln('writer');
code.writeln('..writeByte(${getters.length})');
// Only cascade when there are getters
if (getters.isNotEmpty) code.write('.');
code.writeln('.writeByte(${getters.length})');
for (final field in getters) {
code.writeln('''
..writeByte(${field.index})
Expand Down Expand Up @@ -218,9 +220,7 @@ extension on DartType {
final definingLibrary = element.library;
if (definingLibrary == currentLibrary) return getDisplayString();

// TODO: This is failing in beta (remove when fixed)
// ignore: deprecated_member_use
for (final import in currentLibrary.libraryImports) {
for (final import in currentLibrary.units.expand((e) => e.libraryImports)) {
for (final MapEntry(:key, :value)
in import.namespace.definedNames.entries) {
if (value == element) {
Expand Down
6 changes: 3 additions & 3 deletions hive_generator/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: hive_ce_generator
description: Extension for Hive. Automatically generates TypeAdapters to store any class.
version: 1.8.1
version: 1.8.2
homepage: https://github.com/IO-Design-Team/hive_ce/tree/main/hive_generator
documentation: https://docs.hivedb.dev/

Expand All @@ -9,9 +9,9 @@ environment:

dependencies:
build: ^2.0.0
source_gen: ^1.0.0
source_gen: ^2.0.0
hive_ce: ^2.8.0
analyzer: ^6.5.0
analyzer: ^7.1.0
source_helper: ^1.1.0
glob: ^2.1.2
path: ^1.9.0
Expand Down
Loading