2 instantiations of NullableContextState
Microsoft.CodeAnalysis.CSharp (2)
Syntax\NullableContextStateMap.cs (2)
62=> new NullableContextState( 70var searchContext = new NullableContextState(position, warningsState: NullableContextState.State.Unknown, annotationsState: NullableContextState.State.Unknown);
39 references to NullableContextState
Microsoft.CodeAnalysis.CSharp (38)
Binder\Binder.cs (5)
255Syntax.NullableContextState context = csTree.GetNullableContextState(position); 259Syntax.NullableContextState.State.Enabled => true, 260Syntax.NullableContextState.State.Disabled => false, 261Syntax.NullableContextState.State.ExplicitlyRestored => GetGlobalAnnotationState(), 262Syntax.NullableContextState.State.Unknown =>
Compilation\CSharpDiagnosticFilter.cs (5)
160Syntax.NullableContextState.State? warningsState = tree?.GetNullableContextState(position).WarningsState; 163Syntax.NullableContextState.State.Enabled => true, 164Syntax.NullableContextState.State.Disabled => false, 165Syntax.NullableContextState.State.ExplicitlyRestored => nullableOption.WarningsEnabled(), 166Syntax.NullableContextState.State.Unknown =>
Compilation\CSharpSemanticModel.cs (5)
5444NullableContextState contextState = syntaxTree.GetNullableContextState(position); 5448NullableContextState.State.Enabled => NullableContext.AnnotationsEnabled, 5449NullableContextState.State.Disabled => NullableContext.Disabled, 5455NullableContextState.State.Enabled => NullableContext.WarningsEnabled, 5456NullableContextState.State.Disabled => NullableContext.Disabled,
Syntax\CSharpSyntaxTree.cs (1)
717internal NullableContextState GetNullableContextState(int position)
Syntax\NullableContextStateMap.cs (22)
42private readonly ImmutableArray<NullableContextState> _contexts; 50private NullableContextStateMap(ImmutableArray<NullableContextState> contexts) 61private static NullableContextState GetContextForFileStart() 64warningsState: NullableContextState.State.Unknown, 65annotationsState: NullableContextState.State.Unknown); 70var searchContext = new NullableContextState(position, warningsState: NullableContextState.State.Unknown, annotationsState: NullableContextState.State.Unknown); 91internal NullableContextState GetContextState(int position) 107var context = index < 0 ? GetContextForFileStart() : _contexts[index]; 114case NullableContextState.State.Enabled: 116case NullableContextState.State.Unknown: 117case NullableContextState.State.ExplicitlyRestored: 136private static ImmutableArray<NullableContextState> GetContexts(SyntaxTree tree) 138var previousContext = GetContextForFileStart(); 140var builder = ArrayBuilder<NullableContextState>.GetInstance(); 156SyntaxKind.EnableKeyword => NullableContextState.State.Enabled, 157SyntaxKind.DisableKeyword => NullableContextState.State.Disabled, 158SyntaxKind.RestoreKeyword => NullableContextState.State.ExplicitlyRestored, 177private sealed class PositionComparer : IComparer<NullableContextState> 181public int Compare(NullableContextState x, NullableContextState y)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1)
Semantics\NullableContextTests.cs (1)
585var actualState = tree.GetNullableContextState(syntax.SpanStart);