51 references to SemanticModelOptions
Microsoft.CodeAnalysis (13)
Compilation\Compilation.cs (8)
317
=> GetSemanticModel(syntaxTree, ignoreAccessibility ?
SemanticModelOptions
.IgnoreAccessibility :
SemanticModelOptions
.None);
321
public SemanticModel GetSemanticModel(SyntaxTree syntaxTree,
SemanticModelOptions
options)
326
/// If <see cref="SemanticModelProvider"/> is non-null, it attempts to use <see cref="SemanticModelProvider.GetSemanticModel(SyntaxTree, Compilation,
SemanticModelOptions
)"/>
327
/// to get a semantic model. Otherwise, it creates a new semantic model using <see cref="CreateSemanticModel(SyntaxTree,
SemanticModelOptions
)"/>.
330
protected abstract SemanticModel CommonGetSemanticModel(SyntaxTree syntaxTree,
SemanticModelOptions
options);
334
/// Unlike the <see cref="GetSemanticModel(SyntaxTree, bool)"/> and <see cref="CommonGetSemanticModel(SyntaxTree,
SemanticModelOptions
)"/>,
338
internal abstract SemanticModel CreateSemanticModel(SyntaxTree syntaxTree,
SemanticModelOptions
options);
Compilation\SemanticModel.cs (1)
18
/// an instance is obtained by a call to <see cref="Compilation.GetSemanticModel(SyntaxTree,
SemanticModelOptions
)"/>.
Compilation\SemanticModelProvider.cs (1)
18
public abstract SemanticModel GetSemanticModel(SyntaxTree tree, Compilation compilation,
SemanticModelOptions
options = default);
DiagnosticAnalyzer\CachingSemanticModelProvider.cs (3)
36
public override SemanticModel GetSemanticModel(SyntaxTree tree, Compilation compilation,
SemanticModelOptions
options = default)
68
public SemanticModel GetSemanticModel(SyntaxTree tree,
SemanticModelOptions
options)
71
return options ==
SemanticModelOptions
.None
Microsoft.CodeAnalysis.CSharp (13)
Compilation\CSharpCompilation.cs (5)
2482
=> GetSemanticModel(syntaxTree, ignoreAccessibility ?
SemanticModelOptions
.IgnoreAccessibility :
SemanticModelOptions
.None);
2489
public new SemanticModel GetSemanticModel(SyntaxTree syntaxTree,
SemanticModelOptions
options)
2512
internal override SemanticModel CreateSemanticModel(SyntaxTree syntaxTree,
SemanticModelOptions
options)
3921
protected override SemanticModel CommonGetSemanticModel(SyntaxTree syntaxTree,
SemanticModelOptions
options)
Compilation\SyntaxTreeSemanticModel.cs (8)
39
private readonly
SemanticModelOptions
_options;
44
internal SyntaxTreeSemanticModel(CSharpCompilation compilation, SyntaxTree syntaxTree,
SemanticModelOptions
options)
50
_binderFactory = compilation.GetBinderFactory(SyntaxTree, (options &
SemanticModelOptions
.IgnoreAccessibility) != 0);
53
internal SyntaxTreeSemanticModel(CSharpCompilation parentCompilation, SyntaxTree parentSyntaxTree, SyntaxTree speculatedSyntaxTree,
SemanticModelOptions
options)
57
_binderFactory = _compilation.GetBinderFactory(parentSyntaxTree, ignoreAccessibility: (options &
SemanticModelOptions
.IgnoreAccessibility) != 0);
94
internal
SemanticModelOptions
Options => _options;
101
get { return (_options &
SemanticModelOptions
.IgnoreAccessibility) != 0; }
104
public override bool NullableAnalysisIsDisabled => (_options &
SemanticModelOptions
.DisableNullableAnalysis) != 0;
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1)
Diagnostics\DiagnosticAnalyzerTests.cs (1)
4056
public override SemanticModel GetSemanticModel(SyntaxTree tree, Compilation compilation,
SemanticModelOptions
options)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (6)
Symbols\Source\NullablePublicAPITests.cs (6)
5190
test(
SemanticModelOptions
.None, expectedAnnotation: PublicNullableAnnotation.Annotated);
5191
test(
SemanticModelOptions
.DisableNullableAnalysis, expectedAnnotation: PublicNullableAnnotation.None);
5193
void test(
SemanticModelOptions
options, PublicNullableAnnotation expectedAnnotation)
5225
test(
SemanticModelOptions
.None);
5226
test(
SemanticModelOptions
.DisableNullableAnalysis);
5228
void test(
SemanticModelOptions
options)
Microsoft.CodeAnalysis.VisualBasic (8)
Compilation\VisualBasicCompilation.vb (8)
2045
model = SemanticModelProvider.GetSemanticModel(syntaxTree, Me, If(ignoreAccessibility,
SemanticModelOptions
.IgnoreAccessibility,
SemanticModelOptions
.None))
2049
Return If(model, CreateSemanticModel(syntaxTree, If(ignoreAccessibility,
SemanticModelOptions
.IgnoreAccessibility,
SemanticModelOptions
.None)))
2052
Friend Overrides Function CreateSemanticModel(syntaxTree As SyntaxTree, options As
SemanticModelOptions
) As SemanticModel
2053
Return New SyntaxTreeSemanticModel(Me, DirectCast(Me.SourceModule, SourceModuleSymbol), syntaxTree, ignoreAccessibility:=(options And
SemanticModelOptions
.IgnoreAccessibility) <> 0)
2751
Protected Overrides Function CommonGetSemanticModel(syntaxTree As SyntaxTree, options As
SemanticModelOptions
) As SemanticModel
2752
Return Me.GetSemanticModel(syntaxTree, ignoreAccessibility:=(options And
SemanticModelOptions
.IgnoreAccessibility) <> 0)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (2)
Diagnostics\DiagnosticAnalyzerTests.vb (2)
1710
Public Overrides Function GetSemanticModel(tree As SyntaxTree, compilation As Compilation, Optional options As
SemanticModelOptions
=
SemanticModelOptions
.None) As SemanticModel
Microsoft.CodeAnalysis.Workspaces (8)
ReassignedVariable\AbstractReassignedVariableService.cs (1)
95
model = compilation.GetSemanticModel(syntaxTree,
SemanticModelOptions
.DisableNullableAnalysis);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
55
semanticModel = await document.GetSemanticModelAsync(
SemanticModelOptions
.DisableNullableAnalysis, cancellationToken).ConfigureAwait(false);
Workspace\Solution\Document.cs (6)
285
internal async Task<SemanticModel?> GetSemanticModelAsync(
SemanticModelOptions
options, CancellationToken cancellationToken = default)
288
disableNullableAnalysis: (options &
SemanticModelOptions
.DisableNullableAnalysis) ==
SemanticModelOptions
.DisableNullableAnalysis,
301
semanticModel = await this.GetSemanticModelAsync(
SemanticModelOptions
.DisableNullableAnalysis, cancellationToken).ConfigureAwait(false);
355
var result = compilation.GetSemanticModel(syntaxTree, disableNullableAnalysis ?
SemanticModelOptions
.DisableNullableAnalysis :
SemanticModelOptions
.None);