Conversation
…core" - Update emitEnumMember to accept enumTypeName parameter and use it as prefix instead of _ for invalid identifiers - Update buildEnumTypes to pass normalized enum type name to emitEnumMember - Update prefix-adding-in-enum-member diagnostic message format to include enumTypeName - Update enumKeyNorm.md scenario snapshot to use enum type name prefix - Update extends.md scenario snapshot with new enum member names - Update enumUnion.spec.ts test to properly verify new diagnostic behavior Co-authored-by: MaryGao <9943211+MaryGao@users.noreply.github.com> Agent-Logs-Url: https://github.com/Azure/autorest.typescript/sessions/99a3e736-bfc1-4400-a41d-56f4053c4638
Co-authored-by: MaryGao <9943211+MaryGao@users.noreply.github.com> Agent-Logs-Url: https://github.com/Azure/autorest.typescript/sessions/99a3e736-bfc1-4400-a41d-56f4053c4638
_ for leading-digit identifiers
|
@copilot Could you take a look at the pipeline failure and try to fix then? |
Generated files updated to reflect the new enum member naming where enum type name is used as prefix instead of underscore (e.g., Versions100 instead of _100, Versions20240701Preview instead of _20240701Preview). This ensures the CI check:tree step passes since it compares generated files against committed files. Co-authored-by: MaryGao <9943211+MaryGao@users.noreply.github.com> Agent-Logs-Url: https://github.com/Azure/autorest.typescript/sessions/d16aef3a-466d-4251-a6fe-489bd3fd2549
The previous commit accidentally deleted the openai_non_branded generated files because it uses a non-standard tspconfig.yaml path (in spec/ not root). Re-running the smoke test properly regenerates these files. Co-authored-by: MaryGao <9943211+MaryGao@users.noreply.github.com> Agent-Logs-Url: https://github.com/Azure/autorest.typescript/sessions/d16aef3a-466d-4251-a6fe-489bd3fd2549
The CI failure was in the Fixed in commits
The |
|
@copilot run |
… from main Regenerated 6 scenarios (NetworkAnalytics.Management, healthInsights_radiologyinsights, loadtesting_modular, nestedClient, openai_modular, schemaRegistry) that were affected by the merge with main branch (PR #3856: model array responses fix). This ensures the check:tree CI step passes. Agent-Logs-Url: https://github.com/Azure/autorest.typescript/sessions/47b50ca2-9eda-4d7f-8560-c906ba14c70f Co-authored-by: v-jiaodi <80496810+v-jiaodi@users.noreply.github.com>
Done in commit |
|
@copilot pull main branch and resolve conflicts. |
…er-names # Conflicts: # packages/typespec-ts/test/modularUnit/enumUnion.spec.ts Co-authored-by: v-jiaodi <80496810+v-jiaodi@users.noreply.github.com>
Done in commit |
…me internally Agent-Logs-Url: https://github.com/Azure/autorest.typescript/sessions/4a41bf9d-0c14-444a-8f5e-2995bbcb3461 Co-authored-by: MaryGao <9943211+MaryGao@users.noreply.github.com>
…on occurs Agent-Logs-Url: https://github.com/Azure/autorest.typescript/sessions/335fe4df-4788-4ba4-8c2a-079e2935ec43 Co-authored-by: MaryGao <9943211+MaryGao@users.noreply.github.com>
|
@copilot revert |
…se.md to original state Agent-Logs-Url: https://github.com/Azure/autorest.typescript/sessions/7e7b2568-202d-4eae-8fc3-c62f37697674 Co-authored-by: v-jiaodi <80496810+v-jiaodi@users.noreply.github.com>
Done in commit |
Agent-Logs-Url: https://github.com/Azure/autorest.typescript/sessions/d1234708-ecd8-4ce3-ab5c-5d9bfc6b69fb Co-authored-by: v-jiaodi <80496810+v-jiaodi@users.noreply.github.com>
…script 6.0.65 (#3871) * Initial plan * Bump emitter versions: typespec-ts 0.51.1, rlc-common 0.51.1, autorest.typescript 6.0.65 Agent-Logs-Url: https://github.com/Azure/autorest.typescript/sessions/a8b8af62-f460-4099-8944-43f4cb8ff6f7 Co-authored-by: v-jiaodi <80496810+v-jiaodi@users.noreply.github.com> * Run pnpm install to update lock file with bumped version references Agent-Logs-Url: https://github.com/Azure/autorest.typescript/sessions/fa4b7fda-60f7-4a6f-bacf-fbd27da9e99f Co-authored-by: v-jiaodi <80496810+v-jiaodi@users.noreply.github.com> * Add missing #3870 (Bump TypeSpec dependencies) to all three changelogs Agent-Logs-Url: https://github.com/Azure/autorest.typescript/sessions/42aeb7ec-160d-4e69-9f03-f354ec0afda7 Co-authored-by: v-jiaodi <80496810+v-jiaodi@users.noreply.github.com> * Add missing #3868 (Fix enum member names) to all three changelogs Agent-Logs-Url: https://github.com/Azure/autorest.typescript/sessions/d1234708-ecd8-4ce3-ab5c-5d9bfc6b69fb Co-authored-by: v-jiaodi <80496810+v-jiaodi@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: v-jiaodi <80496810+v-jiaodi@users.noreply.github.com>
Fixes enum member naming in the Modular SDK emitter to produce valid TypeScript identifiers when enum values start with digits or special characters.
Changes Made
emitEnumMembernow computesenumTypeNameinternally frommember.enumType.name(vianormalizeName) instead of receiving it as a parameter, keeping the function signature clean.deduplicateEnumMemberNames()inbuildEnumTypesto handle cases where multiple enum values normalize to the same identifier (e.g."10"and"1.0"both normalizing toExtensibleString10). Conflicting names are disambiguated by appending_1,_2, ... suffixes (e.g.ExtensibleString10_1andExtensibleString10_2).prefix-adding-in-enum-memberwarning is reported when a leading-digit member name is prefixed with the enum type name.enumKeyNorm.mdandextends.mdscenario snapshots to reflect the new naming behavior.check:treeCI step passes with the new enum member names.Testing
Original prompt
_0to fix enum member names having a _ prefix #3859💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.