233 references to GetTypeInfo
Microsoft.CodeAnalysis.CSharp.CodeStyle (61)
AnalyzedPattern.cs (1)
62
var originalInfo = operation.SemanticModel.
GetTypeInfo
(binaryExpression.Right);
CastSimplifier.cs (21)
120
var enumType = semanticModel.
GetTypeInfo
(castExpression.Expression, cancellationToken).Type as INamedTypeSymbol;
121
var castedType = semanticModel.
GetTypeInfo
(castExpression.Type, cancellationToken).Type;
155
var enumType = semanticModel.
GetTypeInfo
(castExpression.Expression, cancellationToken).Type as INamedTypeSymbol;
156
var castedType = semanticModel.
GetTypeInfo
(castExpression.Type, cancellationToken).Type;
160
var parentCastType = semanticModel.
GetTypeInfo
(parentCast.Type, cancellationToken).Type;
296
var originalConvertedType = originalSemanticModel.
GetTypeInfo
(castNode.WalkUpParentheses(), cancellationToken).ConvertedType;
455
var castedExpressionType = originalSemanticModel.
GetTypeInfo
(castedExpressionNode, cancellationToken).Type;
456
var isType = originalSemanticModel.
GetTypeInfo
(isExpression.Right, cancellationToken).Type;
540
var castType = semanticModel.
GetTypeInfo
(castNode, cancellationToken).Type;
712
var originalCastExpressionTypeInfo = originalSemanticModel.
GetTypeInfo
(castExpression, cancellationToken);
713
var originalConditionalTypeInfo = originalSemanticModel.
GetTypeInfo
(originalConditionalExpression, cancellationToken);
714
var rewrittenConditionalTypeInfo = rewrittenSemanticModel.
GetTypeInfo
(rewrittenConditionalExpression, cancellationToken);
731
var castType = originalSemanticModel.
GetTypeInfo
(castExpression, cancellationToken).Type;
877
var castSideType = semanticModel.
GetTypeInfo
(castSide, cancellationToken).Type;
878
var castedExpressionType = semanticModel.
GetTypeInfo
(castExpression.Expression, cancellationToken).Type;
882
var otherSideType = semanticModel.
GetTypeInfo
(otherSide, cancellationToken).Type;
900
var castType = semanticModel.
GetTypeInfo
(castNode, cancellationToken).Type;
901
var castedExpressionType = semanticModel.
GetTypeInfo
(castedExpressionNode, cancellationToken).Type;
941
var typeInfo = semanticModel.
GetTypeInfo
(arrayInitializer, cancellationToken);
1099
var rewrittenType = rewrittenSemanticModel.
GetTypeInfo
(rewrittenExpression, cancellationToken).Type;
1330
var rewrittenConvertedType = rewrittenSemanticModel.
GetTypeInfo
(rewrittenExpression, cancellationToken).ConvertedType;
CSharpAsAndNullCheckDiagnosticAnalyzer.cs (3)
85
var castType = semanticModel.
GetTypeInfo
(castExpression.Type).Type;
121
var asType = semanticModel.
GetTypeInfo
(typeNode, cancellationToken).Type;
244
var rightType = semanticModel.
GetTypeInfo
(assignmentExpression.Right);
CSharpIsAndCastCheckDiagnosticAnalyzer.cs (1)
103
var isType = semanticModel.
GetTypeInfo
(castExpression.Type).Type;
CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (2)
126
var lambdaTypeInfo = semanticModel.
GetTypeInfo
(anonymousFunction, cancellationToken);
194
var rewrittenConvertedType = rewrittenSemanticModel.
GetTypeInfo
(rewrittenExpression, cancellationToken).ConvertedType;
CSharpTypeStyleHelper.State.cs (3)
78
var declaredTypeSymbol = semanticModel.
GetTypeInfo
(variableDeclaration.Type.StripRefIfNeeded(), cancellationToken).Type;
96
? IsMadeOfSpecialTypes(semanticModel.
GetTypeInfo
(typeSyntax.StripRefIfNeeded()).Type)
136
semanticModel.
GetTypeInfo
(typeSyntax).Type?.IsSpecialType() == true;
CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (1)
169
if (semanticModel.
GetTypeInfo
(testedExpression, cancellationToken).Type is IPointerTypeSymbol or IFunctionPointerTypeSymbol)
CSharpUseDeconstructionDiagnosticAnalyzer.cs (1)
165
var type = semanticModel.
GetTypeInfo
(typeNode, cancellationToken).Type;
CSharpUseExplicitTypeHelper.cs (2)
149
var declaredType = semanticModel.
GetTypeInfo
(typeName.StripRefIfNeeded(), cancellationToken).Type;
156
var initializerTypeInfo = semanticModel.
GetTypeInfo
(initializer, cancellationToken);
CSharpUseImplicitObjectCreationDiagnosticAnalyzer.cs (2)
110
var leftType = semanticModel.
GetTypeInfo
(typeNode, cancellationToken).Type;
111
var rightType = semanticModel.
GetTypeInfo
(objectCreation, cancellationToken).Type;
CSharpUseImplicitTypeHelper.cs (3)
195
var declarationType = semanticModel.
GetTypeInfo
(declarationTypeNode, cancellationToken).Type;
293
var declaredType = semanticModel.
GetTypeInfo
(typeName.StripRefIfNeeded(), cancellationToken).Type;
332
var initializerType = semanticModel.
GetTypeInfo
(expression, cancellationToken).Type;
CSharpUseIsNullCheckForCastAndEqualityOperatorDiagnosticAnalyzer.cs (2)
77
if (semanticModel.
GetTypeInfo
(castExpression.Type).Type?.SpecialType == SpecialType.System_Object)
79
var expressionType = semanticModel.
GetTypeInfo
(castExpression.Expression).Type;
CSharpUseLocalFunctionDiagnosticAnalyzer.cs (2)
113
var delegateType = semanticModel.
GetTypeInfo
(anonymousFunction, cancellationToken).ConvertedType as INamedTypeSymbol;
262
var convertedType = semanticModel.
GetTypeInfo
(nodeToCheck, cancellationToken).ConvertedType;
DefaultExpressionSyntaxExtensions.cs (2)
52
var entityType = semanticModel.
GetTypeInfo
(typeSyntax, cancellationToken).Type;
53
var defaultType = semanticModel.
GetTypeInfo
(defaultExpression.Type, cancellationToken).Type;
InvokeDelegateWithConditionalAccessAnalyzer.cs (1)
92
if (syntaxContext.SemanticModel.
GetTypeInfo
(invocationExpression.Expression, syntaxContext.CancellationToken).Type is { TypeKind: TypeKind.FunctionPointer })
ParenthesizedExpressionSyntaxExtensions.cs (1)
76
if (semanticModel.
GetTypeInfo
(varDecl.Type, cancellationToken).Type is
SemanticModelExtensions.cs (2)
113
var typeInfo = semanticModel.
GetTypeInfo
(qualifier, cancellationToken);
414
var info = semanticModel.
GetTypeInfo
(expression, cancellationToken);
SpeculationAnalyzer.cs (8)
370
var originalExpressionTypeInfo = this.OriginalSemanticModel.
GetTypeInfo
(originalExpression, this.CancellationToken);
371
var newExpressionTypeInfo = this.SpeculativeSemanticModel.
GetTypeInfo
(newExpression, this.CancellationToken);
478
var originalExprType = this.OriginalSemanticModel.
GetTypeInfo
(originalSwitchExpression.GoverningExpression, CancellationToken);
479
var replacedExprType = this.SpeculativeSemanticModel.
GetTypeInfo
(replacedSwitchExpression.GoverningExpression, CancellationToken);
548
var originalExpressionType = this.OriginalSemanticModel.
GetTypeInfo
(originalAnonymousObjectMemberDeclarator.Expression, this.CancellationToken).Type;
549
var newExpressionType = this.SpeculativeSemanticModel.
GetTypeInfo
(replacedAnonymousObjectMemberDeclarator.Expression, this.CancellationToken).Type;
685
var originalConvertedType = this.OriginalSemanticModel.
GetTypeInfo
(originalIsOrAsExpression.Right).Type;
686
var newConvertedType = this.SpeculativeSemanticModel.
GetTypeInfo
(newIsOrAsExpression.Right).Type;
TypeStyleHelper.cs (1)
129
var containingType = semanticModel.
GetTypeInfo
(containingTypeName, cancellationToken).Type;
TypeSyntaxExtensions.cs (1)
38
var type = semanticModel.
GetTypeInfo
(typeSyntax).Type;
UseExpressionBodyForLambdaHelpers.cs (1)
41
if (semanticModel.
GetTypeInfo
(declaration, cancellationToken).ConvertedType is not INamedTypeSymbol lambdaType || lambdaType.DelegateInvokeMethod == null)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (21)
ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (2)
192
var typeInfo = _semanticModel.
GetTypeInfo
(node, _cancellationToken);
263
var expressionConvertedType = _semanticModel.
GetTypeInfo
(node.Expression).ConvertedType;
ConvertToRecordEngine.cs (1)
310
=> iEquatable.Equals(semanticModel.
GetTypeInfo
(baseItem.Type, cancellationToken).Type));
CSharpAddYieldCodeFixProvider.cs (1)
100
var info = model.
GetTypeInfo
(expression);
CSharpAsAndNullCheckCodeFixProvider.cs (1)
140
var asExpressionTypeInfo = semanticModel.
GetTypeInfo
(asExpression, cancellationToken);
CSharpFixReturnTypeCodeFixProvider.cs (2)
96
var previousReturnType = semanticModel.
GetTypeInfo
(declarationTypeToFix, cancellationToken).Type;
173
var type = semanticModel.
GetTypeInfo
(argumentExpression, cancellationToken).Type;
CSharpRemoveUnusedValuesCodeFixProvider.cs (1)
110
semanticModel.
GetTypeInfo
(implicitObjectCreation).Type is { } type)
CSharpReplaceDefaultLiteralCodeFixProvider.cs (1)
89
var type = semanticModel.
GetTypeInfo
(defaultLiteral, cancellationToken).ConvertedType;
CSharpSemanticFactsService.cs (1)
141
var type = semanticModel.
GetTypeInfo
(expression, cancellationToken).Type;
CSharpTypeInferenceService.TypeInferrer.cs (4)
440
var info = SemanticModel.
GetTypeInfo
(creation, CancellationToken);
491
var typeInfo = SemanticModel.
GetTypeInfo
(memberAccess.Expression, CancellationToken);
562
var info = SemanticModel.
GetTypeInfo
(elementAccess.Expression, CancellationToken);
1247
var typeInfo = SemanticModel.
GetTypeInfo
(propertyDeclaration.Type);
CSharpUseLocalFunctionCodeFixProvider.cs (1)
109
var delegateType = (INamedTypeSymbol)semanticModel.
GetTypeInfo
(anonymousFunction, cancellationToken).ConvertedType;
CSharpUsePatternCombinatorsCodeFixProvider.cs (1)
119
var type = semanticModel.
GetTypeInfo
(expr).Type;
InternalExtensions.cs (2)
28
var typeInfo = semanticModel.
GetTypeInfo
(decl.Type, cancellationToken);
35
var typeInfo = semanticModel.
GetTypeInfo
(expression, cancellationToken);
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs\SyntaxTokenExtensions.cs (1)
689
var typeInfo = semanticModel.
GetTypeInfo
(memberAccessExpression.Expression, cancellationToken);
UseExplicitTypeForConstCodeFixProvider.cs (1)
51
var type = semanticModel.
GetTypeInfo
(variableDeclaration.Type, cancellationToken).ConvertedType;
UseExpressionBodyForLambdaCodeActionHelpers.cs (1)
76
var lambdaType = (INamedTypeSymbol)semanticModel.
GetTypeInfo
(declaration).ConvertedType!;
Microsoft.CodeAnalysis.CSharp.Features (77)
AddImport\CSharpAddImportFeatureService.cs (1)
272
return semanticModel.
GetTypeInfo
(fromClause.Expression, cancellationToken).Type;
AnalyzedPattern.cs (1)
62
var originalInfo = operation.SemanticModel.
GetTypeInfo
(binaryExpression.Right);
CodeFixes\GenerateMethod\GenerateDeconstructMethodCodeFixProvider.cs (1)
78
type = model.
GetTypeInfo
(assignment.Right).Type;
Completion\CompletionProviders\AwaitCompletionProvider.cs (1)
107
return symbol is ITypeSymbol ? null : semanticModel.
GetTypeInfo
(memberAccessExpression, cancellationToken).Type;
Completion\CompletionProviders\CrefCompletionProvider.cs (1)
217
var leftType = semanticModel.
GetTypeInfo
(parent.Container, cancellationToken).Type;
Completion\CompletionProviders\DeclarationName\DeclarationNameRecommender.cs (1)
295
var methodParameterType = semanticModel.
GetTypeInfo
(parameterType, cancellationToken).Type;
Completion\CompletionProviders\NamedParameterCompletionProvider.cs (4)
175
if (semanticModel.
GetTypeInfo
(objectCreationExpression, cancellationToken).Type is INamedTypeSymbol type && within != null && type.TypeKind != TypeKind.Delegate)
191
var expressionType = semanticModel.
GetTypeInfo
(elementAccessExpression.Expression, cancellationToken).Type;
240
var type = semanticModel.
GetTypeInfo
(recordBaseType.Type, cancellationToken).Type as INamedTypeSymbol;
260
var expressionType = semanticModel.
GetTypeInfo
(invocationExpression.Expression, cancellationToken).Type as INamedTypeSymbol;
Completion\CompletionProviders\ObjectAndWithInitializerCompletionProvider.cs (2)
86
var initializedType = semanticModel.
GetTypeInfo
(expression, cancellationToken).Type;
169
return semanticModel.
GetTypeInfo
(withExpression.Expression, cancellationToken).Type;
Completion\CompletionProviders\OverrideCompletionProvider.cs (1)
70
returnType = semanticModel.
GetTypeInfo
(typeSyntax, cancellationToken).Type;
ConvertForEachToFor\CSharpConvertForEachToForCodeRefactoringProvider.cs (1)
68
model.
GetTypeInfo
(foreachCollectionExpression, cancellationToken).Type ??
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (6)
438
if (typeCheckMethod(_semanticModel.
GetTypeInfo
(expressionToVerifyType, _cancellationToken).Type) &&
528
? _semanticModel.
GetTypeInfo
(expression, _cancellationToken).ConvertedType.GenerateTypeSyntax()
559
var returnTypeInfo = _semanticModel.
GetTypeInfo
(_source, _cancellationToken);
672
var forEachStatementTypeSymbolType = _semanticModel.
GetTypeInfo
(forEachStatement.Type, _cancellationToken).Type;
673
var lastSelectExpressionTypeInfo = _semanticModel.
GetTypeInfo
(lastSelectExpression, _cancellationToken);
890
if (_semanticModel.
GetTypeInfo
(selectClause.Expression, _cancellationToken).Type.ContainsAnonymousType())
ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (2)
192
var typeInfo = _semanticModel.
GetTypeInfo
(node, _cancellationToken);
263
var expressionConvertedType = _semanticModel.
GetTypeInfo
(node.Expression).ConvertedType;
ConvertToRecordEngine.cs (1)
310
=> iEquatable.Equals(semanticModel.
GetTypeInfo
(baseItem.Type, cancellationToken).Type));
CSharpAddYieldCodeFixProvider.cs (1)
100
var info = model.
GetTypeInfo
(expression);
CSharpAsAndNullCheckCodeFixProvider.cs (1)
140
var asExpressionTypeInfo = semanticModel.
GetTypeInfo
(asExpression, cancellationToken);
CSharpAsAndNullCheckDiagnosticAnalyzer.cs (3)
85
var castType = semanticModel.
GetTypeInfo
(castExpression.Type).Type;
121
var asType = semanticModel.
GetTypeInfo
(typeNode, cancellationToken).Type;
244
var rightType = semanticModel.
GetTypeInfo
(assignmentExpression.Right);
CSharpFixReturnTypeCodeFixProvider.cs (2)
96
var previousReturnType = semanticModel.
GetTypeInfo
(declarationTypeToFix, cancellationToken).Type;
173
var type = semanticModel.
GetTypeInfo
(argumentExpression, cancellationToken).Type;
CSharpIsAndCastCheckDiagnosticAnalyzer.cs (1)
103
var isType = semanticModel.
GetTypeInfo
(castExpression.Type).Type;
CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (2)
126
var lambdaTypeInfo = semanticModel.
GetTypeInfo
(anonymousFunction, cancellationToken);
194
var rewrittenConvertedType = rewrittenSemanticModel.
GetTypeInfo
(rewrittenExpression, cancellationToken).ConvertedType;
CSharpRemoveUnusedValuesCodeFixProvider.cs (1)
110
semanticModel.
GetTypeInfo
(implicitObjectCreation).Type is { } type)
CSharpReplaceDefaultLiteralCodeFixProvider.cs (1)
89
var type = semanticModel.
GetTypeInfo
(defaultLiteral, cancellationToken).ConvertedType;
CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (1)
169
if (semanticModel.
GetTypeInfo
(testedExpression, cancellationToken).Type is IPointerTypeSymbol or IFunctionPointerTypeSymbol)
CSharpUseDeconstructionDiagnosticAnalyzer.cs (1)
165
var type = semanticModel.
GetTypeInfo
(typeNode, cancellationToken).Type;
CSharpUseImplicitObjectCreationDiagnosticAnalyzer.cs (2)
110
var leftType = semanticModel.
GetTypeInfo
(typeNode, cancellationToken).Type;
111
var rightType = semanticModel.
GetTypeInfo
(objectCreation, cancellationToken).Type;
CSharpUseIsNullCheckForCastAndEqualityOperatorDiagnosticAnalyzer.cs (2)
77
if (semanticModel.
GetTypeInfo
(castExpression.Type).Type?.SpecialType == SpecialType.System_Object)
79
var expressionType = semanticModel.
GetTypeInfo
(castExpression.Expression).Type;
CSharpUseLocalFunctionCodeFixProvider.cs (1)
109
var delegateType = (INamedTypeSymbol)semanticModel.
GetTypeInfo
(anonymousFunction, cancellationToken).ConvertedType;
CSharpUseLocalFunctionDiagnosticAnalyzer.cs (2)
113
var delegateType = semanticModel.
GetTypeInfo
(anonymousFunction, cancellationToken).ConvertedType as INamedTypeSymbol;
262
var convertedType = semanticModel.
GetTypeInfo
(nodeToCheck, cancellationToken).ConvertedType;
CSharpUsePatternCombinatorsCodeFixProvider.cs (1)
119
var type = semanticModel.
GetTypeInfo
(expr).Type;
Debugging\DataTipInfoGetter.cs (2)
48
var type = semanticModel.
GetTypeInfo
(expression, cancellationToken).Type;
81
var type = semanticModel.
GetTypeInfo
(typeSyntax, cancellationToken).Type;
ExtractMethod\CSharpSelectionResult.ExpressionResult.cs (3)
68
return model.
GetTypeInfo
(variableDeclExpression.Type).Type;
87
return model.
GetTypeInfo
(castExpression).Type;
99
var info = semanticModel.
GetTypeInfo
(expression);
GenerateConstructor\CSharpGenerateConstructorService.cs (1)
160
var typeInfo = document.SemanticModel.
GetTypeInfo
(implicitObjectCreation, cancellationToken);
GenerateMember\GenerateParameterizedMember\CSharpGenerateConversionService.cs (2)
148
typeToGenerateIn = document.SemanticModel.
GetTypeInfo
(castExpression.Type, cancellationToken).Type as INamedTypeSymbol;
150
|| document.SemanticModel.
GetTypeInfo
(castExpression.Expression, cancellationToken).Type is not INamedTypeSymbol parameterSymbol
GenerateMember\GenerateParameterizedMember\CSharpGenerateDeconstructMethodService.cs (1)
59
type: semanticModel.
GetTypeInfo
(((ConstantPatternSyntax)positionalPattern.Subpatterns[i].Pattern).Expression, cancellationToken).Type ?? semanticModel.Compilation.GetSpecialType(SpecialType.System_Object),
GenerateMember\GenerateParameterizedMember\CSharpGenerateMethodService.cs (1)
70
var semanticInfo = semanticModel.
GetTypeInfo
(methodDeclaration.ExplicitInterfaceSpecifier.Name, cancellationToken);
GenerateMember\GenerateParameterizedMember\CSharpGenerateParameterizedMemberService.cs (2)
125
var info = Document.SemanticModel.
GetTypeInfo
(type, cancellationToken);
162
var typeInfo = Document.SemanticModel.
GetTypeInfo
(typeArgument, cancellationToken);
GenerateMember\GenerateVariable\CSharpGenerateVariableService.cs (1)
74
var info = semanticModel.
GetTypeInfo
(propertyDeclaration.ExplicitInterfaceSpecifier.Name, cancellationToken);
GenerateType\CSharpGenerateTypeService.cs (1)
459
var expressionType = semanticModel.
GetTypeInfo
(expression, cancellationToken).Type;
InlineHints\CSharpInlineTypeHintsService.cs (3)
42
var type = semanticModel.
GetTypeInfo
(variableDeclaration.Type, cancellationToken).Type;
52
var type = semanticModel.
GetTypeInfo
(declarationExpression.Type, cancellationToken).Type;
96
var type = semanticModel.
GetTypeInfo
(implicitNew, cancellationToken).Type;
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (1)
123
if (document.SemanticModel.
GetTypeInfo
(oldLambda, cancellationToken).ConvertedType is INamedTypeSymbol delegateType &&
InvokeDelegateWithConditionalAccessAnalyzer.cs (1)
92
if (syntaxContext.SemanticModel.
GetTypeInfo
(invocationExpression.Expression, syntaxContext.CancellationToken).Type is { TypeKind: TypeKind.FunctionPointer })
SignatureHelp\ElementAccessExpressionSignatureHelpProvider.cs (2)
190
expressionType = semanticModel.
GetTypeInfo
(memberAccessExpression.Expression, cancellationToken).Type!;
202
expressionType = semanticModel.
GetTypeInfo
(expression, cancellationToken).Type;
SignatureHelp\GenericNameSignatureHelpProvider.cs (1)
100
: semanticModel.
GetTypeInfo
(beforeDotExpression, cancellationToken).Type as INamespaceOrTypeSymbol;
SignatureHelp\InvocationExpressionSignatureHelpProvider.cs (2)
85
var invokedType = semanticModel.
GetTypeInfo
(invocationExpression.Expression, cancellationToken).Type;
138
var invokedType = semanticModel.
GetTypeInfo
(invocationExpression.Expression, cancellationToken).Type;
SignatureHelp\InvocationExpressionSignatureHelpProviderBase_MethodGroup.cs (1)
54
throughType = semanticModel.
GetTypeInfo
(throughExpression, cancellationToken).Type;
SignatureHelp\ObjectCreationExpressionSignatureHelpProvider.cs (1)
79
if (semanticModel.
GetTypeInfo
(objectCreationExpression, cancellationToken).Type is not INamedTypeSymbol type)
SignatureHelp\PrimaryConstructorBaseTypeSignatureHelpProvider.cs (1)
82
var baseType = semanticModel.
GetTypeInfo
(baseTypeSyntax.Type, cancellationToken).Type as INamedTypeSymbol;
UseExplicitTypeForConstCodeFixProvider.cs (1)
51
var type = semanticModel.
GetTypeInfo
(variableDeclaration.Type, cancellationToken).ConvertedType;
UseExpressionBodyForLambdaCodeActionHelpers.cs (1)
76
var lambdaType = (INamedTypeSymbol)semanticModel.
GetTypeInfo
(declaration).ConvertedType!;
UseExpressionBodyForLambdaHelpers.cs (1)
41
if (semanticModel.
GetTypeInfo
(declaration, cancellationToken).ConvertedType is not INamedTypeSymbol lambdaType || lambdaType.DelegateInvokeMethod == null)
UseNamedArguments\CSharpUseNamedArgumentsCodeRefactoringProvider.cs (1)
43
var argType = semanticModel.
GetTypeInfo
(GetArgumentExpression(argument)).Type;
UsePatternMatching\CSharpIsAndCastCheckWithoutNameDiagnosticAnalyzer.cs (1)
125
var typeSymbol = semanticModel.
GetTypeInfo
(type, cancellationToken).Type;
Microsoft.CodeAnalysis.CSharp.Workspaces (66)
CastSimplifier.cs (21)
120
var enumType = semanticModel.
GetTypeInfo
(castExpression.Expression, cancellationToken).Type as INamedTypeSymbol;
121
var castedType = semanticModel.
GetTypeInfo
(castExpression.Type, cancellationToken).Type;
155
var enumType = semanticModel.
GetTypeInfo
(castExpression.Expression, cancellationToken).Type as INamedTypeSymbol;
156
var castedType = semanticModel.
GetTypeInfo
(castExpression.Type, cancellationToken).Type;
160
var parentCastType = semanticModel.
GetTypeInfo
(parentCast.Type, cancellationToken).Type;
296
var originalConvertedType = originalSemanticModel.
GetTypeInfo
(castNode.WalkUpParentheses(), cancellationToken).ConvertedType;
455
var castedExpressionType = originalSemanticModel.
GetTypeInfo
(castedExpressionNode, cancellationToken).Type;
456
var isType = originalSemanticModel.
GetTypeInfo
(isExpression.Right, cancellationToken).Type;
540
var castType = semanticModel.
GetTypeInfo
(castNode, cancellationToken).Type;
712
var originalCastExpressionTypeInfo = originalSemanticModel.
GetTypeInfo
(castExpression, cancellationToken);
713
var originalConditionalTypeInfo = originalSemanticModel.
GetTypeInfo
(originalConditionalExpression, cancellationToken);
714
var rewrittenConditionalTypeInfo = rewrittenSemanticModel.
GetTypeInfo
(rewrittenConditionalExpression, cancellationToken);
731
var castType = originalSemanticModel.
GetTypeInfo
(castExpression, cancellationToken).Type;
877
var castSideType = semanticModel.
GetTypeInfo
(castSide, cancellationToken).Type;
878
var castedExpressionType = semanticModel.
GetTypeInfo
(castExpression.Expression, cancellationToken).Type;
882
var otherSideType = semanticModel.
GetTypeInfo
(otherSide, cancellationToken).Type;
900
var castType = semanticModel.
GetTypeInfo
(castNode, cancellationToken).Type;
901
var castedExpressionType = semanticModel.
GetTypeInfo
(castedExpressionNode, cancellationToken).Type;
941
var typeInfo = semanticModel.
GetTypeInfo
(arrayInitializer, cancellationToken);
1099
var rewrittenType = rewrittenSemanticModel.
GetTypeInfo
(rewrittenExpression, cancellationToken).Type;
1330
var rewrittenConvertedType = rewrittenSemanticModel.
GetTypeInfo
(rewrittenExpression, cancellationToken).ConvertedType;
CSharpSemanticFactsService.cs (1)
141
var type = semanticModel.
GetTypeInfo
(expression, cancellationToken).Type;
CSharpTypeInferenceService.TypeInferrer.cs (4)
440
var info = SemanticModel.
GetTypeInfo
(creation, CancellationToken);
491
var typeInfo = SemanticModel.
GetTypeInfo
(memberAccess.Expression, CancellationToken);
562
var info = SemanticModel.
GetTypeInfo
(elementAccess.Expression, CancellationToken);
1247
var typeInfo = SemanticModel.
GetTypeInfo
(propertyDeclaration.Type);
CSharpTypeStyleHelper.State.cs (3)
78
var declaredTypeSymbol = semanticModel.
GetTypeInfo
(variableDeclaration.Type.StripRefIfNeeded(), cancellationToken).Type;
96
? IsMadeOfSpecialTypes(semanticModel.
GetTypeInfo
(typeSyntax.StripRefIfNeeded()).Type)
136
semanticModel.
GetTypeInfo
(typeSyntax).Type?.IsSpecialType() == true;
CSharpUseExplicitTypeHelper.cs (2)
149
var declaredType = semanticModel.
GetTypeInfo
(typeName.StripRefIfNeeded(), cancellationToken).Type;
156
var initializerTypeInfo = semanticModel.
GetTypeInfo
(initializer, cancellationToken);
CSharpUseImplicitTypeHelper.cs (3)
195
var declarationType = semanticModel.
GetTypeInfo
(declarationTypeNode, cancellationToken).Type;
293
var declaredType = semanticModel.
GetTypeInfo
(typeName.StripRefIfNeeded(), cancellationToken).Type;
332
var initializerType = semanticModel.
GetTypeInfo
(expression, cancellationToken).Type;
DefaultExpressionSyntaxExtensions.cs (2)
52
var entityType = semanticModel.
GetTypeInfo
(typeSyntax, cancellationToken).Type;
53
var defaultType = semanticModel.
GetTypeInfo
(defaultExpression.Type, cancellationToken).Type;
InternalExtensions.cs (2)
28
var typeInfo = semanticModel.
GetTypeInfo
(decl.Type, cancellationToken);
35
var typeInfo = semanticModel.
GetTypeInfo
(expression, cancellationToken);
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\TypeSyntaxExtensions.cs\TypeSyntaxExtensions.cs (1)
38
var type = semanticModel.
GetTypeInfo
(typeSyntax).Type;
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs\SyntaxTokenExtensions.cs (1)
689
var typeInfo = semanticModel.
GetTypeInfo
(memberAccessExpression.Expression, cancellationToken);
ParenthesizedExpressionSyntaxExtensions.cs (1)
76
if (semanticModel.
GetTypeInfo
(varDecl.Type, cancellationToken).Type is
Recommendations\CSharpRecommendationServiceRunner.cs (5)
66
explicitLambdaParameterType = _context.SemanticModel.
GetTypeInfo
(parameter.Type, _cancellationToken).Type;
370
var container = _context.SemanticModel.
GetTypeInfo
(expression, _cancellationToken).Type;
393
var container = _context.SemanticModel.
GetTypeInfo
(expression, _cancellationToken).Type;
406
var container = _context.SemanticModel.
GetTypeInfo
(expression, _cancellationToken).Type;
563
: semanticModel.
GetTypeInfo
(originalExpression, _cancellationToken).Type;
SemanticModelExtensions.cs (2)
113
var typeInfo = semanticModel.
GetTypeInfo
(qualifier, cancellationToken);
414
var info = semanticModel.
GetTypeInfo
(expression, cancellationToken);
Simplification\CSharpSimplificationService.Expander.cs (4)
80
var objectCreationType = _semanticModel.
GetTypeInfo
(objectCreationExpression).Type;
269
var argumentType = _semanticModel.
GetTypeInfo
(node.Expression).ConvertedType;
799
var typeinfo = semanticModel.
GetTypeInfo
(argument.Expression);
1024
var type = semanticModel.
GetTypeInfo
(typeOfExpression.Type, _cancellationToken).Type as INamedTypeSymbol;
Simplification\Reducers\CSharpNullableAnnotationReducer.cs (1)
53
var type = semanticModel.
GetTypeInfo
(node, cancellationToken).Type;
Simplification\Simplifiers\AbstractCSharpSimplifier.cs (3)
157
var type = semanticModel.
GetTypeInfo
(node, cancellationToken).Type;
171
var type = semanticModel.
GetTypeInfo
(node, cancellationToken).Type;
393
semanticModel.
GetTypeInfo
(invocationExpr).Type.SpecialType == SpecialType.System_String;
Simplification\Simplifiers\NameSimplifier.cs (1)
250
var type = semanticModel.
GetTypeInfo
(name, cancellationToken).Type;
SpeculationAnalyzer.cs (8)
370
var originalExpressionTypeInfo = this.OriginalSemanticModel.
GetTypeInfo
(originalExpression, this.CancellationToken);
371
var newExpressionTypeInfo = this.SpeculativeSemanticModel.
GetTypeInfo
(newExpression, this.CancellationToken);
478
var originalExprType = this.OriginalSemanticModel.
GetTypeInfo
(originalSwitchExpression.GoverningExpression, CancellationToken);
479
var replacedExprType = this.SpeculativeSemanticModel.
GetTypeInfo
(replacedSwitchExpression.GoverningExpression, CancellationToken);
548
var originalExpressionType = this.OriginalSemanticModel.
GetTypeInfo
(originalAnonymousObjectMemberDeclarator.Expression, this.CancellationToken).Type;
549
var newExpressionType = this.SpeculativeSemanticModel.
GetTypeInfo
(replacedAnonymousObjectMemberDeclarator.Expression, this.CancellationToken).Type;
685
var originalConvertedType = this.OriginalSemanticModel.
GetTypeInfo
(originalIsOrAsExpression.Right).Type;
686
var newConvertedType = this.SpeculativeSemanticModel.
GetTypeInfo
(newIsOrAsExpression.Right).Type;
TypeStyleHelper.cs (1)
129
var containingType = semanticModel.
GetTypeInfo
(containingTypeName, cancellationToken).Type;
Microsoft.VisualStudio.LanguageServices.CSharp (8)
CodeModel\CSharpCodeModelService.cs (2)
3783
var typeInfo = semanticModel.
GetTypeInfo
(type.Type, CancellationToken.None);
3871
var typeInfo = semanticModel.
GetTypeInfo
(type.Type, CancellationToken.None);
CodeModel\MethodXml\MethodXmlBuilder.cs (5)
144
var typeSymbol = SemanticModel.
GetTypeInfo
(type).Type;
255
var type = SemanticModel.
GetTypeInfo
(expression).Type;
375
var type = SemanticModel.
GetTypeInfo
(castExpression.Type).Type;
414
var type = SemanticModel.
GetTypeInfo
(arrayCreationExpression).Type;
569
var type = SemanticModel.
GetTypeInfo
(typeOfExpression.Type).Type;
LanguageService\CSharpHelpContextService.cs (1)
164
symbol = semanticModel.GetSymbolInfo(genericName, cancellationToken).Symbol ?? semanticModel.
GetTypeInfo
(genericName, cancellationToken).Type;