19 references to CollectionExpressionPreference
Microsoft.CodeAnalysis.CodeStyle (19)
src\Analyzers\Core\Analyzers\AnalyzerOptionsProvider.cs (1)
43
public CodeStyleOption2<
CollectionExpressionPreference
> PreferCollectionExpression => GetOption(CodeStyleOptions2.PreferCollectionExpression);
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerDiagnosticAnalyzer.cs (3)
140
&& preferExpressionOption.Value == Shared.CodeStyle.
CollectionExpressionPreference
.Never
220
if (preferExpressionOption.Value ==
CollectionExpressionPreference
.Never)
234
var allowSemanticsChange = preferExpressionOption.Value ==
CollectionExpressionPreference
.WhenTypesLooselyMatch;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOptions2.cs (3)
94
internal static readonly PerLanguageOption2<CodeStyleOption2<
CollectionExpressionPreference
>> PreferCollectionExpression = CreatePerLanguageOption(
97
defaultValue: new CodeStyleOption2<
CollectionExpressionPreference
>(
CollectionExpressionPreference
.WhenTypesLooselyMatch, NotificationOption2.Suggestion),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CollectionExpressionPreference.cs (12)
27
CodeStyleOption2<
CollectionExpressionPreference
> value,
28
CodeStyleOption2<
CollectionExpressionPreference
> defaultValue)
32
CollectionExpressionPreference
.Never => never,
33
CollectionExpressionPreference
.WhenTypesExactlyMatch => when_types_exactly_match,
40
public static Optional<CodeStyleOption2<
CollectionExpressionPreference
>> Parse(
41
string optionString, CodeStyleOption2<
CollectionExpressionPreference
> defaultValue)
48
case "false" or never: return new CodeStyleOption2<
CollectionExpressionPreference
>(
CollectionExpressionPreference
.Never, notification);
49
case "true" or when_types_exactly_match: return new CodeStyleOption2<
CollectionExpressionPreference
>(
CollectionExpressionPreference
.WhenTypesExactlyMatch, notification);
50
case when_types_loosely_match: return new CodeStyleOption2<
CollectionExpressionPreference
>(
CollectionExpressionPreference
.WhenTypesLooselyMatch, notification);