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

NormalizeWhitespace should put * next to the type rather than the identifier #49733

Closed
AArnott opened this issue Dec 2, 2020 · 1 comment · Fixed by #49919
Closed

NormalizeWhitespace should put * next to the type rather than the identifier #49733

AArnott opened this issue Dec 2, 2020 · 1 comment · Fixed by #49919

Comments

@AArnott
Copy link
Contributor

AArnott commented Dec 2, 2020

Version Used: Microsoft.CodeAnalysis.CSharp 3.8.0

Steps to Reproduce:

Use NormalizeWhitespace on a VariableDeclarationSyntax containing a PointerTypeSyntax

Expected Behavior:

The output should put the asterisk on the type, for example:

int* p;
int* p1, p2;

Actual Behavior:

The output puts the asterisk on the first identifier:

int *p;
int *p1, p2;

Besides just the nit that the asterisk applies to the type, it honestly makes p1 look like a pointer where p2 does not look like a pointer. But when the asterisk is on the type itself, it's much more apparent how the compiler will always interpret it.

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Dec 2, 2020
@sharwell
Copy link
Member

sharwell commented Dec 9, 2020

Moving back to compilers, as this regards NormalizeWhitespace as opposed to the formatter APIs.

Related to #49732

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