157 references to Feature
Microsoft.CodeAnalysis (9)
CommandLine\CommonCompiler.cs (3)
815
!Arguments.ParseOptions.HasFeature(
Feature
.EnableGeneratorCache) ||
1248
if (Arguments.ParseOptions.HasFeature(
Feature
.PdbPathDeterminism) && !string.IsNullOrEmpty(emitOptions.PdbFilePath))
1253
if (Arguments.ParseOptions.HasFeature(
Feature
.DebugDeterminism))
CommandLine\Feature.cs (1)
37
IEnumerable<string> flags = typeof(
Feature
)
Compilation\Compilation.cs (4)
2194
!HasFeature(CodeAnalysis.
Feature
.UseLegacyStrongNameProvider);
3592
CodeAnalysis.
Feature
.AssertValidFeature(p);
3605
internal bool CatchAnalyzerExceptions => !HasFeature(CodeAnalysis.
Feature
.DebugAnalyzers);
3611
if (Feature(CodeAnalysis.
Feature
.ExperimentalDataSectionStringLiterals) is { } s)
Compilation\ParseOptions.cs (1)
131
Feature
.AssertValidFeature(feature);
Microsoft.CodeAnalysis.CSharp (9)
Compilation\CSharpCompilation.cs (6)
245
internal bool FeatureStrictEnabled => HasFeature(CodeAnalysis.
Feature
.Strict);
253
internal bool IsPeVerifyCompatEnabled => LanguageVersion < LanguageVersion.CSharp7_2 || HasFeature(CodeAnalysis.
Feature
.PEVerifyCompat);
259
internal bool FeatureDisableLengthBasedSwitch => HasFeature(CodeAnalysis.
Feature
.DisableLengthBasedSwitch);
333
return Feature(CodeAnalysis.
Feature
.RunNullableAnalysis) switch
373
_ => Feature(CodeAnalysis.
Feature
.RuntimeAsync) == "on"
4813
bool value = SyntaxTrees.FirstOrDefault()?.Options?.HasFeature(CodeAnalysis.
Feature
.NullablePublicOnly) == true;
CSharpParseOptions.cs (2)
196
ImmutableArray<ImmutableArray<string>> previewNamespaces = Features.TryGetValue(
Feature
.InterceptorsNamespaces, out var namespaces) && namespaces.Length > 0
245
internal bool FileBasedProgram => HasFeature(
Feature
.FileBasedProgram);
Symbols\Source\SourceModuleSymbol.cs (1)
613
return options?.HasFeature(
Feature
.NoRefSafetyRulesAttribute) == true;
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (7)
CommandLineTests.cs (7)
7399
Assert.Equal("UseLegacyStrongNameProvider",
Feature
.UseLegacyStrongNameProvider);
8153
Assert.Equal("noRefSafetyRulesAttribute",
Feature
.NoRefSafetyRulesAttribute);
11662
Assert.Equal("pdb-path-determinism",
Feature
.PdbPathDeterminism);
12323
Assert.Equal("InterceptorsNamespaces",
Feature
.InterceptorsNamespaces);
12333
Assert.Equal("NS1.NS2;NS3.NS4", options.Features[
Feature
.InterceptorsNamespaces]);
12353
Assert.Equal("NS3.NS4", options.Features[
Feature
.InterceptorsNamespaces]);
12377
Assert.False(options.HasFeature(
Feature
.InterceptorsNamespaces));
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (32)
CodeGen\CodeGenAsyncTests.cs (4)
8620
parseOptions = parseOptions.WithFeature(
Feature
.RuntimeAsync, "off");
8670
parseOptions = parseOptions.WithFeature(
Feature
.RuntimeAsync, "off");
8710
parseOptions = parseOptions.WithFeature(
Feature
.RuntimeAsync, "off");
8772
parseOptions = parseOptions.WithFeature(
Feature
.RuntimeAsync, "off");
CodeGen\ForeachTest.cs (1)
1683
var comp = CreateCompilation(source, parseOptions: TestOptions.RegularDefault.WithFeature(
Feature
.RunNullableAnalysis, "never"));
Emit\EmitErrorTests.cs (4)
342
Assert.Equal("experimental-data-section-string-literals",
Feature
.ExperimentalDataSectionStringLiterals);
356
parseOptions: TestOptions.Regular.WithFeature(
Feature
.ExperimentalDataSectionStringLiterals, "1000000"))
360
parseOptions: TestOptions.Regular.WithFeature(
Feature
.ExperimentalDataSectionStringLiterals),
365
parseOptions: TestOptions.Regular.WithFeature(
Feature
.ExperimentalDataSectionStringLiterals, "0"),
Emit\EmitMetadataTests.cs (23)
2950
var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithFeature(
Feature
.ExperimentalDataSectionStringLiterals, "0"));
2956
comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithFeature(
Feature
.ExperimentalDataSectionStringLiterals, "0"));
2962
comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithFeature(
Feature
.ExperimentalDataSectionStringLiterals, "0"));
2971
comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithFeature(
Feature
.ExperimentalDataSectionStringLiterals, "1"));
2980
comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithFeature(
Feature
.ExperimentalDataSectionStringLiterals, "3"));
3023
parseOptions: TestOptions.Regular.WithFeature(
Feature
.ExperimentalDataSectionStringLiterals, null),
3034
parseOptions: TestOptions.Regular.WithFeature(
Feature
.ExperimentalDataSectionStringLiterals, feature),
3042
parseOptions: TestOptions.Regular.WithFeature(
Feature
.ExperimentalDataSectionStringLiterals, "1000"),
3049
parseOptions: TestOptions.Regular.WithFeature(
Feature
.ExperimentalDataSectionStringLiterals, "3"),
3056
parseOptions: TestOptions.Regular.WithFeature(
Feature
.ExperimentalDataSectionStringLiterals, "2"),
3076
parseOptions: TestOptions.Regular.WithFeature(
Feature
.ExperimentalDataSectionStringLiterals, "1"),
3096
parseOptions: TestOptions.Regular.WithFeature(
Feature
.ExperimentalDataSectionStringLiterals, "0"),
3131
parseOptions: TestOptions.Regular.WithFeature(
Feature
.ExperimentalDataSectionStringLiterals, "0"),
3232
parseOptions: TestOptions.Regular.WithFeature(
Feature
.ExperimentalDataSectionStringLiterals, "0"));
3244
parseOptions: TestOptions.Regular.WithFeature(
Feature
.ExperimentalDataSectionStringLiterals, "0"),
3282
parseOptions: TestOptions.Regular.WithFeature(
Feature
.ExperimentalDataSectionStringLiterals, "0"))
3297
parseOptions: TestOptions.Regular.WithFeature(
Feature
.ExperimentalDataSectionStringLiterals, "0"),
3398
parseOptions: TestOptions.Regular.WithFeature(
Feature
.ExperimentalDataSectionStringLiterals, feature),
3423
parseOptions: TestOptions.Regular.WithFeature(
Feature
.ExperimentalDataSectionStringLiterals, "0"),
3465
parseOptions: TestOptions.Regular.WithFeature(
Feature
.ExperimentalDataSectionStringLiterals, "0"),
3511
parseOptions: TestOptions.Regular.WithFeature(
Feature
.ExperimentalDataSectionStringLiterals, "0"),
3548
parseOptions: TestOptions.Regular.WithFeature(
Feature
.ExperimentalDataSectionStringLiterals, "0"),
3623
parseOptions: parseOptions.WithFeature(
Feature
.ExperimentalDataSectionStringLiterals, "0"))
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (3)
Emit\EditAndContinue\EditAndContinueTests.cs (3)
17525
var parseOptions = TestOptions.Regular.WithFeature(
Feature
.ExperimentalDataSectionStringLiterals, "0");
21051
var parseOptions = TestOptions.Regular.WithFeature(
Feature
.ExperimentalDataSectionStringLiterals, "0");
21150
var parseOptions = TestOptions.Regular.WithFeature(
Feature
.ExperimentalDataSectionStringLiterals, "0");
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (9)
Attributes\AttributeTests_Nullable.cs (4)
3473
AssertNullableAttributes(CreateCompilation(source, options: options, parseOptions: parseOptions.WithFeature(
Feature
.NullablePublicOnly)), expectedPublicOnly);
3475
AssertNullableAttributes(CreateCompilation(new[] { source, sourceIVTs }, options: options, parseOptions: parseOptions.WithFeature(
Feature
.NullablePublicOnly)), expectedPublicAndInternal);
3590
comp = CreateCompilation(new[] { sourceAttribute, source }, options: options, parseOptions: parseOptions.WithFeature(
Feature
.NullablePublicOnly));
3649
comp = CreateCompilation(new[] { sourceAttribute, source }, options: options, parseOptions: parseOptions.WithFeature(
Feature
.NullablePublicOnly));
Semantics\PrimaryConstructorTests.cs (3)
3266
var comp = CreateCompilation(source, parseOptions: TestOptions.RegularDefault.WithFeature(
Feature
.RunNullableAnalysis, "never"));
6968
var comp = CreateCompilation(source, parseOptions: TestOptions.RegularPreview.WithFeature(
Feature
.RunNullableAnalysis, "never"), targetFramework: TargetFramework.NetCoreApp);
6994
var comp = CreateCompilation(source, parseOptions: TestOptions.RegularPreview.WithFeature(
Feature
.RunNullableAnalysis, "never"), targetFramework: TargetFramework.NetCoreApp);
Semantics\RecordTests.cs (2)
30563
var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithFeature(
Feature
.RunNullableAnalysis, "never"), targetFramework: TargetFramework.NetCoreApp);
30587
var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithFeature(
Feature
.RunNullableAnalysis, "never"), targetFramework: TargetFramework.NetCoreApp);
Microsoft.CodeAnalysis.CSharp.EndToEnd.UnitTests (1)
EndToEndTests.cs (1)
682
var verifier = CompileAndVerify(files.ToArrayAndFree(), parseOptions: TestOptions.Regular.WithFeature(
Feature
.InterceptorsNamespaces, "global"), expectedOutput: makeExpectedOutput());
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (72)
Semantics\InterceptorsTests.cs (28)
36
private static readonly CSharpParseOptions RegularWithInterceptors = TestOptions.Regular.WithFeature(CodeAnalysis.
Feature
.InterceptorsNamespaces, "global");
37
private static readonly CSharpParseOptions RegularPreviewWithInterceptors = TestOptions.RegularPreview.WithFeature(CodeAnalysis.
Feature
.InterceptorsNamespaces, "global");
166
var comp = CreateCompilation([source, interceptors, s_attributesSource], parseOptions: TestOptions.Regular.WithFeature(CodeAnalysis.
Feature
.InterceptorsNamespaces, "NS"));
172
comp = CreateCompilation([source, interceptors, s_attributesSource], parseOptions: TestOptions.Regular.WithFeature(CodeAnalysis.
Feature
.InterceptorsNamespaces, "NS1.NS2"));
178
var verifier = CompileAndVerify([source, interceptors, s_attributesSource], parseOptions: TestOptions.Regular.WithFeature(CodeAnalysis.
Feature
.InterceptorsNamespaces, "NS1"), expectedOutput: "1");
181
verifier = CompileAndVerify([source, interceptors, s_attributesSource], parseOptions: TestOptions.Regular.WithFeature(CodeAnalysis.
Feature
.InterceptorsNamespaces, "NS1;NS2"), expectedOutput: "1");
188
test(TestOptions.Regular.WithFeature(CodeAnalysis.
Feature
.InterceptorsNamespaces, "NS"), expectedOutput: null,
193
test(TestOptions.Regular.WithFeature(CodeAnalysis.
Feature
.InterceptorsNamespaces, "NS1.NS2"), expectedOutput: null,
198
test(TestOptions.Regular.WithFeature(CodeAnalysis.
Feature
.InterceptorsNamespaces, "NS1"), expectedOutput: "1");
200
test(TestOptions.Regular.WithFeature(CodeAnalysis.
Feature
.InterceptorsNamespaces, "NS1;NS2"), expectedOutput: "1");
295
var comp = CreateCompilation([source, interceptor, s_attributesSource], parseOptions: TestOptions.Regular.WithFeature(CodeAnalysis.
Feature
.InterceptorsNamespaces, featureValue));
304
var verifier = CompileAndVerify([source, interceptor, s_attributesSource], parseOptions: TestOptions.Regular.WithFeature(CodeAnalysis.
Feature
.InterceptorsNamespaces, featureValue), expectedOutput: "1");
332
var comp = CreateCompilation([source, interceptors, s_attributesSource], parseOptions: TestOptions.Regular.WithFeature(CodeAnalysis.
Feature
.InterceptorsNamespaces, ""));
364
var verifier = CompileAndVerify([source, interceptors, s_attributesSource], parseOptions: TestOptions.Regular.WithFeature(CodeAnalysis.
Feature
.InterceptorsNamespaces, "global"), expectedOutput: "1");
367
verifier = CompileAndVerify([source, interceptors, s_attributesSource], parseOptions: TestOptions.Regular.WithFeature(CodeAnalysis.
Feature
.InterceptorsNamespaces, "global"), expectedOutput: "1");
398
var comp = CreateCompilation([source, interceptors, s_attributesSource], parseOptions: TestOptions.Regular.WithFeature(CodeAnalysis.
Feature
.InterceptorsNamespaces, "global.A"));
6826
var comp = CreateCompilation(new[] { source, interceptorSource, s_attributesSource }, parseOptions: TestOptions.Regular.WithFeature(CodeAnalysis.
Feature
.InterceptorsNamespaces, "Interceptors"));
6873
var comp = CreateCompilation(new[] { source, interceptorSource, s_attributesSource }, parseOptions: TestOptions.Regular.WithFeature(CodeAnalysis.
Feature
.InterceptorsNamespaces, "Interceptors"));
6926
var comp = CreateCompilation(new[] { source, interceptorSource, s_attributesSource }, parseOptions: TestOptions.Regular.WithFeature(CodeAnalysis.
Feature
.InterceptorsNamespaces, "Interceptors"));
6975
var comp = CreateCompilation(new[] { source, interceptorSource, s_attributesSource }, parseOptions: TestOptions.Regular.WithFeature(CodeAnalysis.
Feature
.InterceptorsNamespaces, "Interceptors"));
7031
var comp = CreateCompilation(new[] { source, interceptorSource, s_attributesSource }, parseOptions: TestOptions.Regular.WithFeature(CodeAnalysis.
Feature
.InterceptorsNamespaces, "Interceptors"));
7079
var comp = CreateCompilation(new[] { source, interceptorSource, s_attributesSource }, parseOptions: TestOptions.Regular.WithFeature(CodeAnalysis.
Feature
.InterceptorsNamespaces, "Interceptors"));
7126
var comp = CreateCompilation(new[] { source, interceptorSource, s_attributesSource }, parseOptions: featureExists ? TestOptions.Regular.WithFeature(CodeAnalysis.
Feature
.InterceptorsNamespaces, "") : TestOptions.Regular);
7170
var comp = CreateCompilation(new[] { source, interceptorSource, s_attributesSource }, parseOptions: TestOptions.Regular.WithFeature(CodeAnalysis.
Feature
.InterceptorsNamespaces, "Interceptors;Interceptors"));
7198
var comp = CreateCompilation(new[] { source, s_attributesSource }, parseOptions: TestOptions.Regular.WithFeature(CodeAnalysis.
Feature
.InterceptorsNamespaces, "Interceptors"));
7217
var comp = CreateCompilation([], parseOptions: TestOptions.Regular.WithFeature(CodeAnalysis.
Feature
.InterceptorsNamespaces, "Interceptors"));
7257
var comp = CreateCompilation(new[] { source, interceptorSource, s_attributesSource }, parseOptions: TestOptions.Regular.WithFeature(CodeAnalysis.
Feature
.InterceptorsNamespaces, @namespace));
7300
var comp = CreateCompilation([source, interceptorSource, s_attributesSource], parseOptions: TestOptions.Regular.WithFeature(CodeAnalysis.
Feature
.InterceptorsNamespaces, "Interceptors.Nested"));
Semantics\LocalFunctionTests.cs (3)
2361
var comp = CreateCompilation(src, options: TestOptions.UnsafeDebugDll, parseOptions: TestOptions.Regular12.WithFeature(
Feature
.RunNullableAnalysis, "never"));
2435
CreateCompilation(src, options: TestOptions.UnsafeDebugDll, parseOptions: TestOptions.Regular13.WithFeature(
Feature
.RunNullableAnalysis, "never")).VerifyDiagnostics(expectedDiagnostics);
2436
CreateCompilation(src, options: TestOptions.UnsafeDebugDll, parseOptions: TestOptions.RegularPreview.WithFeature(
Feature
.RunNullableAnalysis, "never")).VerifyDiagnostics(expectedDiagnostics);
Semantics\NullableContextTests.cs (23)
185
verify(parseOptions: TestOptions.Regular.WithFeature(
Feature
.RunNullableAnalysis, null), expectedAnalyzedKeysDefault);
186
verify(parseOptions: TestOptions.Regular.WithFeature(
Feature
.RunNullableAnalysis, "always"), expectedAnalyzedKeysAll);
187
verify(parseOptions: TestOptions.Regular.WithFeature(
Feature
.RunNullableAnalysis, "never"));
188
verify(parseOptions: TestOptions.Regular.WithFeature(
Feature
.RunNullableAnalysis, "ALWAYS"), expectedAnalyzedKeysDefault); // unrecognized value (incorrect case) ignored
189
verify(parseOptions: TestOptions.Regular.WithFeature(
Feature
.RunNullableAnalysis, "NEVER"), expectedAnalyzedKeysDefault); // unrecognized value (incorrect case) ignored
190
verify(parseOptions: TestOptions.Regular.WithFeature(
Feature
.RunNullableAnalysis, "true"), expectedAnalyzedKeysDefault); // unrecognized value ignored
191
verify(parseOptions: TestOptions.Regular.WithFeature(
Feature
.RunNullableAnalysis, "false"), expectedAnalyzedKeysDefault); // unrecognized value ignored
192
verify(parseOptions: TestOptions.Regular.WithFeature(
Feature
.RunNullableAnalysis, "unknown"), expectedAnalyzedKeysDefault); // unrecognized value ignored
239
verify(parseOptions: TestOptions.Regular.WithFeature(
Feature
.RunNullableAnalysis, null), expectedAnalyzedKeysDefault);
240
verify(parseOptions: TestOptions.Regular.WithFeature(
Feature
.RunNullableAnalysis, "always"), expectedAnalyzedKeysAll);
241
verify(parseOptions: TestOptions.Regular.WithFeature(
Feature
.RunNullableAnalysis, "never"));
298
verify(parseOptions: TestOptions.Regular.WithFeature(
Feature
.RunNullableAnalysis, null), expectedAnalyzedKeysDefault);
299
verify(parseOptions: TestOptions.Regular.WithFeature(
Feature
.RunNullableAnalysis, "always"), expectedAnalyzedKeysAll);
300
verify(parseOptions: TestOptions.Regular.WithFeature(
Feature
.RunNullableAnalysis, "never"));
340
verify(parseOptions: TestOptions.Regular.WithFeature(
Feature
.RunNullableAnalysis, null), expectedFlowState: true, expectedAnalyzedKeysAll);
341
verify(parseOptions: TestOptions.Regular.WithFeature(
Feature
.RunNullableAnalysis, "always"), expectedFlowState: true, expectedAnalyzedKeysAll);
342
verify(parseOptions: TestOptions.Regular.WithFeature(
Feature
.RunNullableAnalysis, "never"), expectedFlowState: false);
379
verify(parseOptions: TestOptions.Regular.WithFeature(
Feature
.RunNullableAnalysis, null), expectedFlowState: true, expectedAnalyzedKeysAll);
380
verify(parseOptions: TestOptions.Regular.WithFeature(
Feature
.RunNullableAnalysis, "always"), expectedFlowState: true, expectedAnalyzedKeysAll);
381
verify(parseOptions: TestOptions.Regular.WithFeature(
Feature
.RunNullableAnalysis, "never"), expectedFlowState: false);
414
verify(parseOptions: TestOptions.Regular.WithFeature(
Feature
.RunNullableAnalysis, null), expectedFlowState: true, expectedAnalyzedKeysAll);
415
verify(parseOptions: TestOptions.Regular.WithFeature(
Feature
.RunNullableAnalysis, "always"), expectedFlowState: true, expectedAnalyzedKeysAll);
416
verify(parseOptions: TestOptions.Regular.WithFeature(
Feature
.RunNullableAnalysis, "never"), expectedFlowState: false);
Semantics\NullableReferenceTypesTests.cs (8)
5246
var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithFeature(CodeAnalysis.
Feature
.RunNullableAnalysis, "always"), options: TestOptions.DebugDll);
5292
var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithFeature(CodeAnalysis.
Feature
.RunNullableAnalysis, "always"), options: TestOptions.DebugDll.WithNullableContextOptions(NullableContextOptions.Disable));
5338
var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithFeature(CodeAnalysis.
Feature
.RunNullableAnalysis, "always"), options: TestOptions.DebugDll.WithNullableContextOptions(NullableContextOptions.Enable));
10615
var compilation = CreateCompilation(source, parseOptions: TestOptions.Regular.WithFeature(CodeAnalysis.
Feature
.RunNullableAnalysis, "always"), options: WithNullableEnable());
10774
var compilation = CreateCompilation(source, parseOptions: TestOptions.Regular.WithFeature(CodeAnalysis.
Feature
.RunNullableAnalysis, "always"), options: WithNullableEnable());
10937
var compilation = CreateCompilation(source, parseOptions: TestOptions.Regular.WithFeature(CodeAnalysis.
Feature
.RunNullableAnalysis, "always"), options: WithNullableEnable());
11127
var compilation = CreateCompilation(source, parseOptions: TestOptions.Regular.WithFeature(CodeAnalysis.
Feature
.RunNullableAnalysis, "always"), options: WithNullableEnable());
71881
var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithFeature(CodeAnalysis.
Feature
.RunNullableAnalysis, "always"), options: WithNullableEnable());
Semantics\RefFieldTests.cs (8)
8390
var comp = CreateCompilation(source, parseOptions: TestOptions.RegularPreview.WithFeature(
Feature
.PEVerifyCompat), targetFramework: TargetFramework.Net70);
13499
comp = CreateCompilation(source, parseOptions: TestOptions.RegularDefault.WithFeature(
Feature
.RunNullableAnalysis, "never"));
13563
comp = CreateCompilation(source, parseOptions: TestOptions.RegularDefault.WithFeature(
Feature
.RunNullableAnalysis, "never"));
13639
comp = CreateCompilation(source, parseOptions: TestOptions.RegularDefault.WithFeature(
Feature
.RunNullableAnalysis, "never"));
13710
comp = CreateCompilation(source, parseOptions: TestOptions.RegularDefault.WithFeature(
Feature
.RunNullableAnalysis, "never"));
15192
comp = CreateCompilation(source, parseOptions: TestOptions.RegularDefault.WithFeature(
Feature
.RunNullableAnalysis, "never"));
28007
comp = CreateCompilation(source, parseOptions: TestOptions.RegularDefault.WithFeature(
Feature
.RunNullableAnalysis, "never"));
28067
comp = CreateCompilation(source, parseOptions: TestOptions.RegularDefault.WithFeature(
Feature
.RunNullableAnalysis, "never"));
Semantics\UsingStatementTests.cs (1)
1848
var compilation = CreateCompilation(source, parseOptions: TestOptions.Regular.WithFeature(
Feature
.RunNullableAnalysis, "never"));
SourceGeneration\GeneratorDriverTests.cs (1)
4281
var parseOptions = TestOptions.RegularPreview.WithFeature(
Feature
.InterceptorsNamespaces, "global");
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (4)
Symbols\Source\NullablePublicAPITests.cs (4)
1737
var featureFlagOff = TestOptions.Regular8.WithFeature(
Feature
.RunNullableAnalysis, "never");
2623
var comp = CreateCompilation(source, parseOptions: TestOptions.Regular8.WithFeature(
Feature
.RunNullableAnalysis, flagState));
5181
var comp = CreateCompilation(source, parseOptions: runNullableAnalysisAlways ? TestOptions.RegularPreview.WithFeature(
Feature
.RunNullableAnalysis, "always") : TestOptions.RegularPreview);
5219
var comp = CreateCompilation(source, parseOptions: TestOptions.RegularPreview.WithFeature(
Feature
.RunNullableAnalysis, "never"));
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Parsing\IgnoredDirectiveParsingTests.cs (1)
16
private const string FeatureName = CodeAnalysis.
Feature
.FileBasedProgram;
Microsoft.CodeAnalysis.CSharp.Test.Utilities (8)
CSharpTestBase.cs (1)
3207
internal static CSharpParseOptions WithRuntimeAsync(CSharpParseOptions options) => options.WithFeature(
Feature
.RuntimeAsync, "on");
TestOptions.cs (7)
49
public static readonly CSharpParseOptions RegularWithLegacyStrongName = Regular.WithFeature(
Feature
.UseLegacyStrongNameProvider);
104
return options.WithFeatures(options.Features.Concat(new[] { new KeyValuePair<string, string>(
Feature
.Strict, "true") }));
109
return options.WithFeatures(options.Features.Concat(new[] { new KeyValuePair<string, string>(
Feature
.PEVerifyCompat, "true") }));
129
return options.WithFeature(
Feature
.NullablePublicOnly);
134
return options.WithFeature(
Feature
.NoRefSafetyRulesAttribute);
139
return options.WithFeature(
Feature
.DisableLengthBasedSwitch);
142
/// <remarks>Known feature flags should use <see cref="
Feature
"/></remarks>
Microsoft.CodeAnalysis.Rebuild.UnitTests (2)
BasicDeterministicKeyBuilderTests.cs (1)
309
Assert.Equal("debug-determinism", CodeAnalysis.
Feature
.DebugDeterminism);
CSharpDeterministicKeyBuilderTests.cs (1)
493
Assert.Equal("debug-determinism", CodeAnalysis.
Feature
.DebugDeterminism);