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

Include extension members on the extended type's page #3863

Merged
merged 2 commits into from
Sep 10, 2024
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
16 changes: 16 additions & 0 deletions lib/resources/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,22 @@ h1 .category {
vertical-align: middle;
}

/* Do not display "provided by X extension" text on extension pages. */
.main-content.extension-page .from-extension {
display: none;
}

sup.muted {
color: var(--main-sidebar-color);
font-size: 0.6em;
}

.from-extension > span {
background-color: var(--alert-warning);
font-style: italic;
padding: 2px;
}

/* The badge under a declaration for things like "const", "read-only", etc. and for the badges inline like sealed or interface */
/* See https://github.com/dart-lang/dartdoc/blob/main/lib/src/model/feature.dart */
.feature {
Expand Down
18 changes: 16 additions & 2 deletions lib/src/element_type.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,13 @@ abstract class ElementType with CommentReferable, Nameable {

String get linkedName;

/// Name with generics and nullability indication.
/// Name with generics and nullability indication, in HTML tags.
String get nameWithGenerics;

/// Name with generics and nullability indication, in plain text, with
/// unescaped angle brackets.
String get nameWithGenericsPlain;

@override
String get displayName => throw UnimplementedError();

Expand Down Expand Up @@ -103,11 +107,14 @@ class UndefinedElementType extends ElementType {
return type.documentableElement!.name!;
}

@override
String get linkedName => name;

@override
String get nameWithGenerics => '$name$nullabilitySuffix';

@override
String get linkedName => name;
String get nameWithGenericsPlain => '$name$nullabilitySuffix';

@override
Iterable<ElementType> get typeArguments => const [];
Expand Down Expand Up @@ -241,6 +248,9 @@ class TypeParameterElementType extends DefinedElementType {

@override
String get nameWithGenerics => '$name$nullabilitySuffix';

@override
String get nameWithGenericsPlain => '$name$nullabilitySuffix';
}

/// An [ElementType] associated with an [Element].
Expand Down Expand Up @@ -341,6 +351,10 @@ mixin Rendered implements ElementType {
@override
late final String nameWithGenerics = _renderer.renderNameWithGenerics(this);

@override
late final String nameWithGenericsPlain =
_renderer.renderNameWithGenerics(this, plain: true);

ElementTypeRenderer<ElementType> get _renderer;
}

Expand Down
Loading