Skip to content

Commit

Permalink
Releasing 0.30.0 (#1381)
Browse files Browse the repository at this point in the history
  • Loading branch information
belav authored Nov 17, 2024
1 parent 4dfa243 commit 0425539
Show file tree
Hide file tree
Showing 5 changed files with 120 additions and 7 deletions.
113 changes: 112 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -2653,3 +2763,4 @@ Thanks go to @pingzing
2 changes: 1 addition & 1 deletion Nuget/Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>0.29.2</Version>
<Version>0.30.0</Version>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryUrl>https://github.com/belav/csharpier</RepositoryUrl>
<RepositoryType>git</RepositoryType>
Expand Down
2 changes: 2 additions & 0 deletions Src/Website/docs/Editors.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Src/Website/docs/EditorsTroubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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<br/>
`$HOME/.cache/csharpier/[CSharpierVersion]`
3. Assuming the directory above exists, attempt to run the following in that directory<br/>
`dotnet-csharpier --version`
`dotnet csharpier --version`
4. If the installation appears to be corrupt, delete the directory and install CSharpier there yourself<br/>
`dotnet tool install csharpier --version [CSharpierVersion] --tool-path [PathFromStep2]`
5. Repeat step 3 to validate the install
6 changes: 3 additions & 3 deletions Src/Website/docs/MsBuild.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
<PropertyGroup>
<CSharpier_FrameworkVersion>net6.0</CSharpier_FrameworkVersion>
<CSharpier_FrameworkVersion>net8.0</CSharpier_FrameworkVersion>
</PropertyGroup>
```

0 comments on commit 0425539

Please sign in to comment.