Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 27, 2025

  • Understand the issue and locate relevant code
  • Implement PascalCase transformation in GetCleanNameSpace method with minimal refactoring
  • Add comprehensive tests for namespace casing
  • Build and test the changes
  • Verify changes work with integration scenarios
  • Address code review feedback to minimize refactoring
  • Further minimize changes by preserving original loop structure
  • Keep stackalloc buffer allocation - transformation doesn't require variable-length handling
  • Remove duplicate IsSpecialSegment logic - delegate to existing method
  • Optimize ToString calls - use span for checks, only convert when needed
  • Revert global.json to original SDK version
  • Fix special segments bug and add test cases for type, array, enum segments
Original prompt

This section details on the original issue you should resolve

<issue_title>Consider Defaulting to Pascal Case for Generated Namespaces</issue_title>
<issue_description>There is at least one azure spector scenario that is customizing the namespace name: https://github.com/Azure/typespec-azure/blob/main/packages/azure-http-specs/specs/client/namespace/client.tsp. We do not do any casing transformation on the namespace name which is leading to the namespace to be generated as is (all lowercase). In azure, we might consider defaulting to Pascal case though we should also consider if we should have any similar rule for unbranded libraries.</issue_description>

Comments on the Issue (you are @copilot in this section)

@JoshLove-msft This can probably be addressed in TypeFactory.GetCleanNamespace.

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits October 27, 2025 17:01
…nNameSpace

Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
Copilot AI changed the title [WIP] Consider defaulting to Pascal case for generated namespaces Convert namespace segments to PascalCase in C# generator Oct 27, 2025
Copilot finished work on behalf of JoshLove-msft October 27, 2025 17:10
Copilot AI requested a review from JoshLove-msft October 27, 2025 17:10
…sformation

Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
…ffer allocation

Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
Copilot finished work on behalf of JoshLove-msft October 27, 2025 18:25
…thod

Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
Copilot AI requested a review from JoshLove-msft October 27, 2025 20:16
Copilot finished work on behalf of JoshLove-msft October 27, 2025 20:16
…ntifierName

Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
Copilot AI requested a review from JoshLove-msft October 27, 2025 20:25
Copilot finished work on behalf of JoshLove-msft October 27, 2025 20:25
Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
Copilot AI requested a review from JoshLove-msft October 27, 2025 20:31
Copilot finished work on behalf of JoshLove-msft October 27, 2025 20:31
@JoshLove-msft JoshLove-msft marked this pull request as ready for review October 27, 2025 20:48
… test cases

Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
Copilot finished work on behalf of JoshLove-msft November 1, 2025 19:49
@JoshLove-msft JoshLove-msft added this pull request to the merge queue Nov 3, 2025
Merged via the queue into main with commit 5e0cada Nov 3, 2025
28 checks passed
@JoshLove-msft JoshLove-msft deleted the copilot/default-pascal-case-namespaces branch November 3, 2025 17:36
@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 Nov 3, 2025
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.

Consider Defaulting to Pascal Case for Generated Namespaces

3 participants