public static PerLanguageOption <CodeStyleOption <T> > ToPublicOption <T>( this PerLanguageOption2 <CodeStyleOption2 <T> > option ) { RoslynDebug.Assert(option != null); var codeStyleOption = new CodeStyleOption <T>(option.DefaultValue); var optionDefinition = new OptionDefinition( option.Feature, option.Group, option.Name, defaultValue: codeStyleOption, type: typeof(CodeStyleOption <T>), isPerLanguage: true ); return(new PerLanguageOption <CodeStyleOption <T> >( optionDefinition, option.StorageLocations.As <OptionStorageLocation>() )); }
internal DocumentOptionSet WithChangedOption <T>(PerLanguageOption2 <T> option, T value) => (DocumentOptionSet)WithChangedOption(option, _language, value);
internal T GetOption <T>(PerLanguageOption2 <T> option) => _backingOptionSet.GetOption(option, _language);
/// <summary> /// Gets the value of the option, or the default value if not otherwise set. /// </summary> internal T GetOption <T>(PerLanguageOption2 <T> option, string?language) => OptionsHelpers.GetOption(option, language, _getOptionCore);
/// <summary> /// Creates a new <see cref="OptionSet" /> that contains the changed value. /// </summary> internal OptionSet WithChangedOption <T>(PerLanguageOption2 <T> option, string?language, T value) => WithChangedOption(new OptionKey(option, language), value);
public static T GetOption <T>(PerLanguageOption2 <T> option, string?language, Func <OptionKey, object?> getOption) => GetOption <T>(new OptionKey(option, language), getOption);
internal T GetOption <T>(PerLanguageOption2 <T> option) { return(_backingOptionSet.GetOption(option, _language)); }
[return : MaybeNull] public T GetOption <T>(PerLanguageOption2 <T> option, string?languageName) => _globalOptionService.GetOption(option, languageName);