435 references to CSharpFormattingOptions2
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (38)
AutomaticCompletion\AutomaticBraceCompletionTests.cs (24)
786
{
CSharpFormattingOptions2
.NewLineBeforeOpenBrace,
CSharpFormattingOptions2
.NewLineBeforeOpenBrace.DefaultValue.WithFlagValue(NewLineBeforeOpenBracePlacement.ObjectCollectionArrayInitializers, false) }
862
{
CSharpFormattingOptions2
.NewLineBeforeOpenBrace,
CSharpFormattingOptions2
.NewLineBeforeOpenBrace.DefaultValue.WithFlagValue(NewLineBeforeOpenBracePlacement.ObjectCollectionArrayInitializers, false) }
934
{
CSharpFormattingOptions2
.NewLineBeforeOpenBrace,
CSharpFormattingOptions2
.NewLineBeforeOpenBrace.DefaultValue.WithFlagValue(NewLineBeforeOpenBracePlacement.ObjectCollectionArrayInitializers, false) }
996
{
CSharpFormattingOptions2
.NewLineBeforeOpenBrace,
CSharpFormattingOptions2
.NewLineBeforeOpenBrace.DefaultValue.WithFlagValue(NewLineBeforeOpenBracePlacement.ObjectCollectionArrayInitializers, false) }
1058
{
CSharpFormattingOptions2
.NewLineBeforeOpenBrace,
CSharpFormattingOptions2
.NewLineBeforeOpenBrace.DefaultValue.WithFlagValue(NewLineBeforeOpenBracePlacement.ObjectCollectionArrayInitializers, false) }
1383
{
CSharpFormattingOptions2
.NewLineBeforeOpenBrace,
CSharpFormattingOptions2
.NewLineBeforeOpenBrace.DefaultValue.WithFlagValue(NewLineBeforeOpenBracePlacement.ObjectCollectionArrayInitializers, bracesOnNewLine) }
1427
{
CSharpFormattingOptions2
.NewLineBeforeOpenBrace,
CSharpFormattingOptions2
.NewLineBeforeOpenBrace.DefaultValue.WithFlagValue(NewLineBeforeOpenBracePlacement.ObjectCollectionArrayInitializers, bracesOnNewLine) }
1471
{
CSharpFormattingOptions2
.NewLineBeforeOpenBrace,
CSharpFormattingOptions2
.NewLineBeforeOpenBrace.DefaultValue.WithFlagValue(NewLineBeforeOpenBracePlacement.Accessors, bracesOnNewLine) }
1515
{
CSharpFormattingOptions2
.NewLineBeforeOpenBrace,
CSharpFormattingOptions2
.NewLineBeforeOpenBrace.DefaultValue.WithFlagValue(NewLineBeforeOpenBracePlacement.AnonymousMethods, bracesOnNewLine) }
1559
{
CSharpFormattingOptions2
.NewLineBeforeOpenBrace,
CSharpFormattingOptions2
.NewLineBeforeOpenBrace.DefaultValue.WithFlagValue(NewLineBeforeOpenBracePlacement.AnonymousTypes, bracesOnNewLine) }
1604
{
CSharpFormattingOptions2
.NewLineBeforeOpenBrace,
CSharpFormattingOptions2
.NewLineBeforeOpenBrace.DefaultValue.WithFlagValue(NewLineBeforeOpenBracePlacement.ControlBlocks, bracesOnNewLine) }
1655
{
CSharpFormattingOptions2
.NewLineBeforeOpenBrace,
CSharpFormattingOptions2
.NewLineBeforeOpenBrace.DefaultValue.WithFlagValue(NewLineBeforeOpenBracePlacement.ControlBlocks, bracesOnNewLine) }
ChangeSignature\AddParameterTests.Formatting.cs (1)
510
options: Option(
CSharpFormattingOptions2
.IndentBraces, true));
ConvertAutoPropertyToFullProperty\ConvertAutoPropertyToFullPropertyTests_OptionSets.cs (2)
37
{
CSharpFormattingOptions2
.NewLineBeforeOpenBrace, NewLineBeforeOpenBracePlacement.All & ~NewLineBeforeOpenBracePlacement.Properties },
44
{
CSharpFormattingOptions2
.NewLineBeforeOpenBrace, NewLineBeforeOpenBracePlacement.All & ~NewLineBeforeOpenBracePlacement.Accessors },
EditorConfigSettings\Updater\SettingsUpdaterTests.cs (10)
87
(
CSharpFormattingOptions2
.NewLineForElse, true));
148
(
CSharpFormattingOptions2
.NewLineForElse, false));
174
(
CSharpFormattingOptions2
.NewLineForElse, true));
198
(
CSharpFormattingOptions2
.NewLineForElse, true));
234
(
CSharpFormattingOptions2
.NewLineForElse, true));
243
(
CSharpFormattingOptions2
.NewLineForElse, true),
244
(
CSharpFormattingOptions2
.NewLineForCatch, true),
245
(
CSharpFormattingOptions2
.NewLineForFinally, true));
323
(
CSharpFormattingOptions2
.NewLineForElse, true));
389
var setting = Setting.Create(
CSharpFormattingOptions2
.NewLineForElse, "description", options, updater);
InitializeParameter\InitializeMemberFromParameterTests.cs (1)
1678
""", options: this.Option(
CSharpFormattingOptions2
.NewLineBeforeOpenBrace, NewLineBeforeOpenBracePlacement.All & ~NewLineBeforeOpenBracePlacement.Methods));
Microsoft.CodeAnalysis.CSharp.Features (1)
Wrapping\CSharpSyntaxWrappingOptions.cs (1)
39
newLinesForBracesInObjectCollectionArrayInitializers: options.GetOption(
CSharpFormattingOptions2
.NewLineBeforeOpenBrace, newLineBeforeOpenBraceDefault).HasFlag(NewLineBeforeOpenBracePlacement.ObjectCollectionArrayInitializers));
Microsoft.CodeAnalysis.CSharp.Workspaces (112)
CSharpSyntaxFormattingOptions.cs (37)
73
(options.GetOption(
CSharpFormattingOptions2
.SpacesIgnoreAroundVariableDeclaration, fallbackOptions.Spacing.HasFlag(SpacePlacement.IgnoreAroundVariableDeclaration)) ? SpacePlacement.IgnoreAroundVariableDeclaration : 0) |
74
(options.GetOption(
CSharpFormattingOptions2
.SpacingAfterMethodDeclarationName, fallbackOptions.Spacing.HasFlag(SpacePlacement.AfterMethodDeclarationName)) ? SpacePlacement.AfterMethodDeclarationName : 0) |
75
(options.GetOption(
CSharpFormattingOptions2
.SpaceBetweenEmptyMethodDeclarationParentheses, fallbackOptions.Spacing.HasFlag(SpacePlacement.BetweenEmptyMethodDeclarationParentheses)) ? SpacePlacement.BetweenEmptyMethodDeclarationParentheses : 0) |
76
(options.GetOption(
CSharpFormattingOptions2
.SpaceWithinMethodDeclarationParenthesis, fallbackOptions.Spacing.HasFlag(SpacePlacement.WithinMethodDeclarationParenthesis)) ? SpacePlacement.WithinMethodDeclarationParenthesis : 0) |
77
(options.GetOption(
CSharpFormattingOptions2
.SpaceAfterMethodCallName, fallbackOptions.Spacing.HasFlag(SpacePlacement.AfterMethodCallName)) ? SpacePlacement.AfterMethodCallName : 0) |
78
(options.GetOption(
CSharpFormattingOptions2
.SpaceBetweenEmptyMethodCallParentheses, fallbackOptions.Spacing.HasFlag(SpacePlacement.BetweenEmptyMethodCallParentheses)) ? SpacePlacement.BetweenEmptyMethodCallParentheses : 0) |
79
(options.GetOption(
CSharpFormattingOptions2
.SpaceWithinMethodCallParentheses, fallbackOptions.Spacing.HasFlag(SpacePlacement.WithinMethodCallParentheses)) ? SpacePlacement.WithinMethodCallParentheses : 0) |
80
(options.GetOption(
CSharpFormattingOptions2
.SpaceAfterControlFlowStatementKeyword, fallbackOptions.Spacing.HasFlag(SpacePlacement.AfterControlFlowStatementKeyword)) ? SpacePlacement.AfterControlFlowStatementKeyword : 0) |
81
options.GetOption(
CSharpFormattingOptions2
.SpaceBetweenParentheses, fallbackOptions.Spacing.ToSpacingWithinParentheses()).ToSpacePlacement() |
82
(options.GetOption(
CSharpFormattingOptions2
.SpaceBeforeSemicolonsInForStatement, fallbackOptions.Spacing.HasFlag(SpacePlacement.BeforeSemicolonsInForStatement)) ? SpacePlacement.BeforeSemicolonsInForStatement : 0) |
83
(options.GetOption(
CSharpFormattingOptions2
.SpaceAfterSemicolonsInForStatement, fallbackOptions.Spacing.HasFlag(SpacePlacement.AfterSemicolonsInForStatement)) ? SpacePlacement.AfterSemicolonsInForStatement : 0) |
84
(options.GetOption(
CSharpFormattingOptions2
.SpaceAfterCast, fallbackOptions.Spacing.HasFlag(SpacePlacement.AfterCast)) ? SpacePlacement.AfterCast : 0) |
85
(options.GetOption(
CSharpFormattingOptions2
.SpaceBeforeOpenSquareBracket, fallbackOptions.Spacing.HasFlag(SpacePlacement.BeforeOpenSquareBracket)) ? SpacePlacement.BeforeOpenSquareBracket : 0) |
86
(options.GetOption(
CSharpFormattingOptions2
.SpaceBetweenEmptySquareBrackets, fallbackOptions.Spacing.HasFlag(SpacePlacement.BetweenEmptySquareBrackets)) ? SpacePlacement.BetweenEmptySquareBrackets : 0) |
87
(options.GetOption(
CSharpFormattingOptions2
.SpaceWithinSquareBrackets, fallbackOptions.Spacing.HasFlag(SpacePlacement.WithinSquareBrackets)) ? SpacePlacement.WithinSquareBrackets : 0) |
88
(options.GetOption(
CSharpFormattingOptions2
.SpaceAfterColonInBaseTypeDeclaration, fallbackOptions.Spacing.HasFlag(SpacePlacement.AfterColonInBaseTypeDeclaration)) ? SpacePlacement.AfterColonInBaseTypeDeclaration : 0) |
89
(options.GetOption(
CSharpFormattingOptions2
.SpaceBeforeColonInBaseTypeDeclaration, fallbackOptions.Spacing.HasFlag(SpacePlacement.BeforeColonInBaseTypeDeclaration)) ? SpacePlacement.BeforeColonInBaseTypeDeclaration : 0) |
90
(options.GetOption(
CSharpFormattingOptions2
.SpaceAfterComma, fallbackOptions.Spacing.HasFlag(SpacePlacement.AfterComma)) ? SpacePlacement.AfterComma : 0) |
91
(options.GetOption(
CSharpFormattingOptions2
.SpaceBeforeComma, fallbackOptions.Spacing.HasFlag(SpacePlacement.BeforeComma)) ? SpacePlacement.BeforeComma : 0) |
92
(options.GetOption(
CSharpFormattingOptions2
.SpaceAfterDot, fallbackOptions.Spacing.HasFlag(SpacePlacement.AfterDot)) ? SpacePlacement.AfterDot : 0) |
93
(options.GetOption(
CSharpFormattingOptions2
.SpaceBeforeDot, fallbackOptions.Spacing.HasFlag(SpacePlacement.BeforeDot)) ? SpacePlacement.BeforeDot : 0);
94
SpacingAroundBinaryOperator = options.GetOption(
CSharpFormattingOptions2
.SpacingAroundBinaryOperator, fallbackOptions.SpacingAroundBinaryOperator);
96
(options.GetOption(
CSharpFormattingOptions2
.NewLineForMembersInObjectInit, fallbackOptions.NewLines.HasFlag(NewLinePlacement.BeforeMembersInObjectInitializers)) ? NewLinePlacement.BeforeMembersInObjectInitializers : 0) |
97
(options.GetOption(
CSharpFormattingOptions2
.NewLineForMembersInAnonymousTypes, fallbackOptions.NewLines.HasFlag(NewLinePlacement.BeforeMembersInAnonymousTypes)) ? NewLinePlacement.BeforeMembersInAnonymousTypes : 0) |
98
(options.GetOption(
CSharpFormattingOptions2
.NewLineForElse, fallbackOptions.NewLines.HasFlag(NewLinePlacement.BeforeElse)) ? NewLinePlacement.BeforeElse : 0) |
99
(options.GetOption(
CSharpFormattingOptions2
.NewLineForCatch, fallbackOptions.NewLines.HasFlag(NewLinePlacement.BeforeCatch)) ? NewLinePlacement.BeforeCatch : 0) |
100
(options.GetOption(
CSharpFormattingOptions2
.NewLineForFinally, fallbackOptions.NewLines.HasFlag(NewLinePlacement.BeforeFinally)) ? NewLinePlacement.BeforeFinally : 0) |
101
options.GetOption(
CSharpFormattingOptions2
.NewLineBeforeOpenBrace, fallbackOptions.NewLines.ToNewLineBeforeOpenBracePlacement()).ToNewLinePlacement() |
102
(options.GetOption(
CSharpFormattingOptions2
.NewLineForClausesInQuery, fallbackOptions.NewLines.HasFlag(NewLinePlacement.BetweenQueryExpressionClauses)) ? NewLinePlacement.BetweenQueryExpressionClauses : 0);
103
LabelPositioning = options.GetOption(
CSharpFormattingOptions2
.LabelPositioning, fallbackOptions.LabelPositioning);
105
(options.GetOption(
CSharpFormattingOptions2
.IndentBraces, fallbackOptions.Indentation.HasFlag(IndentationPlacement.Braces)) ? IndentationPlacement.Braces : 0) |
106
(options.GetOption(
CSharpFormattingOptions2
.IndentBlock, fallbackOptions.Indentation.HasFlag(IndentationPlacement.BlockContents)) ? IndentationPlacement.BlockContents : 0) |
107
(options.GetOption(
CSharpFormattingOptions2
.IndentSwitchCaseSection, fallbackOptions.Indentation.HasFlag(IndentationPlacement.SwitchCaseContents)) ? IndentationPlacement.SwitchCaseContents : 0) |
108
(options.GetOption(
CSharpFormattingOptions2
.IndentSwitchCaseSectionWhenBlock, fallbackOptions.Indentation.HasFlag(IndentationPlacement.SwitchCaseContentsWhenBlock)) ? IndentationPlacement.SwitchCaseContentsWhenBlock : 0) |
109
(options.GetOption(
CSharpFormattingOptions2
.IndentSwitchSection, fallbackOptions.Indentation.HasFlag(IndentationPlacement.SwitchSection)) ? IndentationPlacement.SwitchSection : 0);
110
WrappingKeepStatementsOnSingleLine = options.GetOption(
CSharpFormattingOptions2
.WrappingKeepStatementsOnSingleLine, fallbackOptions.WrappingKeepStatementsOnSingleLine);
111
WrappingPreserveSingleLine = options.GetOption(
CSharpFormattingOptions2
.WrappingPreserveSingleLine, fallbackOptions.WrappingPreserveSingleLine);
Formatting\CSharpFormattingOptions.cs (75)
13
/// <inheritdoc cref="
CSharpFormattingOptions2
"/>
23
defaultValue:
CSharpFormattingOptions2
.NewLineBeforeOpenBrace.DefaultValue.HasFlag(flag),
25
storageMapping: new NewLineForBracesInternalStorageMapping(
CSharpFormattingOptions2
.NewLineBeforeOpenBrace, flag),
33
defaultValue:
CSharpFormattingOptions2
.SpaceBetweenParentheses.DefaultValue.HasFlag(flag),
35
storageMapping: new SpacePlacementInternalStorageMapping(
CSharpFormattingOptions2
.SpaceBetweenParentheses, flag),
72
/// <inheritdoc cref="
CSharpFormattingOptions2
.SpacingAfterMethodDeclarationName"/>
73
public static Option<bool> SpacingAfterMethodDeclarationName { get; } =
CSharpFormattingOptions2
.SpacingAfterMethodDeclarationName.ToPublicOption();
75
/// <inheritdoc cref="
CSharpFormattingOptions2
.SpaceWithinMethodDeclarationParenthesis"/>
76
public static Option<bool> SpaceWithinMethodDeclarationParenthesis { get; } =
CSharpFormattingOptions2
.SpaceWithinMethodDeclarationParenthesis.ToPublicOption();
78
/// <inheritdoc cref="
CSharpFormattingOptions2
.SpaceBetweenEmptyMethodDeclarationParentheses"/>
79
public static Option<bool> SpaceBetweenEmptyMethodDeclarationParentheses { get; } =
CSharpFormattingOptions2
.SpaceBetweenEmptyMethodDeclarationParentheses.ToPublicOption();
81
/// <inheritdoc cref="
CSharpFormattingOptions2
.SpaceAfterMethodCallName"/>
82
public static Option<bool> SpaceAfterMethodCallName { get; } =
CSharpFormattingOptions2
.SpaceAfterMethodCallName.ToPublicOption();
84
/// <inheritdoc cref="
CSharpFormattingOptions2
.SpaceWithinMethodCallParentheses"/>
85
public static Option<bool> SpaceWithinMethodCallParentheses { get; } =
CSharpFormattingOptions2
.SpaceWithinMethodCallParentheses.ToPublicOption();
87
/// <inheritdoc cref="
CSharpFormattingOptions2
.SpaceBetweenEmptyMethodCallParentheses"/>
88
public static Option<bool> SpaceBetweenEmptyMethodCallParentheses { get; } =
CSharpFormattingOptions2
.SpaceBetweenEmptyMethodCallParentheses.ToPublicOption();
90
/// <inheritdoc cref="
CSharpFormattingOptions2
.SpaceAfterControlFlowStatementKeyword"/>
91
public static Option<bool> SpaceAfterControlFlowStatementKeyword { get; } =
CSharpFormattingOptions2
.SpaceAfterControlFlowStatementKeyword.ToPublicOption();
97
/// <inheritdoc cref="
CSharpFormattingOptions2
.SpaceAfterCast"/>
98
public static Option<bool> SpaceAfterCast { get; } =
CSharpFormattingOptions2
.SpaceAfterCast.ToPublicOption();
100
/// <inheritdoc cref="
CSharpFormattingOptions2
.SpacesIgnoreAroundVariableDeclaration"/>
101
public static Option<bool> SpacesIgnoreAroundVariableDeclaration { get; } =
CSharpFormattingOptions2
.SpacesIgnoreAroundVariableDeclaration.ToPublicOption();
103
/// <inheritdoc cref="
CSharpFormattingOptions2
.SpaceBeforeOpenSquareBracket"/>
104
public static Option<bool> SpaceBeforeOpenSquareBracket { get; } =
CSharpFormattingOptions2
.SpaceBeforeOpenSquareBracket.ToPublicOption();
106
/// <inheritdoc cref="
CSharpFormattingOptions2
.SpaceBetweenEmptySquareBrackets"/>
107
public static Option<bool> SpaceBetweenEmptySquareBrackets { get; } =
CSharpFormattingOptions2
.SpaceBetweenEmptySquareBrackets.ToPublicOption();
109
/// <inheritdoc cref="
CSharpFormattingOptions2
.SpaceWithinSquareBrackets"/>
110
public static Option<bool> SpaceWithinSquareBrackets { get; } =
CSharpFormattingOptions2
.SpaceWithinSquareBrackets.ToPublicOption();
112
/// <inheritdoc cref="
CSharpFormattingOptions2
.SpaceAfterColonInBaseTypeDeclaration"/>
113
public static Option<bool> SpaceAfterColonInBaseTypeDeclaration { get; } =
CSharpFormattingOptions2
.SpaceAfterColonInBaseTypeDeclaration.ToPublicOption();
115
/// <inheritdoc cref="
CSharpFormattingOptions2
.SpaceAfterComma"/>
116
public static Option<bool> SpaceAfterComma { get; } =
CSharpFormattingOptions2
.SpaceAfterComma.ToPublicOption();
118
/// <inheritdoc cref="
CSharpFormattingOptions2
.SpaceAfterDot"/>
119
public static Option<bool> SpaceAfterDot { get; } =
CSharpFormattingOptions2
.SpaceAfterDot.ToPublicOption();
121
/// <inheritdoc cref="
CSharpFormattingOptions2
.SpaceAfterSemicolonsInForStatement"/>
122
public static Option<bool> SpaceAfterSemicolonsInForStatement { get; } =
CSharpFormattingOptions2
.SpaceAfterSemicolonsInForStatement.ToPublicOption();
124
/// <inheritdoc cref="
CSharpFormattingOptions2
.SpaceBeforeColonInBaseTypeDeclaration"/>
125
public static Option<bool> SpaceBeforeColonInBaseTypeDeclaration { get; } =
CSharpFormattingOptions2
.SpaceBeforeColonInBaseTypeDeclaration.ToPublicOption();
127
/// <inheritdoc cref="
CSharpFormattingOptions2
.SpaceBeforeComma"/>
128
public static Option<bool> SpaceBeforeComma { get; } =
CSharpFormattingOptions2
.SpaceBeforeComma.ToPublicOption();
130
/// <inheritdoc cref="
CSharpFormattingOptions2
.SpaceBeforeDot"/>
131
public static Option<bool> SpaceBeforeDot { get; } =
CSharpFormattingOptions2
.SpaceBeforeDot.ToPublicOption();
133
/// <inheritdoc cref="
CSharpFormattingOptions2
.SpaceBeforeSemicolonsInForStatement"/>
134
public static Option<bool> SpaceBeforeSemicolonsInForStatement { get; } =
CSharpFormattingOptions2
.SpaceBeforeSemicolonsInForStatement.ToPublicOption();
136
/// <inheritdoc cref="
CSharpFormattingOptions2
.SpacingAroundBinaryOperator"/>
137
public static Option<BinaryOperatorSpacingOptions> SpacingAroundBinaryOperator { get; } =
CSharpFormattingOptions2
.SpacingAroundBinaryOperator.ToPublicOption();
139
/// <inheritdoc cref="
CSharpFormattingOptions2
.IndentBraces"/>
140
public static Option<bool> IndentBraces { get; } =
CSharpFormattingOptions2
.IndentBraces.ToPublicOption();
142
/// <inheritdoc cref="
CSharpFormattingOptions2
.IndentBlock"/>
143
public static Option<bool> IndentBlock { get; } =
CSharpFormattingOptions2
.IndentBlock.ToPublicOption();
145
/// <inheritdoc cref="
CSharpFormattingOptions2
.IndentSwitchSection"/>
146
public static Option<bool> IndentSwitchSection { get; } =
CSharpFormattingOptions2
.IndentSwitchSection.ToPublicOption();
148
/// <inheritdoc cref="
CSharpFormattingOptions2
.IndentSwitchCaseSection"/>
149
public static Option<bool> IndentSwitchCaseSection { get; } =
CSharpFormattingOptions2
.IndentSwitchCaseSection.ToPublicOption();
151
/// <inheritdoc cref="
CSharpFormattingOptions2
.IndentSwitchCaseSectionWhenBlock"/>
152
public static Option<bool> IndentSwitchCaseSectionWhenBlock { get; } =
CSharpFormattingOptions2
.IndentSwitchCaseSectionWhenBlock.ToPublicOption();
154
/// <inheritdoc cref="
CSharpFormattingOptions2
.LabelPositioning"/>
155
public static Option<LabelPositionOptions> LabelPositioning { get; } =
CSharpFormattingOptions2
.LabelPositioning.ToPublicOption();
157
/// <inheritdoc cref="
CSharpFormattingOptions2
.WrappingPreserveSingleLine"/>
158
public static Option<bool> WrappingPreserveSingleLine { get; } =
CSharpFormattingOptions2
.WrappingPreserveSingleLine.ToPublicOption();
160
/// <inheritdoc cref="
CSharpFormattingOptions2
.WrappingKeepStatementsOnSingleLine"/>
161
public static Option<bool> WrappingKeepStatementsOnSingleLine { get; } =
CSharpFormattingOptions2
.WrappingKeepStatementsOnSingleLine.ToPublicOption();
173
/// <inheritdoc cref="
CSharpFormattingOptions2
.NewLineForElse"/>
174
public static Option<bool> NewLineForElse { get; } =
CSharpFormattingOptions2
.NewLineForElse.ToPublicOption();
176
/// <inheritdoc cref="
CSharpFormattingOptions2
.NewLineForCatch"/>
177
public static Option<bool> NewLineForCatch { get; } =
CSharpFormattingOptions2
.NewLineForCatch.ToPublicOption();
179
/// <inheritdoc cref="
CSharpFormattingOptions2
.NewLineForFinally"/>
180
public static Option<bool> NewLineForFinally { get; } =
CSharpFormattingOptions2
.NewLineForFinally.ToPublicOption();
182
/// <inheritdoc cref="
CSharpFormattingOptions2
.NewLineForMembersInObjectInit"/>
183
public static Option<bool> NewLineForMembersInObjectInit { get; } =
CSharpFormattingOptions2
.NewLineForMembersInObjectInit.ToPublicOption();
185
/// <inheritdoc cref="
CSharpFormattingOptions2
.NewLineForMembersInAnonymousTypes"/>
186
public static Option<bool> NewLineForMembersInAnonymousTypes { get; } =
CSharpFormattingOptions2
.NewLineForMembersInAnonymousTypes.ToPublicOption();
188
/// <inheritdoc cref="
CSharpFormattingOptions2
.NewLineForClausesInQuery"/>
189
public static Option<bool> NewLineForClausesInQuery { get; } =
CSharpFormattingOptions2
.NewLineForClausesInQuery.ToPublicOption();
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (70)
CodeStyle\CSharpEditorConfigCodeStyleParserTests.cs (2)
28
=> Assert.Equal(parsedValue,
CSharpFormattingOptions2
.ParseEditorConfigSpacingAroundBinaryOperator(rawValue));
40
=> Assert.Equal(parsedValue,
CSharpFormattingOptions2
.ParseEditorConfigLabelPositioning(rawValue));
Formatting\EditorConfigOptionParserTests.cs (10)
30
Assert.Equal(value,
CSharpFormattingOptions2
.ParseSpacingWithinParenthesesList(list));
31
Assert.Equal(roundtrip,
CSharpFormattingOptions2
.ToEditorConfigValue(value));
40
Assert.True(
CSharpFormattingOptions2
.ParseEditorConfigSpacingAroundBinaryOperator(value) == expectedResult,
50
Assert.True(
CSharpFormattingOptions2
.ParseEditorConfigSpacingAroundBinaryOperator(value) == BinaryOperatorSpacingOptions.Single,
60
Assert.True(
CSharpFormattingOptions2
.ParseEditorConfigLabelPositioning(value) == expectedValue,
70
Assert.True(
CSharpFormattingOptions2
.ParseEditorConfigLabelPositioning(value) == LabelPositionOptions.NoIndent,
106
Assert.Equal(value,
CSharpFormattingOptions2
.ParseNewLineBeforeOpenBracePlacementList(list));
107
Assert.Equal(roundtrip,
CSharpFormattingOptions2
.ToEditorConfigValue(value));
117
Assert.True(
CSharpFormattingOptions2
.DetermineIfIgnoreSpacesAroundVariableDeclarationIsSet(value),
127
Assert.False(
CSharpFormattingOptions2
.DetermineIfIgnoreSpacesAroundVariableDeclarationIsSet(value),
Formatting\FormattingMultipleSpanTests.cs (2)
129
{
CSharpFormattingOptions2
.IndentBlock, false }
154
{
CSharpFormattingOptions2
.WrappingPreserveSingleLine, false }
Formatting\FormattingTests.cs (48)
18
using static Microsoft.CodeAnalysis.CSharp.Formatting.
CSharpFormattingOptions2
;
1004
{
CSharpFormattingOptions2
.SpacingAroundBinaryOperator, BinaryOperatorSpacingOptions.Remove }
1509
{
CSharpFormattingOptions2
.WrappingPreserveSingleLine, false }
1580
{
CSharpFormattingOptions2
.WrappingKeepStatementsOnSingleLine, false }
1647
{
CSharpFormattingOptions2
.WrappingPreserveSingleLine, false },
1648
{
CSharpFormattingOptions2
.WrappingKeepStatementsOnSingleLine, false }
1729
{
CSharpFormattingOptions2
.WrappingKeepStatementsOnSingleLine, false }
2068
{
CSharpFormattingOptions2
.NewLineForElse, false },
2069
{
CSharpFormattingOptions2
.NewLineForCatch, false },
2070
{
CSharpFormattingOptions2
.NewLineForFinally, false }
2233
{
CSharpFormattingOptions2
.NewLineForMembersInObjectInit, false },
2234
{
CSharpFormattingOptions2
.NewLineForMembersInAnonymousTypes, false },
2235
{
CSharpFormattingOptions2
.NewLineForClausesInQuery, false }
5084
{
CSharpFormattingOptions2
.SpaceAfterMethodCallName, true }
5106
{
CSharpFormattingOptions2
.SpaceWithinMethodCallParentheses, true }
5130
{
CSharpFormattingOptions2
.SpaceBetweenEmptyMethodCallParentheses, true }
5153
changingOptions.Add(
CSharpFormattingOptions2
.SpaceWithinMethodCallParentheses, true);
5860
{
CSharpFormattingOptions2
.LabelPositioning, LabelPositionOptions.LeftMost }
6212
var optionSet = new OptionsCollection(LanguageNames.CSharp) { {
CSharpFormattingOptions2
.SpaceAfterControlFlowStatementKeyword, false } };
6248
var optionSet = new OptionsCollection(LanguageNames.CSharp) { {
CSharpFormattingOptions2
.SpaceAfterComma, false } };
6260
optionSet.Add(
CSharpFormattingOptions2
.SpaceBeforeComma, true);
6364
{
CSharpFormattingOptions2
.NewLineForElse, false }
6603
var options = new OptionsCollection(LanguageNames.CSharp) { {
CSharpFormattingOptions2
.WrappingPreserveSingleLine, false } };
6621
var options = new OptionsCollection(LanguageNames.CSharp) { {
CSharpFormattingOptions2
.WrappingPreserveSingleLine, false } };
6647
var options = new OptionsCollection(LanguageNames.CSharp) { {
CSharpFormattingOptions2
.WrappingKeepStatementsOnSingleLine, false } };
7196
{
CSharpFormattingOptions2
.SpaceWithinSquareBrackets, true },
7197
{
CSharpFormattingOptions2
.SpaceBetweenEmptySquareBrackets, false }
7217
var options = new OptionsCollection(LanguageNames.CSharp) { {
CSharpFormattingOptions2
.SpaceBeforeOpenSquareBracket, true } };
7236
var options = new OptionsCollection(LanguageNames.CSharp) { {
CSharpFormattingOptions2
.SpaceWithinSquareBrackets, true } };
7360
{
CSharpFormattingOptions2
.SpacesIgnoreAroundVariableDeclaration, true }
8119
{
CSharpFormattingOptions2
.SpaceAfterMethodCallName, true },
8120
{
CSharpFormattingOptions2
.SpaceBetweenEmptyMethodCallParentheses, true },
8121
{
CSharpFormattingOptions2
.SpaceWithinMethodCallParentheses, true }
8182
{
CSharpFormattingOptions2
.SpaceWithinMethodCallParentheses, true },
8183
{
CSharpFormattingOptions2
.SpaceAfterMethodCallName, true },
8184
{
CSharpFormattingOptions2
.SpaceBetweenEmptyMethodCallParentheses, true },
8283
{
CSharpFormattingOptions2
.SpaceAfterSemicolonsInForStatement, false },
8314
{
CSharpFormattingOptions2
.SpaceBeforeSemicolonsInForStatement, true },
8315
{
CSharpFormattingOptions2
.SpaceAfterSemicolonsInForStatement, false },
8346
{
CSharpFormattingOptions2
.SpaceBeforeSemicolonsInForStatement, true },
8379
{
CSharpFormattingOptions2
.SpacingAfterMethodDeclarationName, true }
8759
{
CSharpFormattingOptions2
.WrappingPreserveSingleLine, true },
8760
{
CSharpFormattingOptions2
.WrappingKeepStatementsOnSingleLine, false},
9353
{
CSharpFormattingOptions2
.SpacesIgnoreAroundVariableDeclaration, true }
9379
{
CSharpFormattingOptions2
.SpacesIgnoreAroundVariableDeclaration, true },
9380
{
CSharpFormattingOptions2
.WrappingKeepStatementsOnSingleLine, false }
9476
{
CSharpFormattingOptions2
.SpacesIgnoreAroundVariableDeclaration, true }
9498
{
CSharpFormattingOptions2
.SpacesIgnoreAroundVariableDeclaration, false }
Formatting\FormattingTests_Patterns.cs (8)
74
{
CSharpFormattingOptions2
.SpacingAroundBinaryOperator, spacing },
164
{
CSharpFormattingOptions2
.SpacingAroundBinaryOperator, spacing },
165
{
CSharpFormattingOptions2
.SpaceBetweenParentheses,
CSharpFormattingOptions2
.SpaceBetweenParentheses.DefaultValue.WithFlagValue(SpacePlacementWithinParentheses.Expressions, spaceWithinExpressionParentheses) },
222
{
CSharpFormattingOptions2
.SpacingAroundBinaryOperator, spacing },
311
{
CSharpFormattingOptions2
.SpacingAroundBinaryOperator, spacing },
312
{
CSharpFormattingOptions2
.SpaceBetweenParentheses,
CSharpFormattingOptions2
.SpaceBetweenParentheses.DefaultValue.WithFlagValue(SpacePlacementWithinParentheses.Expressions, spaceWithinExpressionParentheses) },
Microsoft.CodeAnalysis.Workspaces.UnitTests (3)
Options\DocumentOptionSetTests.cs (2)
93
var option =
CSharpFormattingOptions2
.NewLineBeforeOpenBrace;
154
var option =
CSharpFormattingOptions2
.SpaceBetweenParentheses;
Options\OptionKeyTests.cs (1)
185
Assert.All(
CSharpFormattingOptions2
.AllOptions, o => Assert.True(o.Definition.IsEditorConfigOption));
Microsoft.VisualStudio.LanguageServices.CSharp (199)
EditorConfigSettings\DataProvider\Whitespace\CSharpWhitespaceSettingsProvider.cs (47)
46
yield return Setting.Create(
CSharpFormattingOptions2
.SpacingAfterMethodDeclarationName, CSharpVSResources.Insert_space_between_method_name_and_its_opening_parenthesis, options, updaterService);
47
yield return Setting.Create(
CSharpFormattingOptions2
.SpaceWithinMethodDeclarationParenthesis, CSharpVSResources.Insert_space_within_parameter_list_parentheses, options, updaterService);
48
yield return Setting.Create(
CSharpFormattingOptions2
.SpaceBetweenEmptyMethodDeclarationParentheses, CSharpVSResources.Insert_space_within_empty_parameter_list_parentheses, options, updaterService);
49
yield return Setting.Create(
CSharpFormattingOptions2
.SpaceAfterMethodCallName, CSharpVSResources.Insert_space_between_called_method_name_and_its_opening_parenthesis, options, updaterService);
50
yield return Setting.Create(
CSharpFormattingOptions2
.SpaceWithinMethodCallParentheses, CSharpVSResources.Insert_space_within_argument_list_parentheses, options, updaterService);
51
yield return Setting.Create(
CSharpFormattingOptions2
.SpaceBetweenEmptyMethodCallParentheses, CSharpVSResources.Insert_space_within_empty_argument_list_parentheses, options, updaterService);
53
yield return Setting.Create(
CSharpFormattingOptions2
.SpaceAfterControlFlowStatementKeyword, CSharpVSResources.Insert_space_after_keywords_in_control_flow_statements, options, updaterService);
56
yield return Setting.CreateEnumFlags(
CSharpFormattingOptions2
.SpaceBetweenParentheses, (int)SpacePlacementWithinParentheses.Expressions, CSharpVSResources.Insert_space_within_parentheses_of_expressions, spaceBetweenParenthesesValue, s_spaceBetweenParenthesesConversions, options, updaterService);
57
yield return Setting.CreateEnumFlags(
CSharpFormattingOptions2
.SpaceBetweenParentheses, (int)SpacePlacementWithinParentheses.TypeCasts, CSharpVSResources.Insert_space_within_parentheses_of_type_casts, spaceBetweenParenthesesValue, s_spaceBetweenParenthesesConversions, options, updaterService);
58
yield return Setting.CreateEnumFlags(
CSharpFormattingOptions2
.SpaceBetweenParentheses, (int)SpacePlacementWithinParentheses.ControlFlowStatements, CSharpVSResources.Insert_spaces_within_parentheses_of_control_flow_statements, spaceBetweenParenthesesValue, s_spaceBetweenParenthesesConversions, options, updaterService);
60
yield return Setting.Create(
CSharpFormattingOptions2
.SpaceAfterCast, CSharpVSResources.Insert_space_after_cast, options, updaterService);
61
yield return Setting.Create(
CSharpFormattingOptions2
.SpacesIgnoreAroundVariableDeclaration, CSharpVSResources.Ignore_spaces_in_declaration_statements, options, updaterService);
63
yield return Setting.Create(
CSharpFormattingOptions2
.SpaceBeforeOpenSquareBracket, CSharpVSResources.Insert_space_before_open_square_bracket, options, updaterService);
64
yield return Setting.Create(
CSharpFormattingOptions2
.SpaceBetweenEmptySquareBrackets, CSharpVSResources.Insert_space_within_empty_square_brackets, options, updaterService);
65
yield return Setting.Create(
CSharpFormattingOptions2
.SpaceWithinSquareBrackets, CSharpVSResources.Insert_spaces_within_square_brackets, options, updaterService);
67
yield return Setting.Create(
CSharpFormattingOptions2
.SpaceAfterColonInBaseTypeDeclaration, CSharpVSResources.Insert_space_after_colon_for_base_or_interface_in_type_declaration, options, updaterService);
68
yield return Setting.Create(
CSharpFormattingOptions2
.SpaceAfterComma, CSharpVSResources.Insert_space_after_comma, options, updaterService);
69
yield return Setting.Create(
CSharpFormattingOptions2
.SpaceAfterDot, CSharpVSResources.Insert_space_after_dot, options, updaterService);
70
yield return Setting.Create(
CSharpFormattingOptions2
.SpaceAfterSemicolonsInForStatement, CSharpVSResources.Insert_space_after_semicolon_in_for_statement, options, updaterService);
71
yield return Setting.Create(
CSharpFormattingOptions2
.SpaceBeforeColonInBaseTypeDeclaration, CSharpVSResources.Insert_space_before_colon_for_base_or_interface_in_type_declaration, options, updaterService);
72
yield return Setting.Create(
CSharpFormattingOptions2
.SpaceBeforeComma, CSharpVSResources.Insert_space_before_comma, options, updaterService);
73
yield return Setting.Create(
CSharpFormattingOptions2
.SpaceBeforeDot, CSharpVSResources.Insert_space_before_dot, options, updaterService);
74
yield return Setting.Create(
CSharpFormattingOptions2
.SpaceBeforeSemicolonsInForStatement, CSharpVSResources.Insert_space_before_semicolon_in_for_statement, options, updaterService);
76
yield return Setting.Create(
CSharpFormattingOptions2
.SpacingAroundBinaryOperator, CSharpVSResources.Set_spacing_for_operators, options, updaterService);
82
yield return Setting.CreateEnumFlags(
CSharpFormattingOptions2
.NewLineBeforeOpenBrace, (int)NewLineBeforeOpenBracePlacement.Types, CSharpVSResources.Place_open_brace_on_new_line_for_types, newLineBeforeOpenBraceValue, s_newLinesForBracesConversions, options, updaterService);
83
yield return Setting.CreateEnumFlags(
CSharpFormattingOptions2
.NewLineBeforeOpenBrace, (int)NewLineBeforeOpenBracePlacement.Methods, CSharpVSResources.Place_open_brace_on_new_line_for_methods_local_functions, newLineBeforeOpenBraceValue, s_newLinesForBracesConversions, options, updaterService);
84
yield return Setting.CreateEnumFlags(
CSharpFormattingOptions2
.NewLineBeforeOpenBrace, (int)NewLineBeforeOpenBracePlacement.Properties, CSharpVSResources.Place_open_brace_on_new_line_for_properties_indexers_and_events, newLineBeforeOpenBraceValue, s_newLinesForBracesConversions, options, updaterService);
85
yield return Setting.CreateEnumFlags(
CSharpFormattingOptions2
.NewLineBeforeOpenBrace, (int)NewLineBeforeOpenBracePlacement.Accessors, CSharpVSResources.Place_open_brace_on_new_line_for_property_indexer_and_event_accessors, newLineBeforeOpenBraceValue, s_newLinesForBracesConversions, options, updaterService);
86
yield return Setting.CreateEnumFlags(
CSharpFormattingOptions2
.NewLineBeforeOpenBrace, (int)NewLineBeforeOpenBracePlacement.AnonymousMethods, CSharpVSResources.Place_open_brace_on_new_line_for_anonymous_methods, newLineBeforeOpenBraceValue, s_newLinesForBracesConversions, options, updaterService);
87
yield return Setting.CreateEnumFlags(
CSharpFormattingOptions2
.NewLineBeforeOpenBrace, (int)NewLineBeforeOpenBracePlacement.ControlBlocks, CSharpVSResources.Place_open_brace_on_new_line_for_control_blocks, newLineBeforeOpenBraceValue, s_newLinesForBracesConversions, options, updaterService);
88
yield return Setting.CreateEnumFlags(
CSharpFormattingOptions2
.NewLineBeforeOpenBrace, (int)NewLineBeforeOpenBracePlacement.AnonymousTypes, CSharpVSResources.Place_open_brace_on_new_line_for_anonymous_types, newLineBeforeOpenBraceValue, s_newLinesForBracesConversions, options, updaterService);
89
yield return Setting.CreateEnumFlags(
CSharpFormattingOptions2
.NewLineBeforeOpenBrace, (int)NewLineBeforeOpenBracePlacement.ObjectCollectionArrayInitializers, CSharpVSResources.Place_open_brace_on_new_line_for_object_collection_array_and_with_initializers, newLineBeforeOpenBraceValue, s_newLinesForBracesConversions, options, updaterService);
90
yield return Setting.CreateEnumFlags(
CSharpFormattingOptions2
.NewLineBeforeOpenBrace, (int)NewLineBeforeOpenBracePlacement.LambdaExpressionBody, CSharpVSResources.Place_open_brace_on_new_line_for_lambda_expression, newLineBeforeOpenBraceValue, s_newLinesForBracesConversions, options, updaterService);
92
yield return Setting.Create(
CSharpFormattingOptions2
.NewLineForElse, CSharpVSResources.Place_else_on_new_line, options, updaterService);
93
yield return Setting.Create(
CSharpFormattingOptions2
.NewLineForCatch, CSharpVSResources.Place_catch_on_new_line, options, updaterService);
94
yield return Setting.Create(
CSharpFormattingOptions2
.NewLineForFinally, CSharpVSResources.Place_finally_on_new_line, options, updaterService);
95
yield return Setting.Create(
CSharpFormattingOptions2
.NewLineForMembersInObjectInit, CSharpVSResources.Place_members_in_object_initializers_on_new_line, options, updaterService);
96
yield return Setting.Create(
CSharpFormattingOptions2
.NewLineForMembersInAnonymousTypes, CSharpVSResources.Place_members_in_anonymous_types_on_new_line, options, updaterService);
97
yield return Setting.Create(
CSharpFormattingOptions2
.NewLineForClausesInQuery, CSharpVSResources.Place_query_expression_clauses_on_new_line, options, updaterService);
102
yield return Setting.Create(
CSharpFormattingOptions2
.IndentBlock, CSharpVSResources.Indent_block_contents, options, updaterService);
103
yield return Setting.Create(
CSharpFormattingOptions2
.IndentBraces, CSharpVSResources.Indent_open_and_close_braces, options, updaterService);
104
yield return Setting.Create(
CSharpFormattingOptions2
.IndentSwitchCaseSection, CSharpVSResources.Indent_case_contents, options, updaterService);
105
yield return Setting.Create(
CSharpFormattingOptions2
.IndentSwitchCaseSectionWhenBlock, CSharpVSResources.Indent_case_contents_when_block, options, updaterService);
106
yield return Setting.Create(
CSharpFormattingOptions2
.IndentSwitchSection, CSharpVSResources.Indent_case_labels, options, updaterService);
107
yield return Setting.Create(
CSharpFormattingOptions2
.LabelPositioning, CSharpVSResources.Label_Indentation, options, updaterService);
112
yield return Setting.Create(
CSharpFormattingOptions2
.WrappingPreserveSingleLine, CSharpVSResources.Leave_block_on_single_line, options, updaterService);
113
yield return Setting.Create(
CSharpFormattingOptions2
.WrappingKeepStatementsOnSingleLine, CSharpVSResources.Leave_statements_and_member_declarations_on_the_same_line, options, updaterService);
Options\AutomationObject\AutomationObject.Formatting.cs (98)
14
get { return GetBooleanOption(
CSharpFormattingOptions2
.IndentBlock); }
15
set { SetBooleanOption(
CSharpFormattingOptions2
.IndentBlock, value); }
20
get { return GetBooleanOption(
CSharpFormattingOptions2
.IndentBraces); }
21
set { SetBooleanOption(
CSharpFormattingOptions2
.IndentBraces, value); }
26
get { return GetBooleanOption(
CSharpFormattingOptions2
.IndentSwitchCaseSection); }
27
set { SetBooleanOption(
CSharpFormattingOptions2
.IndentSwitchCaseSection, value); }
32
get { return GetBooleanOption(
CSharpFormattingOptions2
.IndentSwitchCaseSectionWhenBlock); }
33
set { SetBooleanOption(
CSharpFormattingOptions2
.IndentSwitchCaseSectionWhenBlock, value); }
38
get { return GetBooleanOption(
CSharpFormattingOptions2
.IndentSwitchSection); }
39
set { SetBooleanOption(
CSharpFormattingOptions2
.IndentSwitchSection, value); }
44
get { return (int)GetOption(
CSharpFormattingOptions2
.LabelPositioning); }
45
set { SetOption(
CSharpFormattingOptions2
.LabelPositioning, (LabelPositionOptions)value); }
50
get { return (int)GetOption(
CSharpFormattingOptions2
.LabelPositioning); }
51
set { SetOption(
CSharpFormattingOptions2
.LabelPositioning, (LabelPositionOptions)value); }
56
get { return GetBooleanOption(
CSharpFormattingOptions2
.NewLineForMembersInAnonymousTypes); }
57
set { SetBooleanOption(
CSharpFormattingOptions2
.NewLineForMembersInAnonymousTypes, value); }
62
get { return GetBooleanOption(
CSharpFormattingOptions2
.NewLineBeforeOpenBrace, NewLineBeforeOpenBracePlacement.AnonymousMethods); }
63
set { SetBooleanOption(
CSharpFormattingOptions2
.NewLineBeforeOpenBrace, NewLineBeforeOpenBracePlacement.AnonymousMethods, value); }
68
get { return GetBooleanOption(
CSharpFormattingOptions2
.NewLineBeforeOpenBrace, NewLineBeforeOpenBracePlacement.AnonymousTypes); }
69
set { SetBooleanOption(
CSharpFormattingOptions2
.NewLineBeforeOpenBrace, NewLineBeforeOpenBracePlacement.AnonymousTypes, value); }
74
get { return GetBooleanOption(
CSharpFormattingOptions2
.NewLineBeforeOpenBrace, NewLineBeforeOpenBracePlacement.ControlBlocks); }
75
set { SetBooleanOption(
CSharpFormattingOptions2
.NewLineBeforeOpenBrace, NewLineBeforeOpenBracePlacement.ControlBlocks, value); }
80
get { return GetBooleanOption(
CSharpFormattingOptions2
.NewLineBeforeOpenBrace, NewLineBeforeOpenBracePlacement.LambdaExpressionBody); }
81
set { SetBooleanOption(
CSharpFormattingOptions2
.NewLineBeforeOpenBrace, NewLineBeforeOpenBracePlacement.LambdaExpressionBody, value); }
86
get { return GetBooleanOption(
CSharpFormattingOptions2
.NewLineBeforeOpenBrace, NewLineBeforeOpenBracePlacement.Methods); }
87
set { SetBooleanOption(
CSharpFormattingOptions2
.NewLineBeforeOpenBrace, NewLineBeforeOpenBracePlacement.Methods, value); }
92
get { return GetBooleanOption(
CSharpFormattingOptions2
.NewLineBeforeOpenBrace, NewLineBeforeOpenBracePlacement.Properties); }
93
set { SetBooleanOption(
CSharpFormattingOptions2
.NewLineBeforeOpenBrace, NewLineBeforeOpenBracePlacement.Properties, value); }
98
get { return GetBooleanOption(
CSharpFormattingOptions2
.NewLineBeforeOpenBrace, NewLineBeforeOpenBracePlacement.Accessors); }
99
set { SetBooleanOption(
CSharpFormattingOptions2
.NewLineBeforeOpenBrace, NewLineBeforeOpenBracePlacement.Accessors, value); }
104
get { return GetBooleanOption(
CSharpFormattingOptions2
.NewLineBeforeOpenBrace, NewLineBeforeOpenBracePlacement.ObjectCollectionArrayInitializers); }
105
set { SetBooleanOption(
CSharpFormattingOptions2
.NewLineBeforeOpenBrace, NewLineBeforeOpenBracePlacement.ObjectCollectionArrayInitializers, value); }
110
get { return GetBooleanOption(
CSharpFormattingOptions2
.NewLineBeforeOpenBrace, NewLineBeforeOpenBracePlacement.Types); }
111
set { SetBooleanOption(
CSharpFormattingOptions2
.NewLineBeforeOpenBrace, NewLineBeforeOpenBracePlacement.Types, value); }
116
get { return GetBooleanOption(
CSharpFormattingOptions2
.NewLineForCatch); }
117
set { SetBooleanOption(
CSharpFormattingOptions2
.NewLineForCatch, value); }
122
get { return GetBooleanOption(
CSharpFormattingOptions2
.NewLineForElse); }
123
set { SetBooleanOption(
CSharpFormattingOptions2
.NewLineForElse, value); }
128
get { return GetBooleanOption(
CSharpFormattingOptions2
.NewLineForFinally); }
129
set { SetBooleanOption(
CSharpFormattingOptions2
.NewLineForFinally, value); }
134
get { return GetBooleanOption(
CSharpFormattingOptions2
.NewLineForMembersInObjectInit); }
135
set { SetBooleanOption(
CSharpFormattingOptions2
.NewLineForMembersInObjectInit, value); }
140
get { return GetBooleanOption(
CSharpFormattingOptions2
.NewLineForClausesInQuery); }
141
set { SetBooleanOption(
CSharpFormattingOptions2
.NewLineForClausesInQuery, value); }
146
get { return GetBooleanOption(
CSharpFormattingOptions2
.SpaceAfterColonInBaseTypeDeclaration); }
147
set { SetBooleanOption(
CSharpFormattingOptions2
.SpaceAfterColonInBaseTypeDeclaration, value); }
152
get { return GetBooleanOption(
CSharpFormattingOptions2
.SpaceAfterCast); }
153
set { SetBooleanOption(
CSharpFormattingOptions2
.SpaceAfterCast, value); }
158
get { return GetBooleanOption(
CSharpFormattingOptions2
.SpaceAfterComma); }
159
set { SetBooleanOption(
CSharpFormattingOptions2
.SpaceAfterComma, value); }
164
get { return GetBooleanOption(
CSharpFormattingOptions2
.SpaceAfterDot); }
165
set { SetBooleanOption(
CSharpFormattingOptions2
.SpaceAfterDot, value); }
170
get { return GetBooleanOption(
CSharpFormattingOptions2
.SpaceAfterMethodCallName); }
171
set { SetBooleanOption(
CSharpFormattingOptions2
.SpaceAfterMethodCallName, value); }
176
get { return GetBooleanOption(
CSharpFormattingOptions2
.SpacingAfterMethodDeclarationName); }
177
set { SetBooleanOption(
CSharpFormattingOptions2
.SpacingAfterMethodDeclarationName, value); }
182
get { return GetBooleanOption(
CSharpFormattingOptions2
.SpaceAfterSemicolonsInForStatement); }
183
set { SetBooleanOption(
CSharpFormattingOptions2
.SpaceAfterSemicolonsInForStatement, value); }
188
get { return (int)GetOption(
CSharpFormattingOptions2
.SpacingAroundBinaryOperator); }
189
set { SetOption(
CSharpFormattingOptions2
.SpacingAroundBinaryOperator, (BinaryOperatorSpacingOptions)value); }
194
get { return GetBooleanOption(
CSharpFormattingOptions2
.SpaceBeforeColonInBaseTypeDeclaration); }
195
set { SetBooleanOption(
CSharpFormattingOptions2
.SpaceBeforeColonInBaseTypeDeclaration, value); }
200
get { return GetBooleanOption(
CSharpFormattingOptions2
.SpaceBeforeComma); }
201
set { SetBooleanOption(
CSharpFormattingOptions2
.SpaceBeforeComma, value); }
206
get { return GetBooleanOption(
CSharpFormattingOptions2
.SpaceBeforeDot); }
207
set { SetBooleanOption(
CSharpFormattingOptions2
.SpaceBeforeDot, value); }
212
get { return GetBooleanOption(
CSharpFormattingOptions2
.SpaceBeforeOpenSquareBracket); }
213
set { SetBooleanOption(
CSharpFormattingOptions2
.SpaceBeforeOpenSquareBracket, value); }
218
get { return GetBooleanOption(
CSharpFormattingOptions2
.SpaceBeforeSemicolonsInForStatement); }
219
set { SetBooleanOption(
CSharpFormattingOptions2
.SpaceBeforeSemicolonsInForStatement, value); }
224
get { return GetBooleanOption(
CSharpFormattingOptions2
.SpaceBetweenEmptyMethodCallParentheses); }
225
set { SetBooleanOption(
CSharpFormattingOptions2
.SpaceBetweenEmptyMethodCallParentheses, value); }
230
get { return GetBooleanOption(
CSharpFormattingOptions2
.SpaceBetweenEmptyMethodDeclarationParentheses); }
231
set { SetBooleanOption(
CSharpFormattingOptions2
.SpaceBetweenEmptyMethodDeclarationParentheses, value); }
236
get { return GetBooleanOption(
CSharpFormattingOptions2
.SpaceBetweenEmptySquareBrackets); }
237
set { SetBooleanOption(
CSharpFormattingOptions2
.SpaceBetweenEmptySquareBrackets, value); }
242
get { return GetBooleanOption(
CSharpFormattingOptions2
.SpaceAfterControlFlowStatementKeyword); }
243
set { SetBooleanOption(
CSharpFormattingOptions2
.SpaceAfterControlFlowStatementKeyword, value); }
248
get { return GetBooleanOption(
CSharpFormattingOptions2
.SpaceBetweenParentheses, SpacePlacementWithinParentheses.TypeCasts); }
249
set { SetBooleanOption(
CSharpFormattingOptions2
.SpaceBetweenParentheses, SpacePlacementWithinParentheses.TypeCasts, value); }
254
get { return GetBooleanOption(
CSharpFormattingOptions2
.SpaceBetweenParentheses, SpacePlacementWithinParentheses.Expressions); }
255
set { SetBooleanOption(
CSharpFormattingOptions2
.SpaceBetweenParentheses, SpacePlacementWithinParentheses.Expressions, value); }
260
get { return GetBooleanOption(
CSharpFormattingOptions2
.SpaceBetweenParentheses, SpacePlacementWithinParentheses.ControlFlowStatements); }
261
set { SetBooleanOption(
CSharpFormattingOptions2
.SpaceBetweenParentheses, SpacePlacementWithinParentheses.ControlFlowStatements, value); }
266
get { return GetBooleanOption(
CSharpFormattingOptions2
.SpaceWithinMethodCallParentheses); }
267
set { SetBooleanOption(
CSharpFormattingOptions2
.SpaceWithinMethodCallParentheses, value); }
272
get { return GetBooleanOption(
CSharpFormattingOptions2
.SpaceWithinMethodDeclarationParenthesis); }
273
set { SetBooleanOption(
CSharpFormattingOptions2
.SpaceWithinMethodDeclarationParenthesis, value); }
278
get { return GetBooleanOption(
CSharpFormattingOptions2
.SpaceWithinSquareBrackets); }
279
set { SetBooleanOption(
CSharpFormattingOptions2
.SpaceWithinSquareBrackets, value); }
284
get { return (int)GetOption(
CSharpFormattingOptions2
.SpacingAroundBinaryOperator); }
285
set { SetOption(
CSharpFormattingOptions2
.SpacingAroundBinaryOperator, (BinaryOperatorSpacingOptions)value); }
290
get { return GetBooleanOption(
CSharpFormattingOptions2
.SpacesIgnoreAroundVariableDeclaration); }
291
set { SetBooleanOption(
CSharpFormattingOptions2
.SpacesIgnoreAroundVariableDeclaration, value); }
296
get { return GetBooleanOption(
CSharpFormattingOptions2
.WrappingKeepStatementsOnSingleLine); }
297
set { SetBooleanOption(
CSharpFormattingOptions2
.WrappingKeepStatementsOnSingleLine, value); }
302
get { return GetBooleanOption(
CSharpFormattingOptions2
.WrappingPreserveSingleLine); }
303
set { SetBooleanOption(
CSharpFormattingOptions2
.WrappingPreserveSingleLine, value); }
Options\CSharpVisualStudioOptionStorageReadFallbacks.cs (2)
37
=> TryReadFlags(s_storages, (int)
CSharpFormattingOptions2
.SpaceBetweenParentheses.DefaultValue, readValue, out var intValue) ? (SpacePlacementWithinParentheses)intValue : default(Optional<object?>);
61
=> TryReadFlags(s_storages, (int)
CSharpFormattingOptions2
.NewLineBeforeOpenBrace.DefaultValue, readValue, out var intValue) ? (NewLineBeforeOpenBracePlacement)intValue : default(Optional<object?>);
Options\Formatting\CodeStylePage.cs (1)
38
builder.Add((CSharpVSResources.CSharp_Formatting_Rules,
CSharpFormattingOptions2
.AllOptions));
Options\Formatting\IndentationViewModel.cs (8)
82
Items.Add(new CheckBoxOptionViewModel(
CSharpFormattingOptions2
.IndentBlock, CSharpVSResources.Indent_block_contents, BlockContentPreview, this, optionStore));
83
Items.Add(new CheckBoxOptionViewModel(
CSharpFormattingOptions2
.IndentBraces, CSharpVSResources.Indent_open_and_close_braces, IndentBracePreview, this, optionStore));
84
Items.Add(new CheckBoxOptionViewModel(
CSharpFormattingOptions2
.IndentSwitchCaseSection, CSharpVSResources.Indent_case_contents, SwitchCasePreview, this, optionStore));
85
Items.Add(new CheckBoxOptionViewModel(
CSharpFormattingOptions2
.IndentSwitchCaseSectionWhenBlock, CSharpVSResources.Indent_case_contents_when_block, SwitchCaseWhenBlockPreview, this, optionStore));
86
Items.Add(new CheckBoxOptionViewModel(
CSharpFormattingOptions2
.IndentSwitchSection, CSharpVSResources.Indent_case_labels, SwitchCasePreview, this, optionStore));
90
Items.Add(new RadioButtonViewModel<LabelPositionOptions>(CSharpVSResources.Place_goto_labels_in_leftmost_column, GotoLabelPreview, "goto", LabelPositionOptions.LeftMost,
CSharpFormattingOptions2
.LabelPositioning, this, optionStore));
91
Items.Add(new RadioButtonViewModel<LabelPositionOptions>(CSharpVSResources.Indent_labels_normally, GotoLabelPreview, "goto", LabelPositionOptions.NoIndent,
CSharpFormattingOptions2
.LabelPositioning, this, optionStore));
92
Items.Add(new RadioButtonViewModel<LabelPositionOptions>(CSharpVSResources.Place_goto_labels_one_indent_less_than_current, GotoLabelPreview, "goto", LabelPositionOptions.OneLess,
CSharpFormattingOptions2
.LabelPositioning, this, optionStore));
Options\Formatting\NewLinesViewModel.cs (15)
211
Items.Add(new CheckBoxEnumFlagsOptionViewModel<NewLineBeforeOpenBracePlacement>(
CSharpFormattingOptions2
.NewLineBeforeOpenBrace, (int)NewLineBeforeOpenBracePlacement.Types, CSharpVSResources.Place_open_brace_on_new_line_for_types, s_previewText, this, optionStore, newLineBeforeOpenBraceValue, s_newLinesForBracesConversions));
212
Items.Add(new CheckBoxEnumFlagsOptionViewModel<NewLineBeforeOpenBracePlacement>(
CSharpFormattingOptions2
.NewLineBeforeOpenBrace, (int)NewLineBeforeOpenBracePlacement.Methods, CSharpVSResources.Place_open_brace_on_new_line_for_methods_local_functions, s_methodPreview, this, optionStore, newLineBeforeOpenBraceValue, s_newLinesForBracesConversions));
213
Items.Add(new CheckBoxEnumFlagsOptionViewModel<NewLineBeforeOpenBracePlacement>(
CSharpFormattingOptions2
.NewLineBeforeOpenBrace, (int)NewLineBeforeOpenBracePlacement.Properties, CSharpVSResources.Place_open_brace_on_new_line_for_properties_indexers_and_events, s_propertyPreview, this, optionStore, newLineBeforeOpenBraceValue, s_newLinesForBracesConversions));
214
Items.Add(new CheckBoxEnumFlagsOptionViewModel<NewLineBeforeOpenBracePlacement>(
CSharpFormattingOptions2
.NewLineBeforeOpenBrace, (int)NewLineBeforeOpenBracePlacement.Accessors, CSharpVSResources.Place_open_brace_on_new_line_for_property_indexer_and_event_accessors, s_propertyPreview, this, optionStore, newLineBeforeOpenBraceValue, s_newLinesForBracesConversions));
215
Items.Add(new CheckBoxEnumFlagsOptionViewModel<NewLineBeforeOpenBracePlacement>(
CSharpFormattingOptions2
.NewLineBeforeOpenBrace, (int)NewLineBeforeOpenBracePlacement.AnonymousMethods, CSharpVSResources.Place_open_brace_on_new_line_for_anonymous_methods, s_anonymousMethodPreview, this, optionStore, newLineBeforeOpenBraceValue, s_newLinesForBracesConversions));
216
Items.Add(new CheckBoxEnumFlagsOptionViewModel<NewLineBeforeOpenBracePlacement>(
CSharpFormattingOptions2
.NewLineBeforeOpenBrace, (int)NewLineBeforeOpenBracePlacement.ControlBlocks, CSharpVSResources.Place_open_brace_on_new_line_for_control_blocks, s_forBlockPreview, this, optionStore, newLineBeforeOpenBraceValue, s_newLinesForBracesConversions));
217
Items.Add(new CheckBoxEnumFlagsOptionViewModel<NewLineBeforeOpenBracePlacement>(
CSharpFormattingOptions2
.NewLineBeforeOpenBrace, (int)NewLineBeforeOpenBracePlacement.AnonymousTypes, CSharpVSResources.Place_open_brace_on_new_line_for_anonymous_types, s_anonymousTypePreview, this, optionStore, newLineBeforeOpenBraceValue, s_newLinesForBracesConversions));
218
Items.Add(new CheckBoxEnumFlagsOptionViewModel<NewLineBeforeOpenBracePlacement>(
CSharpFormattingOptions2
.NewLineBeforeOpenBrace, (int)NewLineBeforeOpenBracePlacement.ObjectCollectionArrayInitializers, CSharpVSResources.Place_open_brace_on_new_line_for_object_collection_array_and_with_initializers, s_InitializerPreviewTrue, s_InitializerPreviewFalse, this, optionStore, newLineBeforeOpenBraceValue, s_newLinesForBracesConversions));
219
Items.Add(new CheckBoxEnumFlagsOptionViewModel<NewLineBeforeOpenBracePlacement>(
CSharpFormattingOptions2
.NewLineBeforeOpenBrace, (int)NewLineBeforeOpenBracePlacement.LambdaExpressionBody, CSharpVSResources.Place_open_brace_on_new_line_for_lambda_expression, s_lambdaPreview, this, optionStore, newLineBeforeOpenBraceValue, s_newLinesForBracesConversions));
223
Items.Add(new CheckBoxOptionViewModel(
CSharpFormattingOptions2
.NewLineForElse, CSharpVSResources.Place_else_on_new_line, s_ifElsePreview, this, optionStore));
224
Items.Add(new CheckBoxOptionViewModel(
CSharpFormattingOptions2
.NewLineForCatch, CSharpVSResources.Place_catch_on_new_line, s_tryCatchFinallyPreview, this, optionStore));
225
Items.Add(new CheckBoxOptionViewModel(
CSharpFormattingOptions2
.NewLineForFinally, CSharpVSResources.Place_finally_on_new_line, s_tryCatchFinallyPreview, this, optionStore));
229
Items.Add(new CheckBoxOptionViewModel(
CSharpFormattingOptions2
.NewLineForMembersInObjectInit, CSharpVSResources.Place_members_in_object_initializers_on_new_line, s_objectInitializerPreview, this, optionStore));
230
Items.Add(new CheckBoxOptionViewModel(
CSharpFormattingOptions2
.NewLineForMembersInAnonymousTypes, CSharpVSResources.Place_members_in_anonymous_types_on_new_line, s_anonymousTypePreview, this, optionStore));
231
Items.Add(new CheckBoxOptionViewModel(
CSharpFormattingOptions2
.NewLineForClausesInQuery, CSharpVSResources.Place_query_expression_clauses_on_new_line, s_queryExpressionPreview, this, optionStore));
Options\Formatting\SpacingViewModel.cs (26)
113
Items.Add(new CheckBoxOptionViewModel(
CSharpFormattingOptions2
.SpacingAfterMethodDeclarationName, CSharpVSResources.Insert_space_between_method_name_and_its_opening_parenthesis, s_methodPreview, this, optionStore));
114
Items.Add(new CheckBoxOptionViewModel(
CSharpFormattingOptions2
.SpaceWithinMethodDeclarationParenthesis, CSharpVSResources.Insert_space_within_parameter_list_parentheses, s_methodPreview, this, optionStore));
115
Items.Add(new CheckBoxOptionViewModel(
CSharpFormattingOptions2
.SpaceBetweenEmptyMethodDeclarationParentheses, CSharpVSResources.Insert_space_within_empty_parameter_list_parentheses, s_methodPreview, this, optionStore));
119
Items.Add(new CheckBoxOptionViewModel(
CSharpFormattingOptions2
.SpaceAfterMethodCallName, CSharpVSResources.Insert_space_between_called_method_name_and_its_opening_parenthesis, s_methodPreview, this, optionStore));
120
Items.Add(new CheckBoxOptionViewModel(
CSharpFormattingOptions2
.SpaceWithinMethodCallParentheses, CSharpVSResources.Insert_space_within_argument_list_parentheses, s_methodPreview, this, optionStore));
121
Items.Add(new CheckBoxOptionViewModel(
CSharpFormattingOptions2
.SpaceBetweenEmptyMethodCallParentheses, CSharpVSResources.Insert_space_within_empty_argument_list_parentheses, s_methodPreview, this, optionStore));
125
Items.Add(new CheckBoxOptionViewModel(
CSharpFormattingOptions2
.SpaceAfterControlFlowStatementKeyword, CSharpVSResources.Insert_space_after_keywords_in_control_flow_statements, s_forDelimiterPreview, this, optionStore));
128
Items.Add(new CheckBoxEnumFlagsOptionViewModel<SpacePlacementWithinParentheses>(
CSharpFormattingOptions2
.SpaceBetweenParentheses, (int)SpacePlacementWithinParentheses.Expressions, CSharpVSResources.Insert_space_within_parentheses_of_expressions, s_expressionPreview, this, optionStore, spaceBetweenParenthesesStorage, s_spaceBetweenParenthesesConversions));
129
Items.Add(new CheckBoxEnumFlagsOptionViewModel<SpacePlacementWithinParentheses>(
CSharpFormattingOptions2
.SpaceBetweenParentheses, (int)SpacePlacementWithinParentheses.TypeCasts, CSharpVSResources.Insert_space_within_parentheses_of_type_casts, s_castPreview, this, optionStore, spaceBetweenParenthesesStorage, s_spaceBetweenParenthesesConversions));
130
Items.Add(new CheckBoxEnumFlagsOptionViewModel<SpacePlacementWithinParentheses>(
CSharpFormattingOptions2
.SpaceBetweenParentheses, (int)SpacePlacementWithinParentheses.ControlFlowStatements, CSharpVSResources.Insert_spaces_within_parentheses_of_control_flow_statements, s_forDelimiterPreview, this, optionStore, spaceBetweenParenthesesStorage, s_spaceBetweenParenthesesConversions));
132
Items.Add(new CheckBoxOptionViewModel(
CSharpFormattingOptions2
.SpaceAfterCast, CSharpVSResources.Insert_space_after_cast, s_castPreview, this, optionStore));
133
Items.Add(new CheckBoxOptionViewModel(
CSharpFormattingOptions2
.SpacesIgnoreAroundVariableDeclaration, CSharpVSResources.Ignore_spaces_in_declaration_statements, s_declarationSpacingPreview, this, optionStore));
137
Items.Add(new CheckBoxOptionViewModel(
CSharpFormattingOptions2
.SpaceBeforeOpenSquareBracket, CSharpVSResources.Insert_space_before_open_square_bracket, s_bracketPreview, this, optionStore));
138
Items.Add(new CheckBoxOptionViewModel(
CSharpFormattingOptions2
.SpaceBetweenEmptySquareBrackets, CSharpVSResources.Insert_space_within_empty_square_brackets, s_bracketPreview, this, optionStore));
139
Items.Add(new CheckBoxOptionViewModel(
CSharpFormattingOptions2
.SpaceWithinSquareBrackets, CSharpVSResources.Insert_spaces_within_square_brackets, s_bracketPreview, this, optionStore));
143
Items.Add(new CheckBoxOptionViewModel(
CSharpFormattingOptions2
.SpaceAfterColonInBaseTypeDeclaration, CSharpVSResources.Insert_space_after_colon_for_base_or_interface_in_type_declaration, s_baseColonPreview, this, optionStore));
144
Items.Add(new CheckBoxOptionViewModel(
CSharpFormattingOptions2
.SpaceAfterComma, CSharpVSResources.Insert_space_after_comma, s_delimiterPreview, this, optionStore));
145
Items.Add(new CheckBoxOptionViewModel(
CSharpFormattingOptions2
.SpaceAfterDot, CSharpVSResources.Insert_space_after_dot, s_delimiterPreview, this, optionStore));
146
Items.Add(new CheckBoxOptionViewModel(
CSharpFormattingOptions2
.SpaceAfterSemicolonsInForStatement, CSharpVSResources.Insert_space_after_semicolon_in_for_statement, s_forDelimiterPreview, this, optionStore));
147
Items.Add(new CheckBoxOptionViewModel(
CSharpFormattingOptions2
.SpaceBeforeColonInBaseTypeDeclaration, CSharpVSResources.Insert_space_before_colon_for_base_or_interface_in_type_declaration, s_baseColonPreview, this, optionStore));
148
Items.Add(new CheckBoxOptionViewModel(
CSharpFormattingOptions2
.SpaceBeforeComma, CSharpVSResources.Insert_space_before_comma, s_delimiterPreview, this, optionStore));
149
Items.Add(new CheckBoxOptionViewModel(
CSharpFormattingOptions2
.SpaceBeforeDot, CSharpVSResources.Insert_space_before_dot, s_delimiterPreview, this, optionStore));
150
Items.Add(new CheckBoxOptionViewModel(
CSharpFormattingOptions2
.SpaceBeforeSemicolonsInForStatement, CSharpVSResources.Insert_space_before_semicolon_in_for_statement, s_forDelimiterPreview, this, optionStore));
154
Items.Add(new RadioButtonViewModel<BinaryOperatorSpacingOptions>(CSharpVSResources.Ignore_spaces_around_binary_operators, s_expressionSpacingPreview, "binary", BinaryOperatorSpacingOptions.Ignore,
CSharpFormattingOptions2
.SpacingAroundBinaryOperator, this, OptionStore));
155
Items.Add(new RadioButtonViewModel<BinaryOperatorSpacingOptions>(CSharpVSResources.Remove_spaces_before_and_after_binary_operators, s_expressionSpacingPreview, "binary", BinaryOperatorSpacingOptions.Remove,
CSharpFormattingOptions2
.SpacingAroundBinaryOperator, this, OptionStore));
156
Items.Add(new RadioButtonViewModel<BinaryOperatorSpacingOptions>(CSharpVSResources.Insert_space_before_and_after_binary_operators, s_expressionSpacingPreview, "binary", BinaryOperatorSpacingOptions.Single,
CSharpFormattingOptions2
.SpacingAroundBinaryOperator, this, OptionStore));
Options\Formatting\WrappingViewModel.cs (2)
40
Items.Add(new CheckBoxOptionViewModel(
CSharpFormattingOptions2
.WrappingPreserveSingleLine, CSharpVSResources.Leave_block_on_single_line, s_blockPreview, this, optionStore));
41
Items.Add(new CheckBoxOptionViewModel(
CSharpFormattingOptions2
.WrappingKeepStatementsOnSingleLine, CSharpVSResources.Leave_statements_and_member_declarations_on_the_same_line, s_declarationPreview, this, optionStore));
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (5)
EditorConfigSettings\DataProvider\DataProviderTests.cs (1)
210
AssertEx.SetEqual(
CSharpFormattingOptions2
.AllOptions, optionsForSettings);
Options\OptionViewModelTests.cs (4)
79
workspace.GlobalOptions.SetGlobalOption(
CSharpFormattingOptions2
.SpacingAfterMethodDeclarationName, true);
84
var checkbox = viewModel.Items.OfType<CheckBoxOptionViewModel>().Where(c => c.Option ==
CSharpFormattingOptions2
.SpacingAfterMethodDeclarationName).First();
96
var checkbox = viewModel.Items.OfType<CheckBoxOptionViewModel>().Where(c => c.Option ==
CSharpFormattingOptions2
.SpacingAfterMethodDeclarationName).First();
100
Assert.NotEqual(optionStore.GetOption(
CSharpFormattingOptions2
.SpacingAfterMethodDeclarationName), initial);
Roslyn.VisualStudio.Next.UnitTests (7)
Options\VisualStudioSettingsOptionPersisterTests.cs (3)
126
var optionKey = new OptionKey2(
CSharpFormattingOptions2
.NewLineBeforeOpenBrace);
137
Assert.Equal(value,
CSharpFormattingOptions2
.NewLineBeforeOpenBrace.DefaultValue & ~NewLineBeforeOpenBracePlacement.AnonymousTypes);
150
Assert.Equal((optionKey,
CSharpFormattingOptions2
.NewLineBeforeOpenBrace.DefaultValue & ~NewLineBeforeOpenBracePlacement.Methods), refreshedOptions.Single());
Options\VisualStudioStorageReadFallbackTests.cs (4)
33
CSharpFormattingOptions2
.SpaceBetweenParentheses.DefaultValue & ~SpacePlacementWithinParentheses.Expressions);
38
CSharpFormattingOptions2
.SpaceBetweenParentheses.DefaultValue | SpacePlacementWithinParentheses.Expressions);
57
CSharpFormattingOptions2
.NewLineBeforeOpenBrace.DefaultValue & ~NewLineBeforeOpenBracePlacement.ObjectCollectionArrayInitializers);
62
CSharpFormattingOptions2
.NewLineBeforeOpenBrace.DefaultValue | NewLineBeforeOpenBracePlacement.ObjectCollectionArrayInitializers);