Skip to content
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* Remove the deprecated `nodoc` option.
* Remove the deprecated `include-external` option.
* Refactor 404 error page to use div instead of p for search form.
* Require analyzer 8.1.1 APIs.
* Many internal migrations for analyzer APIs.

## 8.3.4
* The URL for category pages now uses _category name_ instead of
Expand Down
8 changes: 4 additions & 4 deletions lib/src/dartdoc_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ library;

import 'dart:io' show exitCode, stderr, stdout;

import 'package:analyzer/dart/element/element2.dart';
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/file_system/file_system.dart';
import 'package:args/args.dart';
import 'package:dartdoc/src/dartdoc.dart' show dartdocVersion, programName;
Expand Down Expand Up @@ -1128,18 +1128,18 @@ class DartdocOptionContext extends DartdocOptionContextBase
/// Build a DartdocOptionContext from an analyzer element (using its source
/// location).
factory DartdocOptionContext.fromElement(DartdocOptionSet optionSet,
LibraryElement2 libraryElement, ResourceProvider resourceProvider) {
LibraryElement libraryElement, ResourceProvider resourceProvider) {
return DartdocOptionContext(
optionSet,
resourceProvider.getFile(libraryElement.firstFragment.source.fullName),
resourceProvider);
}

/// Build a DartdocOptionContext from an existing [DartdocOptionContext] and a
/// new analyzer [Element2].
/// new analyzer [Element].
factory DartdocOptionContext.fromContextElement(
DartdocOptionContext optionContext,
LibraryElement2 libraryElement,
LibraryElement libraryElement,
ResourceProvider resourceProvider) {
return DartdocOptionContext.fromElement(
optionContext.optionSet, libraryElement, resourceProvider);
Expand Down
20 changes: 10 additions & 10 deletions lib/src/element_type.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/// The only entrypoint for constructing these classes is [ElementType.for_].
library;

import 'package:analyzer/dart/element/element2.dart';
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/nullability_suffix.dart';
import 'package:analyzer/dart/element/type.dart';
import 'package:dartdoc/src/model/comment_referable.dart';
Expand Down Expand Up @@ -67,7 +67,7 @@ abstract class ElementType with CommentReferable, Nameable {
String toString() => '$type';
}

/// An [ElementType] that isn't pinned to an [Element2] (or one that is, but
/// An [ElementType] that isn't pinned to an [Element] (or one that is, but
/// whose element is irrelevant).
class UndefinedElementType extends ElementType {
UndefinedElementType._(super.type, super.library, super.packageGraph)
Expand Down Expand Up @@ -102,9 +102,9 @@ class UndefinedElementType extends ElementType {
// We can not simply throw here because not all SDK libraries resolve
// all types.
if (type is InvalidType) return 'dynamic';
assert(const {'Never'}.contains(type.documentableElement2?.name3),
assert(const {'Never'}.contains(type.documentableElement2?.name),
'Unrecognized type for UndefinedElementType: $type');
return type.documentableElement2!.name3!;
return type.documentableElement2!.name!;
}

@override
Expand All @@ -129,7 +129,7 @@ class UndefinedElementType extends ElementType {
Iterable<CommentReferable>? get referenceGrandparentOverrides => null;
}

/// A [FunctionType] that does not have an underpinning [Element2].
/// A [FunctionType] that does not have an underpinning [Element].
class FunctionTypeElementType extends UndefinedElementType
with Rendered, Callable {
FunctionTypeElementType._(
Expand Down Expand Up @@ -205,10 +205,10 @@ class ParameterizedElementType extends DefinedElementType with Rendered {

/// An [ElementType] whose underlying type was referred to by a type alias.
mixin Aliased implements ElementType {
Element2 get typeAliasElement2 => type.alias!.element2;
Element get typeAliasElement2 => type.alias!.element;

@override
String get name => typeAliasElement2.name3!;
String get name => typeAliasElement2.name!;

@override
bool get isTypedef => true;
Expand Down Expand Up @@ -253,7 +253,7 @@ class TypeParameterElementType extends DefinedElementType {
String get nameWithGenericsPlain => '$name$nullabilitySuffix';
}

/// An [ElementType] associated with an [Element2].
/// An [ElementType] associated with an [Element].
abstract class DefinedElementType extends ElementType {
final ModelElement modelElement;

Expand All @@ -263,7 +263,7 @@ abstract class DefinedElementType extends ElementType {

factory DefinedElementType._from(DartType type, ModelElement modelElement,
Library library, PackageGraph packageGraph) {
if (type is! TypeAliasElement2 && type.alias != null) {
if (type is! TypeAliasElement && type.alias != null) {
// Here, `alias.element` signals that this is a type referring to an
// alias. (`TypeAliasElement.alias.element` has different implications.
// In that case it is an actual type alias of some kind (generic or
Expand All @@ -288,7 +288,7 @@ abstract class DefinedElementType extends ElementType {
}

@override
String get name => type.documentableElement2!.name3!;
String get name => type.documentableElement2!.name!;

@override
String get fullyQualifiedName => modelElement.fullyQualifiedName;
Expand Down
Loading
Loading