mirror of
https://github.com/pese-git/cherrypick.git
synced 2026-03-25 13:01:14 +00:00
feat: migrate to analyzer 9.0.0 API
- Replace Element2 API with Element API - Update imports from element2.dart to element.dart - Replace .firstFragment.name2 with .name - Replace .firstFragment.metadata2.annotations with .metadata.annotations - Replace .fields2 with .fields - Replace .methods2 with .methods - Remove duplicate imports in annotation_validator.dart and generated_class.dart - Update test mocks to use Element instead of Element2 All generators now work correctly with analyzer 9.0.0: - melos analyze: SUCCESS (0 issues) - melos codegen: SUCCESS (13 outputs generated) - melos bootstrap: SUCCESS (8 packages)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import 'package:analyzer/dart/element/element2.dart';
|
||||
import 'package:analyzer/dart/element/element.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
import 'package:cherrypick_generator/src/type_parser.dart';
|
||||
@@ -223,20 +223,14 @@ void main() {
|
||||
}
|
||||
|
||||
// Mock element for testing
|
||||
Element2 _createMockElement() {
|
||||
Element _createMockElement() {
|
||||
return _MockElement();
|
||||
}
|
||||
|
||||
class _MockElement implements Element2 {
|
||||
class _MockElement implements Element {
|
||||
@override
|
||||
String get displayName => 'MockElement';
|
||||
|
||||
//@override
|
||||
//String get name => 'MockElement';
|
||||
//
|
||||
//@override
|
||||
//Source? get source => null;
|
||||
|
||||
@override
|
||||
noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user