Support TCGC exact() client name in C# emitter#10728
Draft
Copilot wants to merge 2 commits into
Draft
Conversation
Agent-Logs-Url: https://github.com/microsoft/typespec/sessions/b465cdf8-5db5-43ea-97f0-f615be72ddc1 Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add support for exact client name in emitter
Support TCGC May 19, 2026
exact() client name in C# emitter
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.
TCGC 0.68.0 added
exact(), which marks a@clientNamevalue to be preserved verbatim by emitters. This change plumbs the newisExactNameflag through the C# emitter and generator so that marked names bypass.ToIdentifierName()casing.Changes
isExactName?: booleantoInputModelType,InputEnumType,InputLiteralType,InputUnionType, andInputPropertyTypeBase. Populated from the corresponding SDK types intype-converter.ts,operation-converter.ts, andclient-converter.ts.IsExactNameto theInputTypeandInputPropertybase classes and extended the JSON converters (model, enum, literal, union, model property, and method/header/query/path/body/endpoint parameter) to deserialize the field.ModelProvider.BuildName,EnumProvider.BuildName, andPropertyProviderskip.ToIdentifierName()whenIsExactNameis true.PropertyProviderTestscases for exact-name model and property; emittermodel-type.test.tscases verifying propagation fromexact()on both a property and a model, plus a negative case.