71 instantiations of OptionKey2
Microsoft.CodeAnalysis.EditorFeatures (8)
EditorConfigSettings\Data\CodeStyleSetting.cs (4)
62var optionKey = new OptionKey2(option); 82var optionKey = new OptionKey2(option, options.Language); 103var optionKey = new OptionKey2(option); 117var optionKey = new OptionKey2(option, options.Language);
EditorConfigSettings\Data\Setting.cs (3)
49var optionKey = new OptionKey2(option); 62var optionKey = new OptionKey2(option, LanguageNames.CSharp); 77var optionKey = new OptionKey2(option);
EditorConfigSettings\Data\TieredAnalyzerConfigOptions.cs (1)
40initialValue = GlobalOptions.GetOption<TValue>(new OptionKey2(option, option.IsPerLanguage ? Language : null))!;
Microsoft.CodeAnalysis.EditorFeatures.DiagnosticsTests.Utilities (8)
CodeActions\AbstractCodeActionOrUserDiagnosticTest_OptionHelpers.cs (7)
14=> (new OptionKey2(option), enabled); 17=> (new OptionKey2(option, this.GetLanguage()), value); 20=> (new OptionKey2(option), new CodeStyleOption2<T>(enabled, notification)); 23=> (new OptionKey2(option), codeStyle); 26=> (new OptionKey2(option, this.GetLanguage()), new CodeStyleOption2<T>(enabled, notification)); 29=> (new OptionKey2(option, this.GetLanguage()), codeStyle); 32=> (new OptionKey2(option, language), codeStyle);
NamingStyles\NamingStylesTestOptionSets.cs (1)
28_optionKey = new OptionKey2(NamingStyleOptions.NamingPreferences, languageName);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (2)
Options\GlobalOptionsTests.cs (2)
67=> GetOption<T>(new OptionKey2(option)); 70=> GetOption<T>(new OptionKey2(option, languageName));
Microsoft.CodeAnalysis.EditorFeatures.Wpf (1)
InlineHints\InlineHintsKeyProcessorProvider.cs (1)
119_globalOptions.RefreshOption(new OptionKey2(InlineHintsGlobalStateOption.DisplayAllOverride), on);
Microsoft.CodeAnalysis.Workspaces (15)
IOptionReader.cs (6)
38=> options.TryGetOption<T>(new OptionKey2(option), out var value) ? value! : option.DefaultValue; 41=> options.TryGetOption<T>(new OptionKey2(option), out var value) ? value! : defaultValue; 44=> options.TryGetOption<T>(new OptionKey2(option, language), out var value) ? value! : option.DefaultValue; 47=> options.TryGetOption<T>(new OptionKey2(option, language), out var value) ? value! : defaultValue; 50=> options.TryGetOption<CodeStyleOption2<T>>(new OptionKey2(option), out var style) ? style!.Value : defaultValue; 53=> options.TryGetOption<CodeStyleOption2<T>>(new OptionKey2(option, language), out var style) ? style!.Value : defaultValue;
Option2.cs (1)
107=> new(option);
Options\EditorConfig\EditorConfigFileGenerator.cs (2)
47if (configOptions.TryGetOption(new OptionKey2(NamingStyleOptions.NamingPreferences, language), out NamingStylePreferences namingStylePreferences)) 67var optionKey = new OptionKey2(option, option.IsPerLanguage ? language : null);
Options\GlobalOptionService.cs (4)
111=> GetOption<T>(new OptionKey2(option)); 114=> GetOption<T>(new OptionKey2(option, language)); 162=> SetGlobalOption(new OptionKey2(option), value); 165=> SetGlobalOption(new OptionKey2(option, language), value);
Options\SolutionOptionSet.cs (2)
56? _legacyGlobalOptions.GlobalOptions.GetOption<object?>(new OptionKey2(internallyDefinedOption, optionKey.Language)) 82var internallyDefined = _changedOptionKeys.Where(key => key.Option is IOption2).SelectAsArray(key => KeyValuePairUtil.Create(new OptionKey2((IOption2)key.Option, key.Language), _values[key]));
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (5)
OptionsCollection.cs (5)
44=> _options[new OptionKey2(option)] = value; 47=> Add(new OptionKey2(option), value); 53=> Add(new OptionKey2(option), new CodeStyleOption2<T>(value, notification)); 56=> Add(new OptionKey2(option, _languageName), value); 62=> Add(new OptionKey2(option, _languageName), new CodeStyleOption2<T>(value, notification));
Microsoft.CodeAnalysis.Workspaces.UnitTests (10)
WorkspaceServiceTests\GlobalOptionServiceTests.cs (10)
127ImmutableArray.Create(KeyValuePairUtil.Create(new OptionKey2(FormattingOptions2.NewLine, "lang"), (object?)"NEW_LINE")), 180var values = globalOptions.GetOptions(ImmutableArray.Create(new OptionKey2(option1), new OptionKey2(option2))); 185KeyValuePairUtil.Create(new OptionKey2(option1), (object?)5), 186KeyValuePairUtil.Create(new OptionKey2(option2), (object?)6), 187KeyValuePairUtil.Create(new OptionKey2(option3), (object?)3))); 195values = globalOptions.GetOptions(ImmutableArray.Create(new OptionKey2(option1), new OptionKey2(option2), new OptionKey2(option3))); 317var optionKey = new OptionKey2(option, language);
Microsoft.VisualStudio.IntegrationTest.Utilities (4)
InProcess\VisualStudioWorkspace_InProc.cs (3)
135_globalOptions.SetGlobalOption(new OptionKey2(option, LanguageNames.CSharp), option.DefaultValue); 136_globalOptions.SetGlobalOption(new OptionKey2(option, LanguageNames.VisualBasic), option.DefaultValue); 140_globalOptions.SetGlobalOption(new OptionKey2(option, language: null), option.DefaultValue);
WellKnownGlobalOptions.cs (1)
37=> new OptionKey2(GetOption(option), language);
Microsoft.VisualStudio.LanguageServices (10)
EditorConfigSettings\Whitespace\ViewModel\IndentationSizeViewModel.cs (1)
27_key = new OptionKey2(FormattingOptions2.IndentationSize, LanguageNames.CSharp);
EditorConfigSettings\Whitespace\ViewModel\NewLineViewModel.cs (1)
27_key = new OptionKey2(FormattingOptions2.NewLine, LanguageNames.CSharp);
EditorConfigSettings\Whitespace\ViewModel\OperatorPlacementWhenWrappingViewModel.cs (1)
27_key = new OptionKey2(CodeStyleOptions2.OperatorPlacementWhenWrapping);
EditorConfigSettings\Whitespace\ViewModel\TabSizeViewModelFactory.cs (1)
25_key = new OptionKey2(FormattingOptions2.TabSize, LanguageNames.CSharp);
KeybindingReset\KeybindingResetDetector.cs (4)
63new OptionKey2(KeybindingResetOptionsStorage.ReSharperStatus), 64new OptionKey2(KeybindingResetOptionsStorage.NeedsReset)); 221KeyValuePairUtil.Create(new OptionKey2(KeybindingResetOptionsStorage.ReSharperStatus), (object)currentStatus), 222KeyValuePairUtil.Create(new OptionKey2(KeybindingResetOptionsStorage.NeedsReset), (object)needsReset)));
Options\PackageSettingsPersister.cs (2)
46_optionService.RefreshOption(new OptionKey2(SolutionCrawlerOptionsStorage.SolutionBackgroundAnalysisScopeOption), _lazyRoslynPackage.AnalysisScope); 53_optionService.RefreshOption(new OptionKey2(SolutionCrawlerOptionsStorage.SolutionBackgroundAnalysisScopeOption), _lazyRoslynPackage.AnalysisScope);
Microsoft.VisualStudio.LanguageServices.Implementation (6)
Options\OptionStore.cs (6)
63=> (T)GetOption(new OptionKey2(option))!; 66=> (T)GetOption(new OptionKey2(option, language))!; 71return (T)GetOption(new OptionKey2(option, language))!; 92=> SetOption(new OptionKey2(option), value); 95=> SetOption(new OptionKey2(option, language), value); 100SetOption(new OptionKey2(option, language), value);
Microsoft.VisualStudio.LanguageServices.New.IntegrationTests (1)
Options\GlobalOptionsTest.cs (1)
70var key = new OptionKey2(option, language);
Roslyn.VisualStudio.Next.UnitTests (1)
Options\VisualStudioSettingsOptionPersisterTests.cs (1)
126var optionKey = new OptionKey2(CSharpFormattingOptions2.NewLineBeforeOpenBrace);
139 references to OptionKey2
Microsoft.CodeAnalysis.EditorFeatures (13)
EditorConfigSettings\Data\CodeStyleSetting.cs (5)
17public CodeStyleSetting(OptionKey2 optionKey, string description, OptionUpdater updater, SettingLocation location) 62var optionKey = new OptionKey2(option); 82var optionKey = new OptionKey2(option, options.Language); 103var optionKey = new OptionKey2(option); 117var optionKey = new OptionKey2(option, options.Language);
EditorConfigSettings\Data\CodeStyleSetting`1.cs (1)
26OptionKey2 optionKey,
EditorConfigSettings\Data\EnumFlagsSetting.cs (1)
25OptionKey2 optionKey,
EditorConfigSettings\Data\Setting.cs (5)
15public OptionKey2 Key { get; } 21protected Setting(OptionKey2 optionKey, string description, OptionUpdater updater, SettingLocation location) 49var optionKey = new OptionKey2(option); 62var optionKey = new OptionKey2(option, LanguageNames.CSharp); 77var optionKey = new OptionKey2(option);
EditorConfigSettings\Data\Setting`1.cs (1)
19OptionKey2 optionKey,
Microsoft.CodeAnalysis.EditorFeatures.DiagnosticsTests.Utilities (9)
CodeActions\AbstractCodeActionOrUserDiagnosticTest_OptionHelpers.cs (7)
13internal static (OptionKey2, object?) SingleOption<T>(Option2<T> option, T enabled) 16internal (OptionKey2, object?) SingleOption<T>(PerLanguageOption2<T> option, T value) 19internal static (OptionKey2, object) SingleOption<T>(Option2<CodeStyleOption2<T>> option, T enabled, NotificationOption2 notification) 22internal static (OptionKey2, object) SingleOption<T>(Option2<CodeStyleOption2<T>> option, CodeStyleOption2<T> codeStyle) 25internal (OptionKey2, object) SingleOption<T>(PerLanguageOption2<CodeStyleOption2<T>> option, T enabled, NotificationOption2 notification) 28internal (OptionKey2, object) SingleOption<T>(PerLanguageOption2<CodeStyleOption2<T>> option, CodeStyleOption2<T> codeStyle) 31internal static (OptionKey2, object) SingleOption<T>(PerLanguageOption2<CodeStyleOption2<T>> option, CodeStyleOption2<T> codeStyle, string language)
NamingStyles\NamingStylesTestOptionSets.cs (2)
23private readonly OptionKey2 _optionKey; 31public OptionKey2 OptionKey => _optionKey;
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (8)
Options\GlobalOptionsTests.cs (8)
47public readonly List<OptionKey2> AccessedOptionKeys = new(); 55private void OnOptionAccessed(OptionKey2 key) 60bool IOptionsReader.TryGetOption<T>(OptionKey2 optionKey, out T value) 72public T GetOption<T>(OptionKey2 optionKey) 84public ImmutableArray<object?> GetOptions(ImmutableArray<OptionKey2> optionKeys) 87public bool RefreshOption(OptionKey2 optionKey, object? newValue) 96public void SetGlobalOption(OptionKey2 optionKey, object? value) 99public bool SetGlobalOptions(ImmutableArray<KeyValuePair<OptionKey2, object?>> options)
Microsoft.CodeAnalysis.ExternalAccess.Razor (6)
RazorGlobalOptions.cs (6)
62public T GetOption<T>(OptionKey2 optionKey) => throw new NotImplementedException(); 64public bool RefreshOption(OptionKey2 optionKey, object? newValue) => throw new NotImplementedException(); 65public ImmutableArray<object?> GetOptions(ImmutableArray<OptionKey2> optionKeys) => throw new NotImplementedException(); 68public void SetGlobalOption(OptionKey2 optionKey, object? value) => throw new NotImplementedException(); 69public bool SetGlobalOptions(ImmutableArray<KeyValuePair<OptionKey2, object?>> options) => throw new NotImplementedException(); 71bool IOptionsReader.TryGetOption<T>(OptionKey2 optionKey, out T value)
Microsoft.CodeAnalysis.Workspaces (42)
IOptionReader.cs (2)
16bool TryGetOption<T>(OptionKey2 optionKey, out T value); 28public bool TryGetOption<T>(OptionKey2 optionKey, out T value)
Option2.cs (1)
106public static implicit operator OptionKey2(Option2<T> option)
OptionKey2.cs (7)
16internal readonly partial struct OptionKey2 : IEquatable<OptionKey2> 50return obj is OptionKey2 key && 54public bool Equals(OptionKey2 other) 83public static bool operator ==(OptionKey2 left, OptionKey2 right) 86public static bool operator !=(OptionKey2 left, OptionKey2 right)
Options\EditorConfig\EditorConfigFileGenerator.cs (1)
67var optionKey = new OptionKey2(option, option.IsPerLanguage ? language : null);
Options\GlobalOptionService.cs (14)
30private ImmutableDictionary<OptionKey2, object?> _currentValues; 45_currentValues = ImmutableDictionary.Create<OptionKey2, object?>(); 89private static object? LoadOptionFromPersisterOrGetDefault(OptionKey2 optionKey, ImmutableArray<IOptionPersister> persisters) 104bool IOptionsReader.TryGetOption<T>(OptionKey2 optionKey, out T value) 116public T GetOption<T>(OptionKey2 optionKey) 127public ImmutableArray<object?> GetOptions(ImmutableArray<OptionKey2> optionKeys) 135foreach (var optionKey in optionKeys) 144private object? GetOption_NoLock(OptionKey2 optionKey, ImmutableArray<IOptionPersister> persisters) 167public void SetGlobalOption(OptionKey2 optionKey, object? value) 170public bool SetGlobalOptions(ImmutableArray<KeyValuePair<OptionKey2, object?>> options) 173private bool SetGlobalOptions(OneOrMany<KeyValuePair<OptionKey2, object?>> options) 207private static void PersistOption(ImmutableArray<IOptionPersister> persisters, OptionKey2 optionKey, object? value) 218public bool RefreshOption(OptionKey2 optionKey, object? newValue) 259_currentValues = ImmutableDictionary.Create<OptionKey2, object?>();
Options\IGlobalOptionService.cs (5)
30T GetOption<T>(OptionKey2 optionKey); 36ImmutableArray<object?> GetOptions(ImmutableArray<OptionKey2> optionKeys); 48void SetGlobalOption(OptionKey2 optionKey, object? value); 57bool SetGlobalOptions(ImmutableArray<KeyValuePair<OptionKey2, object?>> options); 68bool 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)
62ImmutableArray<KeyValuePair<OptionKey2, object?>> internallyDefinedOptions,
Options\OptionChangedEventArgs.cs (2)
11public OptionKey2 OptionKey { get; } 14internal OptionChangedEventArgs(OptionKey2 optionKey, object? value)
Options\OptionKey.cs (3)
11/// <inheritdoc cref="OptionKey2"/> 15/// <inheritdoc cref="OptionKey2.Option"/> 18/// <inheritdoc cref="OptionKey2.Language"/>
Options\OptionSet.cs (1)
87bool IOptionsReader.TryGetOption<T>(OptionKey2 optionKey, out T value)
Options\SolutionOptionSet.cs (1)
80internal (ImmutableArray<KeyValuePair<OptionKey2, object?>> internallyDefined, ImmutableArray<KeyValuePair<OptionKey, object?>> externallyDefined) GetChangedOptions()
StructuredAnalyzerConfigOptions.cs (1)
72public bool TryGetOption<T>(OptionKey2 optionKey, out T value)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (5)
OptionsCollection.cs (5)
22internal sealed class OptionsCollection : IReadOnlyCollection<KeyValuePair<OptionKey2, object?>>, IOptionsReader 24private readonly Dictionary<OptionKey2, object?> _options = new(); 36public void Add<T>(OptionKey2 optionKey, T value) 77public IEnumerator<KeyValuePair<OptionKey2, object?>> GetEnumerator() 96public bool TryGetOption<T>(OptionKey2 optionKey, out T value)
Microsoft.CodeAnalysis.Workspaces.UnitTests (4)
WorkspaceServiceTests\GlobalOptionServiceTests.cs (4)
41ImmutableArray<KeyValuePair<OptionKey2, object?>>.Empty, 47ImmutableArray<KeyValuePair<OptionKey2, object?>>.Empty, 317var optionKey = new OptionKey2(option, language); 319optionService.SetOptions(ImmutableArray.Create(new KeyValuePair<OptionKey2, object?>(optionKey, newValue)), ImmutableArray<KeyValuePair<OptionKey, object?>>.Empty);
Microsoft.VisualStudio.IntegrationTest.Utilities (2)
WellKnownGlobalOptions.cs (2)
15/// TODO: Options are currently explicitly listed since <see cref="OptionKey2"/> is not serializable. 36public static OptionKey2 GetKey(this WellKnownGlobalOption option, string? language)
Microsoft.VisualStudio.LanguageServices (32)
EditorConfigSettings\Common\IEnumSettingViewModelFactory.cs (1)
12bool IsSupported(OptionKey2 key);
EditorConfigSettings\Whitespace\ViewModel\IndentationSizeViewModel.cs (2)
21private readonly OptionKey2 _key; 35public bool IsSupported(OptionKey2 key) => _key == key;
EditorConfigSettings\Whitespace\ViewModel\NewLineViewModel.cs (2)
21private readonly OptionKey2 _key; 35public bool IsSupported(OptionKey2 key) => _key == key;
EditorConfigSettings\Whitespace\ViewModel\OperatorPlacementWhenWrappingViewModel.cs (2)
21private readonly OptionKey2 _key; 35public bool IsSupported(OptionKey2 key) => _key == key;
EditorConfigSettings\Whitespace\ViewModel\TabSizeViewModelFactory.cs (2)
19private readonly OptionKey2 _key; 33public bool IsSupported(OptionKey2 key) => _key == key;
KeybindingReset\KeybindingResetDetector.cs (2)
62private static readonly ImmutableArray<OptionKey2> s_statusOptions = ImmutableArray.Create<OptionKey2>(
Options\FeatureFlagPersister.cs (1)
24public bool TryFetch(OptionKey2 optionKey, string flagName, [NotNullWhen(true)] out object? value)
Options\LocalUserRegistryOptionPersister.cs (2)
49public bool TryFetch(OptionKey2 optionKey, string path, string key, out object? value) 131public void Persist(OptionKey2 optionKey, string path, string key, object? value)
Options\PackageSettingsPersister.cs (2)
56public bool TryFetch(OptionKey2 optionKey, out object? value) 79public bool TryPersist(OptionKey2 optionKey, object? value)
Options\VisualStudioOptionPersister.cs (4)
41public bool TryFetch(OptionKey2 optionKey, out object? value) 47public bool TryFetch(VisualStudioOptionStorage storage, OptionKey2 optionKey, out object? value) 56public bool TryPersist(OptionKey2 optionKey, object? value) 68public Task PersistAsync(VisualStudioOptionStorage storage, OptionKey2 optionKey, object? value)
Options\VisualStudioOptionPersisterProvider.cs (1)
54private void RefreshOption(OptionKey2 optionKey, object? newValue)
Options\VisualStudioOptionStorage.cs (5)
69public Task PersistAsync(VisualStudioSettingsOptionPersister persister, OptionKey2 optionKey, object? value) 72public bool TryFetch(VisualStudioSettingsOptionPersister persister, OptionKey2 optionKey, out object? value) 91public bool TryFetch(FeatureFlagPersister persister, OptionKey2 optionKey, out object? value) 106public Task PersistAsync(LocalUserRegistryOptionPersister persister, OptionKey2 optionKey, object? value) 112public bool TryFetch(LocalUserRegistryOptionPersister persister, OptionKey2 optionKey, out object? value)
Options\VisualStudioSettingsOptionPersister.cs (6)
35private readonly Action<OptionKey2, object?> _refreshOption; 42private ImmutableDictionary<string, (OptionKey2 primaryOptionKey, string primaryStorageKey)> _storageKeysToMonitorForChanges 43= ImmutableDictionary<string, (OptionKey2, string)>.Empty; 48public VisualStudioSettingsOptionPersister(Action<OptionKey2, object?> refreshOption, ImmutableDictionary<string, Lazy<IVisualStudioStorageReadFallback, OptionNameMetadata>> readFallbacks, ISettingsManager? settingsManager) 77public bool TryFetch(OptionKey2 optionKey, string storageKey, out object? value) 103public Optional<object?> TryReadAndMonitorOptionValue(OptionKey2 primaryOptionKey, string primaryStorageKey, string storageKey, Type storageType, object? defaultValue)
Microsoft.VisualStudio.LanguageServices.CSharp (2)
EditorConfigSettings\BinaryOperatorSpacingOptionsViewModelFactory.cs (1)
29public bool IsSupported(OptionKey2 key)
EditorConfigSettings\LabelPositionOptionsViewModel.cs (1)
32public bool IsSupported(OptionKey2 key)
Microsoft.VisualStudio.LanguageServices.Implementation (13)
Options\OptionLogger.cs (2)
18public static void Log(ImmutableArray<(OptionKey2 key, object? oldValue, object? newValue)> changedOptions) 26private static KeyValueLogMessage Create(OptionKey2 optionKey, object? oldValue, object? currentValue)
Options\OptionStore.cs (11)
27public event EventHandler<OptionKey2>? OptionChanged; 32private ImmutableDictionary<OptionKey2, object?> _globalValues; 37private ImmutableDictionary<OptionKey2, object?> _updatedValues; 43_globalValues = ImmutableDictionary<OptionKey2, object?>.Empty; 44_updatedValues = ImmutableDictionary<OptionKey2, object?>.Empty; 49_globalValues = ImmutableDictionary<OptionKey2, object?>.Empty; 50_updatedValues = ImmutableDictionary<OptionKey2, object?>.Empty; 53public ImmutableArray<(OptionKey2 key, object? oldValue, object? newValue)> GetChangedOptions() 56bool IOptionsReader.TryGetOption<T>(OptionKey2 optionKey, out T value) 74private object? GetOption(OptionKey2 optionKey) 103private void SetOption(OptionKey2 optionKey, object? value)
Microsoft.VisualStudio.LanguageServices.New.IntegrationTests (1)
Options\GlobalOptionsTest.cs (1)
70var key = new OptionKey2(option, language);
Roslyn.VisualStudio.Next.UnitTests (2)
Options\VisualStudioSettingsOptionPersisterTests.cs (2)
123var refreshedOptions = new List<(OptionKey2, object?)>(); 126var optionKey = new OptionKey2(CSharpFormattingOptions2.NewLineBeforeOpenBrace);