40 references to SemanticModel
ConfigurationSchemaGenerator (1)
RuntimeSource\Configuration.Binder\Parser\BinderInvocation.cs (1)
28return context.SemanticModel.GetOperation(invocationSyntax, cancellationToken) is IInvocationOperation operation &&
Microsoft.AspNetCore.Http.RequestDelegateGenerator (3)
RequestDelegateGenerator.cs (3)
26var operation = context.SemanticModel.GetOperation(context.Node, token); 27var wellKnownTypes = WellKnownTypes.GetOrCreate(context.SemanticModel.Compilation); 30return new Endpoint(invocationOperation, wellKnownTypes, context.SemanticModel);
Microsoft.AspNetCore.SignalR.Client.SourceGenerator (4)
HubClientProxyGenerator.Parser.cs (2)
39var attributeSymbol = ModelExtensions.GetSymbolInfo(context.SemanticModel, attributeSyntax).Symbol; 149if (ModelExtensions.GetSymbolInfo(context.SemanticModel, memberAccessExpressionSyntax).Symbol is not IMethodSymbol
HubServerProxyGenerator.Parser.cs (2)
39var attributeSymbol = context.SemanticModel.GetSymbolInfo(attributeSyntax).Symbol; 139if (ModelExtensions.GetSymbolInfo(context.SemanticModel, memberAccessExpressionSyntax).Symbol is not IMethodSymbol
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (8)
SourceGeneration\GeneratorDriverTests.cs (4)
2118static (ctx, ct) => ctx.SemanticModel.GetSymbolInfo(ctx.Node, ct).Symbol?.Name ?? "(method not found)") 2180static (ctx, ct) => ctx.SemanticModel.GetSymbolInfo(ctx.Node, ct).Symbol?.Name ?? "(method not found)") 2277static (ctx, ct) => ctx.SemanticModel.GetSymbolInfo(ctx.Node, ct).Symbol?.Name ?? "(method not found)") 4204var model = context.SemanticModel;
SourceGeneration\SyntaxAwareGeneratorTests.cs (4)
294Assert.NotNull(testReceiver.VisitedNodes[0].SemanticModel); 295Assert.Equal(testReceiver.VisitedNodes[0].SemanticModel.SyntaxTree, testReceiver.VisitedNodes[0].Node.SyntaxTree); 790var dType = ctx.SemanticModel.Compilation.GetTypeByMetadataName("D"); 795var typeInfo = ctx.SemanticModel.GetTypeInfo(cds.BaseList!.Types[0].Type);
Microsoft.Extensions.Logging.Generators (1)
LoggerMessageGenerator.Roslyn3.11.cs (1)
75IMethodSymbol attributeSymbol = context.SemanticModel.GetSymbolInfo(attributeSyntax).Symbol as IMethodSymbol;
Microsoft.Gen.ComplianceReports (1)
src\Generators\Shared\GeneratorUtilities.cs (1)
109var ctor = context.SemanticModel.GetSymbolInfo(attributeSyntax, cancellationToken).Symbol as IMethodSymbol;
Microsoft.Gen.ContextualOptions (1)
src\Generators\Shared\GeneratorUtilities.cs (1)
109var ctor = context.SemanticModel.GetSymbolInfo(attributeSyntax, cancellationToken).Symbol as IMethodSymbol;
Microsoft.Gen.Logging (1)
src\Generators\Shared\GeneratorUtilities.cs (1)
109var ctor = context.SemanticModel.GetSymbolInfo(attributeSyntax, cancellationToken).Symbol as IMethodSymbol;
Microsoft.Gen.Metrics (1)
src\Generators\Shared\GeneratorUtilities.cs (1)
109var ctor = context.SemanticModel.GetSymbolInfo(attributeSyntax, cancellationToken).Symbol as IMethodSymbol;
Microsoft.Gen.MetricsReports (1)
src\Generators\Shared\GeneratorUtilities.cs (1)
109var ctor = context.SemanticModel.GetSymbolInfo(attributeSyntax, cancellationToken).Symbol as IMethodSymbol;
Microsoft.Maui.Controls.BindingSourceGen (18)
BindingSourceGenerator.cs (4)
98 var lambdaParamTypeResult = GetLambdaParameterType(lambdaResult.Value, context.SemanticModel, t); 104 var lambdaReturnTypeResult = GetLambdaReturnType(lambdaResult.Value, context.SemanticModel, t); 122 SetterOptions: DeriveSetterOptions(lambdaResult.Value.ExpressionBody, context.SemanticModel, enabledNullable), 130 NullableContext nullableContext = context.SemanticModel.GetNullableContext(context.Node.Span.Start);
InvocationParser.cs (4)
35 var symbol = _context.SemanticModel.GetSymbolInfo(invocation.Expression).Symbol; 50 var type = _context.SemanticModel.GetTypeInfo(firstArgument, cancellationToken: t).Type; 66 var symbol = _context.SemanticModel.GetSymbolInfo(invocation.Expression).Symbol; 98 var secondArgumentType = _context.SemanticModel.GetTypeInfo(secondArgument, cancellationToken: t).Type;
PathParser.cs (10)
44 var typeInfo = _context.SemanticModel.GetTypeInfo(memberAccess).Type; 45 var symbol = _context.SemanticModel.GetSymbolInfo(memberAccess).Symbol; 73 var elementAccessSymbol = _context.SemanticModel.GetSymbolInfo(elementAccess).Symbol; 74 var elementType = _context.SemanticModel.GetTypeInfo(elementAccess).Type; 108 var typeInfo = _context.SemanticModel.GetTypeInfo(memberBinding).Type; 118 var elementAccessSymbol = _context.SemanticModel.GetSymbolInfo(elementBinding).Symbol; 119 var elementType = _context.SemanticModel.GetTypeInfo(elementBinding).Type; 141 var typeInfo = _context.SemanticModel.GetTypeInfo(castTo).Type; 160 var typeInfo = _context.SemanticModel.GetTypeInfo(castExpression.Type).Type; 184 object? indexValue = _context.SemanticModel.GetConstantValue(indexExpression).Value;