Skip to content

feat: Implement a more legible Source Code - #2282

Open
jgarciadelanoceda wants to merge 4 commits into
mainfrom
feat_MoreLegibleSourceGenerated
Open

feat: Implement a more legible Source Code#2282
jgarciadelanoceda wants to merge 4 commits into
mainfrom
feat_MoreLegibleSourceGenerated

Conversation

@jgarciadelanoceda

@jgarciadelanoceda jgarciadelanoceda commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

What kind of change does this PR introduce?

Feature implement a more legible Source code, see the verified files for example

What is the new behavior?

The source code generated is more legible

What is the current behavior?

The source code generated when building the HttpRequestMessage it was a long line hard to see

What might this PR break?

N/A all test are passed

Checklist

  • I have read the Contribute guide
  • Tests have been added or updated (for bug fixes / features)
  • Docs have been added or updated (for bug fixes / features)
  • Changes target the main branch
  • PR title follows Conventional Commits

@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.96%. Comparing base (132f72d) to head (fd744ca).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2282   +/-   ##
=======================================
  Coverage   99.96%   99.96%           
=======================================
  Files         191      191           
  Lines        9945     9981   +36     
  Branches     1912     1914    +2     
=======================================
+ Hits         9942     9978   +36     
  Partials        3        3           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jgarciadelanoceda
jgarciadelanoceda marked this pull request as draft July 29, 2026 10:57
Comment thread src/InterfaceStubGenerator.Shared/Emitter.Inline.Path.cs Outdated
@glennawatson

Copy link
Copy Markdown
Contributor

Looks better agreed reading the end output. Probably just more indenting on method parameters.

Source generator itself is a bit harder, I would group together on the same line together which are generated on the same line.

@jgarciadelanoceda

jgarciadelanoceda commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator Author

Looks better agreed reading the end output. Probably just more indenting on method parameters.

Source generator itself is a bit harder, I would group together on the same line together which are generated on the same line.

That last line I didn´t get it. When generating the SendAsync on the source generated file it looks just beautiful. I tried doing on the path. If you agree that the source generated file should be more readable I continue with this. I just looked at some examples of the generated methods and there are some of them that are 6XX chars long
It's definitely a tradeoff because you will end up allocating a bit more on just making it beautiful

@jgarciadelanoceda
jgarciadelanoceda marked this pull request as ready for review July 29, 2026 22:57
@glennawatson

Copy link
Copy Markdown
Contributor

Looks better agreed reading the end output. Probably just more indenting on method parameters.
Source generator itself is a bit harder, I would group together on the same line together which are generated on the same line.

That last line I didn´t get it. When generating the SendAsync on the source generated file it looks just beautiful. I tried doing on the path. If you agree that the source generated file should be more readable I continue with this. I just looked at some examples of the generated methods and there are some of them that are 6XX chars long It's definitely a tradeoff because you will end up allocating a bit more on just making it beautiful

Sorry crazy time with work

  1. Parameters in generated code be useful to indent one more set.
  2. The source generator it'd be useful to chain the StringBuilder lines with the lines being outputted. eg
   .Append(indent).Append(variable).Append(' ').Append(name).Append(" = ").AppendLine("0;);

Just so you can track in the source generator where the lines are.

Javier García de la Noceda Argüelles added 2 commits July 30, 2026 08:00
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants