94 references to SpacePlacement
Microsoft.CodeAnalysis.CSharp.Workspaces (94)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\CSharpFormattingOptions2.cs (20)
75
CSharpSyntaxFormattingOptions.SpacingDefault.HasFlag(
SpacePlacement
.AfterMethodDeclarationName))
80
CSharpSyntaxFormattingOptions.SpacingDefault.HasFlag(
SpacePlacement
.WithinMethodDeclarationParenthesis))
85
CSharpSyntaxFormattingOptions.SpacingDefault.HasFlag(
SpacePlacement
.BetweenEmptyMethodDeclarationParentheses))
90
CSharpSyntaxFormattingOptions.SpacingDefault.HasFlag(
SpacePlacement
.AfterMethodCallName))
95
CSharpSyntaxFormattingOptions.SpacingDefault.HasFlag(
SpacePlacement
.WithinMethodCallParentheses))
100
CSharpSyntaxFormattingOptions.SpacingDefault.HasFlag(
SpacePlacement
.BetweenEmptyMethodCallParentheses))
105
CSharpSyntaxFormattingOptions.SpacingDefault.HasFlag(
SpacePlacement
.AfterControlFlowStatementKeyword))
118
CSharpSyntaxFormattingOptions.SpacingDefault.HasFlag(
SpacePlacement
.AfterCast))
123
CSharpSyntaxFormattingOptions.SpacingDefault.HasFlag(
SpacePlacement
.IgnoreAroundVariableDeclaration),
131
CSharpSyntaxFormattingOptions.SpacingDefault.HasFlag(
SpacePlacement
.BeforeOpenSquareBracket))
136
CSharpSyntaxFormattingOptions.SpacingDefault.HasFlag(
SpacePlacement
.BetweenEmptySquareBrackets))
141
CSharpSyntaxFormattingOptions.SpacingDefault.HasFlag(
SpacePlacement
.WithinSquareBrackets))
146
CSharpSyntaxFormattingOptions.SpacingDefault.HasFlag(
SpacePlacement
.AfterColonInBaseTypeDeclaration))
151
CSharpSyntaxFormattingOptions.SpacingDefault.HasFlag(
SpacePlacement
.AfterComma))
156
CSharpSyntaxFormattingOptions.SpacingDefault.HasFlag(
SpacePlacement
.AfterDot))
161
CSharpSyntaxFormattingOptions.SpacingDefault.HasFlag(
SpacePlacement
.AfterSemicolonsInForStatement))
166
CSharpSyntaxFormattingOptions.SpacingDefault.HasFlag(
SpacePlacement
.BeforeColonInBaseTypeDeclaration))
171
CSharpSyntaxFormattingOptions.SpacingDefault.HasFlag(
SpacePlacement
.BeforeComma))
176
CSharpSyntaxFormattingOptions.SpacingDefault.HasFlag(
SpacePlacement
.BeforeDot))
181
CSharpSyntaxFormattingOptions.SpacingDefault.HasFlag(
SpacePlacement
.BeforeSemicolonsInForStatement))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\CSharpSyntaxFormattingOptions.cs (27)
23
public const
SpacePlacement
SpacingDefault =
24
SpacePlacement
.AfterControlFlowStatementKeyword |
25
SpacePlacement
.AfterSemicolonsInForStatement |
26
SpacePlacement
.AfterColonInBaseTypeDeclaration |
27
SpacePlacement
.BeforeColonInBaseTypeDeclaration |
28
SpacePlacement
.AfterComma;
55
[DataMember] public
SpacePlacement
Spacing { get; init; } = SpacingDefault;
74
(options.GetOption(CSharpFormattingOptions2.SpacesIgnoreAroundVariableDeclaration) ?
SpacePlacement
.IgnoreAroundVariableDeclaration : 0) |
75
(options.GetOption(CSharpFormattingOptions2.SpacingAfterMethodDeclarationName) ?
SpacePlacement
.AfterMethodDeclarationName : 0) |
76
(options.GetOption(CSharpFormattingOptions2.SpaceBetweenEmptyMethodDeclarationParentheses) ?
SpacePlacement
.BetweenEmptyMethodDeclarationParentheses : 0) |
77
(options.GetOption(CSharpFormattingOptions2.SpaceWithinMethodDeclarationParenthesis) ?
SpacePlacement
.WithinMethodDeclarationParenthesis : 0) |
78
(options.GetOption(CSharpFormattingOptions2.SpaceAfterMethodCallName) ?
SpacePlacement
.AfterMethodCallName : 0) |
79
(options.GetOption(CSharpFormattingOptions2.SpaceBetweenEmptyMethodCallParentheses) ?
SpacePlacement
.BetweenEmptyMethodCallParentheses : 0) |
80
(options.GetOption(CSharpFormattingOptions2.SpaceWithinMethodCallParentheses) ?
SpacePlacement
.WithinMethodCallParentheses : 0) |
81
(options.GetOption(CSharpFormattingOptions2.SpaceAfterControlFlowStatementKeyword) ?
SpacePlacement
.AfterControlFlowStatementKeyword : 0) |
83
(options.GetOption(CSharpFormattingOptions2.SpaceBeforeSemicolonsInForStatement) ?
SpacePlacement
.BeforeSemicolonsInForStatement : 0) |
84
(options.GetOption(CSharpFormattingOptions2.SpaceAfterSemicolonsInForStatement) ?
SpacePlacement
.AfterSemicolonsInForStatement : 0) |
85
(options.GetOption(CSharpFormattingOptions2.SpaceAfterCast) ?
SpacePlacement
.AfterCast : 0) |
86
(options.GetOption(CSharpFormattingOptions2.SpaceBeforeOpenSquareBracket) ?
SpacePlacement
.BeforeOpenSquareBracket : 0) |
87
(options.GetOption(CSharpFormattingOptions2.SpaceBetweenEmptySquareBrackets) ?
SpacePlacement
.BetweenEmptySquareBrackets : 0) |
88
(options.GetOption(CSharpFormattingOptions2.SpaceWithinSquareBrackets) ?
SpacePlacement
.WithinSquareBrackets : 0) |
89
(options.GetOption(CSharpFormattingOptions2.SpaceAfterColonInBaseTypeDeclaration) ?
SpacePlacement
.AfterColonInBaseTypeDeclaration : 0) |
90
(options.GetOption(CSharpFormattingOptions2.SpaceBeforeColonInBaseTypeDeclaration) ?
SpacePlacement
.BeforeColonInBaseTypeDeclaration : 0) |
91
(options.GetOption(CSharpFormattingOptions2.SpaceAfterComma) ?
SpacePlacement
.AfterComma : 0) |
92
(options.GetOption(CSharpFormattingOptions2.SpaceBeforeComma) ?
SpacePlacement
.BeforeComma : 0) |
93
(options.GetOption(CSharpFormattingOptions2.SpaceAfterDot) ?
SpacePlacement
.AfterDot : 0) |
94
(options.GetOption(CSharpFormattingOptions2.SpaceBeforeDot) ?
SpacePlacement
.BeforeDot : 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SpacingFormattingRule.cs (39)
61
return AdjustSpacesOperationZeroOrOne(_options.Spacing.HasFlag(
SpacePlacement
.AfterMethodDeclarationName));
75
return AdjustSpacesOperationZeroOrOne(_options.Spacing.HasFlag(
SpacePlacement
.AfterMethodDeclarationName));
88
return AdjustSpacesOperationZeroOrOne(_options.Spacing.HasFlag(
SpacePlacement
.AfterMethodDeclarationName));
94
return AdjustSpacesOperationZeroOrOne(_options.Spacing.HasFlag(
SpacePlacement
.AfterMethodDeclarationName));
99
return AdjustSpacesOperationZeroOrOne(_options.Spacing.HasFlag(
SpacePlacement
.BetweenEmptyMethodDeclarationParentheses));
104
return AdjustSpacesOperationZeroOrOne(_options.Spacing.HasFlag(
SpacePlacement
.WithinMethodDeclarationParenthesis));
109
return AdjustSpacesOperationZeroOrOne(_options.Spacing.HasFlag(
SpacePlacement
.WithinMethodDeclarationParenthesis));
118
return AdjustSpacesOperationZeroOrOne(_options.Spacing.HasFlag(
SpacePlacement
.AfterMethodCallName));
123
return AdjustSpacesOperationZeroOrOne(_options.Spacing.HasFlag(
SpacePlacement
.BetweenEmptyMethodCallParentheses));
128
return AdjustSpacesOperationZeroOrOne(_options.Spacing.HasFlag(
SpacePlacement
.WithinMethodCallParentheses));
133
return AdjustSpacesOperationZeroOrOne(_options.Spacing.HasFlag(
SpacePlacement
.WithinMethodCallParentheses));
139
return AdjustSpacesOperationZeroOrOne(_options.Spacing.HasFlag(
SpacePlacement
.AfterMethodCallName));
144
return AdjustSpacesOperationZeroOrOne(_options.Spacing.HasFlag(
SpacePlacement
.WithinMethodCallParentheses));
149
return AdjustSpacesOperationZeroOrOne(_options.Spacing.HasFlag(
SpacePlacement
.WithinMethodCallParentheses));
159
return AdjustSpacesOperationZeroOrOne(_options.Spacing.HasFlag(
SpacePlacement
.AfterControlFlowStatementKeyword));
166
return AdjustSpacesOperationZeroOrOne(_options.Spacing.HasFlag(
SpacePlacement
.WithinExpressionParentheses));
173
return AdjustSpacesOperationZeroOrOne(_options.Spacing.HasFlag(
SpacePlacement
.WithinCastParentheses));
182
|| _options.Spacing.HasFlag(
SpacePlacement
.BeforeSemicolonsInForStatement)))
184
return AdjustSpacesOperationZeroOrOne(_options.Spacing.HasFlag(
SpacePlacement
.BeforeSemicolonsInForStatement));
187
return AdjustSpacesOperationZeroOrOne(_options.Spacing.HasFlag(
SpacePlacement
.AfterSemicolonsInForStatement));
193
return AdjustSpacesOperationZeroOrOne(_options.Spacing.HasFlag(
SpacePlacement
.WithinOtherParentheses));
198
return AdjustSpacesOperationZeroOrOne(_options.Spacing.HasFlag(
SpacePlacement
.WithinOtherParentheses));
204
return AdjustSpacesOperationZeroOrOne(_options.Spacing.HasFlag(
SpacePlacement
.AfterCast));
213
return AdjustSpacesOperationZeroOrOne(_options.Spacing.HasFlag(
SpacePlacement
.AfterComma));
226
return AdjustSpacesOperationZeroOrOne(_options.Spacing.HasFlag(
SpacePlacement
.BeforeOpenSquareBracket));
234
return AdjustSpacesOperationZeroOrOne(_options.Spacing.HasFlag(
SpacePlacement
.BetweenEmptySquareBrackets));
240
return AdjustSpacesOperationZeroOrOne(_options.Spacing.HasFlag(
SpacePlacement
.WithinSquareBrackets));
245
return AdjustSpacesOperationZeroOrOne(_options.Spacing.HasFlag(
SpacePlacement
.WithinSquareBrackets));
271
return AdjustSpacesOperationZeroOrOne(_options.Spacing.HasFlag(
SpacePlacement
.AfterColonInBaseTypeDeclaration));
277
return AdjustSpacesOperationZeroOrOne(_options.Spacing.HasFlag(
SpacePlacement
.BeforeColonInBaseTypeDeclaration));
288
return AdjustSpacesOperationZeroOrOne(_options.Spacing.HasFlag(
SpacePlacement
.AfterComma));
299
return AdjustSpacesOperationZeroOrOne(_options.Spacing.HasFlag(
SpacePlacement
.BeforeComma));
305
return AdjustSpacesOperationZeroOrOne(_options.Spacing.HasFlag(
SpacePlacement
.AfterDot));
311
return AdjustSpacesOperationZeroOrOne(_options.Spacing.HasFlag(
SpacePlacement
.BeforeDot));
317
return AdjustSpacesOperationZeroOrOne(_options.Spacing.HasFlag(
SpacePlacement
.AfterSemicolonsInForStatement));
323
return AdjustSpacesOperationZeroOrOne(_options.Spacing.HasFlag(
SpacePlacement
.BeforeSemicolonsInForStatement));
447
return AdjustSpacesOperationZeroOrOne(_options.Spacing.HasFlag(
SpacePlacement
.WithinMethodDeclarationParenthesis));
454
return AdjustSpacesOperationZeroOrOne(_options.Spacing.HasFlag(
SpacePlacement
.WithinMethodDeclarationParenthesis));
583
if (_options.Spacing.HasFlag(
SpacePlacement
.IgnoreAroundVariableDeclaration))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\SpacingWithinParentheses.cs (8)
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);