20 instantiations of EditorConfigValueSerializer
Microsoft.CodeAnalysis.Workspaces (20)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleHelpers.cs (1)
165
=>
new
(parseValue: str => ParseUnusedExpressionAssignmentPreference(str, defaultValue),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOptions2.cs (6)
97
defaultValue =>
new
(
110
serializer:
new
(
180
defaultValue =>
new
(
209
defaultValue =>
new
(
255
defaultValue =>
new
(
307
defaultValue =>
new
(
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingOptions2.cs (2)
29
serializer: new
EditorConfigValueSerializer
<bool>(str => str == "tab", value => value ? "tab" : "space"))
42
serializer: new
EditorConfigValueSerializer
<string>(
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (10)
23
private static readonly EditorConfigValueSerializer<bool> s_bool =
new
(
27
private static readonly EditorConfigValueSerializer<int> s_int32 =
new
(
31
private static readonly EditorConfigValueSerializer<string> s_string =
new
(
35
private static readonly EditorConfigValueSerializer<bool?> s_nullableBoolean =
new
(
78
=>
new
(parseValue: str => str.Equals(emptyStringRepresentation, StringComparison.Ordinal) ? default(Optional<string>) : EscapeLineBreaks(str),
93
=>
new
(parseValue: str => CodeStyleHelpers.TryParseBoolEditorConfigCodeStyleOption(str, defaultValue, out var result) ? result : new Optional<CodeStyleOption2<bool>>(),
97
=>
new
(parseValue: str => CodeStyleHelpers.TryParseStringEditorConfigCodeStyleOption(str, defaultValue, out var result) ? result : new Optional<CodeStyleOption2<string>>(),
104
=>
new
(
119
=>
new
(parseValue: str => map.TryGetValue(str, out var result) || alternative.TryGetValue(str, out result) ? new Optional<T>(result) : new Optional<T>(),
137
return new
EditorConfigValueSerializer
<T?>(
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer`1.cs (1)
19
public static readonly EditorConfigValueSerializer<T> Unsupported =
new
(
38 references to EditorConfigValueSerializer
Microsoft.CodeAnalysis.Workspaces (38)
Options\Option.cs (1)
70
: this(new OptionDefinition<T>(defaultValue,
EditorConfigValueSerializer
<T>.Unsupported, group, feature + "_" + name, storageMapping, isEditorConfigOption), feature, name, storageLocations)
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)
123
Func<CodeStyleOption2<T>,
EditorConfigValueSerializer
<CodeStyleOption2<T>>>? serializerFactory = null)
135
EditorConfigValueSerializer
<T>? serializer = null)
147
Func<CodeStyleOption2<T>,
EditorConfigValueSerializer
<CodeStyleOption2<T>>>? serializerFactory = null)
164
internal static
EditorConfigValueSerializer
<CodeStyleOption2<UnusedValuePreference>> GetUnusedValuePreferenceSerializer(CodeStyleOption2<UnusedValuePreference> defaultValue)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOptions2.cs (3)
23
OptionGroup group, string name, CodeStyleOption2<T> defaultValue, Func<CodeStyleOption2<T>,
EditorConfigValueSerializer
<CodeStyleOption2<T>>>? serializerFactory = null)
27
OptionGroup group, string name, CodeStyleOption2<T> defaultValue, Func<CodeStyleOption2<T>,
EditorConfigValueSerializer
<CodeStyleOption2<T>>>? serializerFactory = null)
31
OptionGroup group, string name, T defaultValue,
EditorConfigValueSerializer
<T>? serializer = null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\VisualBasic\VisualBasicCodeStyleOptions.cs (1)
20
Func<CodeStyleOption2<T>,
EditorConfigValueSerializer
<CodeStyleOption2<T>>>? serializerFactory = null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyleOptions.cs (1)
27
serializer:
EditorConfigValueSerializer
<NamingStylePreferences>.Unsupported);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer.cs (21)
23
private static readonly
EditorConfigValueSerializer
<bool> s_bool = new(
27
private static readonly
EditorConfigValueSerializer
<int> s_int32 = new(
31
private static readonly
EditorConfigValueSerializer
<string> s_string = new(
35
private static readonly
EditorConfigValueSerializer
<bool?> s_nullableBoolean = new(
56
public static
EditorConfigValueSerializer
<T> GetDefault<T>(bool isEditorConfigOption)
59
return (
EditorConfigValueSerializer
<T>)(object)s_bool;
62
return (
EditorConfigValueSerializer
<T>)(object)s_int32;
65
return (
EditorConfigValueSerializer
<T>)(object)s_string;
68
return (
EditorConfigValueSerializer
<T>)(object)s_nullableBoolean;
74
return
EditorConfigValueSerializer
<T>.Unsupported;
77
public static
EditorConfigValueSerializer
<string> String(string emptyStringRepresentation)
81
public static
EditorConfigValueSerializer
<CodeStyleOption2<T>> CodeStyle<T>(CodeStyleOption2<T> defaultValue)
84
return (
EditorConfigValueSerializer
<CodeStyleOption2<T>>)(object)CodeStyle((CodeStyleOption2<bool>)(object)defaultValue);
87
return (
EditorConfigValueSerializer
<CodeStyleOption2<T>>)(object)CodeStyle((CodeStyleOption2<string>)(object)defaultValue);
92
public static
EditorConfigValueSerializer
<CodeStyleOption2<bool>> CodeStyle(CodeStyleOption2<bool> defaultValue)
96
public static
EditorConfigValueSerializer
<CodeStyleOption2<string>> CodeStyle(CodeStyleOption2<string> defaultValue)
103
public static
EditorConfigValueSerializer
<T> CreateSerializerForEnum<T>() where T : struct, Enum
111
public static
EditorConfigValueSerializer
<T> CreateSerializerForEnum<T>(BidirectionalMap<string, T> map) where T : struct, Enum
118
public static
EditorConfigValueSerializer
<T> CreateSerializerForEnum<T>(BidirectionalMap<string, T> map, ImmutableDictionary<string, T> alternative) where T : struct, Enum
126
public static
EditorConfigValueSerializer
<T> CreateSerializerForEnum<T>(IEnumerable<(string name, T value)> entries, IEnumerable<(string name, T value)> alternativeEntries) where T : struct, Enum
135
public static
EditorConfigValueSerializer
<T?> CreateSerializerForNullableEnum<T>() where T : struct, Enum
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\EditorConfigValueSerializer`1.cs (1)
19
public static readonly
EditorConfigValueSerializer
<T> Unsupported = new(
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\Option2.cs (1)
54
EditorConfigValueSerializer
<T>? serializer = null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionDefinition.cs (2)
112
EditorConfigValueSerializer
<T>? serializer,
119
public new
EditorConfigValueSerializer
<T> Serializer { get; } = serializer ?? EditorConfigValueSerializer.GetDefault<T>(isEditorConfigOption);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\PerLanguageOption2.cs (1)
44
EditorConfigValueSerializer
<T>? serializer = null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\PublicOptionFactory.cs (1)
50
serializer:
EditorConfigValueSerializer
<TPublicValue>.Unsupported, // public option instances do not need to be serialized to editorconfig