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