22 instantiations of CodeStyleOption
Microsoft.CodeAnalysis.Workspaces (8)
CodeStyle\CodeStyleOption.cs (4)
19public static CodeStyleOption<T> Default => new(default, NotificationOption.Silent); 39ICodeStyleOption ICodeStyleOption.WithValue(object value) => new CodeStyleOption<T>((T)value, Notification); 40ICodeStyleOption ICodeStyleOption.WithNotification(NotificationOption2 notification) => new CodeStyleOption<T>(Value, (NotificationOption)notification); 57=> new(CodeStyleOption2<T>.FromXElement(element));
CodeStyle\CodeStyleOption2_operators.cs (1)
21return new CodeStyleOption<T>(option.Value, (NotificationOption)option.Notification);
CodeStyleOption2`1.cs (1)
108ICodeStyleOption ICodeStyleOption.AsPublicCodeStyleOption() => new CodeStyleOption<T>(this);
PublicOptionFactory.cs (2)
91=> WithPublicOption(option, feature, name, static value => new CodeStyleOption<T>(value), static value => value.UnderlyingOption); 97=> WithPublicOption(option, feature, name, static value => new CodeStyleOption<T>(value), static value => value.UnderlyingOption);
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (6)
Options\OptionsTestHelpers.cs (6)
88(CodeStyleOptions.QualifyFieldAccess, new CodeStyleOption<bool>(true, NotificationOption.Suggestion)), 89(CodeStyleOptions.QualifyPropertyAccess, new CodeStyleOption<bool>(true, NotificationOption.Suggestion)), 90(CodeStyleOptions.QualifyMethodAccess, new CodeStyleOption<bool>(true, NotificationOption.Suggestion)), 91(CodeStyleOptions.QualifyEventAccess, new CodeStyleOption<bool>(true, NotificationOption.Suggestion)), 92(CodeStyleOptions.PreferIntrinsicPredefinedTypeKeywordInDeclaration, new CodeStyleOption<bool>(false, NotificationOption.Suggestion)), 93(CodeStyleOptions.PreferIntrinsicPredefinedTypeKeywordInMemberAccess, new CodeStyleOption<bool>(false, NotificationOption.Suggestion)));
Microsoft.CodeAnalysis.Workspaces.UnitTests (7)
Options\DocumentOptionSetTests.cs (7)
33Assert.Equal(new CodeStyleOption<bool>(true, NotificationOption.Warning), set.GetOption(CodeStyleOptions.QualifyEventAccess, LanguageNames.CSharp)); 36Assert.Equal(new CodeStyleOption<bool>(true, NotificationOption.Warning), set.GetOption(CodeStyleOptions.QualifyEventAccess, LanguageNames.CSharp)); 39Assert.Equal(new CodeStyleOption<bool>(true, NotificationOption.Error), set.GetOption(CodeStyleOptions.PreferIntrinsicPredefinedTypeKeywordInMemberAccess, LanguageNames.CSharp)); 42Assert.Equal(new CodeStyleOption<bool>(true, NotificationOption.Error), set.GetOption(CodeStyleOptions.PreferIntrinsicPredefinedTypeKeywordInMemberAccess, LanguageNames.CSharp)); 64Assert.Equal(new CodeStyleOption<bool>(true, NotificationOption.Error), set.GetOption(CodeStyleOptions.PreferIntrinsicPredefinedTypeKeywordInMemberAccess, LanguageNames.CSharp)); 67Assert.Equal(new CodeStyleOption<bool>(true, NotificationOption.Error), set.GetOption(CodeStyleOptions.PreferIntrinsicPredefinedTypeKeywordInMemberAccess, LanguageNames.CSharp)); 76var newValue = new CodeStyleOption<bool>(true, NotificationOption.Error);
Roslyn.VisualStudio.Next.UnitTests (1)
Services\VisualStudioDiagnosticAnalyzerExecutorTests.cs (1)
184workspace.GlobalOptions.SetGlobalOption(CSharpCodeStyleOptions.VarWhenTypeIsApparent, new CodeStyleOption<bool>(false, NotificationOption.Suggestion));
26 references to CodeStyleOption
Microsoft.CodeAnalysis.Workspaces (17)
CodeStyle\CodeStyleOption.cs (5)
16public sealed class CodeStyleOption<T> : ICodeStyleOption, IEquatable<CodeStyleOption<T>> 19public static CodeStyleOption<T> Default => new(default, NotificationOption.Silent); 56public static CodeStyleOption<T> FromXElement(XElement element) 59public bool Equals(CodeStyleOption<T> other) 63=> obj is CodeStyleOption<T> option &&
CodeStyle\CodeStyleOption2_operators.cs (2)
14public static explicit operator CodeStyleOption<T>?(CodeStyleOption2<T>? option) 25public static explicit operator CodeStyleOption2<T>?(CodeStyleOption<T>? option)
CodeStyle\CodeStyleOptions.cs (6)
15public static readonly PerLanguageOption<CodeStyleOption<bool>> QualifyFieldAccess = 19public static readonly PerLanguageOption<CodeStyleOption<bool>> QualifyPropertyAccess = 23public static readonly PerLanguageOption<CodeStyleOption<bool>> QualifyMethodAccess = 27public static readonly PerLanguageOption<CodeStyleOption<bool>> QualifyEventAccess = 31public static readonly PerLanguageOption<CodeStyleOption<bool>> PreferIntrinsicPredefinedTypeKeywordInDeclaration = 35public static readonly PerLanguageOption<CodeStyleOption<bool>> PreferIntrinsicPredefinedTypeKeywordInMemberAccess =
PublicOptionFactory.cs (4)
111public static Option<CodeStyleOption<T>> ToPublicOption<T>(this Option2<CodeStyleOption2<T>> option) 114return (Option<CodeStyleOption<T>>)option.PublicOption; 117public static PerLanguageOption<CodeStyleOption<T>> ToPublicOption<T>(this PerLanguageOption2<CodeStyleOption2<T>> option) 120return (PerLanguageOption<CodeStyleOption<T>>)option.PublicOption;
Microsoft.CodeAnalysis.Workspaces.UnitTests (9)
Options\DocumentOptionSetTests.cs (2)
76var newValue = new CodeStyleOption<bool>(true, NotificationOption.Error); 83Assert.IsType<CodeStyleOption<bool>>(actualValue);
WorkspaceServiceTests\GlobalOptionServiceTests.cs (7)
276var newValueCodeStyleOption = (CodeStyleOption<bool>)newValueCodeStyleOption2!; 292var newValueCodeStyleOption = (CodeStyleOption<bool>)newValueCodeStyleOption2!; 298private static void TestPublicOption(Workspace workspace, IPublicOption option, string? language, CodeStyleOption<bool> newPublicValue) 308Assert.IsType<CodeStyleOption<bool>>(newOptionSet.GetOption(optionKey)); 311Assert.Equal(newPublicValue, newOptionSet.GetOption<CodeStyleOption<bool>>(optionKey));