53 references to LabelPositionOptions
Microsoft.CodeAnalysis.CSharp.Workspaces (14)
Formatting\CSharpFormattingOptions.cs (1)
154
public static Option<
LabelPositionOptions
> LabelPositioning { get; } = CSharpFormattingOptions2.LabelPositioning.ToPublicOption();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\CSharpFormattingOptions2.cs (6)
38
private static readonly BidirectionalMap<string,
LabelPositionOptions
> s_labelPositionOptionsEditorConfigMap =
41
KeyValuePairUtil.Create("flush_left",
LabelPositionOptions
.LeftMost),
42
KeyValuePairUtil.Create("no_change",
LabelPositionOptions
.NoIndent),
43
KeyValuePairUtil.Create("one_less_than_current",
LabelPositionOptions
.OneLess),
217
public static Option2<
LabelPositionOptions
> LabelPositioning { get; } = CreateOption(
220
new EditorConfigValueSerializer<
LabelPositionOptions
>(
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\CSharpFormattingOptions2.Parsers.cs (3)
98
internal static
LabelPositionOptions
ParseEditorConfigLabelPositioning(string labelIndentationValue)
99
=> s_labelPositionOptionsEditorConfigMap.TryGetValue(labelIndentationValue.Trim(), out var value) ? value :
LabelPositionOptions
.NoIndent;
101
private static string GetLabelPositionOptionEditorConfigString(
LabelPositionOptions
value)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\CSharpSyntaxFormattingOptions.cs (2)
58
[DataMember] public
LabelPositionOptions
LabelPositioning { get; init; } =
LabelPositionOptions
.OneLess;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\IndentBlockFormattingRule.cs (2)
139
if (_options.LabelPositioning ==
LabelPositionOptions
.OneLess)
143
else if (_options.LabelPositioning ==
LabelPositionOptions
.LeftMost)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (15)
CodeStyle\CSharpEditorConfigCodeStyleParserTests.cs (7)
31
[InlineData("flush_left",
LabelPositionOptions
.LeftMost)]
32
[InlineData("no_change",
LabelPositionOptions
.NoIndent)]
33
[InlineData("one_less_than_current",
LabelPositionOptions
.OneLess)]
36
[InlineData(" flush_left ",
LabelPositionOptions
.LeftMost)]
37
[InlineData(" no_change ",
LabelPositionOptions
.NoIndent)]
38
[InlineData(" one_less_than_current ",
LabelPositionOptions
.OneLess)]
39
public void TestParseLabelPositioning(string rawValue,
LabelPositionOptions
parsedValue)
Formatting\EditorConfigOptionParserTests.cs (5)
55
InlineData("flush_left",
LabelPositionOptions
.LeftMost),
56
InlineData("no_change",
LabelPositionOptions
.NoIndent),
57
InlineData("one_less_than_current",
LabelPositionOptions
.OneLess)]
58
public void TestParseEditorConfigLabelPositioningTrue(string value,
LabelPositionOptions
expectedValue)
70
Assert.True(CSharpFormattingOptions2.ParseEditorConfigLabelPositioning(value) ==
LabelPositionOptions
.NoIndent,
Formatting\FormattingTests.cs (3)
1039
{ LabelPositioning,
LabelPositionOptions
.LeftMost }
1072
{ LabelPositioning,
LabelPositionOptions
.LeftMost }
6028
{ CSharpFormattingOptions2.LabelPositioning,
LabelPositionOptions
.LeftMost }
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp.CSharp (4)
Formatting\OmniSharpSyntaxFormattingOptionsFactory.cs (4)
15
LeftMost =
LabelPositionOptions
.LeftMost,
16
OneLess =
LabelPositionOptions
.OneLess,
17
NoIndent =
LabelPositionOptions
.NoIndent
131
LabelPositioning = (
LabelPositionOptions
)labelPositioning,
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Options\OptionsTestHelpers.cs (1)
42
(CSharpFormattingOptions.LabelPositioning,
LabelPositionOptions
.LeftMost),
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
Formatter\FormatterTests.cs (1)
190
Assert.Equal(
LabelPositionOptions
.LeftMost, formattingOptions.LabelPositioning);
Microsoft.VisualStudio.LanguageServices.CSharp (18)
EditorConfigSettings\LabelPositionOptionsViewModel.cs (10)
33
=> key.Option.Type == typeof(
LabelPositionOptions
);
36
internal class LabelPositionOptionsViewModel : EnumSettingViewModel<
LabelPositionOptions
>
45
protected override void ChangePropertyTo(
LabelPositionOptions
newValue)
50
protected override
LabelPositionOptions
GetCurrentValue()
52
return (
LabelPositionOptions
)_setting.GetValue()!;
55
protected override IReadOnlyDictionary<string,
LabelPositionOptions
> GetValuesAndDescriptions()
59
static IEnumerable<(string description,
LabelPositionOptions
value)> EnumerateOptions()
61
yield return (CSharpVSResources.Place_goto_labels_in_leftmost_column,
LabelPositionOptions
.LeftMost);
62
yield return (CSharpVSResources.Indent_labels_normally,
LabelPositionOptions
.NoIndent);
63
yield return (CSharpVSResources.Place_goto_labels_one_indent_less_than_current,
LabelPositionOptions
.OneLess);
Options\AutomationObject\AutomationObject.Formatting.cs (2)
45
set { SetOption(CSharpFormattingOptions2.LabelPositioning, (
LabelPositionOptions
)value); }
51
set { SetOption(CSharpFormattingOptions2.LabelPositioning, (
LabelPositionOptions
)value); }
Options\Formatting\IndentationViewModel.cs (6)
89
Items.Add(new RadioButtonViewModel<
LabelPositionOptions
>(CSharpVSResources.Place_goto_labels_in_leftmost_column, GotoLabelPreview, "goto",
LabelPositionOptions
.LeftMost, CSharpFormattingOptions2.LabelPositioning, this, optionStore));
90
Items.Add(new RadioButtonViewModel<
LabelPositionOptions
>(CSharpVSResources.Indent_labels_normally, GotoLabelPreview, "goto",
LabelPositionOptions
.NoIndent, CSharpFormattingOptions2.LabelPositioning, this, optionStore));
91
Items.Add(new RadioButtonViewModel<
LabelPositionOptions
>(CSharpVSResources.Place_goto_labels_one_indent_less_than_current, GotoLabelPreview, "goto",
LabelPositionOptions
.OneLess, CSharpFormattingOptions2.LabelPositioning, this, optionStore));