187 references to Enable
ConfigurationSchemaGenerator.Tests (1)
GeneratorTests.cs (1)
1562
var compilationOptions = new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary).WithNullableContextOptions(NullableContextOptions.
Enable
);
Microsoft.Analyzers.Extra.Tests (1)
Resources\RoslynTestUtils.cs (1)
60
.WithNullableContextOptions(NullableContextOptions.
Enable
));
Microsoft.Analyzers.Local.Tests (1)
Resources\RoslynTestUtils.cs (1)
60
.WithNullableContextOptions(NullableContextOptions.
Enable
));
Microsoft.CodeAnalysis.CSharp (5)
Binder\Binder.cs (1)
286
case NullableContextOptions.
Enable
:
CommandLine\CSharpCommandLineParser.cs (4)
429
Debug.Assert(loweredValue == nameof(NullableContextOptions.
Enable
).ToLower());
430
nullableContextOptions = NullableContextOptions.
Enable
;
447
nullableContextOptions = NullableContextOptions.
Enable
;
457
nullableContextOptions = NullableContextOptions.
Enable
;
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (40)
src\Analyzers\CSharp\Tests\ImplementAbstractClass\ImplementAbstractClassTests.cs (1)
182
nullableContextOptions: NullableContextOptions.
Enable
src\Analyzers\CSharp\Tests\RemoveUnnecessaryNullableDirective\CSharpRemoveRedundantNullableDirectiveTests.cs (27)
26
[InlineData(NullableContextOptions.Disable, NullableContextOptions.
Enable
)]
28
[InlineData(NullableContextOptions.Annotations, NullableContextOptions.
Enable
)]
30
[InlineData(NullableContextOptions.Warnings, NullableContextOptions.
Enable
)]
53
[InlineData(NullableContextOptions.
Enable
, NullableContextOptions.Annotations)]
54
[InlineData(NullableContextOptions.
Enable
, NullableContextOptions.Warnings)]
55
[InlineData(NullableContextOptions.
Enable
, NullableContextOptions.
Enable
)]
76
[InlineData(NullableContextOptions.Annotations, NullableContextOptions.
Enable
)]
78
[InlineData(NullableContextOptions.Warnings, NullableContextOptions.
Enable
)]
79
[InlineData(NullableContextOptions.
Enable
, NullableContextOptions.Annotations)]
80
[InlineData(NullableContextOptions.
Enable
, NullableContextOptions.Warnings)]
81
[InlineData(NullableContextOptions.
Enable
, NullableContextOptions.
Enable
)]
104
[InlineData(NullableContextOptions.Disable, NullableContextOptions.
Enable
)]
128
var enable = compilationContext != NullableContextOptions.
Enable
;
170
NullableContextOptions.
Enable
,
193
NullableContextOptions.
Enable
,
222
NullableContextOptions.
Enable
,
250
NullableContextOptions.
Enable
,
278
NullableContextOptions.
Enable
,
308
NullableContextOptions.
Enable
,
338
NullableContextOptions.
Enable
,
369
NullableContextOptions.
Enable
,
398
NullableContextOptions.
Enable
,
428
NullableContextOptions.
Enable
,
459
NullableContextOptions.
Enable
=> "disable",
470
NullableContextOptions.
Enable
=> "enable",
src\Analyzers\CSharp\Tests\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveTests.cs (12)
25
[InlineData(NullableContextOptions.Annotations, NullableContextOptions.
Enable
)]
27
[InlineData(NullableContextOptions.Warnings, NullableContextOptions.
Enable
)]
28
[InlineData(NullableContextOptions.
Enable
, NullableContextOptions.Annotations)]
29
[InlineData(NullableContextOptions.
Enable
, NullableContextOptions.Warnings)]
30
[InlineData(NullableContextOptions.
Enable
, NullableContextOptions.
Enable
)]
52
NullableContextOptions.
Enable
,
74
NullableContextOptions.
Enable
,
101
NullableContextOptions.
Enable
,
131
NullableContextOptions.
Enable
,
157
NullableContextOptions.
Enable
,
225
NullableContextOptions.
Enable
=> "disable",
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (27)
CommandLineTests.cs (27)
4868
Assert.Equal(NullableContextOptions.
Enable
, parsedArgs.CompilationOptions.NullableContextOptions);
4875
Assert.Equal(NullableContextOptions.
Enable
, parsedArgs.CompilationOptions.NullableContextOptions);
4883
Assert.Equal(NullableContextOptions.
Enable
, parsedArgs.CompilationOptions.NullableContextOptions);
4903
Assert.Equal(NullableContextOptions.
Enable
, parsedArgs.CompilationOptions.NullableContextOptions);
4916
Assert.Equal(NullableContextOptions.
Enable
, parsedArgs.CompilationOptions.NullableContextOptions);
4924
Assert.Equal(NullableContextOptions.
Enable
, parsedArgs.CompilationOptions.NullableContextOptions);
4942
Assert.Equal(NullableContextOptions.
Enable
, parsedArgs.CompilationOptions.NullableContextOptions);
4960
Assert.Equal(NullableContextOptions.
Enable
, parsedArgs.CompilationOptions.NullableContextOptions);
4964
Assert.Equal(NullableContextOptions.
Enable
, parsedArgs.CompilationOptions.NullableContextOptions);
4986
Assert.Equal(NullableContextOptions.
Enable
, parsedArgs.CompilationOptions.NullableContextOptions);
5000
Assert.Equal(NullableContextOptions.
Enable
, parsedArgs.CompilationOptions.NullableContextOptions);
5004
Assert.Equal(NullableContextOptions.
Enable
, parsedArgs.CompilationOptions.NullableContextOptions);
5011
Assert.Equal(NullableContextOptions.
Enable
, parsedArgs.CompilationOptions.NullableContextOptions);
5018
Assert.Equal(NullableContextOptions.
Enable
, parsedArgs.CompilationOptions.NullableContextOptions);
5026
Assert.Equal(NullableContextOptions.
Enable
, parsedArgs.CompilationOptions.NullableContextOptions);
5046
Assert.Equal(NullableContextOptions.
Enable
, parsedArgs.CompilationOptions.NullableContextOptions);
5053
Assert.Equal(NullableContextOptions.
Enable
, parsedArgs.CompilationOptions.NullableContextOptions);
5085
Assert.Equal(NullableContextOptions.
Enable
, parsedArgs.CompilationOptions.NullableContextOptions);
5115
Assert.Equal(NullableContextOptions.
Enable
, parsedArgs.CompilationOptions.NullableContextOptions);
5126
Assert.Equal(NullableContextOptions.
Enable
, parsedArgs.CompilationOptions.NullableContextOptions);
5133
Assert.Equal(NullableContextOptions.
Enable
, parsedArgs.CompilationOptions.NullableContextOptions);
5228
Assert.Equal(NullableContextOptions.
Enable
, parsedArgs.CompilationOptions.NullableContextOptions);
5232
Assert.Equal(NullableContextOptions.
Enable
, parsedArgs.CompilationOptions.NullableContextOptions);
5254
Assert.Equal(NullableContextOptions.
Enable
, parsedArgs.CompilationOptions.NullableContextOptions);
5292
Assert.Equal(NullableContextOptions.
Enable
, parsedArgs.CompilationOptions.NullableContextOptions);
5296
Assert.Equal(NullableContextOptions.
Enable
, parsedArgs.CompilationOptions.NullableContextOptions);
5318
Assert.Equal(NullableContextOptions.
Enable
, parsedArgs.CompilationOptions.NullableContextOptions);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
QuickInfo\SemanticQuickInfoSourceTests.cs (1)
8187
await TestWithOptionsAsync(new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary, nullableContextOptions: NullableContextOptions.
Enable
),
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (2)
Emit\EditAndContinue\EditAndContinueTests.cs (1)
259
var compilation0 = CreateCompilation(source0, parseOptions: TestOptions.Regular.WithNoRefSafetyRulesAttribute(), options: TestOptions.DebugDll.WithNullableContextOptions(NullableContextOptions.
Enable
));
PDB\CSharpDeterministicBuildCompilationTests.cs (1)
338
nullableContextOptions: NullableContextOptions.
Enable
);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (3)
Attributes\AttributeTests_Nullable.cs (1)
886
var comp = CreateCompilation(new[] { source }, options: WithNullable(NullableContextOptions.
Enable
), parseOptions: TestOptions.Regular8);
Semantics\PatternMatchingTests5.cs (2)
3033
var comp = CreateCompilation(source, options: TestOptions.DebugDll.WithNullableContextOptions(nullableEnable ? NullableContextOptions.
Enable
: NullableContextOptions.Disable));
3130
var comp = CreateCompilation(source, options: TestOptions.DebugDll.WithNullableContextOptions(nullableEnable ? NullableContextOptions.
Enable
: NullableContextOptions.Disable));
Microsoft.CodeAnalysis.CSharp.Features (1)
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.cs (1)
90
solution = solution.WithProjectCompilationOptions(project.Id, compilationOptions.WithNullableContextOptions(NullableContextOptions.
Enable
));
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (45)
ConvertToRecord\ConvertToRecordCodeRefactoringTests.cs (2)
4701
compilationOptions = compilationOptions.WithNullableContextOptions(NullableContextOptions.
Enable
);
4744
compilationOptions = compilationOptions.WithNullableContextOptions(NullableContextOptions.
Enable
);
EnableNullable\EnableNullableTests.cs (3)
37
solution = solution.WithProjectCompilationOptions(projectId, compilationOptions.WithNullableContextOptions(NullableContextOptions.
Enable
));
53
solution = solution.WithProjectCompilationOptions(projectId, compilationOptions.WithNullableContextOptions(NullableContextOptions.
Enable
));
538
[InlineData(NullableContextOptions.
Enable
)]
src\Analyzers\CSharp\Tests\ImplementAbstractClass\ImplementAbstractClassTests.cs (1)
182
nullableContextOptions: NullableContextOptions.
Enable
src\Analyzers\CSharp\Tests\RemoveUnnecessaryNullableDirective\CSharpRemoveRedundantNullableDirectiveTests.cs (27)
26
[InlineData(NullableContextOptions.Disable, NullableContextOptions.
Enable
)]
28
[InlineData(NullableContextOptions.Annotations, NullableContextOptions.
Enable
)]
30
[InlineData(NullableContextOptions.Warnings, NullableContextOptions.
Enable
)]
53
[InlineData(NullableContextOptions.
Enable
, NullableContextOptions.Annotations)]
54
[InlineData(NullableContextOptions.
Enable
, NullableContextOptions.Warnings)]
55
[InlineData(NullableContextOptions.
Enable
, NullableContextOptions.
Enable
)]
76
[InlineData(NullableContextOptions.Annotations, NullableContextOptions.
Enable
)]
78
[InlineData(NullableContextOptions.Warnings, NullableContextOptions.
Enable
)]
79
[InlineData(NullableContextOptions.
Enable
, NullableContextOptions.Annotations)]
80
[InlineData(NullableContextOptions.
Enable
, NullableContextOptions.Warnings)]
81
[InlineData(NullableContextOptions.
Enable
, NullableContextOptions.
Enable
)]
104
[InlineData(NullableContextOptions.Disable, NullableContextOptions.
Enable
)]
128
var enable = compilationContext != NullableContextOptions.
Enable
;
170
NullableContextOptions.
Enable
,
193
NullableContextOptions.
Enable
,
222
NullableContextOptions.
Enable
,
250
NullableContextOptions.
Enable
,
278
NullableContextOptions.
Enable
,
308
NullableContextOptions.
Enable
,
338
NullableContextOptions.
Enable
,
369
NullableContextOptions.
Enable
,
398
NullableContextOptions.
Enable
,
428
NullableContextOptions.
Enable
,
459
NullableContextOptions.
Enable
=> "disable",
470
NullableContextOptions.
Enable
=> "enable",
src\Analyzers\CSharp\Tests\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveTests.cs (12)
25
[InlineData(NullableContextOptions.Annotations, NullableContextOptions.
Enable
)]
27
[InlineData(NullableContextOptions.Warnings, NullableContextOptions.
Enable
)]
28
[InlineData(NullableContextOptions.
Enable
, NullableContextOptions.Annotations)]
29
[InlineData(NullableContextOptions.
Enable
, NullableContextOptions.Warnings)]
30
[InlineData(NullableContextOptions.
Enable
, NullableContextOptions.
Enable
)]
52
NullableContextOptions.
Enable
,
74
NullableContextOptions.
Enable
,
101
NullableContextOptions.
Enable
,
131
NullableContextOptions.
Enable
,
157
NullableContextOptions.
Enable
,
225
NullableContextOptions.
Enable
=> "disable",
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (49)
Semantics\NullableContextTests.cs (10)
26
[InlineData("#nullable enable", NullableContextOptions.
Enable
, NullableContext.Enabled)]
31
[InlineData("#nullable enable warnings", NullableContextOptions.
Enable
, NullableContext.Enabled | NullableContext.AnnotationsContextInherited)]
36
[InlineData("#nullable enable annotations", NullableContextOptions.
Enable
, NullableContext.Enabled | NullableContext.WarningsContextInherited)]
41
[InlineData("#nullable disable", NullableContextOptions.
Enable
, NullableContext.Disabled)]
46
[InlineData("#nullable disable warnings", NullableContextOptions.
Enable
, NullableContext.AnnotationsEnabled | NullableContext.AnnotationsContextInherited)]
51
[InlineData("#nullable disable annotations", NullableContextOptions.
Enable
, NullableContext.WarningsEnabled | NullableContext.WarningsContextInherited)]
112
Assert.True(NullableContextOptions.
Enable
.AnnotationsEnabled());
113
Assert.True(NullableContextOptions.
Enable
.WarningsEnabled());
503
NullableContextOptions.
Enable
,
1051
verify(new[] { source1, source2, source3, source4 }, TestOptions.ReleaseDll.WithNullableContextOptions(NullableContextOptions.
Enable
), new[] { ".ctor" },
Semantics\NullableReferenceTypesTests.cs (37)
2693
var comp = CreateCompilation(source, options: WithNullable(TestOptions.UnsafeReleaseDll, NullableContextOptions.
Enable
));
5331
var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithFeature("run-nullable-analysis", "always"), options: TestOptions.DebugDll.WithNullableContextOptions(NullableContextOptions.
Enable
));
5419
comp = CreateCompilation(new[] { source0, source1, source2 }, options: TestOptions.DebugDll.WithNullableContextOptions(NullableContextOptions.
Enable
));
5556
var comp = CreateCompilation(source, options: TestOptions.DebugDll.WithNullableContextOptions(NullableContextOptions.
Enable
));
5576
var comp = CreateCompilation(source, options: TestOptions.DebugDll.WithNullableContextOptions(NullableContextOptions.
Enable
));
5598
var comp = CreateCompilation(source, options: TestOptions.DebugDll.WithNullableContextOptions(NullableContextOptions.
Enable
));
5616
var comp = CreateCompilation(source, options: TestOptions.DebugDll.WithNullableContextOptions(NullableContextOptions.
Enable
));
5638
var comp = CreateCompilation(source, options: TestOptions.DebugDll.WithNullableContextOptions(NullableContextOptions.
Enable
));
5667
var comp = CreateCompilation(source, options: TestOptions.DebugDll.WithNullableContextOptions(NullableContextOptions.
Enable
));
5701
var comp = CreateCompilation(new[] { source1, source2 }, options: TestOptions.DebugDll.WithNullableContextOptions(NullableContextOptions.
Enable
));
5736
var comp = CreateCompilation(new[] { source1, source2 }, options: TestOptions.DebugDll.WithNullableContextOptions(NullableContextOptions.
Enable
));
5815
.WithNullableContextOptions(NullableContextOptions.
Enable
)
8589
var comp = CreateCompilation("", options: WithNullable(NullableContextOptions.
Enable
), parseOptions: TestOptions.Regular7_3);
8604
comp = CreateCompilation("", options: WithNullable(NullableContextOptions.
Enable
), parseOptions: TestOptions.Regular8);
8613
comp = CreateCompilation(new string[] { }, options: WithNullable(NullableContextOptions.
Enable
), parseOptions: TestOptions.Regular7_3);
8616
comp = CreateCompilation(new string[] { }, options: WithNullable(NullableContextOptions.
Enable
), parseOptions: TestOptions.Regular8);
32070
options: TestOptions.DebugExe.WithNullableContextOptions(NullableContextOptions.
Enable
));
113793
AssertGetSpeculativeTypeInfo(source, NullableContextOptions.
Enable
, type, "A<System.String!>");
113856
AssertGetSpeculativeTypeInfo(source, NullableContextOptions.
Enable
, type, "A<System.String>");
113909
AssertGetSpeculativeTypeInfo(source, NullableContextOptions.
Enable
, type, "A<System.String>");
113965
AssertGetSpeculativeTypeInfo(source, NullableContextOptions.
Enable
, type, "A<System.String!>");
114018
AssertTryGetSpeculativeSemanticModel(source, NullableContextOptions.
Enable
, type, "A<System.String!>!");
114082
AssertTryGetSpeculativeSemanticModel(source, NullableContextOptions.
Enable
, type, "A<System.String>");
114135
AssertTryGetSpeculativeSemanticModel(source, NullableContextOptions.
Enable
, type, "A<System.String>");
114191
AssertTryGetSpeculativeSemanticModel(source, NullableContextOptions.
Enable
, type, "A<System.String!>!");
114622
assertType(NullableContextOptions.
Enable
);
114653
assertType(NullableContextOptions.
Enable
);
114683
assertType(NullableContextOptions.
Enable
);
114714
assertType(NullableContextOptions.
Enable
);
114744
assertType(NullableContextOptions.
Enable
);
114773
assertType(NullableContextOptions.
Enable
);
125119
assertDiagnosticOptions(NullableContextOptions.
Enable
);
125303
assertDiagnosticOptions(NullableContextOptions.
Enable
);
125452
assertDiagnosticOptions(NullableContextOptions.
Enable
);
125990
assertDiagnosticOptions1(NullableContextOptions.
Enable
);
126137
assertDiagnosticOptions(NullableContextOptions.
Enable
);
157871
var comp = CreateCompilation(src, options: TestOptions.DebugExe.WithNullableContextOptions(NullableContextOptions.
Enable
));
Semantics\TopLevelStatementsTests.cs (2)
183
comp = CreateCompilation(text1, options: TestOptions.DebugExe.WithNullableContextOptions(NullableContextOptions.
Enable
), parseOptions: DefaultParseOptions);
308
comp = CreateCompilation(new[] { text1, text2 }, options: TestOptions.DebugExe.WithNullableContextOptions(NullableContextOptions.
Enable
), parseOptions: DefaultParseOptions);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (3)
Compilation\CSharpCompilationOptionsTests.cs (1)
141
TestProperty((old, value) => old.WithNullableContextOptions(value), opt => opt.NullableContextOptions, NullableContextOptions.
Enable
);
Symbols\PartialPropertiesTests.cs (1)
1624
var comp = CreateCompilation(source, options: TestOptions.DebugDll.WithNullableContextOptions(NullableContextOptions.
Enable
));
Symbols\Source\NullablePublicAPITests.cs (1)
4930
var comp = CreateCompilation(code, options: TestOptions.ReleaseExe.WithNullableContextOptions(NullableContextOptions.
Enable
));
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
CSharpTestBase.cs (1)
779
return WithNullable(options, NullableContextOptions.
Enable
);
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
SolutionTests\SolutionTests.cs (1)
4831
.WithProjectCompilationOptions(projectId, new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary).WithNullableContextOptions(NullableContextOptions.
Enable
));
Microsoft.Gen.ComplianceReports.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
84
new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary).WithNullableContextOptions(NullableContextOptions.
Enable
));
Microsoft.Gen.ContextualOptions.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
84
new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary).WithNullableContextOptions(NullableContextOptions.
Enable
));
Microsoft.Gen.Logging.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
84
new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary).WithNullableContextOptions(NullableContextOptions.
Enable
));
Microsoft.Gen.Metrics.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
84
new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary).WithNullableContextOptions(NullableContextOptions.
Enable
));
Microsoft.Gen.MetricsReports.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
84
new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary).WithNullableContextOptions(NullableContextOptions.
Enable
));
Microsoft.VisualStudio.LanguageServices.CSharp (1)
Utilities\CSharpCompilationOptionsChangingService.cs (1)
48
NullableContextOptions.
Enable
=> "enable",