121 references to Warnings
Microsoft.CodeAnalysis (2)
Compilation\NullableContextOptions.cs (2)
34Enable = Warnings | Annotations, 46IsFlagSet(context, NullableContextOptions.Warnings);
Microsoft.CodeAnalysis.CSharp (4)
Binder\Binder.cs (1)
291case NullableContextOptions.Warnings:
CommandLine\CSharpCommandLineParser.cs (2)
433Debug.Assert(loweredValue == nameof(NullableContextOptions.Warnings).ToLower()); 434nullableContextOptions = 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)
136flagToChange = NullableContextOptions.Warnings; 159return 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)] 457NullableContextOptions.Warnings => "disable warnings", 468NullableContextOptions.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)] 223NullableContextOptions.Warnings => "disable warnings",
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (8)
CommandLineTests.cs (8)
5208Assert.Equal(NullableContextOptions.Warnings, parsedArgs.CompilationOptions.NullableContextOptions); 5212Assert.Equal(NullableContextOptions.Warnings, parsedArgs.CompilationOptions.NullableContextOptions); 5216Assert.Equal(NullableContextOptions.Warnings, parsedArgs.CompilationOptions.NullableContextOptions); 5220Assert.Equal(NullableContextOptions.Warnings, parsedArgs.CompilationOptions.NullableContextOptions); 5239Assert.Equal(NullableContextOptions.Warnings, parsedArgs.CompilationOptions.NullableContextOptions); 5246Assert.Equal(NullableContextOptions.Warnings, parsedArgs.CompilationOptions.NullableContextOptions); 5258Assert.Equal(NullableContextOptions.Warnings, parsedArgs.CompilationOptions.NullableContextOptions); 5265Assert.Equal(NullableContextOptions.Warnings, parsedArgs.CompilationOptions.NullableContextOptions);
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (1)
PDB\CSharpDeterministicBuildCompilationTests.cs (1)
342yield return defaultOptions.WithNullableContextOptions(NullableContextOptions.Warnings);
Microsoft.CodeAnalysis.CSharp.Features (2)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveRedundantNullableDirectiveDiagnosticAnalyzer.cs (2)
136flagToChange = NullableContextOptions.Warnings; 159return 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)] 457NullableContextOptions.Warnings => "disable warnings", 468NullableContextOptions.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)] 223NullableContextOptions.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)] 118Assert.False(NullableContextOptions.Warnings.AnnotationsEnabled()); 119Assert.True(NullableContextOptions.Warnings.WarningsEnabled()); 501NullableContextOptions.Warnings, 555bool isNullableEnabledForProject = projectContext != null && (projectContext.Value & NullableContextOptions.Warnings) != 0; 1652verify(new[] { source }, projectContext: NullableContextOptions.Warnings, expectedAnalyzedKeys: new[] { "<Main>$" }, 2213bool isNullableEnabledForProject = projectContext != null && (projectContext.Value & NullableContextOptions.Warnings) != 0;
Semantics\NullableReferenceTypesTests.cs (46)
6292var comp = CreateCompilation(source, options: WithNullable(NullableContextOptions.Warnings)); 8595comp = CreateCompilation("", options: WithNullable(NullableContextOptions.Warnings), parseOptions: TestOptions.Regular7_3); 8607comp = CreateCompilation("", options: WithNullable(NullableContextOptions.Warnings), parseOptions: TestOptions.Regular8); 8619comp = CreateCompilation(new string[] { }, options: WithNullable(NullableContextOptions.Warnings), parseOptions: TestOptions.Regular7_3); 8622comp = CreateCompilation(new string[] { }, options: WithNullable(NullableContextOptions.Warnings), parseOptions: TestOptions.Regular8); 98649var comp3 = CreateCompilation(new[] { source2 }, references: new[] { comp2.ToMetadataReference() }, options: WithNullable(NullableContextOptions.Warnings), parseOptions: TestOptions.Regular8); 99337var comp3 = CreateCompilation(new[] { source2 }, references: new[] { comp2.ToMetadataReference() }, options: WithNullable(NullableContextOptions.Warnings), parseOptions: TestOptions.Regular8); 100114var comp3 = CreateCompilation(new[] { source2 }, references: new[] { comp2.ToMetadataReference() }, options: WithNullable(NullableContextOptions.Warnings)); 100233var comp3 = CreateCompilation(new[] { source2 }, references: new[] { comp2.ToMetadataReference() }, options: WithNullable(NullableContextOptions.Warnings)); 101370var comp2 = CreateCompilation(source2, options: WithNullable(NullableContextOptions.Warnings), references: new[] { reference }); 113223assertNonNullTypesContext(source1, NullableContextOptions.Warnings); 113226assertNonNullTypesContext(source2, NullableContextOptions.Warnings); 113289assertNonNullTypesContext(source1, NullableContextOptions.Warnings); 113292assertNonNullTypesContext(source2, NullableContextOptions.Warnings); 113361assertNonNullTypesContext(source1, NullableContextOptions.Warnings); 113364assertNonNullTypesContext(source2, NullableContextOptions.Warnings); 113416assertNonNullTypesContext(NullableContextOptions.Warnings); 113471assertNonNullTypesContext(NullableContextOptions.Warnings); 113526assertNonNullTypesContext(NullableContextOptions.Warnings); 113584assertNonNullTypesContext(NullableContextOptions.Warnings); 113642assertNonNullTypesContext(NullableContextOptions.Warnings); 113685assertNonNullTypesContext(NullableContextOptions.Warnings); 113740assertNonNullTypesContext(NullableContextOptions.Warnings); 113831AssertGetSpeculativeTypeInfo(source, NullableContextOptions.Warnings, type, "A<System.String>"); 113882AssertGetSpeculativeTypeInfo(source, NullableContextOptions.Warnings, type, "A<System.String!>"); 113937AssertGetSpeculativeTypeInfo(source, NullableContextOptions.Warnings, type, "A<System.String!>"); 113994AssertGetSpeculativeTypeInfo(source, NullableContextOptions.Warnings, type, "A<System.String>"); 114057AssertTryGetSpeculativeSemanticModel(source, NullableContextOptions.Warnings, type, "A<System.String>!"); 114108AssertTryGetSpeculativeSemanticModel(source, NullableContextOptions.Warnings, type, "A<System.String!>!"); 114163AssertTryGetSpeculativeSemanticModel(source, NullableContextOptions.Warnings, type, "A<System.String!>!"); 114220AssertTryGetSpeculativeSemanticModel(source, NullableContextOptions.Warnings, type, "A<System.String>"); 114242assertNonNullTypesContext(NullableContextOptions.Warnings); 114300assertNonNullTypesContext(NullableContextOptions.Warnings); 114361assertNonNullTypesContext(NullableContextOptions.Warnings); 114419assertNonNullTypesContext(NullableContextOptions.Warnings); 114455assertNonNullTypesContext(NullableContextOptions.Warnings); 114492assertNonNullTypesContext(NullableContextOptions.Warnings); 114528assertNonNullTypesContext(NullableContextOptions.Warnings); 114558assertNonNullTypesContext(NullableContextOptions.Warnings); 114590assertNonNullTypesContext(NullableContextOptions.Warnings); 123810comp = CreateCompilation(new[] { source }, options: WithNullable(NullableContextOptions.Warnings)); 125120assertDiagnosticOptions(NullableContextOptions.Warnings); 125304assertDiagnosticOptions(NullableContextOptions.Warnings); 125453assertDiagnosticOptions(NullableContextOptions.Warnings); 125991assertDiagnosticOptions1(NullableContextOptions.Warnings); 126138assertDiagnosticOptions(NullableContextOptions.Warnings);
Microsoft.VisualStudio.LanguageServices.CSharp (1)
Utilities\CSharpCompilationOptionsChangingService.cs (1)
49NullableContextOptions.Warnings => "warnings",