Skip to content
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
75 changes: 75 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,77 @@
# 1.0.3
## What's Changed
### Switch block case with conditionals adding newlines [#1630](https://github.com/belav/csharpier/issues/1630)
Switch blocks were breaking on conditions within patterns.
```c#
// input and expected output
switch ("")
{
case "" or "":
break;
}

// 1.0.2
switch ("")
{
case ""
or "":
break;
}
```
### switch expression formatting adds odd newlines [#1620](https://github.com/belav/csharpier/issues/1620)
CSharpier was breaking after a discard with a when, resulting in extra new lines
```c#
// input and expected output
_ = someValue switch
{
_ when KeepWhenWithDiscard() => "",
_ when KeepWhenWithDiscard_________________(
SomeObject_______________________________________________
) => "",
_ when KeepWhenWithDiscard_________________(
SomeObject_______________________________________________
) => "LongString_____________________________________________________________________",
};

// 1.0.2
_ = someValue switch
{
_ when KeepWhenWithDiscard() => "",
_
when KeepWhenWithDiscard_________________(
SomeObject_______________________________________________
) => "",
_
when KeepWhenWithDiscard_________________(
SomeObject_______________________________________________
) => "LongString_____________________________________________________________________",
};

```
### multi-line raw string in linq query causes a subsequent linq query to be printed on one line [#1617](https://github.com/belav/csharpier/issues/1617)
If a query syntax linq expression contained a raw string, it could result in method invocations not breaking.
```c#
// input and expected output
(
from x in SomeMethod()
select """
someString
"""
)
.CallMethod_____________________________________________()
.CallMethod_____________________________________________();

// 1.0.2
(
from x in SomeMethod()
select """
someString
"""
).CallMethod_____________________________________________().CallMethod_____________________________________________();

```

**Full Changelog**: https://github.com/belav/csharpier/compare/1.0.2...1.0.3
# 1.0.2
## What's Changed
### Performance issues when supporting .gitignore. [#1588](https://github.com/belav/csharpier/issues/1588)
Expand Down Expand Up @@ -3266,5 +3340,6 @@ 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>1.0.2</Version>
<Version>1.0.3</Version>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryUrl>https://github.com/belav/csharpier</RepositoryUrl>
<RepositoryType>git</RepositoryType>
Expand Down
12 changes: 6 additions & 6 deletions Src/Website/docs/Pre-commit.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ dotnet husky install
Modify the file at `.husky/task-runner.json`. Include any file extensions that you want to be formatted by CSharpier.
```json
{
"tasks": [{
"name": "Run csharpier",
"command": "dotnet",
"args": [ "csharpier", "format", "${staged}" ],
"include": [ "**/*.{cs,csx,csproj,props,targets,xml,config}" ]
}]
"tasks": [{
"name": "Run csharpier",
"command": "dotnet",
"args": [ "csharpier", "format", "${staged}" ],
"include": [ "**/*.{cs,csx,csproj,props,targets,xml,config}" ]
}]
}
```

Expand Down