Skip to content

[dev-v5][Docs] Extend the DocApiGen and DocViewer projects#4719

Open
vnbaaij wants to merge 1 commit intodev-v5from
users/vnbaaij/enhance-docapigen
Open

[dev-v5][Docs] Extend the DocApiGen and DocViewer projects#4719
vnbaaij wants to merge 1 commit intodev-v5from
users/vnbaaij/enhance-docapigen

Conversation

@vnbaaij
Copy link
Copy Markdown
Collaborator

@vnbaaij vnbaaij commented Apr 16, 2026

This pull request refactors the documentation generator to support multiple documentation inputs and assemblies. You can now specify multiple dll and xml sources to generate one combined api-comments.json file.
It replaces the old single-assembly generator creation with a new approach using DocumentationInput and GenerationMode. Some utility methods and test setup logic are also improved for better robustness. For instance, we now use a specialized (isolated) AssemblyLoadContext so errors about mismatching assembly manifests are now prevented.
The PR also updates the MarkdownViewer to read from multiple assembly documentation sources

Test Infrastructure Improvements:

  • Refactored test setup to use DocumentationInput and GenerationMode with the DocumentationGeneratorFactory.Create method, replacing the previous single-assembly generator creation methods. This enables easier extension to multiple assemblies and modes.

  • Added a new test (AllGenerator_WithMultipleDocumentationInputs_ShouldIncludeChartsAssemblyTypes) that verifies the generator can handle multiple assemblies and documentation files, ensuring types from both the core and charts assemblies are included in the output.

Utility and Robustness Improvements:

  • Centralized assembly path resolution with a new GetAssemblyPath method, supporting both Debug and Release builds, improving reliability when locating assemblies for tests.

  • Updated project root directory detection to look for .slnx files instead of .sln, reflecting the current solution file extension.

Demo Service Registration:

  • Updated AddFluentUIDemoServices to use the ApiAssemblies property (now an array) instead of the deprecated ApiAssembly property, aligning with new API expectations.

@vnbaaij vnbaaij added this to the v5.0-RC3 milestone Apr 16, 2026
@vnbaaij vnbaaij requested a review from dvoituron as a code owner April 16, 2026 19:42
Copilot AI review requested due to automatic review settings April 16, 2026 19:42
@github-actions
Copy link
Copy Markdown

✅ All tests passed successfully

Details on your Workflow / Core Tests page.

@github-actions
Copy link
Copy Markdown

Summary - Unit Tests Code Coverage

Summary
Generated on: 04/16/2026 - 19:45:54
Coverage date: 04/16/2026 - 19:45:27
Parser: Cobertura
Assemblies: 1
Classes: 237
Files: 328
Line coverage: 99.2% (10439 of 10521)
Covered lines: 10439
Uncovered lines: 82
Coverable lines: 10521
Total lines: 37276
Branch coverage: 93.1% (5253 of 5638)
Covered branches: 5253
Total branches: 5638
Method coverage: Feature is only available for sponsors
Tag: 5975_24530348318

Coverage

Microsoft.FluentUI.AspNetCore.Components - 99.2%
Name Line Branch
Microsoft.FluentUI.AspNetCore.Components 99.2% 93.1%
Microsoft.FluentUI.AspNetCore.Components.AccordionItemEventArgs 100%
Microsoft.FluentUI.AspNetCore.Components.AdditionalAttributesExtensions 100% 100%
Microsoft.FluentUI.AspNetCore.Components.AutocompleteHeaderFooterContent`1 100% 50%
Microsoft.FluentUI.AspNetCore.Components.CachedServices 100% 100%
Microsoft.FluentUI.AspNetCore.Components.Calendar.CalendarExtended 100% 100%
Microsoft.FluentUI.AspNetCore.Components.Calendar.CalendarTitles`1 100% 100%
Microsoft.FluentUI.AspNetCore.Components.Calendar.CalendarTValue 100% 100%
Microsoft.FluentUI.AspNetCore.Components.ColumnBase`1 95.2% 91.6%
Microsoft.FluentUI.AspNetCore.Components.ColumnHeaderCapabilities 100% 100%
Microsoft.FluentUI.AspNetCore.Components.ColumnKeyGridSort`1 94.4% 75%
Microsoft.FluentUI.AspNetCore.Components.ColumnMenuSettings 100%
Microsoft.FluentUI.AspNetCore.Components.ColumnReorderOptions`1 55.5%
Microsoft.FluentUI.AspNetCore.Components.ColumnResizeOptions`1 100% 100%
Microsoft.FluentUI.AspNetCore.Components.CustomEmoji 100% 100%
Microsoft.FluentUI.AspNetCore.Components.CustomIcon 100%
Microsoft.FluentUI.AspNetCore.Components.DataGrid.Infrastructure.Defer 100%
Microsoft.FluentUI.AspNetCore.Components.DataGrid.Infrastructure.InternalGr
idContext`1
100% 100%
Microsoft.FluentUI.AspNetCore.Components.DataGridSortEventArgs`1 100%
Microsoft.FluentUI.AspNetCore.Components.DateTimeProvider 100% 100%
Microsoft.FluentUI.AspNetCore.Components.DateTimeProviderContext 100% 92.8%
Microsoft.FluentUI.AspNetCore.Components.DefaultStyles 100%
Microsoft.FluentUI.AspNetCore.Components.Dialog.MessageBox.FluentMessageBox 100% 75%
Microsoft.FluentUI.AspNetCore.Components.DialogEventArgs 100% 92.8%
Microsoft.FluentUI.AspNetCore.Components.DialogInstance 100% 100%
Microsoft.FluentUI.AspNetCore.Components.DialogOptions 100%
Microsoft.FluentUI.AspNetCore.Components.DialogOptionsFooter 100% 100%
Microsoft.FluentUI.AspNetCore.Components.DialogOptionsFooterAction 100% 100%
Microsoft.FluentUI.AspNetCore.Components.DialogOptionsHeader 100%
Microsoft.FluentUI.AspNetCore.Components.DialogResult 100% 100%
Microsoft.FluentUI.AspNetCore.Components.DialogResult`1 100%
Microsoft.FluentUI.AspNetCore.Components.DialogService 100% 82.3%
Microsoft.FluentUI.AspNetCore.Components.DialogToggleEventArgs 100%
Microsoft.FluentUI.AspNetCore.Components.DropdownEventArgs 100%
Microsoft.FluentUI.AspNetCore.Components.Emoji 100% 100%
Microsoft.FluentUI.AspNetCore.Components.EmojiCompress 100% 100%
Microsoft.FluentUI.AspNetCore.Components.EmojiExtensions 100% 50%
Microsoft.FluentUI.AspNetCore.Components.EmojiInfo 100%
Microsoft.FluentUI.AspNetCore.Components.Extensions.DateTimeExtensions 98.4% 90.3%
Microsoft.FluentUI.AspNetCore.Components.Extensions.DisplayAttributeExtensi
ons
100% 100%
Microsoft.FluentUI.AspNetCore.Components.Extensions.EnumExtensions 100% 100%
Microsoft.FluentUI.AspNetCore.Components.Extensions.FieldSizeExtensions 100% 100%
Microsoft.FluentUI.AspNetCore.Components.Extensions.FluentInputExtensions 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FileSizeConverter 100%
Microsoft.FluentUI.AspNetCore.Components.FluentAccordion 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentAccordionItem 100% 95.8%
Microsoft.FluentUI.AspNetCore.Components.FluentAnchorButton 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentAppBar 97.4% 97.6%
Microsoft.FluentUI.AspNetCore.Components.FluentAppBarItem 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentAutocomplete`2 97.5% 92.9%
Microsoft.FluentUI.AspNetCore.Components.FluentAvatar 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentBadge 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentButton 98.4% 90.6%
Microsoft.FluentUI.AspNetCore.Components.FluentCalendar`1 97% 85%
Microsoft.FluentUI.AspNetCore.Components.FluentCalendarBase`1 100% 94.4%
Microsoft.FluentUI.AspNetCore.Components.FluentCalendarDay`1 100% 95.8%
Microsoft.FluentUI.AspNetCore.Components.FluentCalendarMonth`1 100% 85.7%
Microsoft.FluentUI.AspNetCore.Components.FluentCalendarYear`1 100% 91.6%
Microsoft.FluentUI.AspNetCore.Components.FluentCard 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentCheckbox 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentCombobox`2 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentComponentBase 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentCompoundButton 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentCounterBadge 100% 94.4%
Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid`1 99.1% 95.9%
Microsoft.FluentUI.AspNetCore.Components.FluentDataGridCell`1 100% 95.5%
Microsoft.FluentUI.AspNetCore.Components.FluentDataGridRow`1 98.5% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentDatePicker`1 97.4% 85.2%
Microsoft.FluentUI.AspNetCore.Components.FluentDialog 97.5% 89.3%
Microsoft.FluentUI.AspNetCore.Components.FluentDialogBody 100% 91.6%
Microsoft.FluentUI.AspNetCore.Components.FluentDialogInstance 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentDialogProvider 100% 73.9%
Microsoft.FluentUI.AspNetCore.Components.FluentDivider 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentDragContainer`1 100%
Microsoft.FluentUI.AspNetCore.Components.FluentDragEventArgs`1 100%
Microsoft.FluentUI.AspNetCore.Components.FluentDropZone`1 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentEmoji`1 100% 95%
Microsoft.FluentUI.AspNetCore.Components.FluentErrorBoundary 95.3% 93.7%
Microsoft.FluentUI.AspNetCore.Components.FluentField 100% 96.5%
Microsoft.FluentUI.AspNetCore.Components.FluentFieldCondition 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentFieldConditionItem 100%
Microsoft.FluentUI.AspNetCore.Components.FluentFieldConditionOptions 100%
Microsoft.FluentUI.AspNetCore.Components.FluentFieldExtensions 100%
Microsoft.FluentUI.AspNetCore.Components.FluentFieldParameterSelector 100% 98.7%
Microsoft.FluentUI.AspNetCore.Components.FluentGrid 100% 90%
Microsoft.FluentUI.AspNetCore.Components.FluentGridItem 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentHighlighter 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentIcon`1 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentImage 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentInputBase`1 93.8% 50%
Microsoft.FluentUI.AspNetCore.Components.FluentInputFile 100% 93.3%
Microsoft.FluentUI.AspNetCore.Components.FluentInputFileBuffer 100%
Microsoft.FluentUI.AspNetCore.Components.FluentInputFileErrorEventArgs 100%
Microsoft.FluentUI.AspNetCore.Components.FluentInputFileEventArgs 100%
Microsoft.FluentUI.AspNetCore.Components.FluentInputImmediateBase`1 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentJSModule 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentKeyCode 100% 92.8%
Microsoft.FluentUI.AspNetCore.Components.FluentKeyCodeEventArgs 100% 75%
Microsoft.FluentUI.AspNetCore.Components.FluentKeyCodeProvider 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentKeyPressEventArgs 100%
Microsoft.FluentUI.AspNetCore.Components.FluentLabel 100%
Microsoft.FluentUI.AspNetCore.Components.FluentLayout 100% 88.8%
Microsoft.FluentUI.AspNetCore.Components.FluentLayoutHamburger 100% 96.6%
Microsoft.FluentUI.AspNetCore.Components.FluentLayoutItem 100% 91%
Microsoft.FluentUI.AspNetCore.Components.FluentLink 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentListBase`2 97.8% 89.7%
Microsoft.FluentUI.AspNetCore.Components.FluentListbox`2 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentLocalizerExtensions 100%
Microsoft.FluentUI.AspNetCore.Components.FluentLocalizerInternal 100%
Microsoft.FluentUI.AspNetCore.Components.FluentMenu 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentMenuButton 100% 71.4%
Microsoft.FluentUI.AspNetCore.Components.FluentMenuItem 100% 90.4%
Microsoft.FluentUI.AspNetCore.Components.FluentMenuList 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentMessageBar 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentMultiSplitter 100% 93.4%
Microsoft.FluentUI.AspNetCore.Components.FluentMultiSplitterEventArgs 100%
Microsoft.FluentUI.AspNetCore.Components.FluentMultiSplitterPane 100% 87.5%
Microsoft.FluentUI.AspNetCore.Components.FluentMultiSplitterResizeEventArgs 100%
Microsoft.FluentUI.AspNetCore.Components.FluentNav 100% 95.4%
Microsoft.FluentUI.AspNetCore.Components.FluentNavBase 100%
Microsoft.FluentUI.AspNetCore.Components.FluentNavCategory 97.8% 92.1%
Microsoft.FluentUI.AspNetCore.Components.FluentNavItem 100% 89.7%
Microsoft.FluentUI.AspNetCore.Components.FluentNavSectionHeader 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentNumberInput`1 100% 93.3%
Microsoft.FluentUI.AspNetCore.Components.FluentNumberInputCultureInfo 100%
Microsoft.FluentUI.AspNetCore.Components.FluentOption`1 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentOptionString 100%
Microsoft.FluentUI.AspNetCore.Components.FluentOverflow 100% 95.8%
Microsoft.FluentUI.AspNetCore.Components.FluentOverflowItem 100% 80%
Microsoft.FluentUI.AspNetCore.Components.FluentOverlay 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentPaginator 100% 95.4%
Microsoft.FluentUI.AspNetCore.Components.FluentPopover 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentPresenceBadge 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentProgress 100%
Microsoft.FluentUI.AspNetCore.Components.FluentProgressBar 100% 87.5%
Microsoft.FluentUI.AspNetCore.Components.FluentProgressRing 100%
Microsoft.FluentUI.AspNetCore.Components.FluentProviders 100%
Microsoft.FluentUI.AspNetCore.Components.FluentPullToRefresh 100% 96.7%
Microsoft.FluentUI.AspNetCore.Components.FluentRadio`1 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentRadioGroup`1 100% 88.8%
Microsoft.FluentUI.AspNetCore.Components.FluentRatingDisplay 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentSelect`2 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentServiceBase`1 100%
Microsoft.FluentUI.AspNetCore.Components.FluentServiceProviderException`1 100%
Microsoft.FluentUI.AspNetCore.Components.FluentSkeleton 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentSlider`1 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentSortableList`1 95.8% 92.3%
Microsoft.FluentUI.AspNetCore.Components.FluentSortableListEventArgs 100%
Microsoft.FluentUI.AspNetCore.Components.FluentSpacer 100%
Microsoft.FluentUI.AspNetCore.Components.FluentSpinner 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentSplitButton 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentStack 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentStatus 100%
Microsoft.FluentUI.AspNetCore.Components.FluentSwitch 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentTab 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentTabs 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentText 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentTextArea 100% 70%
Microsoft.FluentUI.AspNetCore.Components.FluentTextInput 100% 85%
Microsoft.FluentUI.AspNetCore.Components.FluentTimePicker`1 98.9% 75.3%
Microsoft.FluentUI.AspNetCore.Components.FluentToast 100% 92%
Microsoft.FluentUI.AspNetCore.Components.FluentToastProvider 100% 95%
Microsoft.FluentUI.AspNetCore.Components.FluentToggleButton 100% 91.6%
Microsoft.FluentUI.AspNetCore.Components.FluentTooltip 100% 95%
Microsoft.FluentUI.AspNetCore.Components.FluentTooltipProvider 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentTreeItem 100% 95.3%
Microsoft.FluentUI.AspNetCore.Components.FluentTreeView 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentValidationSummary 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FreeOptionOutput 100%
Microsoft.FluentUI.AspNetCore.Components.GridItemsProviderRequest`1 100% 100%
Microsoft.FluentUI.AspNetCore.Components.GridItemsProviderResult 100%
Microsoft.FluentUI.AspNetCore.Components.GridItemsProviderResult`1 100%
Microsoft.FluentUI.AspNetCore.Components.GridSort`1 100% 100%
Microsoft.FluentUI.AspNetCore.Components.HierarchicalGridItem`2 100% 100%
Microsoft.FluentUI.AspNetCore.Components.HierarchicalGridUtilities 100% 100%
Microsoft.FluentUI.AspNetCore.Components.HierarchicalSelectColumn`1 98.8% 95.5%
Microsoft.FluentUI.AspNetCore.Components.HighlighterSplitter 100% 100%
Microsoft.FluentUI.AspNetCore.Components.Icon 100% 95%
Microsoft.FluentUI.AspNetCore.Components.IconFromImage 100%
Microsoft.FluentUI.AspNetCore.Components.IconInfo 100%
Microsoft.FluentUI.AspNetCore.Components.IconsExtensions 100% 50%
Microsoft.FluentUI.AspNetCore.Components.IFluentComponentChangeAfterKeyPres
s
100% 100%
Microsoft.FluentUI.AspNetCore.Components.IFluentLocalizer 100% 100%
Microsoft.FluentUI.AspNetCore.Components.Infrastructure.EventCallbackSubscr
ibable`1
100% 100%
Microsoft.FluentUI.AspNetCore.Components.Infrastructure.EventCallbackSubscr
iber`1
100% 87.5%
Microsoft.FluentUI.AspNetCore.Components.InputFileInstance 100% 100%
Microsoft.FluentUI.AspNetCore.Components.InputFileOptions 100%
Microsoft.FluentUI.AspNetCore.Components.InternalAppBarContext 100% 100%
Microsoft.FluentUI.AspNetCore.Components.InternalListContext`1 100%
Microsoft.FluentUI.AspNetCore.Components.KeyCodeService 100% 85.7%
Microsoft.FluentUI.AspNetCore.Components.KeyPress 100%
Microsoft.FluentUI.AspNetCore.Components.LayoutHamburgerEventArgs 100%
Microsoft.FluentUI.AspNetCore.Components.LibraryToastOptions 100%
Microsoft.FluentUI.AspNetCore.Components.LibraryTooltipOptions 100%
Microsoft.FluentUI.AspNetCore.Components.Localization.LanguageResource 100% 100%
Microsoft.FluentUI.AspNetCore.Components.MarkupSanitizedOptions 100%
Microsoft.FluentUI.AspNetCore.Components.MenuItemEventArgs 100%
Microsoft.FluentUI.AspNetCore.Components.MessageBoxOptions 100%
Microsoft.FluentUI.AspNetCore.Components.Migration.AppearanceExtensions 100% 100%
Microsoft.FluentUI.AspNetCore.Components.Migration.FluentInputAppearanceExt
ensions
100% 100%
Microsoft.FluentUI.AspNetCore.Components.Migration.TooltipPositionExtension 100% 100%
Microsoft.FluentUI.AspNetCore.Components.OptionsSearchEventArgs`1 100%
Microsoft.FluentUI.AspNetCore.Components.PaginationState 100% 81.2%
Microsoft.FluentUI.AspNetCore.Components.ProgressFileDetails 100%
Microsoft.FluentUI.AspNetCore.Components.PropertyColumn`2 100% 81.8%
Microsoft.FluentUI.AspNetCore.Components.RadioEventArgs 100%
Microsoft.FluentUI.AspNetCore.Components.RangeOfDates 96.5% 86.1%
Microsoft.FluentUI.AspNetCore.Components.SelectAllTemplateArgs 100%
Microsoft.FluentUI.AspNetCore.Components.SelectColumn`1 93.1% 88.9%
Microsoft.FluentUI.AspNetCore.Components.ServiceProviderExtensions 100%
Microsoft.FluentUI.AspNetCore.Components.SortedProperty 100%
Microsoft.FluentUI.AspNetCore.Components.SpacingExtensions 100% 97.2%
Microsoft.FluentUI.AspNetCore.Components.TabChangeEventArgs 100%
Microsoft.FluentUI.AspNetCore.Components.TemplateColumn`1 100% 25%
Microsoft.FluentUI.AspNetCore.Components.Theme 100% 80%
Microsoft.FluentUI.AspNetCore.Components.ThemeExtensions 94.7% 87.5%
Microsoft.FluentUI.AspNetCore.Components.ThemeService 100% 88.8%
Microsoft.FluentUI.AspNetCore.Components.ThemeSettings 100%
Microsoft.FluentUI.AspNetCore.Components.ToastEventArgs 100% 90%
Microsoft.FluentUI.AspNetCore.Components.ToastInstance 100% 100%
Microsoft.FluentUI.AspNetCore.Components.ToastOptions 100%
Microsoft.FluentUI.AspNetCore.Components.ToastService 100% 90%
Microsoft.FluentUI.AspNetCore.Components.TooltipEventArgs 100%
Microsoft.FluentUI.AspNetCore.Components.TotalItemCountChangedEventArgs 100%
Microsoft.FluentUI.AspNetCore.Components.TreeItemChangedEventArgs 100%
Microsoft.FluentUI.AspNetCore.Components.TreeViewItem 100% 100%
Microsoft.FluentUI.AspNetCore.Components.TreeViewItemExpandedEventArgs 100%
Microsoft.FluentUI.AspNetCore.Components.UploadedFileDetails 100%
Microsoft.FluentUI.AspNetCore.Components.Utilities.AddTag 100% 100%
Microsoft.FluentUI.AspNetCore.Components.Utilities.CssBuilder 100% 100%
Microsoft.FluentUI.AspNetCore.Components.Utilities.Debounce 100% 100%
Microsoft.FluentUI.AspNetCore.Components.Utilities.Identifier 100% 100%
Microsoft.FluentUI.AspNetCore.Components.Utilities.IdentifierContext 100% 75%
Microsoft.FluentUI.AspNetCore.Components.Utilities.InlineStyleBuilder 100% 91.6%
Microsoft.FluentUI.AspNetCore.Components.Utilities.MarkupStringSanitized 100% 92.5%
Microsoft.FluentUI.AspNetCore.Components.Utilities.RangeOf`1 96.7% 97.2%
Microsoft.FluentUI.AspNetCore.Components.Utilities.StyleBuilder 100% 100%
Microsoft.FluentUI.AspNetCore.Components.ZIndex 100%

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the DocApiGen/DocViewer tooling to support generating and viewing API docs from multiple assemblies/XML inputs, refactoring the generator pipeline around DocumentationInput and a unified factory entrypoint.

Changes:

  • Add multi-input documentation generation via DocumentationInput + DocumentationGeneratorFactory.Create(mode, inputs) and an isolated AssemblyLoadContext.
  • Update DocViewer (options/service + MarkdownViewer) to resolve API types across multiple assemblies.
  • Update test infrastructure and add a multi-input integration test (core + charts) and supporting path-resolution helpers.

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
examples/Tools/FluentUI.Demo.DocViewer/Services/DocViewerService.cs Switch API source to ApiAssemblies, add FindApiType across multiple assemblies.
examples/Tools/FluentUI.Demo.DocViewer/Services/DocViewerOptions.cs Replace single ApiAssembly with ApiAssemblies (keep obsolete shim).
examples/Tools/FluentUI.Demo.DocViewer/Components/MarkdownViewer.razor.cs Use DocViewerService.FindApiType instead of single-assembly scanning.
examples/Tools/FluentUI.Demo.DocApiGen/Program.cs Accept multiple --dll/--xml inputs and create generators from input lists + isolated ALC.
examples/Tools/FluentUI.Demo.DocApiGen/Models/SummaryMode/ApiClassOptions.cs Switch from DocXmlReader to IDocumentationCommentProvider.
examples/Tools/FluentUI.Demo.DocApiGen/Models/SummaryMode/ApiClass.cs Read summaries via the new comment provider abstraction.
examples/Tools/FluentUI.Demo.DocApiGen/Models/DocumentationInput.cs New: pairs an Assembly with its XML doc file + reader.
examples/Tools/FluentUI.Demo.DocApiGen/Models/DocumentationCommentProvider.cs New: resolve member/type summaries across multiple inputs.
examples/Tools/FluentUI.Demo.DocApiGen/DocumentationAssemblyLoadContext.cs New: isolated load context for doc target assemblies/dependencies.
examples/Tools/FluentUI.Demo.DocApiGen/Abstractions/IDocumentationCommentProvider.cs New: abstraction for summary lookup.
examples/Tools/FluentUI.Demo.DocApiGen/Generators/SummaryDocumentationGenerator.cs Generate from multiple inputs; adds partial type-load handling.
examples/Tools/FluentUI.Demo.DocApiGen/Generators/AllDocumentationGenerator.cs Update to multi-input scanning and multi-input comment lookup.
examples/Tools/FluentUI.Demo.DocApiGen/Generators/McpDocumentationGenerator.cs Update to multi-input scanning and multi-input comment lookup.
examples/Tools/FluentUI.Demo.DocApiGen/Generators/IconsEmojisGenerator.cs Update constructor/base usage to accept inputs list.
examples/Tools/FluentUI.Demo.DocApiGen/Generators/DocumentationGeneratorFactory.cs Add new Create(mode, inputs) overload; single-input overload now wraps into inputs.
examples/Tools/FluentUI.Demo.DocApiGen/Generators/DocumentationGeneratorBase.cs Base class now stores Inputs and PrimaryAssembly.
examples/Tools/FluentUI.Demo.DocApiGen.Tests/Models/SummaryMode/ApiClassPerformanceTests.cs Update tests to build ApiClassOptions with comment provider.
examples/Tools/FluentUI.Demo.DocApiGen.Tests/Models/IconEmoji/IconEmojiTests.cs Update tests to use input list for generator construction.
examples/Tools/FluentUI.Demo.DocApiGen.IntegrationTests/FluentUIComponentsIntegrationTests.cs Refactor integration setup to inputs/ALC; add multi-input (core+charts) test + helper.
examples/Demo/FluentUI.Demo.Client/Infrastructure/ServiceCollectionExtensions.cs Register DocViewerOptions.ApiAssemblies (array) instead of deprecated ApiAssembly.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

}

Environment.Exit(1);
//Environment.Exit(1);
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The exception handler no longer exits with a non-zero process code (Environment.Exit(1) is commented out). For a CLI tool, this makes failures look like success to scripts/CI, and may cause downstream steps to run with invalid output. Restore a non-zero exit code (or rethrow) after logging.

Suggested change
//Environment.Exit(1);
Environment.Exit(1);

Copilot uses AI. Check for mistakes.
Comment on lines +60 to +62
var allTypes = Inputs.SelectMany(input => input.Assembly.GetTypes()).ToList();
var validTypes = allTypes.Where(IsValidComponentType).ToList();
var enumTypes = allTypes.Where(t => t.IsEnum && t.IsPublic).ToList();
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inputs.SelectMany(input => input.Assembly.GetTypes()) can throw ReflectionTypeLoadException (e.g., if any dependency is missing). Summary mode already guards this and continues with ex.Types. To avoid the All generator crashing on partially loadable assemblies, wrap GetTypes() with similar handling (or factor out a shared safe GetTypes helper).

Copilot uses AI. Check for mistakes.
Comment on lines +68 to +71
var allTypes = Inputs
.SelectMany(input => input.Assembly.GetTypes())
.Where(t => t.IsClass && t.IsPublic && !t.IsAbstract)
.ToList();
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inputs.SelectMany(input => input.Assembly.GetTypes()) can throw ReflectionTypeLoadException when scanning types (missing dependencies, version mismatches, etc.), which would abort MCP generation entirely. Consider using the same safe GetTypes() pattern used in SummaryDocumentationGenerator to continue with the loadable types and optionally log loader exceptions.

Copilot uses AI. Check for mistakes.
Comment on lines +375 to +378
if (!File.Exists(chartsAssemblyPath) || !File.Exists(chartsXmlPath))
{
return;
}
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new integration test currently becomes a no-op in this repo layout: the referenced src/Charts/.../Microsoft.FluentUI.AspNetCore.Components.Charts.dll and the Microsoft.FluentUI.AspNetCore.Components.Charts.xml file don’t exist, so the test hits return; and always passes without asserting multi-input behavior. Consider pointing the test at an assembly/docs pair that is present in-repo (or making missing prerequisites fail/explicitly skip) so CI actually exercises the multi-assembly path.

Suggested change
if (!File.Exists(chartsAssemblyPath) || !File.Exists(chartsXmlPath))
{
return;
}
Assert.True(
File.Exists(chartsAssemblyPath) && File.Exists(chartsXmlPath),
$"Multi-input integration test prerequisites are missing. Expected assembly: '{chartsAssemblyPath}' (exists: {File.Exists(chartsAssemblyPath)}), expected XML docs: '{chartsXmlPath}' (exists: {File.Exists(chartsXmlPath)}).");

Copilot uses AI. Check for mistakes.
}

_fluentUIAssembly = Assembly.LoadFrom(fluentUIAssemblyPath);
throw new FileNotFoundException($"Assembly not found. Please build the project first. Looked for: {releasePath}");
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetAssemblyPath checks both Debug and Release locations, but the thrown FileNotFoundException message only reports the Release path. This makes failures harder to diagnose because the Debug path was also tried. Consider including both attempted paths in the exception message.

Suggested change
throw new FileNotFoundException($"Assembly not found. Please build the project first. Looked for: {releasePath}");
throw new FileNotFoundException(
$"Assembly not found. Please build the project first. Looked for: {debugPath}; {releasePath}");

Copilot uses AI. Check for mistakes.

using System.Reflection;
using FluentUI.Demo.DocApiGen.Abstractions;
using FluentUI.Demo.DocApiGen.Extensions;
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DocumentationCommentProvider has an unused using FluentUI.Demo.DocApiGen.Extensions;. With EnforceCodeStyleInBuild + TreatWarningsAsErrors, this can fail the build due to IDE0005/CS8019. Remove the unnecessary using directive.

Suggested change
using FluentUI.Demo.DocApiGen.Extensions;

Copilot uses AI. Check for mistakes.
return ApiAssemblies
.SelectMany(GetTypes)
.FirstOrDefault(type => string.Equals(type.FullName, fullName, StringComparison.Ordinal)
|| string.Equals(type.Name, fullName, StringComparison.Ordinal));
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FindApiType no longer matches generic component types when the markdown uses the unadorned name (e.g., MyComponent<T> becomes MyComponent). The previous implementation matched MyComponent against MyComponent1/MyComponent2, but the new predicate only checks exact type.Name, so generic components won’t resolve and API sections may disappear. Consider extending the lookup to also match type.Name that starts with `${fullName}`` (or explicitly check arities 1..N).

Suggested change
|| string.Equals(type.Name, fullName, StringComparison.Ordinal));
|| string.Equals(type.Name, fullName, StringComparison.Ordinal)
|| type.Name.StartsWith(fullName + "`", StringComparison.Ordinal));

Copilot uses AI. Check for mistakes.
Comment on lines 30 to 34
Options = options;
ComponentsAssembly = options.ComponentsAssembly;
ResourcesAssembly = options.ResourcesAssembly;
ApiAssembly = options.ApiAssembly;
ApiAssemblies = options.ApiAssemblies;
ApiCommentSummary = options.ApiCommentSummary;
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ApiAssemblies is assigned directly from options.ApiAssemblies, but DocViewerOptions.ApiAssemblies is settable and could be set to null by consumers/config binding. That would cause NullReferenceException in FindApiType/ApiAssembly. Consider normalizing to an empty list in the constructor (or making the option non-nullable/guarding the setter).

Copilot uses AI. Check for mistakes.
path => Path.GetFileNameWithoutExtension(path),
StringComparer.OrdinalIgnoreCase);

#pragma warning disable CA1416 // Validate platform compatibility
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What will be the result when this part of code will be executed on Linux (during the publication process in ADO) ?
AssemblyDependencyResolver seems not acceptable on Linux (not tested)

Console.WriteLine(" DocApiGen --xml MyApp.xml --dll MyApp.dll --output api-all.json --mode all");
Console.WriteLine();
Console.WriteLine(" # Generate Summary mode JSON from multiple assemblies");
Console.WriteLine(" DocApiGen --xml Core.xml;Charts.xml --dll Core.dll;Charts.dll --output api-summary.json");
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not to use another mode --mode chart like for Icons, Emojis or MCP?
That will use the same logic as already used.
And in the ADO Pipelinem we need to add a new task to run the Chart generation. That's all :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants