30 references to SpacePlacementWithinParentheses
Microsoft.CodeAnalysis.CSharp.Workspaces (30)
Formatting\CSharpFormattingOptions.cs (8)
27
private static Option<bool> CreateSpaceWithinOption(string publicName,
SpacePlacementWithinParentheses
flag)
56
private readonly
SpacePlacementWithinParentheses
_flag;
58
public SpacePlacementInternalStorageMapping(IOption2 internalOption,
SpacePlacementWithinParentheses
flag)
65
=> ((
SpacePlacementWithinParentheses
)internalValue!).HasFlag(_flag);
68
=> ((
SpacePlacementWithinParentheses
)currentInternalValue!).WithFlagValue(_flag, (bool)newPublicValue!);
92
public static Option<bool> SpaceWithinExpressionParentheses { get; } = CreateSpaceWithinOption("SpaceWithinExpressionParentheses",
SpacePlacementWithinParentheses
.Expressions);
93
public static Option<bool> SpaceWithinCastParentheses { get; } = CreateSpaceWithinOption("SpaceWithinCastParentheses",
SpacePlacementWithinParentheses
.TypeCasts);
94
public static Option<bool> SpaceWithinOtherParentheses { get; } = CreateSpaceWithinOption("SpaceWithinOtherParentheses",
SpacePlacementWithinParentheses
.ControlFlowStatements);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\CSharpFormattingOptions2.cs (6)
24
private static readonly BidirectionalMap<string,
SpacePlacementWithinParentheses
> s_spacingWithinParenthesisOptionsEditorConfigMap =
27
KeyValuePairUtil.Create("expressions",
SpacePlacementWithinParentheses
.Expressions),
28
KeyValuePairUtil.Create("type_casts",
SpacePlacementWithinParentheses
.TypeCasts),
29
KeyValuePairUtil.Create("control_flow_statements",
SpacePlacementWithinParentheses
.ControlFlowStatements),
108
public static Option2<
SpacePlacementWithinParentheses
> SpaceBetweenParentheses { get; } = CreateOption(
112
new EditorConfigValueSerializer<
SpacePlacementWithinParentheses
>(
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\CSharpFormattingOptions2.Parsers.cs (5)
69
internal static
SpacePlacementWithinParentheses
ParseSpacingWithinParenthesesList(string list)
70
=> (
SpacePlacementWithinParentheses
)ParseEditorConfigFlags(list, static s => s_spacingWithinParenthesisOptionsEditorConfigMap.TryGetValue(s, out var v) ? (int)v : 0);
72
internal static string ToEditorConfigValue(
SpacePlacementWithinParentheses
value)
73
=> (value ==
SpacePlacementWithinParentheses
.None) ? "false" :
74
ToEditorConfigFlagList((int)value, static v => s_spacingWithinParenthesisOptionsEditorConfigMap[(
SpacePlacementWithinParentheses
)v]);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\SpacingWithinParentheses.cs (11)
21
public static
SpacePlacementWithinParentheses
ToSpacingWithinParentheses(this SpacePlacement placement)
22
=> (placement.HasFlag(SpacePlacement.WithinExpressionParentheses) ?
SpacePlacementWithinParentheses
.Expressions : 0) |
23
(placement.HasFlag(SpacePlacement.WithinCastParentheses) ?
SpacePlacementWithinParentheses
.TypeCasts : 0) |
24
(placement.HasFlag(SpacePlacement.WithinOtherParentheses) ?
SpacePlacementWithinParentheses
.ControlFlowStatements : 0);
26
public static SpacePlacement ToSpacePlacement(this
SpacePlacementWithinParentheses
placement)
27
=> (placement.HasFlag(
SpacePlacementWithinParentheses
.Expressions) ? SpacePlacement.WithinExpressionParentheses : 0) |
28
(placement.HasFlag(
SpacePlacementWithinParentheses
.TypeCasts) ? SpacePlacement.WithinCastParentheses : 0) |
29
(placement.HasFlag(
SpacePlacementWithinParentheses
.ControlFlowStatements) ? SpacePlacement.WithinOtherParentheses : 0);
31
public static
SpacePlacementWithinParentheses
WithFlagValue(this
SpacePlacementWithinParentheses
flags,
SpacePlacementWithinParentheses
flag, bool value)