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

Fix links in sidebar of extension types #3831

Merged
merged 1 commit into from
Aug 14, 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
3 changes: 2 additions & 1 deletion lib/src/generator/html_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ class HtmlGeneratorBackend extends GeneratorBackend {
var data = ExtensionTypeTemplateData(
options, packageGraph, library, extensionType);
var sidebarContent = templates.renderSidebarForContainer(data);
write(writer, extensionType.sidebarPath, data, sidebarContent);
write(writer, extensionType.sidebarPath, data, sidebarContent,
isSidebar: true);
runtimeStats.incrementAccumulator('writtenSidebarFileCount');
}

Expand Down
18 changes: 9 additions & 9 deletions test/templates/extension_type_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -361,10 +361,10 @@ extension type One(int it) {
htmlLines,
containsAllInOrder([
matches(
'<a href="../lib/One-extension-type.html#instance-methods">'
'<a href="lib/One-extension-type.html#instance-methods">'
'Methods</a>',
),
matches('<a href="../lib/One/m1.html">m1</a>'),
matches('<a href="lib/One/m1.html">m1</a>'),
]),
);
}
Expand All @@ -381,8 +381,8 @@ extension type One(int it) {
htmlLines,
containsAllInOrder([
matches(
'<a href="../lib/One-extension-type.html#operators">Operators</a>'),
matches('<a href="../lib/One/operator_greater.html">operator ></a>'),
'<a href="lib/One-extension-type.html#operators">Operators</a>'),
matches('<a href="lib/One/operator_greater.html">operator ></a>'),
]),
);
}
Expand All @@ -402,10 +402,10 @@ extension type One(int it) {
expect(
htmlLines,
containsAllInOrder([
matches('<a href="../lib/One-extension-type.html#static-properties">'
matches('<a href="lib/One-extension-type.html#static-properties">'
'Static properties</a>'),
matches('<a href="../lib/One/gs1.html">gs1</a>'),
matches('<a href="../lib/One/sf1.html">sf1</a>'),
matches('<a href="lib/One/gs1.html">gs1</a>'),
matches('<a href="lib/One/sf1.html">sf1</a>'),
]),
);
}
Expand All @@ -421,9 +421,9 @@ extension type One(int it) {
expect(
htmlLines,
containsAllInOrder([
matches('<a href="../lib/One-extension-type.html#static-methods">'
matches('<a href="lib/One-extension-type.html#static-methods">'
'Static methods</a>'),
matches('<a href="../lib/One/s1.html">s1</a>'),
matches('<a href="lib/One/s1.html">s1</a>'),
]),
);
}
Expand Down