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

expose IndentSwitchCaseSectionWhenBlock in OmniSharp FormattingOptions #1353

Merged
merged 2 commits into from
Dec 6, 2018
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ All changes to the project will be documented in this file.

## [1.32.9] - not yet released
* Updated to Roslyn 2.10.0 (PR: [#1344](https://github.com/OmniSharp/omnisharp-roslyn/pull/1344))
* Incorporate *IndentSwitchCaseSectionWhenBlock* into OmniSharp's formatting options. This fixes the default formatting behavior, as the setting is set to *true* by default, and still allows users to disable it if needed. ([#1351](https://github.com/OmniSharp/omnisharp-roslyn/issues/1351), PR: [#1353](https://github.com/OmniSharp/omnisharp-roslyn/pull/1353))

## [1.32.8] - 2018-11-14
* Fixed MSBuild discovery path (1.32.7 regression) (PR: [#1337](https://github.com/OmniSharp/omnisharp-roslyn/pull/1337))
Expand Down
3 changes: 3 additions & 0 deletions src/OmniSharp.Abstractions/Options/FormattingOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public FormattingOptions()
IndentBlock = true;
IndentSwitchSection = true;
IndentSwitchCaseSection = true;
IndentSwitchCaseSectionWhenBlock = true;
LabelPositioning = "oneLess";
WrappingPreserveSingleLine = true;
WrappingKeepStatementsOnSingleLine = true;
Expand Down Expand Up @@ -122,6 +123,8 @@ public FormattingOptions()

public bool IndentSwitchCaseSection { get; set; }

public bool IndentSwitchCaseSectionWhenBlock { get; set; }

public string LabelPositioning { get; set; }

public bool WrappingPreserveSingleLine { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ private static OptionSet GetOptions(OptionSet optionSet, FormattingOptions forma
.WithChangedOption(CSharpFormattingOptions.IndentBlock, formattingOptions.IndentBlock)
.WithChangedOption(CSharpFormattingOptions.IndentSwitchSection, formattingOptions.IndentSwitchSection)
.WithChangedOption(CSharpFormattingOptions.IndentSwitchCaseSection, formattingOptions.IndentSwitchCaseSection)
.WithChangedOption(CSharpFormattingOptions.IndentSwitchCaseSectionWhenBlock, formattingOptions.IndentSwitchCaseSectionWhenBlock)
.WithChangedOption(CSharpFormattingOptions.LabelPositioning, LabelPositionOptionForStringValue(formattingOptions.LabelPositioning))
.WithChangedOption(CSharpFormattingOptions.WrappingPreserveSingleLine, formattingOptions.WrappingPreserveSingleLine)
.WithChangedOption(CSharpFormattingOptions.WrappingKeepStatementsOnSingleLine, formattingOptions.WrappingKeepStatementsOnSingleLine)
Expand Down Expand Up @@ -97,4 +98,4 @@ public OptionSet Process(OptionSet workOptionSet, FormattingOptions options)
return GetOptions(workOptionSet, options);
}
}
}
}