Skip to content

Commit d5f03c1

Browse files
authored
Releasing 0.12.0 (#497)
1 parent 841389c commit d5f03c1

File tree

4 files changed

+51
-24
lines changed

4 files changed

+51
-24
lines changed

CHANGELOG.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
[diff](https://github.com/belav/csharpier/compare/0.11.1...0.12.0)
2+
3+
### Breaking Changes
4+
- If a file that fails to compile is piped to csharpier, csharpier now writes an error message on std error and return a 1 exit code.
5+
6+
### Changes
7+
- Nested Initializers should break [#487](https://github.com/belav/csharpier/issues/487)
8+
- Adding --pipe-multiple-files and other changes to support vscode extension [#283](https://github.com/belav/csharpier/pull/495)
9+
10+
111
# 0.11.2 (CSharpier.MSBuild only)
212
- CSharpier.MSBuild 0.11.1 is not published correctly [#481](https://github.com/belav/csharpier/issues/481)
313

@@ -39,7 +49,7 @@
3949

4050
- Require the directoryOrFile argument when not piping into to stdin [#381](https://github.com/belav/csharpier/issues/381)
4151

42-
### Resolved Issues
52+
### Changes
4353
- SwitchExpression + Pattern edge cause causes extra line and poor formatting [#408](https://github.com/belav/csharpier/issues/408)
4454
- NewLines not retained before lock statement [#401](https://github.com/belav/csharpier/issues/401)
4555
- Better error handling when given a csproj or sln file [#398](https://github.com/belav/csharpier/issues/398)

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.11.1</Version>
3+
<Version>0.12.0</Version>
44
<PackageLicenseExpression>MIT</PackageLicenseExpression>
55
<RepositoryUrl>https://github.com/belav/csharpier</RepositoryUrl>
66
<RepositoryType>git</RepositoryType>

Docs/CLI.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Options:
1212
--fast Skip comparing syntax tree of formatted file to original file to validate changes.
1313
--skip-write Skip writing changes. Generally used for testing to ensure csharpier doesn't throw any errors or cause syntax tree validation failures.
1414
--write-stdout Write the results of formatting any files to stdout.
15+
--pipe-multiple-files Keep csharpier running so that multiples files can be piped to it via stdin
1516
--version Show version information
1617
-?, -h, --help Show help and usage information
1718

@@ -78,4 +79,24 @@ public class ClassName
7879
{
7980
public string Field;
8081
}
81-
```
82+
```
83+
84+
### --pipe-multiple-files
85+
Running csharpier to format a single file is slow because of the overhead of starting up dotnet.
86+
This option keeps csharpier running so that multiple files can be formatted. This is mainly used by IDE plugins
87+
to drastically improve formatting time.
88+
The input is a '\u0003' delimited list of file names followed by file contents.
89+
The results are written to stdout delimited by \u0003.
90+
For an example of implementing this in code see [this example](https://github.com/belav/csharpier/blob/master/Src/CSharpier.VSCode/src/CSharpierProcessPipeMultipleFiles.ts)
91+
```bash
92+
$ [FullPathToFile]\u0003[FileContents]\u0003[FullPathToFile]\u0003[FileContents]\u0003 | dotnet csharpier --pipe-multiple-files
93+
public class ClassName
94+
{
95+
public string Field;
96+
}
97+
\u0003
98+
public class ClassName
99+
{
100+
public string Field;
101+
}
102+
```

Docs/EditorsAndCICD.md

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
## Editor Integration
2+
### Visual Studio
3+
Check out [WillFuqua.RunOnSave](https://marketplace.visualstudio.com/items?itemName=WillFuqua.RunOnSave)
4+
### Visual Studio Code
5+
Use the [official extension](https://marketplace.visualstudio.com/items?itemName=csharpier.csharpier-vscode)
6+
7+
8+
### Rider
9+
1. Open Settings
10+
2. Tools - File Watchers
11+
3. Add New File Watcher
12+
* File Type: C# File
13+
* Program: dotnet
14+
* Arguments: csharpier $FilePath$
15+
* Output paths to refresh: $FilePath$
16+
* Advanced Options - Auto-save edited files...: This should probably be off otherwise if you pause while coding csharpier will reformat the file as is.
17+
118
## Continuous Integration
219
Normally when using a code formatter like CSharpier, you'll want to ensure that all code that makes it to your main branch has been formatted. This can be accomplished by doing the following
320
1. Set up a dotnet tool manifest file at `.config/dotnet-tools.json` with the following content. Replacing `[SpecificVersion]` with the version of CSharpier you are currently using.
@@ -38,24 +55,3 @@ Normally when using a code formatter like CSharpier, you'll want to ensure that
3855
3956
```
4057

41-
42-
## Editor Integration
43-
### Visual Studio
44-
Check out [WillFuqua.RunOnSave](https://marketplace.visualstudio.com/items?itemName=WillFuqua.RunOnSave)
45-
### Visual Studio Code
46-
An official extension is being discussed https://github.com/belav/csharpier/issues/283 \
47-
A couple of extensions have been built for personal use [CSharpier-vscode]([https://github.com/pontusntengnas/CSharpier-vscode]) and
48-
[vscode-csharpier](https://github.com/saborrie/vscode-csharpier) \
49-
Using a run on save extension is another option. Check out
50-
[emeraldwalk.RunOnSave](https://marketplace.visualstudio.com/items?itemName=emeraldwalk.RunOnSave) or [pucelle.run-on-save](https://marketplace.visualstudio.com/items?itemName=pucelle.run-on-save)
51-
52-
53-
### Rider
54-
1. Open Settings
55-
2. Tools - File Watchers
56-
3. Add New File Watcher
57-
* File Type: C# File
58-
* Program: dotnet
59-
* Arguments: csharpier $FilePath$
60-
* Output paths to refresh: $FilePath$
61-
* Advanced Options - Auto-save edited files...: This should probably be off otherwise if you pause while coding csharpier will reformat the file as is.

0 commit comments

Comments
 (0)