Skip to content

Commit a066013

Browse files
authored
Releasing 0.24.0 (#878)
1 parent d896f6c commit a066013

4 files changed

Lines changed: 165 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,165 @@
1+
# 0.24.0
2+
## What's Changed
3+
#### Formatting named list patterns loses code and causes compilation error [#876](https://github.com/belav/csharpier/issues/876)
4+
```c#
5+
// input & expected output
6+
return list switch
7+
{
8+
[var elem] => elem * elem,
9+
[] => 0,
10+
[..] elems => elems.Sum(e => e + e),
11+
};
12+
13+
// 0.23.0
14+
return list switch
15+
{
16+
[var elem] => elem * elem,
17+
[] => 0,
18+
[..] => elems.Sum(e => e + e),
19+
};
20+
21+
```
22+
23+
Thanks go to @Dragemil for reporting the bug
24+
25+
#### CSharpier.MSBuild does not support usernames or project paths with spaces [#872](https://github.com/belav/csharpier/issues/872)
26+
CSharpier.MSBuild would throw an exception when building a project if the username had a space, or if the project path had a space.
27+
28+
Thanks go to @ooo2003003v2 for reporting the bug.
29+
30+
#### #pragma with long line introduces extra line break [#865](https://github.com/belav/csharpier/issues/865)
31+
```c#
32+
// input & expected output
33+
if (
34+
e is
35+
#pragma warning disable CS0618
36+
BadHttpRequestException
37+
#pragma warning restore CS0618
38+
{
39+
Message: "______________________________________________________________________________________________________________"
40+
}
41+
) { }
42+
43+
// 0.23.0
44+
if (
45+
e is
46+
#pragma warning disable CS0618
47+
BadHttpRequestException
48+
#pragma warning restore CS0618
49+
50+
{
51+
Message: "______________________________________________________________________________________________________________"
52+
}
53+
) { }
54+
```
55+
56+
Thanks go to @Denton-L for reporting the bug
57+
58+
#### Better support for ignore on method attributes [#848](https://github.com/belav/csharpier/issues/848)
59+
```c#
60+
// input
61+
public class AttributesAndMethods
62+
{
63+
// csharpier-ignore - only the first attribute
64+
[Attribute ]
65+
[Attribute ]
66+
public void MethodThatShouldFormat() { }
67+
68+
[Attribute]
69+
// csharpier-ignore - only the second attribute
70+
[Attribute ]
71+
public void MethodThatShouldFormat() { }
72+
73+
[Attribute ]
74+
[Attribute ]
75+
// csharpier-ignore - just the method
76+
public void MethodThatShouldNotFormat( ) { }
77+
}
78+
79+
// 0.23.0
80+
public class AttributesAndMethods
81+
{
82+
// csharpier-ignore - only the first attribute
83+
[Attribute ]
84+
[Attribute ]
85+
public void MethodThatShouldFormat() { }
86+
87+
[Attribute]
88+
// csharpier-ignore - only the second attribute
89+
[Attribute]
90+
public void MethodThatShouldFormat() { }
91+
92+
[Attribute]
93+
[Attribute]
94+
// csharpier-ignore - just the method
95+
public void MethodThatShouldNotFormat() { }
96+
}
97+
98+
// 0.24.0
99+
public class AttributesAndMethods
100+
{
101+
// csharpier-ignore - only the first attribute
102+
[Attribute ]
103+
[Attribute]
104+
public void MethodThatShouldFormat() { }
105+
106+
[Attribute]
107+
// csharpier-ignore - only the second attribute
108+
[Attribute]
109+
public void MethodThatShouldFormat() { }
110+
111+
[Attribute]
112+
[Attribute]
113+
// csharpier-ignore - just the method
114+
public void MethodThatShouldNotFormat() { }
115+
}
116+
```
117+
118+
Thanks go to @Billuc for reporting the bug
119+
120+
#### Ranged ignore applies some formatting when multiple statements are on a line [#846](https://github.com/belav/csharpier/issues/846)
121+
```c#
122+
// input & expected output
123+
void MethodName()
124+
{
125+
// csharpier-ignore-start
126+
var packet = new List<byte>();
127+
packet.Add(0x0f); packet.Add(0x00);
128+
packet.Add(0x00); packet.Add(0x00);
129+
// csharpier-ignore-end
130+
}
131+
132+
// 0.23.0
133+
void MethodName()
134+
{
135+
// csharpier-ignore-start
136+
var packet = new List<byte>();
137+
packet.Add(0x0f);
138+
packet.Add(0x00);
139+
packet.Add(0x00);
140+
packet.Add(0x00);
141+
// csharpier-ignore-end
142+
}
143+
```
144+
145+
Thanks go to @Billuc for reporting the bug
146+
147+
#### Support scoped variables (better handling of unrecognized syntax nodes) [#839](https://github.com/belav/csharpier/issues/839)
148+
Scoped variables are a language proposal. CSharpier has some support for printing unrecognized syntax nodes but the validation logic didn't account for them and would throw an exception
149+
```c#
150+
scoped Span<byte> span;
151+
```
152+
Thanks go to @Dragemil for reporting the bug
153+
#### Unrecognized syntax nodes lose comments [#869](https://github.com/belav/csharpier/issues/869)
154+
CSharpier now supports printing commends on unrecognized nodes.
155+
```c#
156+
// comment on unrecognized node
157+
scoped Span<byte> span;
158+
```
159+
160+
**Full Changelog**: https://github.com/belav/csharpier/compare/0.23.0...0.24.0
161+
162+
1163
# 0.23.0
2164
## Breaking Changes
3165
#### Make compile errors public when using CSharpier.Core [#799](https://github.com/belav/csharpier/issues/799)

CSharpier.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<Version>0.23.0</Version>
3+
<Version>0.24.0</Version>
44
<PackageLicenseExpression>MIT</PackageLicenseExpression>
55
<RepositoryUrl>https://github.com/belav/csharpier</RepositoryUrl>
66
<RepositoryType>git</RepositoryType>

Src/Website/docs/CLI.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ This option keeps csharpier running so that multiple files can be formatted. Thi
112112
to drastically improve formatting time.
113113
The input is a '\u0003' delimited list of file names followed by file contents.
114114
The results are written to stdout delimited by \u0003.
115-
For an example of implementing this in code see [this example](https://github.com/belav/csharpier/blob/master/Src/CSharpier.VSCode/src/CSharpierProcessPipeMultipleFiles.ts)
115+
For an example of implementing this in code see [this example](https://github.com/belav/csharpier/blob/main/Src/CSharpier.VSCode/src/CSharpierProcessPipeMultipleFiles.ts)
116116
```bash
117117
$ [FullPathToFile]\u0003[FileContents]\u0003[FullPathToFile]\u0003[FileContents]\u0003 | dotnet csharpier --pipe-multiple-files
118118
public class ClassName

Src/Website/docs/ContinuousIntegration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Normally when using a code formatter like CSharpier, you'll want to ensure that
2929
name: Validate PR
3030
on:
3131
pull_request:
32-
branches: [ master ]
32+
branches: [ main ]
3333
jobs:
3434
check_formatting:
3535
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)