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

Release 0.28.0 #1223

Merged
merged 1 commit into from
Apr 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 119 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,121 @@
# 0.27.3
# 0.28.0
## What's Changed
### Fix dedented method call if there is a long chain [#1154](https://github.com/belav/csharpier/issues/1154)
In some cases of method chains, the first invocation would end up dedented.

```c#
// 0.27.3
o.Property.CallMethod(
someParameter_____________________________,
someParameter_____________________________
)
.CallMethod()
.CallMethod();

// 0.28.0
o.Property.CallMethod(
someParameter_____________________________,
someParameter_____________________________
)
.CallMethod()
.CallMethod();
```
### Extra newline in switch case statement with curly braces [#1192](https://github.com/belav/csharpier/issues/1192
If a case statement started with a block it would get an extra new line
```c#
// 0.27.3
switch (someValue)
{
case 0:
{
// dedented because the only statement is a block
break;
}

case 1:

{
// indented because there are two statements, a block then a break
}
break;
}

// 0.28.0
// 0.27.3
switch (someValue)
{
case 0:
{
// dedented because the only statement is a block
break;
}

case 1:
{
// indented because there are two statements, a block then a break
}
break;
}
```

Thanks go to @emberTrev for reporting the bug.

### Handle more editorconfig glob patterns. [#1214](https://github.com/belav/csharpier/issues/1214)
The editorconfig parsing was not handling glob patterns that contained braces.
```editorconfig
# worked in 0.27.3
[*.cs]
indent_size = 4
tab_width = 4

# did not work in 0.27.3
[*.{cs,csx}]
indent_size = 4
tab_width = 4

# did not work in 0.27.3
[*.{cs}]
indent_size = 4
tab_width = 4
```

Thanks go to @kada-v for reporting the bug

### Ignore-start combined with regions throws exception [#1197](https://github.com/belav/csharpier/issues/1197)
The following code would throw an exception, it is now working as expected.
```c#
class ClassName
{
#region Region
// csharpier-ignore-start
public string Field;
// csharpier-ignore-end
#endregion
}
```
Thanks go to @davidescapolan01 for reporting the bug

### Cannot format project containing editorconfig [#1194](https://github.com/belav/csharpier/issues/1194)
On some OSs the following would cause an exception.
```bash
dotnet new console -n foo
cd foo
dotnet new editorconfig
dotnet csharpier ./
```

Thanks go to @hashitaku for contributing the fix.

### Expose IncludeGenerated in CodeFormatterOptions [#1215](https://github.com/belav/csharpier/issues/1215)
`CodeFormatterOptions.IncludeGenerated` is now available for the SDK.

### Returning errors + status from csharpier http server [#1191](https://github.com/belav/csharpier/pull/1191)
Improved the http server that CSharpier will soon use to facilitate formatting by plugins. The formatting request now returns errors and a status for each file formatted.
This allows the plugin to provide more information to the user when they attempt to format a file. The plugins will be updated to use the http server option for CSharpier 0.28.0+


**Full Changelog**: https://github.com/belav/csharpier/compare/0.27.3...0.28.0
# 0.27.3
## What's Changed
### Add more options to CodeFormatterOptions [#1172](https://github.com/belav/csharpier/issues/1172)
The API for CSharpier was only exposing `CodeFormatterOptions.PrintWidth`. It is now in sync with the CLI and exposes all of the available options
Expand Down Expand Up @@ -2220,3 +2337,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.27.3</Version>
<Version>0.28.0</Version>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryUrl>https://github.com/belav/csharpier</RepositoryUrl>
<RepositoryType>git</RepositoryType>
Expand Down
Loading