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 for c# 12 collection expressions #966

Merged
merged 3 commits into from
Oct 3, 2023

Conversation

belav
Copy link
Owner

@belav belav commented Sep 29, 2023

closes #964

@belav
Copy link
Owner Author

belav commented Oct 1, 2023

It looks like I need to add code to ensure that syntax tree validation accounts for collection expressions. With the new csharpier-repos

Error C:/projects/csharpier-repos/roslyn/src/Compilers/CSharp/Test/Emit/Emit/EditAndContinue/EditAndContinueStateMachineTests.cs - Failed with exception during syntax tree validation.
  Can't handle CollectionExpressionSyntax
     at CSharpier.SyntaxNodeComparer.Compare(ValueTuple`2 original, ValueTuple`2 formatted) in C:\projects\csharpier\Src\CSharpier\SyntaxNodeComparer.generated.cs:line 519
     at CSharpier.SyntaxNodeComparer.AreEqualIgnoringWhitespace(SyntaxNode originalStart, SyntaxNode formattedStart) in C:\projects\csharpier\Src\CSharpier\SyntaxNodeComparer.cs:line 117
     at CSharpier.SyntaxNodeComparer.CompareSourceAsync(CancellationToken cancellationToken) in C:\projects\csharpier\Src\CSharpier\SyntaxNodeComparer.cs:line 46
     at CSharpier.Cli.CommandLineFormatter.PerformFormattingSteps(FileToFormatInfo fileToFormatInfo, IFormattedFileWriter formattedFileWriter, CommandLineFormatterResult commandLineFormatterResult, FileIssueLogger fileIssueLogger, PrinterOptions printerOptions, CommandLineOptions commandLineOptions, IFormat
tingCache formattingCache, CancellationToken cancellationToken) in C:\projects\csharpier\Src\CSharpier.Cli\CommandLineFormatter.cs:line 406

@@ -11,7 +11,7 @@ jobs:
- uses: actions/setup-dotnet@v1
with:
dotnet-version: |
7.0.304
7.0.400
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On an unrelated note, I think you can the whole "default variables" feature to share this constant between all the different yaml files you have, so you only have to update it once in future:
https://docs.github.com/en/actions/learn-github-actions/variables#defining-configuration-variables-for-multiple-workflows

@@ -2,7 +2,7 @@ FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
WORKDIR /app
EXPOSE 80

FROM mcr.microsoft.com/dotnet/sdk:7.0.304 AS build
FROM mcr.microsoft.com/dotnet/sdk:7.0.400 AS build
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the whole variables thing I said in the other comment works out, you can make this an ARG and pass it from the yaml.

@shocklateboy92
Copy link
Collaborator

I'm going to merge this anyway, since the comments I made weren't directly related to this PR.

@shocklateboy92 shocklateboy92 enabled auto-merge (squash) October 3, 2023 04:32
@shocklateboy92 shocklateboy92 merged commit 0a2de08 into main Oct 3, 2023
3 checks passed
@shocklateboy92 shocklateboy92 deleted the collection-expressions branch October 3, 2023 04:33
@belav belav mentioned this pull request Oct 26, 2023
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.

Support C# 12 collection expressions
2 participants