Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C# Format Problem: Insert space before comma #73258

Open
vsfeedback opened this issue Apr 29, 2024 · 1 comment
Open

C# Format Problem: Insert space before comma #73258

vsfeedback opened this issue Apr 29, 2024 · 1 comment
Labels
Area-IDE IDE-Formatter Code formatter and/or smart indent Investigation Required
Milestone

Comments

@vsfeedback
Copy link

vsfeedback commented Apr 29, 2024

This issue has been moved from a ticket on Developer Community.


[severity:It bothers me. A fix would be nice]
Setting:

Bd2c0318ee2ed40cabd22f0a4cea19419638499484866624176_20240429_084305

Result:
Bee58988dd6fe4bbd84cc95ef9992fd63638499485019017755_20240429_084756

The setting's implementation is not as it described: Insert space before comma.
Like above picture when using tuple , after formatting , there are actually commas , but none were inserted comma before.
I can't find anything override this option , if it is why the other case comma is inserted?

I think the option setting should be defined clearly has no extra side effect or unexceptional case.

And the demo code should have more cases to perform , better that let the user to edit to see the effect.

And I don't like the way to config by check or uncheck , it is old and fixed.

Is there any flexible way to configure it?
Such as: Using a file directly configure the AST Tree.


Original Comments

Feedback Bot on 4/28/2024, 08:34 PM:

(private comment, text removed)


Original Solutions

(no solutions)

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Apr 29, 2024
@sharwell
Copy link
Member

sharwell commented Apr 29, 2024

Bugs in this area would not surprise me at all. I've never seen code using the "Insert space before comma" option, and I doubt we have any tests for it.

It's possible the issue in the screenshot above is caused by a separate setting to ignore spaces within declarations. However, if that option isn't checked, we would likely accept a pull request to correct this behavior (and insert the missing spaces).

@sharwell sharwell added Investigation Required IDE-Formatter Code formatter and/or smart indent and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Apr 29, 2024
@sharwell sharwell added this to the Backlog milestone Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE IDE-Formatter Code formatter and/or smart indent Investigation Required
Projects
None yet
Development

No branches or pull requests

2 participants