121 references to Warnings
Microsoft.CodeAnalysis (2)
Compilation\NullableContextOptions.cs (2)
34
Enable =
Warnings
| Annotations,
46
IsFlagSet(context, NullableContextOptions.
Warnings
);
Microsoft.CodeAnalysis.CSharp (4)
Binder\Binder.cs (1)
291
case NullableContextOptions.
Warnings
:
CommandLine\CSharpCommandLineParser.cs (2)
433
Debug.Assert(loweredValue == nameof(NullableContextOptions.
Warnings
).ToLower());
434
nullableContextOptions = NullableContextOptions.
Warnings
;
Compilation\CSharpCompilation.cs (1)
258
(Options.NullableContextOptions & NullableContextOptions.
Warnings
) != 0;
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveRedundantNullableDirectiveDiagnosticAnalyzer.cs (2)
136
flagToChange = NullableContextOptions.
Warnings
;
159
return NullableContextOptions.Annotations | NullableContextOptions.
Warnings
;
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (21)
src\Analyzers\CSharp\Tests\RemoveUnnecessaryNullableDirective\CSharpRemoveRedundantNullableDirectiveTests.cs (16)
25
[InlineData(NullableContextOptions.Disable, NullableContextOptions.
Warnings
)]
27
[InlineData(NullableContextOptions.Annotations, NullableContextOptions.
Warnings
)]
29
[InlineData(NullableContextOptions.
Warnings
, NullableContextOptions.Annotations)]
30
[InlineData(NullableContextOptions.
Warnings
, NullableContextOptions.Enable)]
52
[InlineData(NullableContextOptions.
Warnings
, NullableContextOptions.
Warnings
)]
54
[InlineData(NullableContextOptions.Enable, NullableContextOptions.
Warnings
)]
77
[InlineData(NullableContextOptions.
Warnings
, NullableContextOptions.
Warnings
)]
78
[InlineData(NullableContextOptions.
Warnings
, NullableContextOptions.Enable)]
80
[InlineData(NullableContextOptions.Enable, NullableContextOptions.
Warnings
)]
103
[InlineData(NullableContextOptions.Disable, NullableContextOptions.
Warnings
)]
105
[InlineData(NullableContextOptions.Annotations, NullableContextOptions.
Warnings
)]
106
[InlineData(NullableContextOptions.
Warnings
, NullableContextOptions.Annotations)]
457
NullableContextOptions.
Warnings
=> "disable warnings",
468
NullableContextOptions.
Warnings
=> "enable warnings",
src\Analyzers\CSharp\Tests\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveTests.cs (5)
26
[InlineData(NullableContextOptions.
Warnings
, NullableContextOptions.
Warnings
)]
27
[InlineData(NullableContextOptions.
Warnings
, NullableContextOptions.Enable)]
29
[InlineData(NullableContextOptions.Enable, NullableContextOptions.
Warnings
)]
223
NullableContextOptions.
Warnings
=> "disable warnings",
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (8)
CommandLineTests.cs (8)
5208
Assert.Equal(NullableContextOptions.
Warnings
, parsedArgs.CompilationOptions.NullableContextOptions);
5212
Assert.Equal(NullableContextOptions.
Warnings
, parsedArgs.CompilationOptions.NullableContextOptions);
5216
Assert.Equal(NullableContextOptions.
Warnings
, parsedArgs.CompilationOptions.NullableContextOptions);
5220
Assert.Equal(NullableContextOptions.
Warnings
, parsedArgs.CompilationOptions.NullableContextOptions);
5239
Assert.Equal(NullableContextOptions.
Warnings
, parsedArgs.CompilationOptions.NullableContextOptions);
5246
Assert.Equal(NullableContextOptions.
Warnings
, parsedArgs.CompilationOptions.NullableContextOptions);
5258
Assert.Equal(NullableContextOptions.
Warnings
, parsedArgs.CompilationOptions.NullableContextOptions);
5265
Assert.Equal(NullableContextOptions.
Warnings
, parsedArgs.CompilationOptions.NullableContextOptions);
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (1)
PDB\CSharpDeterministicBuildCompilationTests.cs (1)
342
yield return defaultOptions.WithNullableContextOptions(NullableContextOptions.
Warnings
);
Microsoft.CodeAnalysis.CSharp.Features (2)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveRedundantNullableDirectiveDiagnosticAnalyzer.cs (2)
136
flagToChange = NullableContextOptions.
Warnings
;
159
return NullableContextOptions.Annotations | NullableContextOptions.
Warnings
;
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (22)
EnableNullable\EnableNullableTests.cs (1)
537
[InlineData(NullableContextOptions.
Warnings
)]
src\Analyzers\CSharp\Tests\RemoveUnnecessaryNullableDirective\CSharpRemoveRedundantNullableDirectiveTests.cs (16)
25
[InlineData(NullableContextOptions.Disable, NullableContextOptions.
Warnings
)]
27
[InlineData(NullableContextOptions.Annotations, NullableContextOptions.
Warnings
)]
29
[InlineData(NullableContextOptions.
Warnings
, NullableContextOptions.Annotations)]
30
[InlineData(NullableContextOptions.
Warnings
, NullableContextOptions.Enable)]
52
[InlineData(NullableContextOptions.
Warnings
, NullableContextOptions.
Warnings
)]
54
[InlineData(NullableContextOptions.Enable, NullableContextOptions.
Warnings
)]
77
[InlineData(NullableContextOptions.
Warnings
, NullableContextOptions.
Warnings
)]
78
[InlineData(NullableContextOptions.
Warnings
, NullableContextOptions.Enable)]
80
[InlineData(NullableContextOptions.Enable, NullableContextOptions.
Warnings
)]
103
[InlineData(NullableContextOptions.Disable, NullableContextOptions.
Warnings
)]
105
[InlineData(NullableContextOptions.Annotations, NullableContextOptions.
Warnings
)]
106
[InlineData(NullableContextOptions.
Warnings
, NullableContextOptions.Annotations)]
457
NullableContextOptions.
Warnings
=> "disable warnings",
468
NullableContextOptions.
Warnings
=> "enable warnings",
src\Analyzers\CSharp\Tests\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveTests.cs (5)
26
[InlineData(NullableContextOptions.
Warnings
, NullableContextOptions.
Warnings
)]
27
[InlineData(NullableContextOptions.
Warnings
, NullableContextOptions.Enable)]
29
[InlineData(NullableContextOptions.Enable, NullableContextOptions.
Warnings
)]
223
NullableContextOptions.
Warnings
=> "disable warnings",
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (58)
Semantics\NullableContextTests.cs (12)
25
[InlineData("#nullable enable", NullableContextOptions.
Warnings
, NullableContext.Enabled)]
29
[InlineData("#nullable enable warnings", NullableContextOptions.
Warnings
, NullableContext.WarningsEnabled | NullableContext.AnnotationsContextInherited)]
34
[InlineData("#nullable enable annotations", NullableContextOptions.
Warnings
, NullableContext.Enabled | NullableContext.WarningsContextInherited)]
40
[InlineData("#nullable disable", NullableContextOptions.
Warnings
, NullableContext.Disabled)]
44
[InlineData("#nullable disable warnings", NullableContextOptions.
Warnings
, NullableContext.Disabled | NullableContext.AnnotationsContextInherited)]
49
[InlineData("#nullable disable annotations", NullableContextOptions.
Warnings
, NullableContext.WarningsEnabled | NullableContext.WarningsContextInherited)]
118
Assert.False(NullableContextOptions.
Warnings
.AnnotationsEnabled());
119
Assert.True(NullableContextOptions.
Warnings
.WarningsEnabled());
501
NullableContextOptions.
Warnings
,
555
bool isNullableEnabledForProject = projectContext != null && (projectContext.Value & NullableContextOptions.
Warnings
) != 0;
1652
verify(new[] { source }, projectContext: NullableContextOptions.
Warnings
, expectedAnalyzedKeys: new[] { "<Main>$" },
2213
bool isNullableEnabledForProject = projectContext != null && (projectContext.Value & NullableContextOptions.
Warnings
) != 0;
Semantics\NullableReferenceTypesTests.cs (46)
6292
var comp = CreateCompilation(source, options: WithNullable(NullableContextOptions.
Warnings
));
8595
comp = CreateCompilation("", options: WithNullable(NullableContextOptions.
Warnings
), parseOptions: TestOptions.Regular7_3);
8607
comp = CreateCompilation("", options: WithNullable(NullableContextOptions.
Warnings
), parseOptions: TestOptions.Regular8);
8619
comp = CreateCompilation(new string[] { }, options: WithNullable(NullableContextOptions.
Warnings
), parseOptions: TestOptions.Regular7_3);
8622
comp = CreateCompilation(new string[] { }, options: WithNullable(NullableContextOptions.
Warnings
), parseOptions: TestOptions.Regular8);
98649
var comp3 = CreateCompilation(new[] { source2 }, references: new[] { comp2.ToMetadataReference() }, options: WithNullable(NullableContextOptions.
Warnings
), parseOptions: TestOptions.Regular8);
99337
var comp3 = CreateCompilation(new[] { source2 }, references: new[] { comp2.ToMetadataReference() }, options: WithNullable(NullableContextOptions.
Warnings
), parseOptions: TestOptions.Regular8);
100114
var comp3 = CreateCompilation(new[] { source2 }, references: new[] { comp2.ToMetadataReference() }, options: WithNullable(NullableContextOptions.
Warnings
));
100233
var comp3 = CreateCompilation(new[] { source2 }, references: new[] { comp2.ToMetadataReference() }, options: WithNullable(NullableContextOptions.
Warnings
));
101370
var comp2 = CreateCompilation(source2, options: WithNullable(NullableContextOptions.
Warnings
), references: new[] { reference });
113223
assertNonNullTypesContext(source1, NullableContextOptions.
Warnings
);
113226
assertNonNullTypesContext(source2, NullableContextOptions.
Warnings
);
113289
assertNonNullTypesContext(source1, NullableContextOptions.
Warnings
);
113292
assertNonNullTypesContext(source2, NullableContextOptions.
Warnings
);
113361
assertNonNullTypesContext(source1, NullableContextOptions.
Warnings
);
113364
assertNonNullTypesContext(source2, NullableContextOptions.
Warnings
);
113416
assertNonNullTypesContext(NullableContextOptions.
Warnings
);
113471
assertNonNullTypesContext(NullableContextOptions.
Warnings
);
113526
assertNonNullTypesContext(NullableContextOptions.
Warnings
);
113584
assertNonNullTypesContext(NullableContextOptions.
Warnings
);
113642
assertNonNullTypesContext(NullableContextOptions.
Warnings
);
113685
assertNonNullTypesContext(NullableContextOptions.
Warnings
);
113740
assertNonNullTypesContext(NullableContextOptions.
Warnings
);
113831
AssertGetSpeculativeTypeInfo(source, NullableContextOptions.
Warnings
, type, "A<System.String>");
113882
AssertGetSpeculativeTypeInfo(source, NullableContextOptions.
Warnings
, type, "A<System.String!>");
113937
AssertGetSpeculativeTypeInfo(source, NullableContextOptions.
Warnings
, type, "A<System.String!>");
113994
AssertGetSpeculativeTypeInfo(source, NullableContextOptions.
Warnings
, type, "A<System.String>");
114057
AssertTryGetSpeculativeSemanticModel(source, NullableContextOptions.
Warnings
, type, "A<System.String>!");
114108
AssertTryGetSpeculativeSemanticModel(source, NullableContextOptions.
Warnings
, type, "A<System.String!>!");
114163
AssertTryGetSpeculativeSemanticModel(source, NullableContextOptions.
Warnings
, type, "A<System.String!>!");
114220
AssertTryGetSpeculativeSemanticModel(source, NullableContextOptions.
Warnings
, type, "A<System.String>");
114242
assertNonNullTypesContext(NullableContextOptions.
Warnings
);
114300
assertNonNullTypesContext(NullableContextOptions.
Warnings
);
114361
assertNonNullTypesContext(NullableContextOptions.
Warnings
);
114419
assertNonNullTypesContext(NullableContextOptions.
Warnings
);
114455
assertNonNullTypesContext(NullableContextOptions.
Warnings
);
114492
assertNonNullTypesContext(NullableContextOptions.
Warnings
);
114528
assertNonNullTypesContext(NullableContextOptions.
Warnings
);
114558
assertNonNullTypesContext(NullableContextOptions.
Warnings
);
114590
assertNonNullTypesContext(NullableContextOptions.
Warnings
);
123810
comp = CreateCompilation(new[] { source }, options: WithNullable(NullableContextOptions.
Warnings
));
125120
assertDiagnosticOptions(NullableContextOptions.
Warnings
);
125304
assertDiagnosticOptions(NullableContextOptions.
Warnings
);
125453
assertDiagnosticOptions(NullableContextOptions.
Warnings
);
125991
assertDiagnosticOptions1(NullableContextOptions.
Warnings
);
126138
assertDiagnosticOptions(NullableContextOptions.
Warnings
);
Microsoft.VisualStudio.LanguageServices.CSharp (1)
Utilities\CSharpCompilationOptionsChangingService.cs (1)
49
NullableContextOptions.
Warnings
=> "warnings",