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

Support scoped variables #839

Closed
Dragemil opened this issue Mar 6, 2023 · 2 comments · Fixed by #840
Closed

Support scoped variables #839

Dragemil opened this issue Mar 6, 2023 · 2 comments · Fixed by #840
Milestone

Comments

@Dragemil
Copy link

Dragemil commented Mar 6, 2023

https://github.com/dotnet/csharplang/blob/d45a4817470319e08707d2426b9ad4edebe99676/proposals/low-level-struct-improvements.md#examples-scoped-locals

Currently csharpier throws when it is encountered.

Can't handle ScopedTypeSyntax
     at CSharpier.SyntaxNodeComparer.Compare(ValueTuple`2 original, ValueTuple`2 formatted) in /home/runner/work/csharpier/csharpier/Src/CSharpier/SyntaxNodeComparer.generated.cs:line 516
     at CSharpier.SyntaxNodeComparer.AreEqualIgnoringWhitespace(SyntaxNode originalStart, SyntaxNode formattedStart) in /home/runner/work/csharpier/csharpier/Src/CSharpier/SyntaxNodeComparer.cs:line 114
     at CSharpier.SyntaxNodeComparer.CompareSourceAsync(CancellationToken cancellationToken) in /home/runner/work/csharpier/csharpier/Src/CSharpier/SyntaxNodeComparer.cs:line 43
     at CSharpier.Cli.CommandLineFormatter.PerformFormattingSteps(FileToFormatInfo fileToFormatInfo, IFormattedFileWriter formattedFileWriter, CommandLineFormatterResult commandLineFormatterResult, FileIssueLogger fileIssueLogger, PrinterOptions printerOptions, CommandLineOptions commandLineOptions, IFormattingCache formattingCache, CancellationToken cancellationToken) in /home/runner/work/csharpier/csharpier/Src/CSharpier.Cli/CommandLineFormatter.cs:line 398
@belav
Copy link
Owner

belav commented Mar 6, 2023

I thought I had CSharpier handling syntax nodes that it wasn't familiar with correctly but I missed the code in SyntaxNodeComparer.

If you want a workaround dotnet csharpier . --fast bypasses the SyntaxNodeComparer code or // csharpier-ignore is always an option.

@belav belav added this to the 0.23.0 milestone Mar 6, 2023
@belav belav modified the milestones: 0.23.0, 0.24.0 Mar 6, 2023
shocklateboy92 added a commit that referenced this issue Mar 6, 2023
closes #839

Co-authored-by: Lasath Fernando <devel@lasath.org>
@Dragemil
Copy link
Author

Dragemil commented Mar 7, 2023

Thanks!

Didn't try dotnet csharpier . --fast back then, but having // csharpier-ignore on the variable or even whole method still had csharpier throwing. Same for the scoped ignores.

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

Successfully merging a pull request may close this issue.

2 participants