Centralize C# type attribute back-compat merging in TypeProvider - #11237
Centralize C# type attribute back-compat merging in TypeProvider#11237Jorge Rangel (jorgerangel-msft) with Copilot wants to merge 47 commits into
Conversation
Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
… attributes, perf Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
commit: |
…p internalize gating, add tests Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
…tions Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
|
Copilot pull latest main |
…pe-attribute-merging Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
Addressed in |
Jorge Rangel (jorgerangel-msft)
left a comment
There was a problem hiding this comment.
Copilot pull latest main and address merge conflicts
…pe-attribute-merging # Conflicts: # packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ModelReaderWriterContextDefinition.cs # packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/TestHelpers/MockHelpers.cs Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
Addressed in |
Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
| { | ||
| public static class CodeGenAttributes | ||
| { | ||
| public const string CodeGenAttributePrefix = "CodeGen"; |
There was a problem hiding this comment.
Copilot why do we still have this? Remove this change and all of the obsolete code we have
Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
…ilot/centralize-type-attribute-merging
|
No changes needing a change description found. |
Attribute back-compat merging (generated + last-contract + custom-code) was owned locally by
CanonicalTypeProvider.BuildAttributes(). This moves that logic into a sharedTypeProviderAPI so it follows the existing centralized back-compat pattern (Build*ForBackCompatibility).Changes
TypeProvider: AddedBuildAttributesForBackCompatibility()that:Attributes) and custom-code (CustomCodeView.Attributes) attributes,CodeGenSuppress/CodeGenMember/CodeGenType/CodeGenSerialization) that should not be preserved,CanonicalTypeProvider:BuildAttributes()now delegates to the shared API instead of owning merge/dedup logic.Because the method reads
Attributes,CustomCodeView,LastContractView, andDeclarationModifiersfrom the provider, invoking it on the generated provider reproduces the previous merge exactly: