91 references to TryGetSpeculativeSemanticModel
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
AnalyzedPattern.cs (1)
60
if (operation.SemanticModel.
TryGetSpeculativeSemanticModel
(typeSyntax.SpanStart, dummyStatement, out var speculativeModel))
SpeculationAnalyzer.cs (1)
128
semanticModel.
TryGetSpeculativeSemanticModel
(position, statementNode, out speculativeModel);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
CSharpInlineDeclarationCodeFixProvider.cs (1)
403
return semanticModel.
TryGetSpeculativeSemanticModel
(position, statement, out speculativeModel);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
CodeGeneration\SyntaxGeneratorTests.cs (1)
85
Assert.True(semanticModel.
TryGetSpeculativeSemanticModel
(
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (15)
Attributes\AttributeTests_RefReadOnly.cs (2)
1454
Assert.True(model.
TryGetSpeculativeSemanticModel
(position, localfunction, out var newModel));
1481
Assert.True(model.
TryGetSpeculativeSemanticModel
(position, localfunction, out var newModel));
Semantics\PatternMatchingTests_Scope.cs (13)
407
bool success = model.
TryGetSpeculativeSemanticModel
(
712
bool success = model.
TryGetSpeculativeSemanticModel
(
981
bool success = model.
TryGetSpeculativeSemanticModel
(
1285
bool success = model.
TryGetSpeculativeSemanticModel
(
5341
bool success = model.
TryGetSpeculativeSemanticModel
(
6471
bool success = model.
TryGetSpeculativeSemanticModel
(
6884
bool success = model.
TryGetSpeculativeSemanticModel
(tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "SpeculateHere").Single().SpanStart, statement, out model);
7211
bool success = model.
TryGetSpeculativeSemanticModel
(
7534
bool success = model.
TryGetSpeculativeSemanticModel
(
9640
bool success = model.
TryGetSpeculativeSemanticModel
(
10203
bool success = model.
TryGetSpeculativeSemanticModel
(
10719
bool success = model.
TryGetSpeculativeSemanticModel
(
12146
bool success = model.
TryGetSpeculativeSemanticModel
(GetReferences(tree, "SpeculateHere").Single().SpanStart, statement, out model);
Microsoft.CodeAnalysis.CSharp.Features (2)
AnalyzedPattern.cs (1)
60
if (operation.SemanticModel.
TryGetSpeculativeSemanticModel
(typeSyntax.SpanStart, dummyStatement, out var speculativeModel))
CSharpInlineDeclarationCodeFixProvider.cs (1)
403
return semanticModel.
TryGetSpeculativeSemanticModel
(position, statement, out speculativeModel);
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (1)
IOperation\IOperationTests.cs (1)
621
bool success = model.
TryGetSpeculativeSemanticModel
(methodDecl.Body.Statements[0].SpanStart, speculatedBlock, out speculativeModel);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (26)
Semantics\DelegateTypeTests.cs (1)
9380
Assert.True(model.
TryGetSpeculativeSemanticModel
(position, stmt, out model));
Semantics\ImplicitObjectCreationTests.cs (1)
4190
bool success = model.
TryGetSpeculativeSemanticModel
(nodeLocation, modifiedNode, out var speculativeModel);
Semantics\NullableReferenceTypesTests.cs (2)
63432
Assert.True(model1.
TryGetSpeculativeSemanticModel
(function1.SpanStart, function2, out var model2));
142172
Assert.True(model.
TryGetSpeculativeSemanticModel
(
Semantics\OutVarTests.cs (14)
4004
bool success = model.
TryGetSpeculativeSemanticModel
(GetReferences(tree, "SpeculateHere").Single().SpanStart, statement, out model);
5110
bool success = model.
TryGetSpeculativeSemanticModel
(GetReferences(tree, "SpeculateHere").Single().SpanStart, statement, out model);
8804
bool success = model.
TryGetSpeculativeSemanticModel
(GetReferences(tree, "SpeculateHere").Single().SpanStart, statement, out model);
9643
bool success = model.
TryGetSpeculativeSemanticModel
(GetReferences(tree, "SpeculateHere").Single().SpanStart, statement, out model);
10211
bool success = model.
TryGetSpeculativeSemanticModel
(GetReferences(tree, "SpeculateHere").Single().SpanStart, statement, out model);
10860
bool success = model.
TryGetSpeculativeSemanticModel
(GetReferences(tree, "SpeculateHere").Single().SpanStart, statement, out model);
13340
bool success = model.
TryGetSpeculativeSemanticModel
(GetReferences(tree, "SpeculateHere").Single().SpanStart, statement, out model);
13739
bool success = model.
TryGetSpeculativeSemanticModel
(GetReferences(tree, "SpeculateHere").Single().SpanStart, statement, out model);
15260
bool success = model.
TryGetSpeculativeSemanticModel
(GetReferences(tree, "SpeculateHere").Single().SpanStart, statement, out model);
16538
bool success = model.
TryGetSpeculativeSemanticModel
(GetReferences(tree, "SpeculateHere").Single().SpanStart, statement, out model);
17097
bool success = model.
TryGetSpeculativeSemanticModel
(GetReferences(tree, "SpeculateHere").Single().SpanStart, statement, out model);
17533
bool success = model.
TryGetSpeculativeSemanticModel
(GetReferences(tree, "SpeculateHere").Single().SpanStart, statement, out model);
21285
bool success = model.
TryGetSpeculativeSemanticModel
(GetReferences(tree, "SpeculateHere").Single().SpanStart, statement, out model);
35607
bool success = model.
TryGetSpeculativeSemanticModel
(statementBefore.SpanStart, statementAfter, out model);
Semantics\QueryTests.cs (5)
3424
bool success = model.
TryGetSpeculativeSemanticModel
(methodM.Body.Statements[1].Span.End, queryStatement, out speculativeModel);
3468
bool success = model.
TryGetSpeculativeSemanticModel
(methodM.Body.Statements[1].Span.End, queryStatement, out speculativeModel);
3515
bool success = model.
TryGetSpeculativeSemanticModel
(methodM.Body.SpanStart, queryStatement, out speculativeModel);
3554
bool success = model.
TryGetSpeculativeSemanticModel
(methodM.Body.Statements[0].Span.End, queryStatement, out speculativeModel);
3602
bool success = model.
TryGetSpeculativeSemanticModel
(methodM.Body.SpanStart, queryStatement, out speculativeModel);
Semantics\SuppressAccessibilityChecksTests.cs (1)
93
semanticModel.
TryGetSpeculativeSemanticModel
(position, statement, out speculativeSemanticModel);
Semantics\TopLevelStatementsTests.cs (2)
9695
model.
TryGetSpeculativeSemanticModel
(root.DescendantNodes().Single(n => n is ExpressionStatementSyntax { Parent: GlobalStatementSyntax }).Span.End, nodeToSpeculate, out var speculativeModelInTopLevel);
9700
model.
TryGetSpeculativeSemanticModel
(root.DescendantNodes().Single(n => n is ExpressionStatementSyntax { Parent: BlockSyntax }).Span.End, nodeToSpeculate, out var speculativeModelOutsideTopLevel);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (42)
Compilation\GetSemanticInfoTests.cs (1)
4880
bool success = model.
TryGetSpeculativeSemanticModel
(position, newStatement, out speculativeModel);
Compilation\SemanticModelAPITests.cs (25)
1781
bool success = model.
TryGetSpeculativeSemanticModel
(methodDecl.Body.Statements[0].SpanStart, statement, out speculativeModel);
1835
bool success = model.
TryGetSpeculativeSemanticModel
(methodDecl.Body.Statements[0].SpanStart, statement, out speculativeModel);
1848
success = model.
TryGetSpeculativeSemanticModel
(methodDecl.Body.Statements[0].SpanStart, statement, out speculativeModel);
1882
bool success = model.
TryGetSpeculativeSemanticModel
(methodDecl.Body.Statements[0].SpanStart, labeledStatement, out statModel);
1920
bool success = model.
TryGetSpeculativeSemanticModel
(methodDecl.Body.Statements[0].Span.End, switchStatement, out statModel);
1958
bool success = model.
TryGetSpeculativeSemanticModel
(methodDecl.Body.Statements[0].Span.End, speculatedStatement, out speculativeModel);
1995
bool success = model.
TryGetSpeculativeSemanticModel
(methodDecl.Body.Statements[0].SpanStart, statement, out speculativeModel);
2181
Assert.Throws<ArgumentNullException>(() => model.
TryGetSpeculativeSemanticModel
(statement.SpanStart, statement: null, speculativeModel: out speculativeModel));
2186
Assert.Throws<ArgumentException>(() => model.
TryGetSpeculativeSemanticModel
(statement.SpanStart, statement: statement, speculativeModel: out speculativeModel));
2192
model.
TryGetSpeculativeSemanticModel
(statement.SpanStart, speculatedStatement, speculativeModel: out speculativeModel);
2193
Assert.Throws<InvalidOperationException>(() => speculativeModel.
TryGetSpeculativeSemanticModel
(speculatedStatement.SpanStart, speculatedStatement, speculativeModel: out speculativeModel));
2227
var success = model.
TryGetSpeculativeSemanticModel
(statement.SpanStart, speculatedStatement, out speculativeModel);
2235
Assert.Throws<InvalidOperationException>(() => speculativeModel.
TryGetSpeculativeSemanticModel
(speculatedStatement.SpanStart, newSpeculatedStatement, out newModel));
2239
Assert.Throws<InvalidOperationException>(() => speculativeModel.
TryGetSpeculativeSemanticModel
(speculatedStatement.SpanStart, newSpeculatedStatement, out newModel));
2264
var success = model.
TryGetSpeculativeSemanticModel
(methodDecl.Body.Statements[0].Span.End, unsafeStatement, out speculativeModel);
2320
var success = model.
TryGetSpeculativeSemanticModel
(statementSyntax.SpanStart, speculativeSyntax, out speculativeModel);
3161
var success = model.
TryGetSpeculativeSemanticModel
(position, yieldStatement, out speculativeModel);
3196
var success = model.
TryGetSpeculativeSemanticModel
(position, yieldStatement, out speculativeModel);
3267
var success = model.
TryGetSpeculativeSemanticModel
(position, statementSyntax, out speculativeModel);
3308
var success = model.
TryGetSpeculativeSemanticModel
(position, statementSyntax, out speculativeModel);
3384
var success = model.
TryGetSpeculativeSemanticModel
(position, statementSyntax, out speculativeModel);
3425
var success = model.
TryGetSpeculativeSemanticModel
(position, statementSyntax, out speculativeModel);
3466
var success = model.
TryGetSpeculativeSemanticModel
(position, statementSyntax, out speculativeModel);
3789
Assert.True(model.
TryGetSpeculativeSemanticModel
(localFunctionBody.Block!.Statements[0].SpanStart + 1, @return, out var specModel));
4430
Assert.True(model.
TryGetSpeculativeSemanticModel
(ifStatement.SpanStart, replacementIfStatement, out var specModel));
Symbols\Source\FileModifierTests.cs (2)
3220
Assert.True(model.
TryGetSpeculativeSemanticModel
(position: body.OpenBraceToken.EndPosition, newBody, out var speculativeModel));
3261
Assert.True(model.
TryGetSpeculativeSemanticModel
(position: body.OpenBraceToken.EndPosition, newBody, out var speculativeModel));
Symbols\Source\NullablePublicAPITests.cs (14)
1167
Assert.True(syntaxContext.SemanticModel.
TryGetSpeculativeSemanticModel
(syntaxContext.Node.SpanStart, newSource, out var specModel));
1393
Assert.True(model.
TryGetSpeculativeSemanticModel
(spanStart, newSource, out var speculativeModel));
1442
Assert.True(model.
TryGetSpeculativeSemanticModel
(returnStatement.SpanStart, newSource, out var specModel));
2139
Assert.True(model.
TryGetSpeculativeSemanticModel
(s2Assignment.SpanStart, newDeclaration, out var specModel));
2143
Assert.True(model.
TryGetSpeculativeSemanticModel
(lastDeclaration.SpanStart, newDeclaration, out specModel));
3702
Assert.True(model.
TryGetSpeculativeSemanticModel
(localFunctionBody.Body!.OpenBraceToken.SpanStart + 1, @return, out var specModel));
3737
Assert.True(model.
TryGetSpeculativeSemanticModel
(localFunctionBody.Block!.OpenBraceToken.SpanStart + 1, @return, out var specModel));
3782
Assert.True(model.
TryGetSpeculativeSemanticModel
(lambda.Body.SpanStart, newStatement, out var speculativeModel));
4369
Assert.True(model.
TryGetSpeculativeSemanticModel
(type.SpanStart, statement, out var speculativeModel));
4397
Assert.True(model.
TryGetSpeculativeSemanticModel
(type.SpanStart, statement, out var speculativeModel));
4427
Assert.True(model.
TryGetSpeculativeSemanticModel
(type.SpanStart, statement, out var speculativeModel));
4457
Assert.True(model.
TryGetSpeculativeSemanticModel
(type.SpanStart, statement, out var speculativeModel));
4487
Assert.True(model.
TryGetSpeculativeSemanticModel
(type.SpanStart, statement, out var speculativeModel));
4913
Assert.True(model.
TryGetSpeculativeSemanticModel
(spanStart, newBody, out var speculativeModel));
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
SpeculationAnalyzer.cs (1)
128
semanticModel.
TryGetSpeculativeSemanticModel
(position, statementNode, out speculativeModel);