Skip to content

Commit

Permalink
bump analyzer version to ^7.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
devmil committed Jan 14, 2025
1 parent 0279f87 commit c6f7bac
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions lib/src/analyze/api_relevant_elements_collector.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class APIRelevantElementsCollector extends RecursiveElementVisitor<void> {

void _onTypeUsed(DartType type, Element referringElement,
{required TypeUsageKind typeUsageKind}) {
final directElement = type.element2;
final directElement = type.element;
final directElementLibrary = directElement?.library;
if (directElement == null || directElementLibrary == null) {
return;
Expand Down Expand Up @@ -203,7 +203,7 @@ class APIRelevantElementsCollector extends RecursiveElementVisitor<void> {
// (like Enum constructors)
if (element is ConstructorElement) {
// constructors of enums aren't collected
if (element.enclosingElement is EnumElement) {
if (element.enclosingElement3 is EnumElement) {
return false;
}
}
Expand Down Expand Up @@ -292,7 +292,7 @@ class APIRelevantElementsCollector extends RecursiveElementVisitor<void> {
rootPath: _context.rootPath,
));
super.visitFieldElement(element);
if (element.type.element2 != null) {
if (element.type.element != null) {
bool canBeSet = !element.isFinal &&
!element.isConst &&
!element.isPrivate &&
Expand All @@ -319,7 +319,7 @@ class APIRelevantElementsCollector extends RecursiveElementVisitor<void> {
rootPath: _context.rootPath,
));
super.visitTopLevelVariableElement(element);
if (element.type.element2 != null) {
if (element.type.element != null) {
bool canBeSet =
!element.isFinal && !element.isConst && !element.isPrivate;
_onTypeUsed(element.type, element, typeUsageKind: TypeUsageKind.output);
Expand All @@ -334,11 +334,11 @@ class APIRelevantElementsCollector extends RecursiveElementVisitor<void> {
_onVisitAnyElement(element);
super.visitParameterElement(element);
// exclude parameters for fields and properties as they are handled separately
if (element.enclosingElement is PropertyAccessorElement) {
if (element.enclosingElement3 is PropertyAccessorElement) {
return;
}
// this includes method, function and constructor calls
if (element.type.element2 != null) {
if (element.type.element != null) {
_onTypeUsed(element.type, element, typeUsageKind: TypeUsageKind.input);
}
}
Expand All @@ -358,7 +358,7 @@ class APIRelevantElementsCollector extends RecursiveElementVisitor<void> {
rootPath: _context.rootPath,
));
super.visitMethodElement(element);
if (element.returnType.element2 != null) {
if (element.returnType.element != null) {
_onTypeUsed(element.returnType, element,
typeUsageKind: TypeUsageKind.output);
}
Expand All @@ -380,7 +380,7 @@ class APIRelevantElementsCollector extends RecursiveElementVisitor<void> {
rootPath: _context.rootPath,
));
super.visitFunctionElement(element);
if (element.returnType.element2 != null) {
if (element.returnType.element != null) {
_onTypeUsed(element.returnType, element,
typeUsageKind: TypeUsageKind.output);
}
Expand Down Expand Up @@ -421,7 +421,7 @@ class APIRelevantElementsCollector extends RecursiveElementVisitor<void> {
rootPath: _context.rootPath,
));
super.visitTypeAliasElement(element);
if (element.aliasedType.element2 != null) {
if (element.aliasedType.element != null) {
_onTypeUsed(element.aliasedType, element,
typeUsageKind: TypeUsageKind.hierarchy);
}
Expand All @@ -431,7 +431,7 @@ class APIRelevantElementsCollector extends RecursiveElementVisitor<void> {
visitTypeParameterElement(TypeParameterElement element) {
_onVisitAnyElement(element);
super.visitTypeParameterElement(element);
if (element.bound?.element2 != null) {
if (element.bound?.element != null) {
_onTypeUsed(element.bound!, element,
typeUsageKind: TypeUsageKind.hierarchy);
}
Expand All @@ -455,7 +455,7 @@ class APIRelevantElementsCollector extends RecursiveElementVisitor<void> {
namespace: _context.namespace,
rootPath: _context.rootPath,
));
if (element.extendedType.element2 != null) {
if (element.extendedType.element != null) {
_onTypeUsed(element.extendedType, element,
typeUsageKind: TypeUsageKind.hierarchy);
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ environment:
sdk: ">=3.0.0 <4.0.0"

dependencies:
analyzer: ^6.9.0
analyzer: ^7.0.0
args: ^2.3.1
collection: ^1.19.0
colorize: ^3.0.0
Expand Down

0 comments on commit c6f7bac

Please sign in to comment.