Skip to content

Conversation

@ArgoZhang
Copy link
Member

@ArgoZhang ArgoZhang commented Jan 6, 2026

Link issues

fixes #888

Summary By Copilot

Regression?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • Merge the latest code from the main branch

Summary by Sourcery

Refactor the LLMs documentation generator tool to simplify its CLI interface, adjust paths to work from the published server output, and streamline documentation generation.

Enhancements:

  • Convert DocsGenerator and MarkdownBuilder to internal static helpers and simplify documentation generation to a single entry point.
  • Update namespaces and entry program to use a Runner and ArgumentsHelper for argument parsing and tool execution.
  • Remove partial generation and check modes, focusing the tool on generating all documentation from a specified root folder.

Copilot AI review requested due to automatic review settings January 6, 2026 06:15
@bb-auto bb-auto bot added the enhancement New feature or request label Jan 6, 2026
@bb-auto bb-auto bot added this to the v9.2.0 milestone Jan 6, 2026
@sourcery-ai
Copy link

sourcery-ai bot commented Jan 6, 2026

Reviewer's Guide

Refactors the LLM docs generator into a simpler, static, root-folder–driven tool with a new namespace, removes incremental/checking logic and CLI options, and centralizes argument parsing and execution through a Runner and ArgumentsHelper while making Markdown generation static and allocation-local.

Sequence diagram for new CLI execution flow of the docs generator

sequenceDiagram
    actor Developer
    participant Program
    participant Runner
    participant ArgumentsHelper
    participant RootCommand
    participant DocsGenerator
    participant ComponentAnalyzer
    participant MarkdownBuilder
    participant FileSystem

    Developer->>Program: llms-docs-generator --root path
    Program->>Runner: Run(args)
    activate Runner

    Runner->>ArgumentsHelper: Parse(args)
    activate ArgumentsHelper
    ArgumentsHelper->>RootCommand: configure options and action
    ArgumentsHelper-->>Runner: ParseResult
    deactivate ArgumentsHelper

    Runner->>RootCommand: InvokeAsync()
    activate RootCommand
    RootCommand->>DocsGenerator: GenerateAllAsync(rootFolder)
    deactivate RootCommand

    activate DocsGenerator
    DocsGenerator->>FileSystem: build _sourcePath, _outputPath
    DocsGenerator->>FileSystem: Directory.Exists(_sourcePath)?
    alt source path exists
        DocsGenerator->>FileSystem: CreateDirectory(_outputPath)
        DocsGenerator->>FileSystem: CreateDirectory(_componentsOutputPath)

        DocsGenerator->>ComponentAnalyzer: AnalyzeAllComponentsAsync()
        activate ComponentAnalyzer
        ComponentAnalyzer-->>DocsGenerator: List<ComponentInfo>
        deactivate ComponentAnalyzer

        DocsGenerator->>MarkdownBuilder: BuildIndexDoc(components)
        activate MarkdownBuilder
        MarkdownBuilder-->>DocsGenerator: indexContent
        deactivate MarkdownBuilder
        DocsGenerator->>FileSystem: WriteAllTextAsync(llms.txt, indexContent)

        loop for each component
            DocsGenerator->>MarkdownBuilder: BuildComponentDoc(component)
            activate MarkdownBuilder
            MarkdownBuilder-->>DocsGenerator: componentContent
            deactivate MarkdownBuilder
            DocsGenerator->>FileSystem: WriteAllTextAsync(componentFile, componentContent)
        end
    else source path missing
        DocsGenerator-->>Runner: return (no files generated)
    end

    deactivate DocsGenerator
    Runner-->>Program: completed
    deactivate Runner
    Program-->>Developer: process exit
Loading

Class diagram for refactored LLMs docs generator tool

classDiagram
    direction LR

    class Runner {
        <<static>>
        +Task Run(string[] args)
    }

    class ArgumentsHelper {
        <<static>>
        +ParseResult Parse(string[] args)
    }

    class DocsGenerator {
        <<static>>
        +Task GenerateAllAsync(string rootFolder)
        -static void Logger(string message)
    }

    class MarkdownBuilder {
        <<static>>
        -const string GitHubBaseUrl
        +string BuildIndexDoc(List~ComponentInfo~ components)
        +string BuildComponentDoc(ComponentInfo component)
        -static void BuildComponentSection(StringBuilder sb, ComponentInfo component, bool includeHeader)
        -static string EscapeMarkdownCell(string text)
        -static string EscapeMarkdownCode(string code)
        -static string TruncateSummary(string summary, int maxLength)
    }

    class ComponentAnalyzer {
        +Task List~ComponentInfo~ AnalyzeAllComponentsAsync()
        +Task ComponentInfo AnalyzeComponentAsync(string componentName)
    }

    class ComponentInfo {
        +string Name
        +string FilePath
        +DateTime LastModified
        +string Summary
        +List~ParameterInfo~ Parameters
        +List~EventInfo~ Events
    }

    class ParseResult {
        +Task InvokeAsync()
    }

    class RootCommand
    class Option

    Runner ..> ArgumentsHelper : uses
    Runner ..> ParseResult : receives

    ArgumentsHelper ..> RootCommand : configures
    ArgumentsHelper ..> Option : defines
    ArgumentsHelper ..> DocsGenerator : sets action

    DocsGenerator ..> ComponentAnalyzer : creates and uses
    DocsGenerator ..> MarkdownBuilder : uses
    ComponentAnalyzer ..> ComponentInfo : produces

    MarkdownBuilder ..> ComponentInfo : reads

    NoteForStaticClasses <|.. Runner : static
    NoteForStaticClasses <|.. ArgumentsHelper : static
    NoteForStaticClasses <|.. DocsGenerator : static
    NoteForStaticClasses <|.. MarkdownBuilder : static

    class NoteForStaticClasses {
    }
Loading

File-Level Changes

Change Details Files
Refactor DocsGenerator to a static, simplified generator that uses an explicit root folder and always regenerates all docs.
  • Change namespace to BootstrapBlazorLLMsDocsGenerator and make DocsGenerator an internal static class
  • Replace constructor-based configuration with a static GenerateAllAsync(rootFolder) method that computes source and output paths from the given root folder
  • Remove debug flag, instance fields, selective generation, and freshness-check logic; logging now always writes to Console
  • Simplify generation flow to always analyze all components and write index and component docs under wwwroot/llms
tools/BootstrapBlazor.LLMsDocsGenerator/DocsGenerator.cs
Make MarkdownBuilder a static helper with local StringBuilder instances for each operation and adjust API names.
  • Change namespace and make MarkdownBuilder an internal static class
  • Replace instance-based state with static methods that create local StringBuilder instances per call
  • Rename BuildIndex to BuildIndexDoc and update component section builder to accept a StringBuilder parameter
  • Comment out the unused BuildParameterTable helper instead of using shared state
tools/BootstrapBlazor.LLMsDocsGenerator/MarkdownBuilder.cs
Simplify the command-line entry point and route execution through a new Runner and ArgumentsHelper abstraction.
  • Change Program.cs to reference the new BootstrapBlazor.LLMsDocsGenerator namespace and delegate execution to Runner.Run(args)
  • Introduce ArgumentsHelper to define the minimal CLI (only --root supported) and to call DocsGenerator.GenerateAllAsync when root is provided
  • Add Runner class to parse arguments and invoke the parsed command
  • Remove support for component-specific generation, index-only generation, and CI check mode from the CLI
tools/BootstrapBlazor.LLMsDocsGenerator/Program.cs
tools/BootstrapBlazor.LLMsDocsGenerator/ArgumentsHelper.cs
tools/BootstrapBlazor.LLMsDocsGenerator/Runner.cs
Rename the internal namespaces used by analyzer and model types to the new generator namespace.
  • Update ComponentAnalyzer namespace to BootstrapBlazorLLMsDocsGenerator
  • Update ComponentInfo namespace to BootstrapBlazorLLMsDocsGenerator
tools/BootstrapBlazor.LLMsDocsGenerator/ComponentAnalyzer.cs
tools/BootstrapBlazor.LLMsDocsGenerator/ComponentInfo.cs

Assessment against linked issues

Issue Objective Addressed Explanation
#888 Refactor the LLMs documentation generator internals (DocsGenerator, MarkdownBuilder, ComponentAnalyzer, ComponentInfo) to a cleaner static/utility-style design and updated namespaces.
#888 Update and simplify the command-line entrypoint for the LLMs docs generator tool to use a focused argument set (root folder) and a new Runner/ArgumentsHelper structure.

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@ArgoZhang ArgoZhang merged commit 3dec210 into master Jan 6, 2026
3 of 4 checks passed
@ArgoZhang ArgoZhang deleted the dev-tools branch January 6, 2026 06:15
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've found 3 issues, and left some high level feedback:

  • The new ArgumentsHelper.Parse path handling is a bit opaque: --root is required but silently ignored when missing, and DocsGenerator.GenerateAllAsync assumes rootFolder is the server project directory; consider validating the argument and failing fast with a clear error if it’s null/invalid so callers know why nothing was generated.
  • With DocsGenerator.Logger now always writing to Console, the tool will be much noisier than before (no --debug flag); consider either reintroducing a verbosity switch or routing logs through a configurable logger to avoid excessive output in automated environments.
  • In MarkdownBuilder, the commented-out BuildParameterTable method is now dead code; if it’s not planned for near-term use, removing it (or moving it to a separate utility) would keep the helper cleaner and easier to maintain.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new `ArgumentsHelper.Parse` path handling is a bit opaque: `--root` is required but silently ignored when missing, and `DocsGenerator.GenerateAllAsync` assumes `rootFolder` is the server project directory; consider validating the argument and failing fast with a clear error if it’s null/invalid so callers know why nothing was generated.
- With `DocsGenerator.Logger` now always writing to `Console`, the tool will be much noisier than before (no `--debug` flag); consider either reintroducing a verbosity switch or routing logs through a configurable logger to avoid excessive output in automated environments.
- In `MarkdownBuilder`, the commented-out `BuildParameterTable` method is now dead code; if it’s not planned for near-term use, removing it (or moving it to a separate utility) would keep the helper cleaner and easier to maintain.

## Individual Comments

### Comment 1
<location> `tools/BootstrapBlazor.LLMsDocsGenerator/Runner.cs:13` </location>
<code_context>
+    {
+        var result = ArgumentsHelper.Parse(args);
+
+        await result.InvokeAsync();
+    }
+}
</code_context>

<issue_to_address>
**issue (bug_risk):** The process exit code from System.CommandLine is ignored, which can hide failures from callers/CI.

Previously `Program.cs` returned `await rootCommand.Parse(args).InvokeAsync();`, so the process exit code reflected the command result. Now `Runner.Run` awaits `result.InvokeAsync()` but discards the `int`, so the process always exits with 0 and CI/scripts can’t detect failures. Please capture the return value and either set `Environment.ExitCode` or return it so callers can observe failures.
</issue_to_address>

### Comment 2
<location> `tools/BootstrapBlazor.LLMsDocsGenerator/DocsGenerator.cs:23-25` </location>
<code_context>
+        if (!Directory.Exists(_sourcePath))
</code_context>

<issue_to_address>
**suggestion (bug_risk):** Silently returning when the source path is missing makes it hard to diagnose misconfiguration.

If `_sourcePath` doesn’t exist, `GenerateAllAsync` effectively no‑ops with no log or non‑zero exit code, so misconfigured `--root` values look like successful runs. Consider logging a clear error and, if appropriate, signalling failure (exception or non‑zero exit code) instead of returning silently.

Suggested implementation:

```csharp
        if (!Directory.Exists(_sourcePath))
        {
            // Misconfigured --root should be treated as a failure, not a silent no-op
            Console.Error.WriteLine($"[DocsGenerator] Source path '{_sourcePath}' does not exist. Check the --root configuration.");
            throw new DirectoryNotFoundException($"Source path '{_sourcePath}' does not exist.");

```

Depending on how `GenerateAllAsync` is currently used, you may want to:
1. Replace the `throw` with returning a non-zero exit code if `GenerateAllAsync` is part of your `Main`/CLI pipeline and already uses exit codes.
2. If there is an existing logging abstraction (e.g., `ILogger<DocsGenerator>` or a custom logger), replace `Console.Error.WriteLine` with that logger to be consistent with the rest of the codebase.
3. Ensure the caller of `GenerateAllAsync` either lets the exception bubble up to the process boundary (so the process exits non-zero) or catches it and converts it into an appropriate exit code.
</issue_to_address>

### Comment 3
<location> `tools/BootstrapBlazor.LLMsDocsGenerator/ArgumentsHelper.cs:23-29` </location>
<code_context>
+
+        rootCommand.SetAction(async result =>
+        {
+            var rootFolder = result.GetValue(rootFolderOption);
+            if (string.IsNullOrEmpty(rootFolder))
+            {
+                return;
+            }
+
+            await DocsGenerator.GenerateAllAsync(rootFolder);
+        });
+
</code_context>

<issue_to_address>
**suggestion:** Handling of missing `--root` is very silent and may confuse users.

Right now, omitting `--root` makes the command exit silently. Since `rootFolder` is required for any useful work, consider either marking the option as required or displaying usage/help or an explicit error when its missing so users understand why nothing happened.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

{
var result = ArgumentsHelper.Parse(args);

await result.InvokeAsync();
Copy link

Choose a reason for hiding this comment

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

issue (bug_risk): The process exit code from System.CommandLine is ignored, which can hide failures from callers/CI.

Previously Program.cs returned await rootCommand.Parse(args).InvokeAsync();, so the process exit code reflected the command result. Now Runner.Run awaits result.InvokeAsync() but discards the int, so the process always exits with 0 and CI/scripts can’t detect failures. Please capture the return value and either set Environment.ExitCode or return it so callers can observe failures.

Comment on lines +23 to +29
var rootFolder = result.GetValue(rootFolderOption);
if (string.IsNullOrEmpty(rootFolder))
{
return;
}

await DocsGenerator.GenerateAllAsync(rootFolder);
Copy link

Choose a reason for hiding this comment

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

suggestion: Handling of missing --root is very silent and may confuse users.

Right now, omitting --root makes the command exit silently. Since rootFolder is required for any useful work, consider either marking the option as required or displaying usage/help or an explicit error when it’s missing so users understand why nothing happened.

Copy link

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 refactors the LLMs documentation generator tool by simplifying its architecture and removing several command-line options that were previously available. The refactoring consolidates the code into a more streamlined structure.

Key changes:

  • Simplified command-line interface by removing --component, --index-only, --check, and --debug options, keeping only --root
  • Converted instance-based classes to static classes for simpler architecture
  • Removed dynamic source path discovery and replaced with hard-coded path patterns

Reviewed changes

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

Show a summary per file
File Description
Runner.cs New entry point that delegates to ArgumentsHelper for parsing and execution
ArgumentsHelper.cs New file that handles command-line argument parsing with simplified options
Program.cs Simplified to a single line that calls Runner.Run
DocsGenerator.cs Converted to static class, removed CheckAsync and component-specific generation methods, hard-coded output paths
MarkdownBuilder.cs Converted from instance to static class, renamed BuildIndex to BuildIndexDoc, commented out BuildParameterTable method
ComponentInfo.cs Namespace change only
ComponentAnalyzer.cs Namespace change only
BootstrapBlazor.LLMsDocsGenerator.csproj Version bump to 10.0.1 and added SatelliteResourceLanguages property
Comments suppressed due to low confidence (4)

tools/BootstrapBlazor.LLMsDocsGenerator/ComponentAnalyzer.cs:242

        foreach (var method in methodDeclarations)
        {
            // Skip property accessors, overrides of base class methods
            if (method.Modifiers.Any(m => m.IsKind(SyntaxKind.OverrideKeyword)))
                continue;

            var methodInfo = new MethodInfo
            {
                Name = method.Identifier.Text,
                ReturnType = SimplifyTypeName(method.ReturnType.ToString()),
                Description = ExtractXmlSummary(method),
                IsJSInvokable = HasAttribute(method, "JSInvokable"),
                Parameters = method.ParameterList.Parameters
                    .Select(p => (SimplifyTypeName(p.Type?.ToString() ?? ""), p.Identifier.Text))
                    .ToList()
            };

            methods.Add(methodInfo);
        }

tools/BootstrapBlazor.LLMsDocsGenerator/ComponentAnalyzer.cs:52

        foreach (var file in files)
        {
            var component = await AnalyzeFileAsync(file);
            if (component != null && component.Parameters.Count > 0)
            {
                components.Add(component);
            }
        }

tools/BootstrapBlazor.LLMsDocsGenerator/ComponentAnalyzer.cs:63

        foreach (var file in csFiles)
        {
            var component = await AnalyzeFileAsync(file);
            if (component != null && component.Parameters.Count > 0)
            {
                components.Add(component);
            }
        }

tools/BootstrapBlazor.LLMsDocsGenerator/ComponentAnalyzer.cs:151

  • Redundant call to 'ToString' on a String object.
            className += classDeclaration.TypeParameterList.ToString();

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

// Maintainer: Argo Zhang([email protected]) Website: https://www.blazor.zone

namespace LlmsDocsGenerator;
namespace BootstrapBlazorLLMsDocsGenerator;
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

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

There is a namespace inconsistency in this file. Line 6 declares the namespace as BootstrapBlazorLLMsDocsGenerator (without dots), but the proper format used in ArgumentsHelper.cs line 8 is BootstrapBlazor.LLMsDocsGenerator (with dots). All files should use a consistent namespace pattern to avoid confusion and potential compilation issues.

Suggested change
namespace BootstrapBlazorLLMsDocsGenerator;
namespace BootstrapBlazor.LLMsDocsGenerator;

Copilot uses AI. Check for mistakes.
// Maintainer: Argo Zhang([email protected]) Website: https://www.blazor.zone

namespace LlmsDocsGenerator;
namespace BootstrapBlazorLLMsDocsGenerator;
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

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

There is a namespace inconsistency in this file. Line 6 declares the namespace as BootstrapBlazorLLMsDocsGenerator (without dots), but the proper format used in ArgumentsHelper.cs line 8 is BootstrapBlazor.LLMsDocsGenerator (with dots). All files should use a consistent namespace pattern to avoid confusion and potential compilation issues.

Suggested change
namespace BootstrapBlazorLLMsDocsGenerator;
namespace BootstrapBlazor.LLMsDocsGenerator;

Copilot uses AI. Check for mistakes.
using BootstrapBlazorLLMsDocsGenerator;
using System.CommandLine;

namespace BootstrapBlazor.LLMsDocsGenerator;
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

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

There's a namespace inconsistency: line 5 uses BootstrapBlazorLLMsDocsGenerator (no dots between words) while line 8 declares the namespace as BootstrapBlazor.LLMsDocsGenerator (with dots). This mismatch will cause a compilation error. The using statement should match the actual namespace of the DocsGenerator class, which appears to be BootstrapBlazorLLMsDocsGenerator based on DocsGenerator.cs line 6.

Suggested change
namespace BootstrapBlazor.LLMsDocsGenerator;
namespace BootstrapBlazorLLMsDocsGenerator;

Copilot uses AI. Check for mistakes.
public static async Task GenerateAllAsync(string rootFolder)
{
var _sourcePath = Path.Combine(rootFolder, "..", "BootstrapBlazor");
var _outputPath = Path.Combine(rootFolder, "bin", "Release", "net10.0", "publish", "wwwroot", "llms");
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

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

The target framework version "net10.0" is hard-coded in the output path. This makes the tool brittle - if the framework version changes or if the tool needs to support multiple framework versions, this path will break. Consider making this configurable or dynamically detecting the framework version.

Suggested change
var _outputPath = Path.Combine(rootFolder, "bin", "Release", "net10.0", "publish", "wwwroot", "llms");
var releaseDir = Path.Combine(rootFolder, "bin", "Release");
string targetFrameworkDir;
if (Directory.Exists(releaseDir))
{
targetFrameworkDir = Path.Combine(releaseDir, "net10.0");
foreach (var dir in Directory.GetDirectories(releaseDir))
{
var frameworkName = Path.GetFileName(dir);
if (frameworkName.StartsWith("net", StringComparison.OrdinalIgnoreCase))
{
targetFrameworkDir = dir;
break;
}
}
}
else
{
targetFrameworkDir = Path.Combine(releaseDir, "net10.0");
}
var _outputPath = Path.Combine(targetFrameworkDir, "publish", "wwwroot", "llms");

Copilot uses AI. Check for mistakes.
using System.Text;

namespace LlmsDocsGenerator;
namespace BootstrapBlazorLLMsDocsGenerator;
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

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

There is a namespace inconsistency in this file. Line 8 declares the namespace as BootstrapBlazorLLMsDocsGenerator (without dots), but the proper format used in other files like ArgumentsHelper.cs line 8 is BootstrapBlazor.LLMsDocsGenerator (with dots). This inconsistency will cause namespace resolution issues. All namespaces should follow a consistent pattern.

Suggested change
namespace BootstrapBlazorLLMsDocsGenerator;
namespace BootstrapBlazor.LLMsDocsGenerator;

Copilot uses AI. Check for mistakes.
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<SatelliteResourceLanguages>false</SatelliteResourceLanguages>
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

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

The SatelliteResourceLanguages property should be a semicolon-separated list of language codes (e.g., "en;zh") or an empty string, not a boolean value. Setting it to "false" is invalid. If the intention is to disable satellite resource assembly generation, the correct value should be an empty string or the property should be removed entirely.

Suggested change
<SatelliteResourceLanguages>false</SatelliteResourceLanguages>
<SatelliteResourceLanguages></SatelliteResourceLanguages>

Copilot uses AI. Check for mistakes.
using System.Text.RegularExpressions;

namespace LlmsDocsGenerator;
namespace BootstrapBlazorLLMsDocsGenerator;
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

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

There is a namespace inconsistency in this file. Line 11 declares the namespace as BootstrapBlazorLLMsDocsGenerator (without dots), but the proper format used in ArgumentsHelper.cs line 8 is BootstrapBlazor.LLMsDocsGenerator (with dots). All files should use a consistent namespace pattern to avoid confusion and potential compilation issues.

Suggested change
namespace BootstrapBlazorLLMsDocsGenerator;
namespace BootstrapBlazor.LLMsDocsGenerator;

Copilot uses AI. Check for mistakes.
Comment on lines +24 to +27
if (string.IsNullOrEmpty(rootFolder))
{
return;
}
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

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

When the root folder is not provided, the command silently exits without any error message or indication of what went wrong. This makes it difficult for users to understand that the --root parameter is required. Consider adding a descriptive error message or making the option required.

Copilot uses AI. Check for mistakes.
Logger("Generating individual component documentation...");
foreach (var component in components)
if (!Directory.Exists(_sourcePath))
{
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

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

When the source path doesn't exist, the method silently returns without any error message or logging. This makes it difficult to debug why documentation generation failed. Consider adding an error message or throwing an exception to inform the user that the source path was not found.

Suggested change
{
{
Logger($"Source path not found: {_sourcePath}. Documentation generation aborted.");

Copilot uses AI. Check for mistakes.
Comment on lines +358 to 380
// _sb.Clear();

// _sb.AppendLine("| Parameter | Type | Default | Description |");
// _sb.AppendLine("|-----------|------|---------|-------------|");

// var sortedParams = parameters
// .OrderByDescending(p => p.IsRequired)
// .ThenBy(p => p.IsEventCallback)
// .ThenBy(p => p.Name);

// foreach (var param in sortedParams)
// {
// var required = param.IsRequired ? " **[Required]**" : "";
// var description = EscapeMarkdownCell(param.Description ?? "") + required;
// var defaultVal = param.DefaultValue ?? "-";
// var type = EscapeMarkdownCell(param.Type);

// _sb.AppendLine($"| {param.Name} | `{type}` | {defaultVal} | {description} |");
// }

// return _sb.ToString();
//}

Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

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

Large blocks of commented-out code should be removed rather than left in the codebase. If this functionality (BuildParameterTable) might be needed in the future, it should either be kept as working code or removed entirely and retrieved from version control if needed later. Commented-out code reduces code readability and maintainability.

Suggested change
// _sb.Clear();
// _sb.AppendLine("| Parameter | Type | Default | Description |");
// _sb.AppendLine("|-----------|------|---------|-------------|");
// var sortedParams = parameters
// .OrderByDescending(p => p.IsRequired)
// .ThenBy(p => p.IsEventCallback)
// .ThenBy(p => p.Name);
// foreach (var param in sortedParams)
// {
// var required = param.IsRequired ? " **[Required]**" : "";
// var description = EscapeMarkdownCell(param.Description ?? "") + required;
// var defaultVal = param.DefaultValue ?? "-";
// var type = EscapeMarkdownCell(param.Type);
// _sb.AppendLine($"| {param.Name} | `{type}` | {defaultVal} | {description} |");
// }
// return _sb.ToString();
//}

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(LLMs): improve generator tools

2 participants