21 instantiations of EditorConfigValueSerializer
Microsoft.CodeAnalysis.Workspaces (21)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleHelpers.cs (1)
166=> new(parseValue: str => ParseUnusedExpressionAssignmentPreference(str, defaultValue),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOptions2.cs (6)
98defaultValue => new( 111serializer: new( 181defaultValue => new( 210defaultValue => new( 256defaultValue => new( 308defaultValue => new(
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingOptions2.cs (2)
28serializer: new EditorConfigValueSerializer<bool>(str => str == "tab", value => value ? "tab" : "space")) 41serializer: new EditorConfigValueSerializer<string>(
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (11)
24private static readonly EditorConfigValueSerializer<bool> s_bool = new( 28private static readonly EditorConfigValueSerializer<int> s_int32 = new( 32private static readonly EditorConfigValueSerializer<string> s_string = new( 36private static readonly EditorConfigValueSerializer<bool?> s_nullableBoolean = new( 79=> new(parseValue: str => str.Equals(emptyStringRepresentation, StringComparison.Ordinal) ? default(Optional<string>) : EscapeLineBreaks(str), 94=> new(parseValue: str => CodeStyleHelpers.TryParseBoolEditorConfigCodeStyleOption(str, defaultValue, out var result) ? result : new Optional<CodeStyleOption2<bool>>(), 98=> new(parseValue: str => CodeStyleHelpers.TryParseStringEditorConfigCodeStyleOption(str, defaultValue, out var result) ? result : new Optional<CodeStyleOption2<string>>(), 105=> new( 120=> new(parseValue: str => map.TryGetValue(str, out var result) || alternative.TryGetValue(str, out result) ? new Optional<T>(result) : new Optional<T>(), 138return new EditorConfigValueSerializer<T?>( 212return new(
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer`1.cs (1)
19public static readonly EditorConfigValueSerializer<T> Unsupported = new(
41 references to EditorConfigValueSerializer
Microsoft.CodeAnalysis.Workspaces (41)
Options\Option.cs (1)
70: this(new OptionDefinition<T>(defaultValue, EditorConfigValueSerializer<T>.Unsupported, group, feature + "_" + name, storageMapping, isEditorConfigOption), feature, name, storageLocations)
Options\OptionExtensions.cs (1)
25var newSerializer = EditorConfigValueSerializer.ConvertEnumSerializer<TFromEnum, TToEnum>(definition.Serializer);
Options\PerLanguageOption.cs (1)
62: this(new OptionDefinition<T>(defaultValue, EditorConfigValueSerializer<T>.Unsupported, group, feature + "_" + name, storageMapping, isEditorConfigOption), feature, name, storageLocations)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleHelpers.cs (4)
124Func<CodeStyleOption2<T>, EditorConfigValueSerializer<CodeStyleOption2<T>>>? serializerFactory = null) 136EditorConfigValueSerializer<T>? serializer = null) 148Func<CodeStyleOption2<T>, EditorConfigValueSerializer<CodeStyleOption2<T>>>? serializerFactory = null) 165internal static EditorConfigValueSerializer<CodeStyleOption2<UnusedValuePreference>> GetUnusedValuePreferenceSerializer(CodeStyleOption2<UnusedValuePreference> defaultValue)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOptions2.cs (3)
24OptionGroup group, string name, CodeStyleOption2<T> defaultValue, Func<CodeStyleOption2<T>, EditorConfigValueSerializer<CodeStyleOption2<T>>>? serializerFactory = null) 28OptionGroup group, string name, CodeStyleOption2<T> defaultValue, Func<CodeStyleOption2<T>, EditorConfigValueSerializer<CodeStyleOption2<T>>>? serializerFactory = null) 32OptionGroup group, string name, T defaultValue, EditorConfigValueSerializer<T>? serializer = null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\VisualBasic\VisualBasicCodeStyleOptions.cs (1)
20Func<CodeStyleOption2<T>, EditorConfigValueSerializer<CodeStyleOption2<T>>>? serializerFactory = null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyleOptions.cs (1)
27serializer: EditorConfigValueSerializer<NamingStylePreferences>.Unsupported);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (23)
24private static readonly EditorConfigValueSerializer<bool> s_bool = new( 28private static readonly EditorConfigValueSerializer<int> s_int32 = new( 32private static readonly EditorConfigValueSerializer<string> s_string = new( 36private static readonly EditorConfigValueSerializer<bool?> s_nullableBoolean = new( 57public static EditorConfigValueSerializer<T> GetDefault<T>(bool isEditorConfigOption) 60return (EditorConfigValueSerializer<T>)(object)s_bool; 63return (EditorConfigValueSerializer<T>)(object)s_int32; 66return (EditorConfigValueSerializer<T>)(object)s_string; 69return (EditorConfigValueSerializer<T>)(object)s_nullableBoolean; 75return EditorConfigValueSerializer<T>.Unsupported; 78public static EditorConfigValueSerializer<string> String(string emptyStringRepresentation) 82public static EditorConfigValueSerializer<CodeStyleOption2<T>> CodeStyle<T>(CodeStyleOption2<T> defaultValue) 85return (EditorConfigValueSerializer<CodeStyleOption2<T>>)(object)CodeStyle((CodeStyleOption2<bool>)(object)defaultValue); 88return (EditorConfigValueSerializer<CodeStyleOption2<T>>)(object)CodeStyle((CodeStyleOption2<string>)(object)defaultValue); 93public static EditorConfigValueSerializer<CodeStyleOption2<bool>> CodeStyle(CodeStyleOption2<bool> defaultValue) 97public static EditorConfigValueSerializer<CodeStyleOption2<string>> CodeStyle(CodeStyleOption2<string> defaultValue) 104public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>() where T : struct, Enum 112public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(BidirectionalMap<string, T> map) where T : struct, Enum 119public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(BidirectionalMap<string, T> map, ImmutableDictionary<string, T> alternative) where T : struct, Enum 127public static EditorConfigValueSerializer<T> CreateSerializerForEnum<T>(IEnumerable<(string name, T value)> entries, IEnumerable<(string name, T value)> alternativeEntries) where T : struct, Enum 136public static EditorConfigValueSerializer<T?> CreateSerializerForNullableEnum<T>() where T : struct, Enum 208public static EditorConfigValueSerializer<TToEnum>? ConvertEnumSerializer<TFromEnum, TToEnum>(EditorConfigValueSerializer<TFromEnum> serializer)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer`1.cs (1)
19public static readonly EditorConfigValueSerializer<T> Unsupported = new(
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\Option2.cs (1)
54EditorConfigValueSerializer<T>? serializer = null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionDefinition.cs (2)
112EditorConfigValueSerializer<T>? serializer, 119public new EditorConfigValueSerializer<T> Serializer { get; } = serializer ?? EditorConfigValueSerializer.GetDefault<T>(isEditorConfigOption);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\PerLanguageOption2.cs (1)
44EditorConfigValueSerializer<T>? serializer = null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\PublicOptionFactory.cs (1)
50serializer: EditorConfigValueSerializer<TPublicValue>.Unsupported, // public option instances do not need to be serialized to editorconfig