From bf7cbd74f710dfa462462588e621078d942d4315 Mon Sep 17 00:00:00 2001 From: Bela VanderVoort Date: Sun, 17 Nov 2024 11:00:22 -0600 Subject: [PATCH] Releasing 0.30.0 --- CHANGELOG.md | 113 ++++++++++++++++++++- Nuget/Build.props | 2 +- Src/Website/docs/Editors.md | 2 + Src/Website/docs/EditorsTroubleshooting.md | 4 +- Src/Website/docs/MsBuild.md | 6 +- 5 files changed, 120 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e8a4d5130..444f66829 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,114 @@ -# 0.29.2 +# 0.30.0 +## Breaking Changes +The CSharpier dotnet tool no longer supports net6 & net7. +## What's Changed +### Support C# 13 & dotnet 9. [#1318](https://github.com/belav/csharpier/issues/1318) +CSharpier now supports dotnet 9 along with formatting all C# 13 language features. +### Inconsistent Formatting for new() Operator Compared to Explicit Object Constructors [#1364](https://github.com/belav/csharpier/issues/1364) +Implicit and explicit object initialization with constructors was not formatted consistently +```c# +// input & expected output +SomeObject someObject = new( + someLongParameter___________________, + someLongParameter___________________ +) +{ + Property = longValue_______________________________________________________________________, +}; + +SomeObject someObject = new SomeObject( + someLongParameter___________________, + someLongParameter___________________ +) +{ + Property = longValue_______________________________________________________________________, +}; + +// 0.29.2 +SomeObject someObject = + new(someLongParameter___________________, someLongParameter___________________) + { + Property = longValue_______________________________________________________________________, + }; + +SomeObject someObject = new SomeObject( + someLongParameter___________________, + someLongParameter___________________ +) +{ + Property = longValue_______________________________________________________________________, +}; + +``` +### Adds additional space before each member access in verbatim interpolated multiline string [#1358](https://github.com/belav/csharpier/issues/1358) +When an interpolated verbatim string contained line breaks, the code within the interpolations would contain extra spaces. +```c# +// input & expected output +var someStringWithLineBreakAndLongValue = + $@" +{someValue.GetValue().Name} someLongText________________________________________________________________"; + +// 0.29.2 +var someStringWithLineBreakAndLongValue = + $@" + {someValue .GetValue() .Name} someLongText________________________________________________________________"; +``` + +### Inserting trailing comma with trailing comment causes problems. [#1354](https://github.com/belav/csharpier/issues/1354) +CSharpier would insert a trailing comma after a trailing comment and format the end result poorly. +```c# +// input +var someObject = new SomeObject() +{ + Property1 = 1, + Property2 = 2 // Trailing Comment +}; + +// 0.29.2 +var someObject = new SomeObject() +{ + Property1 = 1, + Property2 = + 2 // Trailing Comment + , +}; + +// 0.30.0 +var someObject = new SomeObject() +{ + Property1 = 1, + Property2 = 2, // Trailing Comment +}; +``` + +### Double line break before collection expression in field [#1351](https://github.com/belav/csharpier/issues/1351) +CSharpier was inserting an extra line break on a long field name followed by a collection expression to initialize it. +```c# +// input & expected output +class ClassName +{ + public SomeType[] LongName____________________________________________________________________________ = + [ + someLongValue___________________________________________________, + someLongValue___________________________________________________, + ]; +} + +// 0.29.2 +class ClassName +{ + public SomeType[] LongName____________________________________________________________________________ = + + [ + someLongValue___________________________________________________, + someLongValue___________________________________________________, + ]; +} + +``` + +**Full Changelog**: https://github.com/belav/csharpier/compare/0.29.2...0.30.0 +# 0.29.2 ## What's Changed ### Comments don't follow tabs indent style [#1343](https://github.com/belav/csharpier/issues/1343) Prior to `0.29.2` CSharpier was converting any tabs within the block of a multiline comment to spaces. @@ -2653,3 +2763,4 @@ Thanks go to @pingzing + diff --git a/Nuget/Build.props b/Nuget/Build.props index ad5774fd5..44e1798fb 100644 --- a/Nuget/Build.props +++ b/Nuget/Build.props @@ -1,6 +1,6 @@ - 0.29.2 + 0.30.0 MIT https://github.com/belav/csharpier git diff --git a/Src/Website/docs/Editors.md b/Src/Website/docs/Editors.md index 71f0b4ed2..cc9dc1305 100644 --- a/Src/Website/docs/Editors.md +++ b/Src/Website/docs/Editors.md @@ -22,6 +22,8 @@ Use the [official plugin](https://plugins.jetbrains.com/plugin/18243-csharpier) It can be installed via the Plugins dialog. ### Neovim +Use [conform.nvim](https://github.com/stevearc/conform.nvim) +or Use [neoformat](https://github.com/sbdchd/neoformat) ### Emacs diff --git a/Src/Website/docs/EditorsTroubleshooting.md b/Src/Website/docs/EditorsTroubleshooting.md index 86e1e4b30..68f3703c5 100644 --- a/Src/Website/docs/EditorsTroubleshooting.md +++ b/Src/Website/docs/EditorsTroubleshooting.md @@ -34,7 +34,7 @@ When the extension is unable to format files, it is generally a problem with bei - Change the dropdown to `CSharpier` ### Rider -- Execute the action `Show Log in Explorer +- Execute the action `Show Log in Explorer` - Look for lines that contain `#c.i.c.CSharpierLogger` ## Troubleshooting Steps @@ -46,7 +46,7 @@ The following can help track down issues with the extension being unable to inst `C:\Users\[UserName]\AppData\Local\CSharpier\[CSharpierVersion]` or
`$HOME/.cache/csharpier/[CSharpierVersion]` 3. Assuming the directory above exists, attempt to run the following in that directory
- `dotnet-csharpier --version` + `dotnet csharpier --version` 4. If the installation appears to be corrupt, delete the directory and install CSharpier there yourself
`dotnet tool install csharpier --version [CSharpierVersion] --tool-path [PathFromStep2]` 5. Repeat step 3 to validate the install diff --git a/Src/Website/docs/MsBuild.md b/Src/Website/docs/MsBuild.md index 700f5f9e3..75c508ab8 100644 --- a/Src/Website/docs/MsBuild.md +++ b/Src/Website/docs/MsBuild.md @@ -51,10 +51,10 @@ Valid options are: - Debug ### Target Frameworks -CSharpier.MSBuild will be run with net6.0, net7.0 or net8.0 if the project targets one of the three frameworks. In cases where the project targets something else (net48, netstandard2.0) `CSharpier_FrameworkVersion` will default to net7.0 -This can be controlled with the following property. This property is required if the csproj is targeting < net6.0 (netstandard2.0, net48, etc) and net7.0 is not installed. +CSharpier.MSBuild will be run with net8.0 or net9.0 if the project targets one of the three frameworks. In cases where the project targets something else (net48, netstandard2.0) `CSharpier_FrameworkVersion` will default to net8.0 +This can be controlled with the following property. This property is required if the csproj is targeting < net8.0 (netstandard2.0, net48, etc) and net8.0 is not installed. ```xml - net6.0 + net8.0 ```