Skip to content

Commit

Permalink
Fix links in sidebar of extension types (#3831)
Browse files Browse the repository at this point in the history
  • Loading branch information
srawlins authored Aug 14, 2024
1 parent 392e2aa commit 7fb1f3f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
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

0 comments on commit 7fb1f3f

Please sign in to comment.