Skip to content

Conversation

@ArcturusZhang
Copy link
Member

@ArcturusZhang ArcturusZhang commented Mar 28, 2025

Fixes Azure/autorest.csharp#4746

We have a very complicated logic to give names to literal types (or constant types from TCGC) so that we could convert them into extensible enums in our generated code.

But actually, TCGC already has the ability to make up a name for the constant types, which in most cases is the same as the one we have.

Therefore, to simplify our emitter, we should remove this literalContext and related logic, just use the name we have from TCGC.

During making this change, some requirements come up for TCGC as well, I will open issues, and fix them in TCGC in a near future.

Issues created for TCGC:

@microsoft-github-policy-service microsoft-github-policy-service bot added the emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp label Mar 28, 2025
@ArcturusZhang ArcturusZhang force-pushed the try-to-remove-literal-context branch from 9f1d990 to a13e170 Compare March 28, 2025 04:48
@github-actions
Copy link
Contributor

No changes needing a change description found.

@azure-sdk
Copy link
Collaborator

azure-sdk commented Apr 7, 2025

API change check

APIView has identified API level changes in this PR and created following API reviews.

@typespec/http-client-csharp
Microsoft.TypeSpec.Generator.Input

@ArcturusZhang ArcturusZhang marked this pull request as ready for review April 18, 2025 09:37
@ArcturusZhang ArcturusZhang requested a review from m-nash as a code owner April 18, 2025 09:37
@ArcturusZhang
Copy link
Member Author

ArcturusZhang commented Apr 24, 2025

Please create an uptake PR for the Azure emitter to absorb any breaking changes.

yep this is in progress which contains quite a few changes

@ArcturusZhang ArcturusZhang added this pull request to the merge queue May 14, 2025
Merged via the queue into microsoft:main with commit 4442181 May 14, 2025
21 checks passed
@ArcturusZhang ArcturusZhang deleted the try-to-remove-literal-context branch May 14, 2025 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove literalTypeContext in emitter

4 participants