169 references to SemanticModel
ILLink.RoslynAnalyzer (1)
RequiresAnalyzerBase.cs (1)
73 var model = syntaxNodeAnalysisContext.SemanticModel;
Microsoft.Analyzers.Local (2)
InternalReferencedInPublicDocAnalyzer.cs (2)
131var symbol = context.SemanticModel.GetDeclaredSymbol(symbolNode); 145var referencedSymbol = context.SemanticModel.GetSymbolInfo(crefNode.Cref).Symbol;
Microsoft.AspNetCore.App.Analyzers (1)
Kestrel\ListenOnIPv6AnyAnalyzer.cs (1)
41var nodeOperation = context.SemanticModel.GetOperation(context.Node, context.CancellationToken);
Microsoft.CodeAnalysis.CodeStyle (22)
src\Analyzers\Core\Analyzers\ForEachCast\AbstractForEachCastDiagnosticAnalyzer.cs (1)
53var semanticModel = context.SemanticModel;
src\Analyzers\Core\Analyzers\MatchFolderAndNamespace\AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (2)
71var symbol = context.SemanticModel.GetDeclaredSymbol(namespaceDecl); 77IsFixSupported(context.SemanticModel, namespaceDecl, context.CancellationToken))
src\Analyzers\Core\Analyzers\NamingStyle\NamingStyleDiagnosticAnalyzerBase.cs (1)
87var symbol = syntaxContext.SemanticModel.GetDeclaredSymbol(syntaxContext.Node, syntaxContext.CancellationToken);
src\Analyzers\Core\Analyzers\RemoveUnnecessaryCast\AbstractRemoveUnnecessaryCastDiagnosticAnalyzer.cs (1)
46context.SemanticModel,
src\Analyzers\Core\Analyzers\RemoveUnnecessaryParentheses\AbstractRemoveUnnecessaryParenthesesDiagnosticAnalyzer.cs (1)
52if (!CanRemoveParentheses(parenthesizedExpression, context.SemanticModel, cancellationToken,
src\Analyzers\Core\Analyzers\SimplifyBooleanExpression\AbstractSimplifyConditionalDiagnosticAnalyzer.cs (1)
73var semanticModel = context.SemanticModel;
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (1)
340var semanticModel = context.SemanticModel;
src\Analyzers\Core\Analyzers\UseCoalesceExpression\AbstractUseCoalesceExpressionForIfNullCheckDiagnosticAnalyzer.cs (1)
53var semanticModel = context.SemanticModel;
src\Analyzers\Core\Analyzers\UseCoalesceExpression\AbstractUseCoalesceExpressionForNullableTernaryConditionalCheckDiagnosticAnalyzer.cs (1)
102var semanticModel = context.SemanticModel;
src\Analyzers\Core\Analyzers\UseCoalesceExpression\AbstractUseCoalesceExpressionForTernaryConditionalCheckDiagnosticAnalyzer.cs (1)
100var semanticModel = context.SemanticModel;
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerDiagnosticAnalyzer.cs (2)
130var semanticModel = context.SemanticModel; 149var objectType = context.SemanticModel.GetTypeInfo(objectCreationExpression, cancellationToken);
src\Analyzers\Core\Analyzers\UseCompoundAssignment\AbstractUseCompoundAssignmentDiagnosticAnalyzer.cs (1)
138var semanticModel = context.SemanticModel;
src\Analyzers\Core\Analyzers\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsDiagnosticAnalyzer.cs (1)
60var semanticModel = context.SemanticModel;
src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer.cs (2)
149var semanticModel = context.SemanticModel; 318var semanticModel = context.SemanticModel;
src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer_IfStatement.cs (1)
56var semanticModel = context.SemanticModel;
src\Analyzers\Core\Analyzers\UseObjectInitializer\AbstractUseObjectInitializerDiagnosticAnalyzer.cs (1)
95var semanticModel = context.SemanticModel;
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (2)
105var symbolInfo = context.SemanticModel.GetSymbolInfo(expression, context.CancellationToken); 120if (ArgsIsArrayOfReferenceTypes(context.SemanticModel, arguments, parameters, syntaxFacts))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\DiagnosticAnalyzerCategory.cs (1)
21/// up needing to use the <see cref="SyntaxNodeAnalysisContext.SemanticModel"/>. If a
Microsoft.CodeAnalysis.CSharp.CodeStyle (44)
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertToTopLevelStatementsDiagnosticAnalyzer.cs (1)
59var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.cs (1)
58context.SemanticModel,
src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (1)
127var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessAnalyzer.cs (4)
91if (syntaxContext.SemanticModel.GetTypeInfo(invocationExpression.Expression, syntaxContext.CancellationToken).Type is { TypeKind: TypeKind.FunctionPointer }) 130var tree = context.SemanticModel.SyntaxTree; 158var type = context.SemanticModel.GetTypeInfo(expression, context.CancellationToken).Type; 275var semanticModel = syntaxContext.SemanticModel;
src\Analyzers\CSharp\Analyzers\MakeAnonymousFunctionStatic\MakeAnonymousFunctionStaticDiagnosticAnalyzer.cs (1)
49if (context.SemanticModel.AnalyzeDataFlow(anonymousFunction) is { Succeeded: true, Captured.IsEmpty: true })
src\Analyzers\CSharp\Analyzers\MakeLocalFunctionStatic\MakeLocalFunctionStaticDiagnosticAnalyzer.cs (1)
50var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\MakeStructReadOnly\CSharpMakeStructReadOnlyDiagnosticAnalyzer.cs (1)
48var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryDiscardDesignation\CSharpRemoveUnnecessaryDiscardDesignationDiagnosticAnalyzer.cs (1)
50var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
59var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\RemoveUnnecessarySuppressions\CSharpRemoveUnnecessaryAttributeSuppressionsDiagnosticAnalyzer.cs (1)
25compilationAnalyzer.AnalyzeAssemblyOrModuleAttribute(attribute, context.SemanticModel, context.ReportDiagnostic, context.CancellationToken);
src\Analyzers\CSharp\Analyzers\SimplifyLinqExpression\CSharpSimplifyLinqTypeCheckAndCastDiagnosticAnalyzer.cs (1)
181var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForArrayDiagnosticAnalyzer.cs (2)
37var semanticModel = context.SemanticModel; 140var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderDiagnosticAnalyzer.cs (1)
39var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForCreateDiagnosticAnalyzer.cs (1)
28var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForEmptyDiagnosticAnalyzer.cs (1)
29var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs (1)
71var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForNewDiagnosticAnalyzer.cs (1)
40var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForStackAllocDiagnosticAnalyzer.cs (2)
43var semanticModel = context.SemanticModel; 85var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (2)
57var semanticModel = context.SemanticModel; 123var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (2)
62if (!TryAnalyzeVariableDeclaration(context.SemanticModel, variableDeclaration, out _, out _, context.CancellationToken)) 77if (!TryAnalyzeForEachStatement(context.SemanticModel, forEachStatement, out _, out _, context.CancellationToken))
src\Analyzers\CSharp\Analyzers\UseDefaultLiteral\CSharpUseDefaultLiteralDiagnosticAnalyzer.cs (1)
44if (!defaultExpression.CanReplaceWithDefaultLiteral(parseOptions, preference.Value, context.SemanticModel, cancellationToken))
src\Analyzers\CSharp\Analyzers\UseExpressionBodyForLambda\UseExpressionBodyForLambdaDiagnosticAnalyzer.cs (2)
40var syntaxTree = context.SemanticModel.SyntaxTree; 63var diagnostic = AnalyzeSyntax(context.SemanticModel, option, declaration, context.Options, context.CancellationToken);
src\Analyzers\CSharp\Analyzers\UseImplicitObjectCreation\CSharpUseImplicitObjectCreationDiagnosticAnalyzer.cs (1)
40var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseImplicitOrExplicitType\CSharpTypeStyleDiagnosticAnalyzerBase.cs (1)
37var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseIsNullCheck\CSharpUseIsNullCheckForCastAndEqualityOperatorDiagnosticAnalyzer.cs (1)
53var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (1)
86var semanticModel = syntaxContext.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseNameofInNullableAttribute\CSharpUseNameofInNullableAttributeDiagnosticAnalyzer.cs (1)
59var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UsePatternCombinators\CSharpUsePatternCombinatorsDiagnosticAnalyzer.cs (1)
68var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndMemberAccessDiagnosticAnalyzer.cs (1)
63var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.cs (1)
83var semanticModel = syntaxContext.SemanticModel;
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpIsAndCastCheckDiagnosticAnalyzer.cs (1)
111var semanticModel = syntaxContext.SemanticModel;
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpUseNotPatternDiagnosticAnalyzer.cs (2)
71var semanticModel = context.SemanticModel; 92if (node.IsInExpressionTree(context.SemanticModel, expressionOfTType, cancellationToken))
src\Analyzers\CSharp\Analyzers\UseSimpleUsingStatement\UseSimpleUsingStatementDiagnosticAnalyzer.cs (2)
85var semanticModel = context.SemanticModel; 115context.SemanticModel, parentBlockLike,
src\Analyzers\CSharp\Analyzers\UseTupleSwap\CSharpUseTupleSwapDiagnosticAnalyzer.cs (1)
108var semanticModel = syntaxContext.SemanticModel;
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
Diagnostics\FixAllProvider\BatchFixerTests.cs (1)
51var symbol = context.SemanticModel.GetSymbolInfo(node).Symbol;
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1)
Semantics\OutVarTests.cs (1)
18813var model = context.SemanticModel;
Microsoft.CodeAnalysis.CSharp.Features (45)
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertToTopLevelStatementsDiagnosticAnalyzer.cs (1)
59var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.cs (1)
58context.SemanticModel,
src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (1)
127var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessAnalyzer.cs (4)
91if (syntaxContext.SemanticModel.GetTypeInfo(invocationExpression.Expression, syntaxContext.CancellationToken).Type is { TypeKind: TypeKind.FunctionPointer }) 130var tree = context.SemanticModel.SyntaxTree; 158var type = context.SemanticModel.GetTypeInfo(expression, context.CancellationToken).Type; 275var semanticModel = syntaxContext.SemanticModel;
src\Analyzers\CSharp\Analyzers\MakeAnonymousFunctionStatic\MakeAnonymousFunctionStaticDiagnosticAnalyzer.cs (1)
49if (context.SemanticModel.AnalyzeDataFlow(anonymousFunction) is { Succeeded: true, Captured.IsEmpty: true })
src\Analyzers\CSharp\Analyzers\MakeLocalFunctionStatic\MakeLocalFunctionStaticDiagnosticAnalyzer.cs (1)
50var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\MakeStructReadOnly\CSharpMakeStructReadOnlyDiagnosticAnalyzer.cs (1)
48var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryDiscardDesignation\CSharpRemoveUnnecessaryDiscardDesignationDiagnosticAnalyzer.cs (1)
50var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
59var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\RemoveUnnecessarySuppressions\CSharpRemoveUnnecessaryAttributeSuppressionsDiagnosticAnalyzer.cs (1)
25compilationAnalyzer.AnalyzeAssemblyOrModuleAttribute(attribute, context.SemanticModel, context.ReportDiagnostic, context.CancellationToken);
src\Analyzers\CSharp\Analyzers\SimplifyLinqExpression\CSharpSimplifyLinqTypeCheckAndCastDiagnosticAnalyzer.cs (1)
181var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForArrayDiagnosticAnalyzer.cs (2)
37var semanticModel = context.SemanticModel; 140var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderDiagnosticAnalyzer.cs (1)
39var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForCreateDiagnosticAnalyzer.cs (1)
28var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForEmptyDiagnosticAnalyzer.cs (1)
29var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs (1)
71var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForNewDiagnosticAnalyzer.cs (1)
40var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForStackAllocDiagnosticAnalyzer.cs (2)
43var semanticModel = context.SemanticModel; 85var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (2)
57var semanticModel = context.SemanticModel; 123var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (2)
62if (!TryAnalyzeVariableDeclaration(context.SemanticModel, variableDeclaration, out _, out _, context.CancellationToken)) 77if (!TryAnalyzeForEachStatement(context.SemanticModel, forEachStatement, out _, out _, context.CancellationToken))
src\Analyzers\CSharp\Analyzers\UseDefaultLiteral\CSharpUseDefaultLiteralDiagnosticAnalyzer.cs (1)
44if (!defaultExpression.CanReplaceWithDefaultLiteral(parseOptions, preference.Value, context.SemanticModel, cancellationToken))
src\Analyzers\CSharp\Analyzers\UseExpressionBodyForLambda\UseExpressionBodyForLambdaDiagnosticAnalyzer.cs (2)
40var syntaxTree = context.SemanticModel.SyntaxTree; 63var diagnostic = AnalyzeSyntax(context.SemanticModel, option, declaration, context.Options, context.CancellationToken);
src\Analyzers\CSharp\Analyzers\UseImplicitObjectCreation\CSharpUseImplicitObjectCreationDiagnosticAnalyzer.cs (1)
40var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseImplicitOrExplicitType\CSharpTypeStyleDiagnosticAnalyzerBase.cs (1)
37var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseIsNullCheck\CSharpUseIsNullCheckForCastAndEqualityOperatorDiagnosticAnalyzer.cs (1)
53var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (1)
86var semanticModel = syntaxContext.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseNameofInNullableAttribute\CSharpUseNameofInNullableAttributeDiagnosticAnalyzer.cs (1)
59var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UsePatternCombinators\CSharpUsePatternCombinatorsDiagnosticAnalyzer.cs (1)
68var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndMemberAccessDiagnosticAnalyzer.cs (1)
63var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.cs (1)
83var semanticModel = syntaxContext.SemanticModel;
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpIsAndCastCheckDiagnosticAnalyzer.cs (1)
111var semanticModel = syntaxContext.SemanticModel;
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpUseNotPatternDiagnosticAnalyzer.cs (2)
71var semanticModel = context.SemanticModel; 92if (node.IsInExpressionTree(context.SemanticModel, expressionOfTType, cancellationToken))
src\Analyzers\CSharp\Analyzers\UseSimpleUsingStatement\UseSimpleUsingStatementDiagnosticAnalyzer.cs (2)
85var semanticModel = context.SemanticModel; 115context.SemanticModel, parentBlockLike,
src\Analyzers\CSharp\Analyzers\UseTupleSwap\CSharpUseTupleSwapDiagnosticAnalyzer.cs (1)
108var semanticModel = syntaxContext.SemanticModel;
UsePatternMatching\CSharpIsAndCastCheckWithoutNameDiagnosticAnalyzer.cs (1)
66var semanticModel = context.SemanticModel;
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (5)
Semantics\ColorColorTests.cs (1)
1787var actualSymbol = context.SemanticModel.GetSymbolInfo(memberAccessExpression.Expression);
Semantics\TopLevelStatementsTests.cs (4)
6437var model = context.SemanticModel; 6467var model = context.SemanticModel; 7065var model = context.SemanticModel; 7099var model = context.SemanticModel;
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (5)
Symbols\Source\NullablePublicAPITests.cs (5)
1168var info = syntaxContext.SemanticModel.GetTypeInfoAndVerifyIOperation(syntaxContext.Node); 1169Assert.True(syntaxContext.SemanticModel.TryGetSpeculativeSemanticModel(syntaxContext.Node.SpanStart, newSource, out var specModel)); 1177var declaredSymbol = (ILocalSymbol)context.SemanticModel.GetDeclaredSymbol(declarator); 1792var model = context.SemanticModel; 4848var model = context.SemanticModel;
Microsoft.CodeAnalysis.Features (24)
Diagnostics\Analyzers\UnboundIdentifiersDiagnosticAnalyzerBase.cs (1)
72var info = context.SemanticModel.GetSymbolInfo(typeName);
PreferFrameworkType\PreferFrameworkTypeDiagnosticAnalyzerBase.cs (1)
52var semanticModel = context.SemanticModel;
SimplifyThisOrMe\AbstractSimplifyThisOrMeDiagnosticAnalyzer.cs (1)
55var semanticModel = context.SemanticModel;
src\Analyzers\Core\Analyzers\ForEachCast\AbstractForEachCastDiagnosticAnalyzer.cs (1)
53var semanticModel = context.SemanticModel;
src\Analyzers\Core\Analyzers\MatchFolderAndNamespace\AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (2)
71var symbol = context.SemanticModel.GetDeclaredSymbol(namespaceDecl); 77IsFixSupported(context.SemanticModel, namespaceDecl, context.CancellationToken))
src\Analyzers\Core\Analyzers\NamingStyle\NamingStyleDiagnosticAnalyzerBase.cs (1)
87var symbol = syntaxContext.SemanticModel.GetDeclaredSymbol(syntaxContext.Node, syntaxContext.CancellationToken);
src\Analyzers\Core\Analyzers\RemoveUnnecessaryCast\AbstractRemoveUnnecessaryCastDiagnosticAnalyzer.cs (1)
46context.SemanticModel,
src\Analyzers\Core\Analyzers\RemoveUnnecessaryParentheses\AbstractRemoveUnnecessaryParenthesesDiagnosticAnalyzer.cs (1)
52if (!CanRemoveParentheses(parenthesizedExpression, context.SemanticModel, cancellationToken,
src\Analyzers\Core\Analyzers\SimplifyBooleanExpression\AbstractSimplifyConditionalDiagnosticAnalyzer.cs (1)
73var semanticModel = context.SemanticModel;
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (1)
340var semanticModel = context.SemanticModel;
src\Analyzers\Core\Analyzers\UseCoalesceExpression\AbstractUseCoalesceExpressionForIfNullCheckDiagnosticAnalyzer.cs (1)
53var semanticModel = context.SemanticModel;
src\Analyzers\Core\Analyzers\UseCoalesceExpression\AbstractUseCoalesceExpressionForNullableTernaryConditionalCheckDiagnosticAnalyzer.cs (1)
102var semanticModel = context.SemanticModel;
src\Analyzers\Core\Analyzers\UseCoalesceExpression\AbstractUseCoalesceExpressionForTernaryConditionalCheckDiagnosticAnalyzer.cs (1)
100var semanticModel = context.SemanticModel;
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerDiagnosticAnalyzer.cs (2)
130var semanticModel = context.SemanticModel; 149var objectType = context.SemanticModel.GetTypeInfo(objectCreationExpression, cancellationToken);
src\Analyzers\Core\Analyzers\UseCompoundAssignment\AbstractUseCompoundAssignmentDiagnosticAnalyzer.cs (1)
138var semanticModel = context.SemanticModel;
src\Analyzers\Core\Analyzers\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsDiagnosticAnalyzer.cs (1)
60var semanticModel = context.SemanticModel;
src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer.cs (2)
149var semanticModel = context.SemanticModel; 318var semanticModel = context.SemanticModel;
src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer_IfStatement.cs (1)
56var semanticModel = context.SemanticModel;
src\Analyzers\Core\Analyzers\UseObjectInitializer\AbstractUseObjectInitializerDiagnosticAnalyzer.cs (1)
95var semanticModel = context.SemanticModel;
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (2)
105var symbolInfo = context.SemanticModel.GetSymbolInfo(expression, context.CancellationToken); 120if (ArgsIsArrayOfReferenceTypes(context.SemanticModel, arguments, parameters, syntaxFacts))
Microsoft.CodeAnalysis.Test.Utilities (2)
Diagnostics\OperationTestAnalyzer.cs (2)
2140var model = syntaxContext.SemanticModel; 2152var model = syntaxContext.SemanticModel;
Microsoft.CodeAnalysis.UnitTests (1)
Diagnostics\AnalysisContextInfoTests.cs (1)
80c.RegisterSyntaxNodeAction(b => ThrowIfMatch(nameof(c.RegisterSyntaxNodeAction), new AnalysisContextInfo(b.SemanticModel.Compilation, b.Node)), SyntaxKind.ReturnStatement);
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (3)
src\Analyzers\VisualBasic\Analyzers\RemoveUnnecessarySuppressions\VisualBasicRemoveUnnecessaryAttributeSuppressionsDiagnosticAnalyzer.vb (1)
21compilationAnalyzer.AnalyzeAssemblyOrModuleAttribute(attribute, syntaxContext.SemanticModel, AddressOf syntaxContext.ReportDiagnostic, syntaxContext.CancellationToken)
src\Analyzers\VisualBasic\Analyzers\RemoveUnusedMembers\VisualBasicRemoveUnusedMembersDiagnosticAnalyzer.vb (1)
48Dim symbolInfo = context.SemanticModel.GetSymbolInfo(node, context.CancellationToken)
src\Analyzers\VisualBasic\Analyzers\SimplifyObjectCreation\VisualBasicSimplifyObjectCreationDiagnosticAnalyzer.vb (1)
55Dim symbolInfo = context.SemanticModel.GetTypeInfo(objectCreation, cancellationToken)
Microsoft.CodeAnalysis.VisualBasic.Features (3)
src\Analyzers\VisualBasic\Analyzers\RemoveUnnecessarySuppressions\VisualBasicRemoveUnnecessaryAttributeSuppressionsDiagnosticAnalyzer.vb (1)
21compilationAnalyzer.AnalyzeAssemblyOrModuleAttribute(attribute, syntaxContext.SemanticModel, AddressOf syntaxContext.ReportDiagnostic, syntaxContext.CancellationToken)
src\Analyzers\VisualBasic\Analyzers\RemoveUnusedMembers\VisualBasicRemoveUnusedMembersDiagnosticAnalyzer.vb (1)
48Dim symbolInfo = context.SemanticModel.GetSymbolInfo(node, context.CancellationToken)
src\Analyzers\VisualBasic\Analyzers\SimplifyObjectCreation\VisualBasicSimplifyObjectCreationDiagnosticAnalyzer.vb (1)
55Dim symbolInfo = context.SemanticModel.GetTypeInfo(objectCreation, cancellationToken)
Microsoft.CodeAnalysis.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\DiagnosticAnalyzerCategory.cs (1)
21/// up needing to use the <see cref="SyntaxNodeAnalysisContext.SemanticModel"/>. If a
Microsoft.DotNet.CodeAnalysis (2)
Analyzers\AppContextDefaultsAnalyzer.cs (1)
67if (!IsCallToDefineSwitchDefault(call, context.SemanticModel))
Analyzers\ResourceUsageAnalyzer.cs (1)
43IMethodSymbol memberSymbol = context.SemanticModel.GetSymbolInfo(memberAccessExpr).Symbol as IMethodSymbol;
Microsoft.ML.InternalCodeAnalyzer (2)
ContractsCheckAnalyzer.cs (2)
152var field = context.SemanticModel.GetSymbolInfo(access).Symbol as IFieldSymbol; 195var symbolInfo = context.SemanticModel.GetSymbolInfo(invocation);
System.Windows.Forms.Analyzers.CSharp (2)
System\Windows\Forms\CSharp\Analyzers\AvoidPassingTaskWithoutCancellationToken\AvoidPassingTaskWithoutCancellationTokenAnalyzer.cs (2)
35|| context.SemanticModel.GetSymbolInfo(memberAccessExpr).Symbol is not IMethodSymbol methodSymbol 42TypeInfo objectTypeInfo = context.SemanticModel.GetTypeInfo(memberAccessExpr.Expression);
System.Windows.Forms.Analyzers.VisualBasic (2)
Analyzers\AvoidPassingTaskWithoutCancellationToken\AvoidPassingTaskWithoutCancellationTokenAnalyzer.vb (2)
40Dim methodSymbol = TryCast(context.SemanticModel.GetSymbolInfo(memberAccessExpr).Symbol, IMethodSymbol) 47Dim objectTypeInfo As TypeInfo = context.SemanticModel.GetTypeInfo(memberAccessExpr.Expression)