Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 11, 2025

BinaryOperatorExpression.Write() adds spaces around operators during code generation. ClientUriBuilderDefinition was passing operators with embedded spaces (" - ", " + ", " ??= "), causing double spacing in generated output.

Changes:

  • Remove spaces from operator strings in ClientUriBuilderDefinition.cs to match codebase convention

Before:

private UriBuilder UriBuilder => _uriBuilder  ??=  new UriBuilder();
if (_pathLength > 0 && PathAndQuery[_pathLength  -  1] == '/')

After:

private UriBuilder UriBuilder => _uriBuilder ??= new UriBuilder();
if (_pathLength > 0 && PathAndQuery[_pathLength - 1] == '/')
Original prompt

This section details on the original issue you should resolve

<issue_title>Inconsistent spacing in ClientUriBuilder</issue_title>
<issue_description>Azure/azure-sdk-for-net#53776 (comment)</issue_description>

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


💡 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.

Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
@JoshLove-msft JoshLove-msft marked this pull request as ready for review November 11, 2025 01:11
Copilot AI changed the title [WIP] Fix inconsistent spacing in ClientUriBuilder Fix double spacing in ClientUriBuilder generated code Nov 11, 2025
Copilot finished work on behalf of JoshLove-msft November 11, 2025 01:12
@JoshLove-msft JoshLove-msft added this pull request to the merge queue Nov 11, 2025
Merged via the queue into main with commit e3c8704 Nov 11, 2025
28 checks passed
@JoshLove-msft JoshLove-msft deleted the copilot/fix-inconsistent-spacing-client-uri branch November 11, 2025 17:50
@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 11, 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.

Inconsistent spacing in ClientUriBuilder

3 participants