74 references to BinaryOperatorSpacingOptions
Microsoft.CodeAnalysis.CSharp.Workspaces (15)
Formatting\CSharpFormattingOptions.cs (1)
136
public static Option<
BinaryOperatorSpacingOptions
> SpacingAroundBinaryOperator { get; } = CSharpFormattingOptions2.SpacingAroundBinaryOperator.ToPublicOption();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\CSharpFormattingOptions2.cs (6)
31
private static readonly BidirectionalMap<string,
BinaryOperatorSpacingOptions
> s_binaryOperatorSpacingOptionsEditorConfigMap =
34
KeyValuePairUtil.Create("ignore",
BinaryOperatorSpacingOptions
.Ignore),
35
KeyValuePairUtil.Create("none",
BinaryOperatorSpacingOptions
.Remove),
36
KeyValuePairUtil.Create("before_and_after",
BinaryOperatorSpacingOptions
.Single),
184
public static Option2<
BinaryOperatorSpacingOptions
> SpacingAroundBinaryOperator { get; } = CreateOption(
187
new EditorConfigValueSerializer<
BinaryOperatorSpacingOptions
>(
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\CSharpFormattingOptions2.Parsers.cs (3)
92
internal static
BinaryOperatorSpacingOptions
ParseEditorConfigSpacingAroundBinaryOperator(string binaryOperatorSpacingValue)
93
=> s_binaryOperatorSpacingOptionsEditorConfigMap.TryGetValue(binaryOperatorSpacingValue.Trim(), out var value) ? value :
BinaryOperatorSpacingOptions
.Single;
95
private static string GetSpacingAroundBinaryOperatorEditorConfigString(
BinaryOperatorSpacingOptions
value)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\CSharpSyntaxFormattingOptions.cs (2)
56
[DataMember] public
BinaryOperatorSpacingOptions
SpacingAroundBinaryOperator { get; init; } =
BinaryOperatorSpacingOptions
.Single;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SpacingFormattingRule.cs (3)
336
case
BinaryOperatorSpacingOptions
.Single:
338
case
BinaryOperatorSpacingOptions
.Remove:
355
case
BinaryOperatorSpacingOptions
.Ignore:
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (35)
CodeStyle\CSharpEditorConfigCodeStyleParserTests.cs (7)
19
[InlineData("ignore",
BinaryOperatorSpacingOptions
.Ignore)]
20
[InlineData("none",
BinaryOperatorSpacingOptions
.Remove)]
21
[InlineData("before_and_after",
BinaryOperatorSpacingOptions
.Single)]
24
[InlineData(" ignore ",
BinaryOperatorSpacingOptions
.Ignore)]
25
[InlineData(" none ",
BinaryOperatorSpacingOptions
.Remove)]
26
[InlineData(" before_and_after ",
BinaryOperatorSpacingOptions
.Single)]
27
public void TestParseSpacingAroundBinaryOperator(string rawValue,
BinaryOperatorSpacingOptions
parsedValue)
Formatting\EditorConfigOptionParserTests.cs (5)
35
InlineData("ignore",
BinaryOperatorSpacingOptions
.Ignore),
36
InlineData("none",
BinaryOperatorSpacingOptions
.Remove),
37
InlineData("before_and_after",
BinaryOperatorSpacingOptions
.Single)]
38
public void TestParseEditorConfigSpacingAroundBinaryOperatorTrue(string value,
BinaryOperatorSpacingOptions
expectedResult)
50
Assert.True(CSharpFormattingOptions2.ParseEditorConfigSpacingAroundBinaryOperator(value) ==
BinaryOperatorSpacingOptions
.Single,
Formatting\FormattingTests.cs (1)
1004
{ CSharpFormattingOptions2.SpacingAroundBinaryOperator,
BinaryOperatorSpacingOptions
.Remove }
Formatting\FormattingTests_Patterns.cs (22)
23
BinaryOperatorSpacingOptions
spacing)
65
BinaryOperatorSpacingOptions
.Single => expectedSingle,
66
BinaryOperatorSpacingOptions
.Ignore => expectedIgnore,
67
BinaryOperatorSpacingOptions
.Remove => expectedRemove,
81
BinaryOperatorSpacingOptions
spacing,
151
(
BinaryOperatorSpacingOptions
.Single, false) => expectedSingleFalse,
152
(
BinaryOperatorSpacingOptions
.Ignore, false) => expectedIgnoreFalse,
153
(
BinaryOperatorSpacingOptions
.Remove, false) => expectedRemoveFalse,
154
(
BinaryOperatorSpacingOptions
.Single, true) => expectedSingleTrue,
155
(
BinaryOperatorSpacingOptions
.Ignore, true) => expectedIgnoreTrue,
156
(
BinaryOperatorSpacingOptions
.Remove, true) => expectedRemoveTrue,
169
public async Task FormatNotPatterns1(
BinaryOperatorSpacingOptions
spacing)
211
BinaryOperatorSpacingOptions
.Single => expectedSingle,
212
BinaryOperatorSpacingOptions
.Ignore => expectedIgnore,
213
BinaryOperatorSpacingOptions
.Remove => expectedRemove,
226
BinaryOperatorSpacingOptions
spacing,
296
(
BinaryOperatorSpacingOptions
.Single, false) => expectedSingleFalse,
297
(
BinaryOperatorSpacingOptions
.Ignore, false) => expectedIgnoreFalse,
298
(
BinaryOperatorSpacingOptions
.Remove, false) => expectedRemoveFalse,
299
(
BinaryOperatorSpacingOptions
.Single, true) => expectedSingleTrue,
300
(
BinaryOperatorSpacingOptions
.Ignore, true) => expectedIgnoreTrue,
301
(
BinaryOperatorSpacingOptions
.Remove, true) => expectedRemoveTrue,
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp.CSharp (4)
Formatting\OmniSharpSyntaxFormattingOptionsFactory.cs (4)
22
Single =
BinaryOperatorSpacingOptions
.Single,
23
Ignore =
BinaryOperatorSpacingOptions
.Ignore,
24
Remove =
BinaryOperatorSpacingOptions
.Remove
114
SpacingAroundBinaryOperator = (
BinaryOperatorSpacingOptions
)spacingAroundBinaryOperator,
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Options\OptionsTestHelpers.cs (1)
81
(CSharpFormattingOptions.SpacingAroundBinaryOperator,
BinaryOperatorSpacingOptions
.Remove),
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
Formatter\FormatterTests.cs (1)
172
Assert.Equal(
BinaryOperatorSpacingOptions
.Remove, formattingOptions.SpacingAroundBinaryOperator);
Microsoft.VisualStudio.LanguageServices.CSharp (18)
EditorConfigSettings\BinaryOperatorSpacingOptionsViewModel.cs (9)
13
internal class BinaryOperatorSpacingOptionsViewModel : EnumSettingViewModel<
BinaryOperatorSpacingOptions
>
22
protected override void ChangePropertyTo(
BinaryOperatorSpacingOptions
newValue)
27
protected override
BinaryOperatorSpacingOptions
GetCurrentValue()
29
return (
BinaryOperatorSpacingOptions
)_setting.GetValue()!;
32
protected override IReadOnlyDictionary<string,
BinaryOperatorSpacingOptions
> GetValuesAndDescriptions()
36
static IEnumerable<(string description,
BinaryOperatorSpacingOptions
value)> EnumerateOptions()
38
yield return (CSharpVSResources.Ignore_spaces_around_binary_operators,
BinaryOperatorSpacingOptions
.Ignore);
39
yield return (CSharpVSResources.Remove_spaces_before_and_after_binary_operators,
BinaryOperatorSpacingOptions
.Remove);
40
yield return (CSharpVSResources.Insert_space_before_and_after_binary_operators,
BinaryOperatorSpacingOptions
.Single);
EditorConfigSettings\BinaryOperatorSpacingOptionsViewModelFactory.cs (1)
30
=> key.Option.Type == typeof(
BinaryOperatorSpacingOptions
);
Options\AutomationObject\AutomationObject.Formatting.cs (2)
189
set { SetOption(CSharpFormattingOptions2.SpacingAroundBinaryOperator, (
BinaryOperatorSpacingOptions
)value); }
285
set { SetOption(CSharpFormattingOptions2.SpacingAroundBinaryOperator, (
BinaryOperatorSpacingOptions
)value); }
Options\Formatting\SpacingViewModel.cs (6)
153
Items.Add(new RadioButtonViewModel<
BinaryOperatorSpacingOptions
>(CSharpVSResources.Ignore_spaces_around_binary_operators, s_expressionSpacingPreview, "binary",
BinaryOperatorSpacingOptions
.Ignore, CSharpFormattingOptions2.SpacingAroundBinaryOperator, this, OptionStore));
154
Items.Add(new RadioButtonViewModel<
BinaryOperatorSpacingOptions
>(CSharpVSResources.Remove_spaces_before_and_after_binary_operators, s_expressionSpacingPreview, "binary",
BinaryOperatorSpacingOptions
.Remove, CSharpFormattingOptions2.SpacingAroundBinaryOperator, this, OptionStore));
155
Items.Add(new RadioButtonViewModel<
BinaryOperatorSpacingOptions
>(CSharpVSResources.Insert_space_before_and_after_binary_operators, s_expressionSpacingPreview, "binary",
BinaryOperatorSpacingOptions
.Single, CSharpFormattingOptions2.SpacingAroundBinaryOperator, this, OptionStore));