Skip to content

Commit

Permalink
fix: ApiPage is not generated when multiple namespaces exists
Browse files Browse the repository at this point in the history
  • Loading branch information
filzrev committed Jan 25, 2024
1 parent 670a278 commit 1ff4cdd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Docfx.Dotnet/DotnetApiCatalog.Toc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ IEnumerable<TocNode> CreateNamespaceToc(INamespaceSymbol ns)
});
}

var existingNodeHasNoLeafNode = idExists && !node.containsLeafNodes;

node.items ??= new();
node.symbols.Add((symbol, compilation));

Expand All @@ -120,9 +122,12 @@ IEnumerable<TocNode> CreateNamespaceToc(INamespaceSymbol ns)
}

node.containsLeafNodes = node.items.Any(i => i.containsLeafNodes);
if (!idExists && node.containsLeafNodes)
if (node.containsLeafNodes)
{
yield return node;
if (!idExists || existingNodeHasNoLeafNode)
{
yield return node;
}
}
}

Expand Down

0 comments on commit 1ff4cdd

Please sign in to comment.