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