101 references to NewLineBeforeOpenBrace
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (27)
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) }
ConvertAutoPropertyToFullProperty\ConvertAutoPropertyToFullPropertyTests_OptionSets.cs (2)
37
{ CSharpFormattingOptions2.
NewLineBeforeOpenBrace
, NewLineBeforeOpenBracePlacement.All & ~NewLineBeforeOpenBracePlacement.Properties },
44
{ CSharpFormattingOptions2.
NewLineBeforeOpenBrace
, NewLineBeforeOpenBracePlacement.All & ~NewLineBeforeOpenBracePlacement.Accessors },
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 (3)
CSharpSyntaxFormattingOptions.cs (1)
101
options.GetOption(CSharpFormattingOptions2.
NewLineBeforeOpenBrace
, fallbackOptions.NewLines.ToNewLineBeforeOpenBracePlacement()).ToNewLinePlacement() |
Formatting\CSharpFormattingOptions.cs (2)
23
defaultValue: CSharpFormattingOptions2.
NewLineBeforeOpenBrace
.DefaultValue.HasFlag(flag),
25
storageMapping: new NewLineForBracesInternalStorageMapping(CSharpFormattingOptions2.
NewLineBeforeOpenBrace
, flag),
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (27)
Formatting\FormattingTests.cs (27)
963
{
NewLineBeforeOpenBrace
,
NewLineBeforeOpenBrace
.DefaultValue.WithFlagValue(NewLineBeforeOpenBracePlacement.ObjectCollectionArrayInitializers, false) },
1038
{
NewLineBeforeOpenBrace
,
NewLineBeforeOpenBrace
.DefaultValue.WithFlagValue(NewLineBeforeOpenBracePlacement.LambdaExpressionBody, false) },
1884
{
NewLineBeforeOpenBrace
, NewLineBeforeOpenBracePlacement.None }
2134
{
NewLineBeforeOpenBrace
,
NewLineBeforeOpenBrace
.DefaultValue.WithFlagValue(NewLineBeforeOpenBracePlacement.ControlBlocks, false) }
7268
{
NewLineBeforeOpenBrace
,
NewLineBeforeOpenBrace
.DefaultValue.WithFlagValue(NewLineBeforeOpenBracePlacement.ControlBlocks, false) }
7307
{
NewLineBeforeOpenBrace
,
NewLineBeforeOpenBrace
.DefaultValue.WithFlagValue(NewLineBeforeOpenBracePlacement.ControlBlocks, false) }
8485
{
NewLineBeforeOpenBrace
,
NewLineBeforeOpenBrace
.DefaultValue.WithFlagValue(NewLineBeforeOpenBracePlacement.ControlBlocks, false) }
8628
{
NewLineBeforeOpenBrace
,
NewLineBeforeOpenBrace
.DefaultValue.WithFlagValue(NewLineBeforeOpenBracePlacement.Properties, false) },
8666
{
NewLineBeforeOpenBrace
,
NewLineBeforeOpenBrace
.DefaultValue.WithFlagValue(NewLineBeforeOpenBracePlacement.Accessors, false) },
8704
{
NewLineBeforeOpenBrace
,
NewLineBeforeOpenBrace
.DefaultValue
9757
{
NewLineBeforeOpenBrace
,
NewLineBeforeOpenBrace
.DefaultValue.WithFlagValue(NewLineBeforeOpenBracePlacement.ObjectCollectionArrayInitializers, false) },
9817
{
NewLineBeforeOpenBrace
,
NewLineBeforeOpenBrace
.DefaultValue.WithFlagValue(NewLineBeforeOpenBracePlacement.ObjectCollectionArrayInitializers, false) },
9927
{
NewLineBeforeOpenBrace
,
NewLineBeforeOpenBrace
.DefaultValue.WithFlagValue(NewLineBeforeOpenBracePlacement.ObjectCollectionArrayInitializers, false) },
9963
{
NewLineBeforeOpenBrace
,
NewLineBeforeOpenBrace
.DefaultValue.WithFlagValue(NewLineBeforeOpenBracePlacement.ObjectCollectionArrayInitializers, option) },
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
Options\DocumentOptionSetTests.cs (1)
93
var option = CSharpFormattingOptions2.
NewLineBeforeOpenBrace
;
Microsoft.VisualStudio.LanguageServices.CSharp (37)
EditorConfigSettings\DataProvider\Whitespace\CSharpWhitespaceSettingsProvider.cs (9)
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);
Options\AutomationObject\AutomationObject.Formatting.cs (18)
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); }
Options\CSharpVisualStudioOptionStorageReadFallbacks.cs (1)
61
=> TryReadFlags(s_storages, (int)CSharpFormattingOptions2.
NewLineBeforeOpenBrace
.DefaultValue, readValue, out var intValue) ? (NewLineBeforeOpenBracePlacement)intValue : default(Optional<object?>);
Options\Formatting\NewLinesViewModel.cs (9)
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));
Roslyn.VisualStudio.Next.UnitTests (5)
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 (2)
57
CSharpFormattingOptions2.
NewLineBeforeOpenBrace
.DefaultValue & ~NewLineBeforeOpenBracePlacement.ObjectCollectionArrayInitializers);
62
CSharpFormattingOptions2.
NewLineBeforeOpenBrace
.DefaultValue | NewLineBeforeOpenBracePlacement.ObjectCollectionArrayInitializers);