15 instantiations of OptionKey2
Microsoft.CodeAnalysis.Features (2)
Options\EditorConfig\EditorConfigFileGenerator.cs (2)
49if (configOptions.TryGetOption(new OptionKey2(NamingStyleOptions.NamingPreferences, language), out NamingStylePreferences namingStylePreferences)) 69var optionKey = new OptionKey2(option, option.IsPerLanguage ? language : null);
Microsoft.CodeAnalysis.Workspaces (13)
Options\GlobalOptionService.cs (4)
63=> GetOption<T>(new OptionKey2(option)); 66=> GetOption<T>(new OptionKey2(option, language)); 137=> SetGlobalOption(new OptionKey2(option), value); 140=> SetGlobalOption(new OptionKey2(option, language), value);
Options\SolutionOptionSet.cs (2)
55? _legacyGlobalOptions.GlobalOptions.GetOption<object?>(new OptionKey2(internallyDefinedOption, optionKey.Language)) 83selector: key => KeyValuePair.Create(new OptionKey2((IOption2)key.Option, key.Language), _values[key]));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\IOptionReader.cs (6)
29=> options.TryGetOption<T>(new OptionKey2(option), out var value) ? value : option.DefaultValue; 32=> options.TryGetOption<T>(new OptionKey2(option), out var value) ? value : defaultValue; 35=> options.TryGetOption<T>(new OptionKey2(option, language), out var value) ? value : option.DefaultValue; 38=> options.TryGetOption<T>(new OptionKey2(option, language), out var value) ? value : defaultValue; 44=> options.TryGetOption<CodeStyleOption2<T>>(new OptionKey2(option), out var style) ? style.Value : defaultValue; 50=> options.TryGetOption<CodeStyleOption2<T>>(new OptionKey2(option, language), out var style) ? style.Value : defaultValue;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\Option2.cs (1)
106=> new(option);
39 references to OptionKey2
Microsoft.CodeAnalysis.Features (1)
Options\EditorConfig\EditorConfigFileGenerator.cs (1)
69var optionKey = new OptionKey2(option, option.IsPerLanguage ? language : null);
Microsoft.CodeAnalysis.Workspaces (38)
Options\GlobalOptionService.cs (18)
29private ImmutableDictionary<OptionKey2, object?> _currentValues = ImmutableDictionary.Create<OptionKey2, object?>(); 41private static object? LoadOptionFromPersisterOrGetDefault(OptionKey2 optionKey, ImmutableArray<IOptionPersister> persisters) 56bool IOptionsReader.TryGetOption<T>(OptionKey2 optionKey, out T value) 68public T GetOption<T>(OptionKey2 optionKey) 85public ImmutableArray<object?> GetOptions(ImmutableArray<OptionKey2> optionKeys) 92foreach (var optionKey in optionKeys) 109foreach (var optionKey in optionKeys) 119private static object? GetOption_NoLock(ref ImmutableDictionary<OptionKey2, object?> currentValues, OptionKey2 optionKey, ImmutableArray<IOptionPersister> persisters) 142public void SetGlobalOption(OptionKey2 optionKey, object? value) 145public bool SetGlobalOptions(ImmutableArray<KeyValuePair<OptionKey2, object?>> options) 148private bool SetGlobalOptions(OneOrMany<KeyValuePair<OptionKey2, object?>> options) 150using var _ = ArrayBuilder<(OptionKey2, object?)>.GetInstance(options.Count, out var changedOptions); 185private static void PersistOption(ImmutableArray<IOptionPersister> persisters, OptionKey2 optionKey, object? value) 196public bool RefreshOption(OptionKey2 optionKey, object? newValue) 226private void RaiseOptionChangedEvent(ImmutableArray<(OptionKey2, object?)> changedOptions) 250_instance._currentValues = ImmutableDictionary.Create<OptionKey2, object?>();
Options\IGlobalOptionService.cs (5)
29T GetOption<T>(OptionKey2 optionKey); 35ImmutableArray<object?> GetOptions(ImmutableArray<OptionKey2> optionKeys); 47void SetGlobalOption(OptionKey2 optionKey, object? value); 56bool SetGlobalOptions(ImmutableArray<KeyValuePair<OptionKey2, object?>> options); 65bool RefreshOption(OptionKey2 optionKey, object? newValue);
Options\ILegacyWorkspaceOptionService.cs (1)
31ImmutableArray<KeyValuePair<OptionKey2, object?>> internallyDefinedOptions,
Options\IOptionPersister.cs (2)
13bool TryFetch(OptionKey2 optionKey, out object? value); 14bool TryPersist(OptionKey2 optionKey, object? value);
Options\LegacyWorkspaceOptionService.cs (1)
52ImmutableArray<KeyValuePair<OptionKey2, object?>> internallyDefinedOptions,
Options\OptionChangedEventArgs.cs (2)
11internal sealed class OptionChangedEventArgs(ImmutableArray<(OptionKey2 key, object? newValue)> changedOptions) : EventArgs 13public ImmutableArray<(OptionKey2 key, object? newValue)> ChangedOptions => changedOptions;
Options\OptionKey.cs (3)
9/// <inheritdoc cref="OptionKey2"/> 13/// <inheritdoc cref="OptionKey2.Option"/> 16/// <inheritdoc cref="OptionKey2.Language"/>
Options\OptionSet.cs (1)
85bool IOptionsReader.TryGetOption<T>(OptionKey2 optionKey, out T value)
Options\SolutionOptionSet.cs (1)
79internal (ImmutableArray<KeyValuePair<OptionKey2, object?>> internallyDefined, ImmutableArray<KeyValuePair<OptionKey, object?>> externallyDefined) GetChangedOptions()
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\StructuredAnalyzerConfigOptions.cs (1)
55public bool TryGetOption<T>(OptionKey2 optionKey, out T value)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\IOptionReader.cs (2)
12bool TryGetOption<T>(OptionKey2 optionKey, out T value); 19public bool TryGetOption<T>(OptionKey2 optionKey, out T value)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\Option2.cs (1)
105public static implicit operator OptionKey2(Option2<T> option)