Skip to content

Commit

Permalink
Releasing 0.9.9 (#420)
Browse files Browse the repository at this point in the history
  • Loading branch information
belav authored Aug 23, 2021
1 parent d7ca975 commit b6b8dea
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 3 deletions.
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
# 0.9.9

[diff](https://github.com/belav/csharpier/compare/0.9.8...0.9.9)

### Breaking Changes

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

### Resolved Issues
- SwitchExpression + Pattern edge cause causes extra line and poor formatting [#408](https://github.com/belav/csharpier/issues/408)
- NewLines not retained before lock statement [#401](https://github.com/belav/csharpier/issues/401)
- Better error handling when given a csproj or sln file [#398](https://github.com/belav/csharpier/issues/398)
- CSharpierignore not taken into account when supplying . as the directory [#392](https://github.com/belav/csharpier/issues/392)
- SwitchStatement with When breaks even with body of switch [#387](https://github.com/belav/csharpier/issues/387)
- Respect new lines between case statements [#383](https://github.com/belav/csharpier/issues/383)
- Line breaks in "when" clause in SwitchExpression [#382](https://github.com/belav/csharpier/issues/382)
- Block loses extra lines [#378](https://github.com/belav/csharpier/issues/378)
- RecordDeclaration should format consistently with ConstructorDeclaration [#371](https://github.com/belav/csharpier/issues/371)
- Conditional breaking without indentation [#345](https://github.com/belav/csharpier/issues/345)
- Improve formatting of pattern matching (IsPatternExpression, BinaryPattern, etc) [#154](https://github.com/belav/csharpier/issues/154)
- Code in IfDirective can't currently be formatted [#15](https://github.com/belav/csharpier/issues/15)


# 0.9.8

[diff](https://github.com/belav/csharpier/compare/0.9.7...0.9.8)
Expand Down
2 changes: 1 addition & 1 deletion CSharpier.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>0.9.8</Version>
<Version>0.9.9</Version>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryUrl>https://github.com/belav/csharpier</RepositoryUrl>
<RepositoryType>git</RepositoryType>
Expand Down
29 changes: 27 additions & 2 deletions Docs/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,40 @@ CSharpier has support for a configuration file. You can use any of the following
JSON
```json
{
"printWidth": 100
"printWidth": 100,
"preprocessorSymbolSets": ["", "DEBUG", "DEBUG,CODE_STYLE"]
}
```
YAML
```json
```yaml
printWidth: 100
preprocessorSymbolSets:
- ""
- "DEBUG"
- "DEBUG,CODE_STYLE"
```
#### Print Width
Specify at what point the printer will wrap content. This is not a hard limit. Some lines will be shorter or longer.
Default 100
#### Preprocessor Symbol Sets
Currently CSharpier only has basic support for understanding how to format code inside of `#if` directives.
It will attempt to determine which sets of preprocessor symbols are needed for roslyn to parse all the code in each file.

For example in the following code block, the following symbol sets would be needed ["FIRST", "SECOND,THIRD", ""]
```c#
#if FIRST
// some code
#elif SECOND && THIRD
// some code
#else
// some code
#endif
```

When supplying symbol sets, they will be used for all files being formatted. This will slow down formatting, and determining all symbol sets needed across all files won't be straight forward.

The long term plan is to improve Csharpier's ability to determine the symbol sets itself and to allow specifying the for individual files.

0 comments on commit b6b8dea

Please sign in to comment.