3 interfaces inheriting from IOption2
Microsoft.CodeAnalysis.Workspaces (3)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\IPublicOption.cs (1)
13internal interface IPublicOption : IOption2
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\Option2.cs (1)
14internal interface ISingleValuedOption : IOption2
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\PerLanguageOption2.cs (1)
15internal interface IPerLanguageValuedOption : IOption2
114 references to IOption2
Microsoft.CodeAnalysis.CSharp.Features (3)
Options\CSharpEditorConfigOptionsEnumerator.cs (1)
21public IEnumerable<(string feature, ImmutableArray<IOption2> options)> GetOptions(bool includeUnsupported)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseExpressionBody\UseExpressionBodyDiagnosticAnalyzer.cs (2)
30private static ImmutableArray<(DiagnosticDescriptor, IOption2)> GetSupportedDescriptorsWithOptions() 32var builder = new FixedSizeArrayBuilder<(DiagnosticDescriptor, IOption2)>(_helpers.Length);
Microsoft.CodeAnalysis.CSharp.Workspaces (9)
Formatting\CSharpFormattingOptions.cs (2)
41public NewLineForBracesInternalStorageMapping(IOption2 internalOption, NewLineBeforeOpenBracePlacement flag) 58public SpacePlacementInternalStorageMapping(IOption2 internalOption, SpacePlacementWithinParentheses flag)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\CSharpCodeStyleOptions.cs (3)
18private static readonly ImmutableArray<IOption2>.Builder s_editorConfigOptionsBuilder = ImmutableArray.CreateBuilder<IOption2>(); 316internal static readonly ImmutableArray<IOption2> EditorConfigOptions = s_editorConfigOptionsBuilder.ToImmutable();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\CSharpFormattingOptions2.cs (4)
17private static readonly ImmutableArray<IOption2>.Builder s_editorConfigOptionsBuilder = ImmutableArray.CreateBuilder<IOption2>(); 282internal static readonly ImmutableArray<IOption2> EditorConfigOptions = s_editorConfigOptionsBuilder.ToImmutable(); 287internal static readonly ImmutableArray<IOption2> UndocumentedOptions = [CollectionExpressionWrappingLength];
Microsoft.CodeAnalysis.Features (40)
CodeFixes\Configuration\ConfigurationUpdater.cs (2)
354foreach (var option in codeStyleOptions) 383internal static ImmutableArray<IOption2> GetCodeStyleOptionsForDiagnostic(Diagnostic diagnostic, Project project)
CodeFixes\Configuration\ConfigureCodeStyle\ConfigureCodeStyleOptionCodeFixProvider.cs (2)
78foreach (var option in codeStyleOptions) 101TopLevelConfigureCodeStyleOptionCodeAction? GetCodeActionForCodeStyleOption(IOption2 option, Diagnostic diagnostic, bool hasMultipleOptions)
Diagnostics\Service\DiagnosticAnalyzerService.cs (1)
104public static bool IsGlobalOptionAffectingDiagnostics(IOption2 option)
EmbeddedLanguages\Json\LanguageServices\JsonDetectionOptionsStorage.cs (1)
22public static readonly ImmutableArray<IOption2> UnsupportedOptions = [DetectAndOfferEditorFeaturesForProbableJsonStrings, ReportInvalidJsonPatterns];
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexOptionsStorage.cs (1)
17public static readonly ImmutableArray<IOption2> UnsupportedOptions = [ReportInvalidRegexPatterns];
Options\EditorConfig\EditorConfigFileGenerator.cs (3)
18IEnumerable<(string feature, ImmutableArray<IOption2> options)> groupedOptions, 57private static void AppendOptionsToEditorConfig(IOptionsReader configOptions, string feature, ImmutableArray<IOption2> options, string language, StringBuilder editorconfig) 67foreach (var option in optionGrouping)
Options\EditorConfig\EditorConfigOptionsEnumerator.cs (2)
28public IEnumerable<(string feature, ImmutableArray<IOption2> options)> GetOptions(string language, bool includeUnsupported = false) 33internal static IEnumerable<(string feature, ImmutableArray<IOption2> options)> GetLanguageAgnosticEditorConfigOptions(bool includeUnsupported)
Options\EditorConfig\IEditorConfigOptionsEnumerator.cs (1)
16IEnumerable<(string feature, ImmutableArray<IOption2> options)> GetOptions(bool includeUnsupported);
src\roslyn\src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer.cs (8)
18/// unique <see cref="IOption2"/> code style option. 36IOption2? option, 49/// two or more <see cref="IOption2 "/> code style options. 66ImmutableHashSet<IOption2> options, 82protected AbstractBuiltInCodeStyleDiagnosticAnalyzer(ImmutableArray<(DiagnosticDescriptor Descriptor, IOption2 Option)> supportedDiagnosticsWithOptions) 95protected AbstractBuiltInCodeStyleDiagnosticAnalyzer(ImmutableArray<(DiagnosticDescriptor Descriptor, ImmutableHashSet<IOption2> Options)> supportedDiagnosticsWithOptions) 107private static void AddDiagnosticIdToOptionMapping(string diagnosticId, IOption2? option) 115private static void AddDiagnosticIdToOptionMapping(string diagnosticId, ImmutableHashSet<IOption2> options)
src\roslyn\src\Analyzers\Core\Analyzers\AbstractBuiltInUnnecessaryCodeStyleDiagnosticAnalyzer.cs (4)
34IOption2? option, 60ImmutableHashSet<IOption2> options, 80protected AbstractBuiltInUnnecessaryCodeStyleDiagnosticAnalyzer(ImmutableArray<(DiagnosticDescriptor Descriptor, IOption2 Option)> supportedDiagnosticsWithOptions) 88protected AbstractBuiltInUnnecessaryCodeStyleDiagnosticAnalyzer(ImmutableArray<(DiagnosticDescriptor Descriptor, ImmutableHashSet<IOption2> Options)> supportedDiagnosticsWithOptions)
src\roslyn\src\Analyzers\Core\Analyzers\IDEDiagnosticIdToOptionMappingHelper.cs (10)
22private static readonly ConcurrentDictionary<string, ImmutableHashSet<IOption2>> s_diagnosticIdToOptionMap = new(); 23private static readonly ConcurrentDictionary<string, ConcurrentDictionary<string, ImmutableHashSet<IOption2>>> s_diagnosticIdToLanguageSpecificOptionsMap = new(); 25public static bool TryGetMappedOptions(string diagnosticId, string language, [NotNullWhen(true)] out ImmutableHashSet<IOption2>? options) 34public static void AddOptionMapping(string diagnosticId, ImmutableHashSet<IOption2> options) 40var multipleLanguagesOptionsBuilder = ImmutableHashSet.CreateBuilder<IOption2>(); 45foreach (var perLanguageValuedOption in group) 59foreach (var option in languageGroup) 66var map = s_diagnosticIdToLanguageSpecificOptionsMap.GetOrAdd(language, _ => new ConcurrentDictionary<string, ImmutableHashSet<IOption2>>()); 79private static void AddOptionMapping(ConcurrentDictionary<string, ImmutableHashSet<IOption2>> map, string diagnosticId, ImmutableHashSet<IOption2> options)
src\roslyn\src\Analyzers\Core\Analyzers\ParenthesesDiagnosticAnalyzersHelper.cs (1)
15internal static ImmutableHashSet<IOption2> Options =
src\roslyn\src\Analyzers\Core\Analyzers\ValidateFormatString\FormatStringValidationOptionStorage.cs (1)
17public static readonly ImmutableArray<IOption2> UnsupportedOptions = [ReportInvalidPlaceholdersInStringDotFormatCalls];
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementType\ImplementTypeOptions.cs (1)
65public static readonly ImmutableArray<IOption2> EditorConfigOptions = [InsertionBehavior, PropertyGenerationBehavior];
SymbolSearch\SymbolSearchOptions.cs (2)
87public static readonly ImmutableArray<IOption2> EditorConfigOptions = [SearchReferenceAssemblies]; 88public static readonly ImmutableArray<IOption2> UnsupportedOptions = [
Microsoft.CodeAnalysis.Workspaces (62)
Options\DocumentOptionSet.cs (1)
71if (optionKey.Option is not IOption2 internallyDefinedOption)
Options\GlobalOptionService.cs (1)
122Debug.Assert(optionKey.Option is IOption2 { Definition.StorageMapping: null });
Options\LegacyWorkspaceOptionService.cs (2)
35/// Stores options that are not defined by Roslyn and do not implement <see cref="IOption2"/>. 41Debug.Assert(key.Option is not IOption2);
Options\Option.cs (6)
86IPublicOption? IOption2.PublicOption => null; 88OptionDefinition IOption2.Definition => OptionDefinition; 90bool IEquatable<IOption2?>.Equals(IOption2? other) => Equals(other); 96public override bool Equals(object? obj) => Equals(obj as IOption2); 98private bool Equals(IOption2? other)
Options\OptionChangedEventArgs.cs (1)
15public bool HasOption(Func<IOption2, bool> predicate)
Options\OptionKey.cs (2)
46if (thisOption is not IOption2 thisOption2 || 47otherOption is not IOption2 otherOption2)
Options\OptionSet.cs (2)
25if (optionKey.Option is IOption2 { Definition.StorageMapping: { } mapping }) 72if (optionAndLanguage.Option is IOption2 { Definition.StorageMapping: { } mapping })
Options\PerLanguageOption.cs (6)
74OptionDefinition IOption2.Definition => _optionDefinition; 78IPublicOption? IOption2.PublicOption => null; 82bool IEquatable<IOption2?>.Equals(IOption2? other) => Equals(other); 88public override bool Equals(object? obj) => Equals(obj as IOption2); 90private bool Equals(IOption2? other)
Options\SolutionOptionSet.cs (4)
54value = (optionKey.Option is IOption2 internallyDefinedOption) 82predicate: key => key.Option is IOption2, 83selector: key => KeyValuePair.Create(new OptionKey2((IOption2)key.Option, key.Language), _values[key])); 85predicate: key => key.Option is not IOption2,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleHelpers.cs (3)
119this ImmutableArray<IOption2>.Builder optionsBuilder, 132this ImmutableArray<IOption2>.Builder optionsBuilder, 144this ImmutableArray<IOption2>.Builder optionsBuilder,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOptions2.cs (3)
21private static readonly ImmutableArray<IOption2>.Builder s_editorConfigOptionsBuilder = ImmutableArray.CreateBuilder<IOption2>(); 356internal static readonly ImmutableArray<IOption2> EditorConfigOptions = s_editorConfigOptionsBuilder.ToImmutable();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\VisualBasic\VisualBasicCodeStyleOptions.cs (3)
14private static readonly ImmutableArray<IOption2>.Builder s_allOptionsBuilder = ImmutableArray.CreateBuilder<IOption2>(); 55public static ImmutableArray<IOption2> EditorConfigOptions => s_allOptionsBuilder.ToImmutable();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Editing\GenerationOptions.cs (1)
30public static readonly ImmutableArray<IOption2> EditorConfigOptions = [PlaceSystemNamespaceFirst, SeparateImportDirectiveGroups];
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\AnalyzerConfigOptionsExtensions.cs (3)
15public static T GetEditorConfigOption<T>(this AnalyzerConfigOptions analyzerConfigOptions, IOption2 option, T defaultValue) 18public static T GetEditorConfigOptionValue<T>(this AnalyzerConfigOptions analyzerConfigOptions, IOption2 option, T defaultValue) 21public static bool TryGetEditorConfigOption<T>(this AnalyzerConfigOptions analyzerConfigOptions, IOption2 option, out T value)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingOptions2.cs (2)
97internal static readonly ImmutableArray<IOption2> EditorConfigOptions = [UseTabs, TabSize, IndentationSize, NewLine, InsertFinalNewLine]; 102internal static readonly ImmutableArray<IOption2> UndocumentedOptions = [WrappingColumn, ConditionalExpressionWrappingLength];
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyleOptions.cs (1)
32internal static readonly ImmutableArray<IOption2> EditorConfigOptions = [NamingPreferences];
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (1)
180public static void Serialize(IDictionary<string, string> builder, IOption2 option, string language, object? value)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\InternalOptionStorageMapping.cs (2)
11internal abstract class OptionStorageMapping(IOption2 internalOption) 16public IOption2 InternalOption { get; } = internalOption;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\IOption2.cs (2)
13/// This ensures that all the sub-types of <see cref="IOption2"/> in either layer see an identical 16internal interface IOption2 : IEquatable<IOption2?>
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\Option2.cs (4)
41internal Option2(OptionDefinition<T> definition, string? languageName, Func<IOption2, IPublicOption>? publicOptionFactory) 76OptionDefinition IOption2.Definition => Definition; 93public override bool Equals(object? obj) => Equals(obj as IOption2); 95public bool Equals(IOption2? other)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionKey2.cs (2)
17public IOption2 Option { get; } 20public OptionKey2(IOption2 option, string? language)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\PerLanguageOption2.cs (4)
33internal PerLanguageOption2(OptionDefinition<T> optionDefinition, Func<IOption2, IPublicOption>? publicOptionFactory) 64OptionDefinition IOption2.Definition => Definition; 81public override bool Equals(object? obj) => Equals(obj as IOption2); 83public bool Equals(IOption2? other)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\PublicOptionFactory.cs (5)
38private sealed class StorageMapping(IOption2 internalOption, Func<object?, object?> toPublicValue, Func<object?, object?> toInternalValue) : OptionStorageMapping(internalOption) 47private static OptionDefinition<TPublicValue> ToPublicOptionDefinition<T, TPublicValue>(this OptionDefinition<T> definition, IOption2 internalOption, Func<T, TPublicValue> toPublicValue, Func<TPublicValue, T> toInternalValue) 115public static string PublicOptionDefinitionToString(this IOption2 option) 118public static bool PublicOptionDefinitionEquals(this IOption2 x, IOption2 y)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Options\MemberDisplayOptions.cs (1)
39public static readonly ImmutableArray<IOption2> EditorConfigOptions = [HideAdvancedMembers];