1 type derived from Option
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Options\TestOption.cs (1)
23
internal class TestOption<T> :
Option
<T>
26 instantiations of Option
Microsoft.CodeAnalysis.Workspaces (10)
Rename\RenameOptions.cs (4)
15
public static Option<bool> RenameOverloads { get; } = new
Option
<bool>(nameof(RenameOptions), nameof(RenameOverloads), defaultValue: false);
17
public static Option<bool> RenameInStrings { get; } = new
Option
<bool>(nameof(RenameOptions), nameof(RenameInStrings), defaultValue: false);
19
public static Option<bool> RenameInComments { get; } = new
Option
<bool>(nameof(RenameOptions), nameof(RenameInComments), defaultValue: false);
21
public static Option<bool> PreviewChanges { get; } = new
Option
<bool>(nameof(RenameOptions), nameof(PreviewChanges), defaultValue: false);
Simplification\SimplificationOptions.cs (6)
22
public static Option<bool> PreferAliasToQualification { get; } = new
Option
<bool>("SimplificationOptions", "PreferAliasToQualification", defaultValue: true);
29
public static Option<bool> PreferOmittingModuleNamesInQualification { get; } = new
Option
<bool>("SimplificationOptions", "PreferOmittingModuleNamesInQualification", defaultValue: true);
35
public static Option<bool> PreferImplicitTypeInference { get; } = new
Option
<bool>("SimplificationOptions", "PreferImplicitTypeInference", defaultValue: true);
41
public static Option<bool> PreferImplicitTypeInLocalDeclaration { get; } = new
Option
<bool>("SimplificationOptions", "PreferImplicitTypeInLocalDeclaration", defaultValue: true);
47
public static Option<bool> AllowSimplificationToGenericType { get; } = new
Option
<bool>("SimplificationOptions", "AllowSimplificationToGenericType", defaultValue: false);
53
public static Option<bool> AllowSimplificationToBaseType { get; } = new
Option
<bool>("SimplificationOptions", "AllowSimplificationToBaseType", defaultValue: true);
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Options\OptionsTestHelpers.cs (1)
23
public static readonly Option<bool> CustomPublicOption = new
Option
<bool>("My Feature", "My Option", defaultValue: true);
Microsoft.CodeAnalysis.Workspaces.UnitTests (15)
Options\OptionKeyTests.cs (9)
23
Assert.Throws<ArgumentNullException>(() => new
Option
<bool>("Test Feature", null!, false));
24
Assert.Throws<ArgumentNullException>(() => new
Option
<bool>(null!, "Test Name", false));
25
Assert.Throws<ArgumentNullException>(() => new
Option
<bool>("X", "Test Name", false, storageLocations: null!));
45
var option = new
Option
<bool>("X", "Test Name", false, storage1, storage2, storage3);
97
var option = new
Option
<bool>("FooFeature", "BarName");
108
var option = new
Option
<bool>("FooFeature", "BarName", false);
155
var option1 = new
Option
<bool>("FooFeature", "BarName", defaultValue: false);
156
var option2 = new
Option
<bool>("FooFeature", "BarName", defaultValue: true);
157
var option3 = new
Option
<bool>("CSharpFormattingOptions", "SpacingAfterMethodDeclarationName", CSharpFormattingOptions.SpacingAfterMethodDeclarationName.DefaultValue);
WorkspaceServiceTests\GlobalOptionServiceTests.cs (6)
160
var option = new
Option
<bool>("Test Feature", "Test Name", false);
213
var option = new
Option
<bool>("Test Feature", "Test Name", false);
226
var optionFalse = new
Option
<bool>("Test Feature", "Test Name", false);
229
var optionTrue = new
Option
<bool>("Test Feature", "Test Name", true);
246
var option = new
Option
<bool>("Test Feature", "Test Name", defaultValue: true);
262
var option = new
Option
<bool>("Test Feature", "Test Name", defaultValue: true);
79 references to Option
Microsoft.CodeAnalysis.CSharp.Workspaces (49)
Formatting\CSharpFormattingOptions.cs (49)
17
private static
Option
<bool> CreateNewLineForBracesOption(string publicName, NewLineBeforeOpenBracePlacement flag)
27
private static
Option
<bool> CreateSpaceWithinOption(string publicName, SpacePlacementWithinParentheses flag)
72
public static
Option
<bool> SpacingAfterMethodDeclarationName { get; } = CSharpFormattingOptions2.SpacingAfterMethodDeclarationName.ToPublicOption();
75
public static
Option
<bool> SpaceWithinMethodDeclarationParenthesis { get; } = CSharpFormattingOptions2.SpaceWithinMethodDeclarationParenthesis.ToPublicOption();
78
public static
Option
<bool> SpaceBetweenEmptyMethodDeclarationParentheses { get; } = CSharpFormattingOptions2.SpaceBetweenEmptyMethodDeclarationParentheses.ToPublicOption();
81
public static
Option
<bool> SpaceAfterMethodCallName { get; } = CSharpFormattingOptions2.SpaceAfterMethodCallName.ToPublicOption();
84
public static
Option
<bool> SpaceWithinMethodCallParentheses { get; } = CSharpFormattingOptions2.SpaceWithinMethodCallParentheses.ToPublicOption();
87
public static
Option
<bool> SpaceBetweenEmptyMethodCallParentheses { get; } = CSharpFormattingOptions2.SpaceBetweenEmptyMethodCallParentheses.ToPublicOption();
90
public static
Option
<bool> SpaceAfterControlFlowStatementKeyword { get; } = CSharpFormattingOptions2.SpaceAfterControlFlowStatementKeyword.ToPublicOption();
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);
97
public static
Option
<bool> SpaceAfterCast { get; } = CSharpFormattingOptions2.SpaceAfterCast.ToPublicOption();
100
public static
Option
<bool> SpacesIgnoreAroundVariableDeclaration { get; } = CSharpFormattingOptions2.SpacesIgnoreAroundVariableDeclaration.ToPublicOption();
103
public static
Option
<bool> SpaceBeforeOpenSquareBracket { get; } = CSharpFormattingOptions2.SpaceBeforeOpenSquareBracket.ToPublicOption();
106
public static
Option
<bool> SpaceBetweenEmptySquareBrackets { get; } = CSharpFormattingOptions2.SpaceBetweenEmptySquareBrackets.ToPublicOption();
109
public static
Option
<bool> SpaceWithinSquareBrackets { get; } = CSharpFormattingOptions2.SpaceWithinSquareBrackets.ToPublicOption();
112
public static
Option
<bool> SpaceAfterColonInBaseTypeDeclaration { get; } = CSharpFormattingOptions2.SpaceAfterColonInBaseTypeDeclaration.ToPublicOption();
115
public static
Option
<bool> SpaceAfterComma { get; } = CSharpFormattingOptions2.SpaceAfterComma.ToPublicOption();
118
public static
Option
<bool> SpaceAfterDot { get; } = CSharpFormattingOptions2.SpaceAfterDot.ToPublicOption();
121
public static
Option
<bool> SpaceAfterSemicolonsInForStatement { get; } = CSharpFormattingOptions2.SpaceAfterSemicolonsInForStatement.ToPublicOption();
124
public static
Option
<bool> SpaceBeforeColonInBaseTypeDeclaration { get; } = CSharpFormattingOptions2.SpaceBeforeColonInBaseTypeDeclaration.ToPublicOption();
127
public static
Option
<bool> SpaceBeforeComma { get; } = CSharpFormattingOptions2.SpaceBeforeComma.ToPublicOption();
130
public static
Option
<bool> SpaceBeforeDot { get; } = CSharpFormattingOptions2.SpaceBeforeDot.ToPublicOption();
133
public static
Option
<bool> SpaceBeforeSemicolonsInForStatement { get; } = CSharpFormattingOptions2.SpaceBeforeSemicolonsInForStatement.ToPublicOption();
136
public static
Option
<BinaryOperatorSpacingOptions> SpacingAroundBinaryOperator { get; } = CSharpFormattingOptions2.SpacingAroundBinaryOperator.ToPublicOption();
139
public static
Option
<bool> IndentBraces { get; } = CSharpFormattingOptions2.IndentBraces.ToPublicOption();
142
public static
Option
<bool> IndentBlock { get; } = CSharpFormattingOptions2.IndentBlock.ToPublicOption();
145
public static
Option
<bool> IndentSwitchSection { get; } = CSharpFormattingOptions2.IndentSwitchSection.ToPublicOption();
148
public static
Option
<bool> IndentSwitchCaseSection { get; } = CSharpFormattingOptions2.IndentSwitchCaseSection.ToPublicOption();
151
public static
Option
<bool> IndentSwitchCaseSectionWhenBlock { get; } = CSharpFormattingOptions2.IndentSwitchCaseSectionWhenBlock.ToPublicOption();
154
public static
Option
<LabelPositionOptions> LabelPositioning { get; } = CSharpFormattingOptions2.LabelPositioning.ToPublicOption();
157
public static
Option
<bool> WrappingPreserveSingleLine { get; } = CSharpFormattingOptions2.WrappingPreserveSingleLine.ToPublicOption();
160
public static
Option
<bool> WrappingKeepStatementsOnSingleLine { get; } = CSharpFormattingOptions2.WrappingKeepStatementsOnSingleLine.ToPublicOption();
162
public static
Option
<bool> NewLinesForBracesInTypes { get; } = CreateNewLineForBracesOption("NewLinesForBracesInTypes", NewLineBeforeOpenBracePlacement.Types);
163
public static
Option
<bool> NewLinesForBracesInMethods { get; } = CreateNewLineForBracesOption("NewLinesForBracesInMethods", NewLineBeforeOpenBracePlacement.Methods);
164
public static
Option
<bool> NewLinesForBracesInProperties { get; } = CreateNewLineForBracesOption("NewLinesForBracesInProperties", NewLineBeforeOpenBracePlacement.Properties);
165
public static
Option
<bool> NewLinesForBracesInAccessors { get; } = CreateNewLineForBracesOption("NewLinesForBracesInAccessors", NewLineBeforeOpenBracePlacement.Accessors);
166
public static
Option
<bool> NewLinesForBracesInAnonymousMethods { get; } = CreateNewLineForBracesOption("NewLinesForBracesInAnonymousMethods", NewLineBeforeOpenBracePlacement.AnonymousMethods);
167
public static
Option
<bool> NewLinesForBracesInControlBlocks { get; } = CreateNewLineForBracesOption("NewLinesForBracesInControlBlocks", NewLineBeforeOpenBracePlacement.ControlBlocks);
168
public static
Option
<bool> NewLinesForBracesInAnonymousTypes { get; } = CreateNewLineForBracesOption("NewLinesForBracesInAnonymousTypes", NewLineBeforeOpenBracePlacement.AnonymousTypes);
169
public static
Option
<bool> NewLinesForBracesInObjectCollectionArrayInitializers { get; } = CreateNewLineForBracesOption("NewLinesForBracesInObjectCollectionArrayInitializers", NewLineBeforeOpenBracePlacement.ObjectCollectionArrayInitializers);
170
public static
Option
<bool> NewLinesForBracesInLambdaExpressionBody { get; } = CreateNewLineForBracesOption("NewLinesForBracesInLambdaExpressionBody", NewLineBeforeOpenBracePlacement.LambdaExpressionBody);
173
public static
Option
<bool> NewLineForElse { get; } = CSharpFormattingOptions2.NewLineForElse.ToPublicOption();
176
public static
Option
<bool> NewLineForCatch { get; } = CSharpFormattingOptions2.NewLineForCatch.ToPublicOption();
179
public static
Option
<bool> NewLineForFinally { get; } = CSharpFormattingOptions2.NewLineForFinally.ToPublicOption();
182
public static
Option
<bool> NewLineForMembersInObjectInit { get; } = CSharpFormattingOptions2.NewLineForMembersInObjectInit.ToPublicOption();
185
public static
Option
<bool> NewLineForMembersInAnonymousTypes { get; } = CSharpFormattingOptions2.NewLineForMembersInAnonymousTypes.ToPublicOption();
188
public static
Option
<bool> NewLineForClausesInQuery { get; } = CSharpFormattingOptions2.NewLineForClausesInQuery.ToPublicOption();
Microsoft.CodeAnalysis.Workspaces (17)
Options\Option.cs (1)
108
public static implicit operator OptionKey(
Option
<T> option)
Options\OptionSet.cs (2)
46
public T GetOption<T>(
Option
<T> option)
52
public OptionSet WithChangedOption<T>(
Option
<T> option, T value)
Rename\RenameOptions.cs (4)
15
public static
Option
<bool> RenameOverloads { get; } = new Option<bool>(nameof(RenameOptions), nameof(RenameOverloads), defaultValue: false);
17
public static
Option
<bool> RenameInStrings { get; } = new Option<bool>(nameof(RenameOptions), nameof(RenameInStrings), defaultValue: false);
19
public static
Option
<bool> RenameInComments { get; } = new Option<bool>(nameof(RenameOptions), nameof(RenameInComments), defaultValue: false);
21
public static
Option
<bool> PreviewChanges { get; } = new Option<bool>(nameof(RenameOptions), nameof(PreviewChanges), defaultValue: false);
Simplification\SimplificationOptions.cs (6)
22
public static
Option
<bool> PreferAliasToQualification { get; } = new Option<bool>("SimplificationOptions", "PreferAliasToQualification", defaultValue: true);
29
public static
Option
<bool> PreferOmittingModuleNamesInQualification { get; } = new Option<bool>("SimplificationOptions", "PreferOmittingModuleNamesInQualification", defaultValue: true);
35
public static
Option
<bool> PreferImplicitTypeInference { get; } = new Option<bool>("SimplificationOptions", "PreferImplicitTypeInference", defaultValue: true);
41
public static
Option
<bool> PreferImplicitTypeInLocalDeclaration { get; } = new Option<bool>("SimplificationOptions", "PreferImplicitTypeInLocalDeclaration", defaultValue: true);
47
public static
Option
<bool> AllowSimplificationToGenericType { get; } = new Option<bool>("SimplificationOptions", "AllowSimplificationToGenericType", defaultValue: false);
53
public static
Option
<bool> AllowSimplificationToBaseType { get; } = new Option<bool>("SimplificationOptions", "AllowSimplificationToBaseType", defaultValue: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\PublicOptionFactory.cs (4)
89
public static
Option
<T> ToPublicOption<T>(this Option2<T> option)
92
return (
Option
<T>)option.PublicOption;
101
public static
Option
<CodeStyleOption<T>> ToPublicOption<T>(this Option2<CodeStyleOption2<T>> option)
104
return (
Option
<CodeStyleOption<T>>)option.PublicOption;
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Options\OptionsTestHelpers.cs (1)
23
public static readonly
Option
<bool> CustomPublicOption = new Option<bool>("My Feature", "My Option", defaultValue: true);
Microsoft.CodeAnalysis.Workspaces.UnitTests (12)
Options\OptionKeyTests.cs (6)
45
var
option = new Option<bool>("X", "Test Name", false, storage1, storage2, storage3);
97
var
option = new Option<bool>("FooFeature", "BarName");
108
var
option = new Option<bool>("FooFeature", "BarName", false);
155
var
option1 = new Option<bool>("FooFeature", "BarName", defaultValue: false);
156
var
option2 = new Option<bool>("FooFeature", "BarName", defaultValue: true);
157
var
option3 = new Option<bool>("CSharpFormattingOptions", "SpacingAfterMethodDeclarationName", CSharpFormattingOptions.SpacingAfterMethodDeclarationName.DefaultValue);
WorkspaceServiceTests\GlobalOptionServiceTests.cs (6)
160
var
option = new Option<bool>("Test Feature", "Test Name", false);
213
var
option = new Option<bool>("Test Feature", "Test Name", false);
226
var
optionFalse = new Option<bool>("Test Feature", "Test Name", false);
229
var
optionTrue = new Option<bool>("Test Feature", "Test Name", true);
246
var
option = new Option<bool>("Test Feature", "Test Name", defaultValue: true);
262
var
option = new Option<bool>("Test Feature", "Test Name", defaultValue: true);