Extend --with-conditional to multi-file output#774
Merged
tannergooding merged 1 commit intoJul 14, 2026
Merged
Conversation
Wraps each file in multi-file C# output in the same leading '#if <symbol>' and trailing '#endif' using the single global symbol, matching single-file behavior. XML output and per-file symbols remain out of scope. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.
Follow-up to #772, which added
--with-conditionalfor single-file output. This extends the same option to multi-file output: each generated C# file is wrapped in a leading#if <symbol>and trailing#endifusing the same single global symbol.Same two choke points as single-file, just in the multi-file writer (
CloseOutputBuilder): the#ifgoes after the header/before the usings, the#endifafter the namespace close. Empty-contents builders are already skipped before the writer runs, so every emitted file gets a matched pair.XML output and per-file (varying) symbols remain out of scope, same as #772 — a per-file symbol wants a remap and is a separate design. The golden-file harness is single-stream, so the multi-file test drives the generator directly with a per-path capturing stream factory (
ConditionalMultiFileOutputTest).Relates to #365