Skip to content

Propose code snippet importer design for API reference documentation - #806

Draft
gewarren with Copilot wants to merge 2 commits into
mainfrom
copilot/add-code-snippet-importer-tooling
Draft

gewarren with Copilot wants to merge 2 commits into
mainfrom
copilot/add-code-snippet-importer-tooling

Conversation

Copilot AI commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Compiler-generated XML references snippet files that aren’t included in compiler output, leaving unresolved examples in generated ECMAXML. This proposal outlines a standalone importer; no repository files or tool code were changed.

  • Discovery and resolution

    • Detect XML and Markdown snippet references.
    • Use SourceLink metadata to resolve paths against the original source file at the matching revision; report ambiguous mappings.
  • Import and reference updates

    • Copy complete snippet files into a deterministic layout.
    • Rewrite documentation paths while preserving region selectors.
    • Deduplicate imports and guard against path escapes and conflicting destinations.
  • Operation and scope

    • Support local checkouts or commit-pinned downloads, dry runs, strict mode, and provenance reports.
    • Defer project-file copying and compilation support to a subsequent phase.

Copilot AI balanced review requested due to automatic review settings November 4, 2026 04:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request. Check if the Files changed in this pull request are included in default exclusions.

Copilot AI linked an issue Nov 4, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add tooling to import code snippet files Propose code snippet importer design for API reference documentation Nov 4, 2026
Copilot AI requested a review from gewarren November 4, 2026 04:05
@gewarren

gewarren commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

@copilot Please go ahead and generate a prototype of the tool.

Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>

Copilot AI commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Please go ahead and generate a prototype of the tool.

Implemented in 3b9fb85. The prototype imports XML and Markdown snippet references from a local checkout using an explicit DocId source map, preserves selectors, and supports dry runs and safe path checks. Usage and deferred SourceLink/project-file support are documented. Validation: 113 tests passed, two existing skips; manual CLI checks passed; no secret-scanning or CodeQL findings.

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.

[Code snippet importer] Add tooling to import code snippet files

3 participants