GenFacades: Enrich PNSE stubs with XML doc comments from implementation sources#16624
Draft
GenFacades: Enrich PNSE stubs with XML doc comments from implementation sources#16624
Conversation
…reserved Co-authored-by: ericstj <8918108+ericstj@users.noreply.github.com> Agent-Logs-Url: https://github.com/dotnet/arcade/sessions/636beb1a-1195-4d41-b167-5ba7a1877d6e
…es via **/*.cs glob Co-authored-by: ericstj <8918108+ericstj@users.noreply.github.com> Agent-Logs-Url: https://github.com/dotnet/arcade/sessions/4e4d36a1-1980-4a25-bd9f-b03f132195f0
Copilot created this pull request from a session on behalf of
ericstj
March 25, 2026 22:44
View session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NotSupportedAssemblyGeneratorgenerated PNSE stubs with no useful XML docs — the shipped PNSE assemblies lacked the documentation that matched the implementation. This adds a doc-comment enrichment pass: all**/*.csfiles in the project are parsed for///docs and applied to the generated stubs.Approach
Rather than complex cross-project source evaluation, the task does a pre-pass over
@(NotSupportedAssemblyImplementationSource)(defaults to**/*.csin the current project) to build aDocCommentIndex(API key → trivia, first-occurrence-wins), then the rewriter applies those docs when generating each stub. API definitions still come from theContractProjectreference sources; the implementation sources only contribute documentation.Key changes
NotSupportedAssemblyGenerator.csImplementationSourceFilestask propertyDocCommentIndex— lookup from FQN API key →SyntaxTriviaListof doc-comment trivia; first match across all impl files winsDocCommentWalker(CSharpSyntaxWalker) — populates the index across all member kinds: types, methods, properties, events (including event-field syntax), constructors, fields, operators, conversion operators, enum membersApiKeystatic class — shared FQN key computation used by both walker and rewriter; handles regular and file-scoped namespaces (C# 10), nested types, and top-level typesReplaceDocTrivia— strips existing doc-comment trivia from the reference node's leading trivia, inserts impl docs before the final indentation whitespaceApplyDocComment— called from everyVisit*method; emitsLogWarningfor APIs not found in impl or found without docs (only when impl sources are provided)CreateThrowBlock()/CreateEmptyBlock()to eliminate the repeatedParseStatementpatternMicrosoft.DotNet.GenFacades.NotSupported.targetsNotSupportedAssemblyImplementationSourceitem (defaults to**/*.cs, excludes$(IntermediateOutputPath))IncludeNotSupportedAssemblyImplementationSources=falseor remove items fromNotSupportedAssemblyImplementationSourceImplementationProjectapproach from previous iterationTo double check: