250 references to GetLocation
ConfigurationSchemaGenerator (1)
RuntimeSource\Configuration.Binder\Parser\BinderInvocation.cs (1)
30? new BinderInvocation(operation, invocationSyntax.GetLocation())
Microsoft.Analyzers.Local (2)
CallAnalysis\Throws.cs (1)
53binaryExpression.GetLocation(),
InternalReferencedInPublicDocAnalyzer.cs (1)
154var diagnostic = Diagnostic.Create(DiagDescriptors.InternalReferencedInPublicDoc, crefNode.Cref.GetLocation(), referencedName);
Microsoft.AspNetCore.App.Analyzers (4)
Kestrel\ListenOnIPv6AnyAnalyzer.cs (2)
69context.ReportDiagnostic(Diagnostic.Create(DiagnosticDescriptors.KestrelShouldListenOnIPv6AnyInsteadOfIpAny, ipAddressArgumentSyntax.GetLocation())); 94context.ReportDiagnostic(Diagnostic.Create(DiagnosticDescriptors.KestrelShouldListenOnIPv6AnyInsteadOfIpAny, ipAddressArgumentSyntax.GetLocation()));
RouteHandlers\DisallowNonParsableComplexTypesOnParameters.cs (1)
48var location = syntax.GetLocation();
WebApplicationBuilder\WebApplicationBuilderAnalyzer.cs (1)
292var methodLocation = methodName.GetLocation();
Microsoft.AspNetCore.SignalR.Client.SourceGenerator (7)
HubClientProxyGenerator.Parser.cs (3)
199extraneous.GetLocation())); 230methodDeclarationSyntax.GetLocation())); 281CallSite = memberAccess.GetLocation()
HubServerProxyGenerator.Parser.cs (4)
188extraneous.GetLocation())); 219methodDeclarationSyntax.GetLocation())); 242memberAccess.GetLocation(), 258CallSite = memberAccess.GetLocation()
Microsoft.CodeAnalysis.CSharp (3)
Binder\Binder_Constraints.cs (1)
360diagnostics.Add(ErrorCode.ERR_TypeConstraintsMustBeUniqueAndFirst, syntax.GetLocation());
Symbols\Symbol.cs (1)
1501diagnostics.Add(ErrorCode.ERR_BlockBodyAndExpressionBody, syntax.GetLocation());
Symbols\Symbol_Attributes.cs (1)
698diagnostics.Add(ErrorCode.WRN_NonECMAFeature, targetOpt.GetLocation(), MessageID.IDS_FeatureModuleAttrLoc);
Microsoft.CodeAnalysis.CSharp.CodeStyle (77)
src\Analyzers\CSharp\Analyzers\AddAccessibilityModifiers\CSharpAddAccessibilityModifiersDiagnosticAnalyzer.cs (1)
57var additionalLocations = ImmutableArray.Create(member.GetLocation());
src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertToBlockScopedNamespaceDiagnosticAnalyzer.cs (2)
54? declaration.Name.GetLocation() 62ImmutableArray.Create(declaration.GetLocation()),
src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertToFileScopedNamespaceDiagnosticAnalyzer.cs (2)
57? declaration.Name.GetLocation() 65ImmutableArray.Create(declaration.GetLocation()),
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertProgramAnalysis_TopLevelStatements.cs (1)
34return isHidden ? methodDeclaration.GetLocation() : methodDeclaration.Identifier.GetLocation();
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertToTopLevelStatementsDiagnosticAnalyzer.cs (1)
81ImmutableArray.Create(methodDeclaration.GetLocation()),
src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.cs (1)
67additionalLocations.AddOptional(declaratorToRemoveOpt?.GetLocation());
src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (2)
231localDeclarator.GetLocation(), 232identifierName.GetLocation(),
src\Analyzers\CSharp\Analyzers\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessAnalyzer.cs (4)
197expressionStatement.GetLocation(), 303[localDeclarationStatement.GetLocation(), ifStatement.GetLocation(), expressionStatement.GetLocation()],
src\Analyzers\CSharp\Analyzers\MakeAnonymousFunctionStatic\MakeAnonymousFunctionStaticDiagnosticAnalyzer.cs (1)
54anonymousFunction.GetLocation()));
src\Analyzers\CSharp\Analyzers\MakeLocalFunctionStatic\MakeLocalFunctionStaticDiagnosticAnalyzer.cs (1)
58additionalLocations: ImmutableArray.Create(localFunction.GetLocation()),
src\Analyzers\CSharp\Analyzers\MakeStructReadOnly\CSharpMakeStructReadOnlyDiagnosticAnalyzer.cs (1)
126additionalLocation = typeDeclaration.GetLocation();
src\Analyzers\CSharp\Analyzers\MisplacedUsingDirectives\MisplacedUsingDirectivesDiagnosticAnalyzer.cs (1)
106usingDirective.GetLocation(),
src\Analyzers\CSharp\Analyzers\NewLines\ConstructorInitializerPlacement\ConstructorInitializerPlacementDiagnosticAnalyzer.cs (1)
96additionalLocations: ImmutableArray.Create(initializer.GetLocation()),
src\Analyzers\CSharp\Analyzers\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementDiagnosticAnalyzer.cs (1)
73var additionalLocations = ImmutableArray.Create(statement.GetLocation());
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryDiscardDesignation\CSharpRemoveUnnecessaryDiscardDesignationDiagnosticAnalyzer.cs (1)
99discard.GetLocation()));
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
232additionalLocations: [anonymousFunction.GetLocation()],
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveDiagnosticAnalyzer.cs (2)
129diagnostics.Add(Diagnostic.Create(Descriptor, currentOptionsDirective.GetLocation())); 161diagnostics.Add(Diagnostic.Create(Descriptor, currentOptionsDirective.GetLocation()));
src\Analyzers\CSharp\Analyzers\RemoveUnusedParametersAndValues\CSharpRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (3)
89return declarationPattern.Designation.GetLocation(); 93return recursivePattern.Designation!.GetLocation(); 97return listPattern.Designation!.GetLocation();
src\Analyzers\CSharp\Analyzers\SimplifyLinqExpression\CSharpSimplifyLinqTypeCheckAndCastDiagnosticAnalyzer.cs (1)
220additionalLocations: [invocationExpression.GetLocation(), castTypeArgument.GetLocation()]));
src\Analyzers\CSharp\Analyzers\SimplifyPropertyPattern\CSharpSimplifyPropertyPatternDiagnosticAnalyzer.cs (2)
67expressionColon.GetLocation(), 70ImmutableArray.Create(subpattern.GetLocation()),
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForArrayDiagnosticAnalyzer.cs (2)
199additionalLocations: ImmutableArray.Create(initializer.GetLocation()), 208var locations = ImmutableArray.Create(expression.GetLocation());
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderDiagnosticAnalyzer.cs (2)
52var locations = ImmutableArray.Create(invocationExpression.GetLocation()); 69analysisResult.LocalDeclarationStatement.GetLocation());
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForCreateDiagnosticAnalyzer.cs (1)
49var locations = ImmutableArray.Create(invocationExpression.GetLocation());
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForEmptyDiagnosticAnalyzer.cs (1)
60additionalLocations: ImmutableArray.Create(nodeToReplace.GetLocation()),
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs (1)
105additionalLocations: ImmutableArray.Create(invocation.GetLocation()),
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForNewDiagnosticAnalyzer.cs (1)
74var locations = ImmutableArray.Create(objectCreationExpression.GetLocation());
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForStackAllocDiagnosticAnalyzer.cs (2)
60var locations = ImmutableArray.Create(expression.GetLocation()); 100var locations = ImmutableArray.Create(expression.GetLocation());
src\Analyzers\CSharp\Analyzers\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (2)
100additionalLocations: ImmutableArray.Create(coalesceExpression.GetLocation()), 173additionalLocations: ImmutableArray.Create(ifStatement.GetLocation()),
src\Analyzers\CSharp\Analyzers\UseDefaultLiteral\CSharpUseDefaultLiteralDiagnosticAnalyzer.cs (1)
53defaultExpression.GetLocation(),
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForIndexersHelper.cs (2)
84return body.Statements[0].GetLocation(); 88return getAccessor.ExpressionBody.GetLocation();
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForPropertiesHelper.cs (1)
88return getAccessor.ExpressionBody.GetLocation();
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyHelper`1.cs (1)
88return body.Statements[0].GetLocation();
src\Analyzers\CSharp\Analyzers\UseExpressionBody\UseExpressionBodyDiagnosticAnalyzer.cs (1)
117: expressionBody.GetLocation();
src\Analyzers\CSharp\Analyzers\UseExpressionBodyForLambda\UseExpressionBodyForLambdaDiagnosticAnalyzer.cs (2)
78var additionalLocations = ImmutableArray.Create(declaration.GetLocation()); 93var additionalLocations = ImmutableArray.Create(declaration.GetLocation());
src\Analyzers\CSharp\Analyzers\UseImplicitObjectCreation\CSharpUseImplicitObjectCreationDiagnosticAnalyzer.cs (2)
60objectCreation.Type.GetLocation(), 63ImmutableArray.Create(objectCreation.GetLocation()),
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseIndexOperatorDiagnosticAnalyzer.cs (1)
208binaryExpression.GetLocation(),
src\Analyzers\CSharp\Analyzers\UseInferredMemberName\CSharpUseInferredMemberNameDiagnosticAnalyzer.cs (2)
59nameColon.GetLocation(), 85nameEquals.GetLocation(),
src\Analyzers\CSharp\Analyzers\UseIsNullCheck\CSharpUseIsNullCheckForCastAndEqualityOperatorDiagnosticAnalyzer.cs (1)
66Descriptor, binaryExpression.GetLocation(), option.Notification, context.Options, additionalLocations: null, properties));
src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (6)
134localDeclaration.GetLocation(), 135anonymousFunction.GetLocation()); 156localDeclaration.GetLocation(), 276references.Add(invocationExpression.GetLocation()); 283references.Add(explicitInvocationExpression.GetLocation()); 294references.Add(nodeToCheck.GetLocation());
src\Analyzers\CSharp\Analyzers\UseNameofInNullableAttribute\CSharpUseNameofInNullableAttributeDiagnosticAnalyzer.cs (1)
108argument.Expression.GetLocation(),
src\Analyzers\CSharp\Analyzers\UsePatternCombinators\CSharpUsePatternCombinatorsDiagnosticAnalyzer.cs (1)
97expression.GetLocation(),
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndMemberAccessDiagnosticAnalyzer.cs (1)
83asExpression.GetLocation(),
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.cs (2)
255comparison.GetLocation(), 261localStatement.GetLocation(),
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpIsAndCastCheckDiagnosticAnalyzer.cs (3)
149ifStatement.GetLocation(), 150localDeclarationStatement.GetLocation()); 155localDeclarationStatement.GetLocation(),
src\Analyzers\CSharp\Analyzers\UseSimpleUsingStatement\UseSimpleUsingStatementDiagnosticAnalyzer.cs (1)
127additionalLocations: [outermostUsing.GetLocation()],
src\Analyzers\CSharp\Analyzers\UseTupleSwap\CSharpUseTupleSwapDiagnosticAnalyzer.cs (3)
114localDeclarationStatement.GetLocation(), 115firstAssignmentStatement.GetLocation(), 116secondAssignmentStatement.GetLocation());
src\Analyzers\CSharp\Analyzers\UseUnboundGenericTypeInNameOf\CSharpUseUnboundGenericTypeInNameOfDiagnosticAnalyzer.cs (1)
79[invocation.GetLocation()],
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (2)
223AssignmentExpressionSyntax assignment => assignment.Left.GetLocation(), 224ForEachVariableStatementSyntax @foreach => @foreach.Variable.GetLocation(),
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
Diagnostics\FixAllProvider\BatchFixerTests.cs (1)
54var diagnostic = Diagnostic.Create(Descriptor, node.GetLocation());
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (2)
CodeGen\CodeGenTupleTest.cs (2)
17376Assert.Equal(nc.Name.GetLocation(), sym.Symbol.Locations[0]); 17411Assert.Equal(secondElement.GetLocation(), bobField.Locations[0]);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (2)
Diagnostics\DiagnosticAnalyzerTests.cs (2)
668var diagnostic = CodeAnalysis.Diagnostic.Create(Rule, fieldDeclaration.GetLocation()); 4087var diagnostic = CodeAnalysis.Diagnostic.Create(Rule, recordDeclaration.GetLocation());
Microsoft.CodeAnalysis.CSharp.Features (73)
src\Analyzers\CSharp\Analyzers\AddAccessibilityModifiers\CSharpAddAccessibilityModifiersDiagnosticAnalyzer.cs (1)
57var additionalLocations = ImmutableArray.Create(member.GetLocation());
src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertToBlockScopedNamespaceDiagnosticAnalyzer.cs (2)
54? declaration.Name.GetLocation() 62ImmutableArray.Create(declaration.GetLocation()),
src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertToFileScopedNamespaceDiagnosticAnalyzer.cs (2)
57? declaration.Name.GetLocation() 65ImmutableArray.Create(declaration.GetLocation()),
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertProgramAnalysis_TopLevelStatements.cs (1)
34return isHidden ? methodDeclaration.GetLocation() : methodDeclaration.Identifier.GetLocation();
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertToTopLevelStatementsDiagnosticAnalyzer.cs (1)
81ImmutableArray.Create(methodDeclaration.GetLocation()),
src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.cs (1)
67additionalLocations.AddOptional(declaratorToRemoveOpt?.GetLocation());
src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (2)
231localDeclarator.GetLocation(), 232identifierName.GetLocation(),
src\Analyzers\CSharp\Analyzers\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessAnalyzer.cs (4)
197expressionStatement.GetLocation(), 303[localDeclarationStatement.GetLocation(), ifStatement.GetLocation(), expressionStatement.GetLocation()],
src\Analyzers\CSharp\Analyzers\MakeAnonymousFunctionStatic\MakeAnonymousFunctionStaticDiagnosticAnalyzer.cs (1)
54anonymousFunction.GetLocation()));
src\Analyzers\CSharp\Analyzers\MakeLocalFunctionStatic\MakeLocalFunctionStaticDiagnosticAnalyzer.cs (1)
58additionalLocations: ImmutableArray.Create(localFunction.GetLocation()),
src\Analyzers\CSharp\Analyzers\MakeStructReadOnly\CSharpMakeStructReadOnlyDiagnosticAnalyzer.cs (1)
126additionalLocation = typeDeclaration.GetLocation();
src\Analyzers\CSharp\Analyzers\MisplacedUsingDirectives\MisplacedUsingDirectivesDiagnosticAnalyzer.cs (1)
106usingDirective.GetLocation(),
src\Analyzers\CSharp\Analyzers\NewLines\ConstructorInitializerPlacement\ConstructorInitializerPlacementDiagnosticAnalyzer.cs (1)
96additionalLocations: ImmutableArray.Create(initializer.GetLocation()),
src\Analyzers\CSharp\Analyzers\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementDiagnosticAnalyzer.cs (1)
73var additionalLocations = ImmutableArray.Create(statement.GetLocation());
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryDiscardDesignation\CSharpRemoveUnnecessaryDiscardDesignationDiagnosticAnalyzer.cs (1)
99discard.GetLocation()));
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
232additionalLocations: [anonymousFunction.GetLocation()],
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveDiagnosticAnalyzer.cs (2)
129diagnostics.Add(Diagnostic.Create(Descriptor, currentOptionsDirective.GetLocation())); 161diagnostics.Add(Diagnostic.Create(Descriptor, currentOptionsDirective.GetLocation()));
src\Analyzers\CSharp\Analyzers\RemoveUnusedParametersAndValues\CSharpRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (3)
89return declarationPattern.Designation.GetLocation(); 93return recursivePattern.Designation!.GetLocation(); 97return listPattern.Designation!.GetLocation();
src\Analyzers\CSharp\Analyzers\SimplifyLinqExpression\CSharpSimplifyLinqTypeCheckAndCastDiagnosticAnalyzer.cs (1)
220additionalLocations: [invocationExpression.GetLocation(), castTypeArgument.GetLocation()]));
src\Analyzers\CSharp\Analyzers\SimplifyPropertyPattern\CSharpSimplifyPropertyPatternDiagnosticAnalyzer.cs (2)
67expressionColon.GetLocation(), 70ImmutableArray.Create(subpattern.GetLocation()),
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForArrayDiagnosticAnalyzer.cs (2)
199additionalLocations: ImmutableArray.Create(initializer.GetLocation()), 208var locations = ImmutableArray.Create(expression.GetLocation());
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderDiagnosticAnalyzer.cs (2)
52var locations = ImmutableArray.Create(invocationExpression.GetLocation()); 69analysisResult.LocalDeclarationStatement.GetLocation());
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForCreateDiagnosticAnalyzer.cs (1)
49var locations = ImmutableArray.Create(invocationExpression.GetLocation());
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForEmptyDiagnosticAnalyzer.cs (1)
60additionalLocations: ImmutableArray.Create(nodeToReplace.GetLocation()),
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs (1)
105additionalLocations: ImmutableArray.Create(invocation.GetLocation()),
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForNewDiagnosticAnalyzer.cs (1)
74var locations = ImmutableArray.Create(objectCreationExpression.GetLocation());
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForStackAllocDiagnosticAnalyzer.cs (2)
60var locations = ImmutableArray.Create(expression.GetLocation()); 100var locations = ImmutableArray.Create(expression.GetLocation());
src\Analyzers\CSharp\Analyzers\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (2)
100additionalLocations: ImmutableArray.Create(coalesceExpression.GetLocation()), 173additionalLocations: ImmutableArray.Create(ifStatement.GetLocation()),
src\Analyzers\CSharp\Analyzers\UseDefaultLiteral\CSharpUseDefaultLiteralDiagnosticAnalyzer.cs (1)
53defaultExpression.GetLocation(),
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForIndexersHelper.cs (2)
84return body.Statements[0].GetLocation(); 88return getAccessor.ExpressionBody.GetLocation();
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForPropertiesHelper.cs (1)
88return getAccessor.ExpressionBody.GetLocation();
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyHelper`1.cs (1)
88return body.Statements[0].GetLocation();
src\Analyzers\CSharp\Analyzers\UseExpressionBody\UseExpressionBodyDiagnosticAnalyzer.cs (1)
117: expressionBody.GetLocation();
src\Analyzers\CSharp\Analyzers\UseExpressionBodyForLambda\UseExpressionBodyForLambdaDiagnosticAnalyzer.cs (2)
78var additionalLocations = ImmutableArray.Create(declaration.GetLocation()); 93var additionalLocations = ImmutableArray.Create(declaration.GetLocation());
src\Analyzers\CSharp\Analyzers\UseImplicitObjectCreation\CSharpUseImplicitObjectCreationDiagnosticAnalyzer.cs (2)
60objectCreation.Type.GetLocation(), 63ImmutableArray.Create(objectCreation.GetLocation()),
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseIndexOperatorDiagnosticAnalyzer.cs (1)
208binaryExpression.GetLocation(),
src\Analyzers\CSharp\Analyzers\UseInferredMemberName\CSharpUseInferredMemberNameDiagnosticAnalyzer.cs (2)
59nameColon.GetLocation(), 85nameEquals.GetLocation(),
src\Analyzers\CSharp\Analyzers\UseIsNullCheck\CSharpUseIsNullCheckForCastAndEqualityOperatorDiagnosticAnalyzer.cs (1)
66Descriptor, binaryExpression.GetLocation(), option.Notification, context.Options, additionalLocations: null, properties));
src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (5)
134localDeclaration.GetLocation(), 135anonymousFunction.GetLocation()); 156localDeclaration.GetLocation(), 276references.Add(invocationExpression.GetLocation()); 283references.Add(explicitInvocationExpression.GetLocation());
src\Analyzers\CSharp\Analyzers\UseNameofInNullableAttribute\CSharpUseNameofInNullableAttributeDiagnosticAnalyzer.cs (1)
108argument.Expression.GetLocation(),
src\Analyzers\CSharp\Analyzers\UsePatternCombinators\CSharpUsePatternCombinatorsDiagnosticAnalyzer.cs (1)
97expression.GetLocation(),
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndMemberAccessDiagnosticAnalyzer.cs (1)
83asExpression.GetLocation(),
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.cs (2)
255comparison.GetLocation(), 261localStatement.GetLocation(),
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpIsAndCastCheckDiagnosticAnalyzer.cs (3)
149ifStatement.GetLocation(), 150localDeclarationStatement.GetLocation()); 155localDeclarationStatement.GetLocation(),
src\Analyzers\CSharp\Analyzers\UseSimpleUsingStatement\UseSimpleUsingStatementDiagnosticAnalyzer.cs (1)
127additionalLocations: [outermostUsing.GetLocation()],
src\Analyzers\CSharp\Analyzers\UseTupleSwap\CSharpUseTupleSwapDiagnosticAnalyzer.cs (1)
114localDeclarationStatement.GetLocation(),
src\Analyzers\CSharp\Analyzers\UseUnboundGenericTypeInNameOf\CSharpUseUnboundGenericTypeInNameOfDiagnosticAnalyzer.cs (1)
79[invocation.GetLocation()],
UsePatternMatching\CSharpIsAndCastCheckWithoutNameDiagnosticAnalyzer.cs (1)
98Descriptor, isExpression.GetLocation(),
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (3)
Diagnostics\Suppression\SuppressionTests.cs (3)
932context.ReportDiagnostic(Diagnostic.Create(Decsciptor, classDecl.GetLocation())); 1081context.ReportDiagnostic(Diagnostic.Create(Descriptor, ns.Name.GetLocation())); 2075context.ReportDiagnostic(Diagnostic.Create(_descriptor, ns.Name.GetLocation()));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (2)
Symbols\Source\DeclaringSyntaxNodeTests.cs (1)
383Assert.Equal(member.Locations[0], propertyInitializer.NameEquals.Name.GetLocation());
Symbols\Source\NullablePublicAPITests.cs (1)
1179context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(s_descriptor2, declarator.GetLocation(), declaredSymbol.Name, declaredSymbol.NullableAnnotation));
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Syntax\SyntaxNodeTests.cs (1)
2077var nodeLocation = method.GetLocation();
Microsoft.CodeAnalysis.CSharp.Workspaces (4)
Rename\CSharpRenameRewriterLanguageService.cs (2)
889conflicts.Add(reverseMappedLocations[usingDirective.Alias.Name.GetLocation()]); 1007return [((CommonForEachStatementSyntax)token.Parent!).Expression.GetLocation()];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (2)
223AssignmentExpressionSyntax assignment => assignment.Left.GetLocation(), 224ForEachVariableStatementSyntax @foreach => @foreach.Variable.GetLocation(),
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
CodeFixes\CodeFixServiceTests.cs (1)
1204context.ReportDiagnostic(Diagnostic.Create(Descriptor, decl.GetLocation()));
Microsoft.CodeAnalysis.Test.Utilities (1)
Diagnostics\CommonDiagnosticAnalyzers.cs (1)
2852reportDiagnostic(Diagnostic.Create(s_descriptor, localDecl.GetLocation(), arg));
Microsoft.DotNet.CodeAnalysis (5)
Analyzers\AppContextDefaultsAnalyzer.cs (4)
76context.ReportDiagnostic(Diagnostic.Create(s_appContextDefaultNotInitializedToTrueDiagnostic, args.GetLocation(), call)); 83context.ReportDiagnostic(Diagnostic.Create(s_appContextDefaultValueDefinedOutsideIfConditionDiagnostic, args.GetLocation(), call)); 91context.ReportDiagnostic(Diagnostic.Create(s_appContextDefaultValueDefinedOutsideIfConditionDiagnostic, args.GetLocation(), call)); 98context.ReportDiagnostic(Diagnostic.Create(s_appContextDefaultUsedUnexpectedIfStatementDiagnostic, containingIfStatement.GetLocation()));
Analyzers\ResourceUsageAnalyzer.cs (1)
53context.ReportDiagnostic(Diagnostic.Create(InvalidSRFormatCall, invokeExpr.GetLocation(), invokeExpr.GetText()));
Microsoft.Extensions.Logging.Generators (12)
LoggerMessageGenerator.Parser.cs (12)
271Diag(DiagnosticDescriptors.LoggingMethodMustReturnVoid, method.ReturnType.GetLocation()); 298Diag(DiagnosticDescriptors.LoggingMethodMustBePartial, method.GetLocation()); 305Diag(DiagnosticDescriptors.LoggingMethodHasBody, methodBody.GetLocation()); 313Diag(DiagnosticDescriptors.ShouldntReuseEventIds, ma.GetLocation(), lm.EventId, classDec.Identifier.Text); 319Diag(DiagnosticDescriptors.ShouldntReuseEventNames, ma.GetLocation(), lm.EventName, classDec.Identifier.Text); 330Diag(DiagnosticDescriptors.RedundantQualifierInMessage, ma.GetLocation(), method.Identifier.ToString()); 442Diag(DiagnosticDescriptors.MissingLoggerArgument, method.GetLocation(), lm.Name); 447Diag(DiagnosticDescriptors.LoggingMethodShouldBeStatic, method.GetLocation()); 458Diag(DiagnosticDescriptors.MultipleLoggerFields, method.GetLocation(), classDec.Identifier.Text); 463Diag(DiagnosticDescriptors.MissingLoggerField, method.GetLocation(), classDec.Identifier.Text); 474Diag(DiagnosticDescriptors.MissingLogLevel, method.GetLocation()); 494Diag(DiagnosticDescriptors.TemplateHasNoCorrespondingArgument, ma.GetLocation(), t.Key);
Microsoft.Extensions.Options.SourceGeneration (5)
Parser.cs (5)
64Diag(DiagDescriptors.CantBeStaticClass, syntax.GetLocation()); 74Diag(DiagDescriptors.DoesntImplementIValidateOptions, syntax.GetLocation(), validatorType.Name); 96Diag(DiagDescriptors.AlreadyImplementsValidateMethod, syntax.GetLocation(), validatorType.Name); 103: syntax.GetLocation(); 110Diag(DiagDescriptors.NoEligibleMembersFromValidator, syntax.GetLocation(), modelType.ToString(), validatorType.ToString());
Microsoft.Gen.Logging (6)
Parsing\Parser.cs (6)
213Diag(DiagDescriptors.MissingLoggerParameter, method.ParameterList.GetLocation(), lm.Name); 246Diag(DiagDescriptors.MissingLogLevel, method.GetLocation()); 397Diag(DiagDescriptors.LoggingMethodMustReturnVoid, method.ReturnType.GetLocation()); 404Diag(DiagDescriptors.LoggingMethodIsGeneric, method.TypeParameterList!.GetLocation()); 411Diag(DiagDescriptors.LoggingMethodHasBody, method.Body.GetLocation()); 612return methodAttr.GetLocation();
Microsoft.Interop.ComInterfaceGenerator (3)
Analyzers\RuntimeComApiUsageWithSourceGeneratedComAnalyzer.cs (2)
222location = ((GenericNameSyntax)expression).TypeArgumentList.Arguments[ordinal].GetLocation(); 237ITypeOfOperation typeOf => (typeOf.TypeOperand, ((TypeOfExpressionSyntax)typeOf.Syntax).Type.GetLocation()),
ComMethodInfo.cs (1)
105Location interfaceLocation = ifaceContext.Declaration.GetLocation();
Microsoft.Interop.LibraryImportGenerator (3)
Analyzers\CustomMarshallerAttributeAnalyzer.cs (2)
657DiagnosticReporter managedTypeReporter = DiagnosticReporter.CreateForLocation(((TypeOfExpressionSyntax)managedTypeOfOp.Syntax).Type.GetLocation(), context.ReportDiagnostic); 678DiagnosticReporter marshallerTypeReporter = DiagnosticReporter.CreateForLocation(((TypeOfExpressionSyntax)marshallerTypeOfOp.Syntax).Type.GetLocation(), context.ReportDiagnostic);
Analyzers\NativeMarshallingAttributeAnalyzer.cs (1)
102DiagnosticReporter.CreateForLocation(((TypeOfExpressionSyntax)typeOfOp.Syntax).Type.GetLocation(), context.ReportDiagnostic),
Microsoft.Maui.Controls.BindingSourceGen (22)
BindingSourceGenerator.cs (9)
86 var sourceCodeLocation = SourceCodeLocation.CreateFrom(method.Name.GetLocation()); 89 return Result<BindingInvocationDescription>.Failure(DiagnosticsFactory.UnableToResolvePath(invocation.GetLocation())); 146 return Result<LambdaExpressionSyntax>.Failure(DiagnosticsFactory.GetterIsNotLambda(expression.GetLocation())); 152 return Result<LambdaExpressionSyntax>.Failure(DiagnosticsFactory.LambdaIsNotStatic(lambda.GetLocation())); 162 return Result<ITypeSymbol>.Failure(DiagnosticsFactory.GetterLambdaBodyIsNotExpression(lambda.Body.GetLocation())); 168 return Result<ITypeSymbol>.Failure(DiagnosticsFactory.LambdaResultCannotBeResolved(lambdaBody.GetLocation())); 178 return Result<ITypeSymbol>.Failure(DiagnosticsFactory.GetterIsNotLambda(lambda.GetLocation())); 184 return Result<ITypeSymbol>.Failure(DiagnosticsFactory.LambdaParameterCannotBeResolved(lambda.GetLocation())); 190 return Result<ITypeSymbol>.Failure(DiagnosticsFactory.UnaccessibleTypeUsedAsLambdaParameter(lambda.GetLocation()));
InvocationParser.cs (7)
39 return Result<InterceptedMethodType>.Failure(DiagnosticsFactory.SuboptimalSetBindingOverload(invocation.GetLocation())); 53 return Result<InterceptedMethodType>.Failure(DiagnosticsFactory.GetterIsNotLambda(firstArgument.GetLocation())); 57 return Result<InterceptedMethodType>.Failure(DiagnosticsFactory.SuboptimalSetBindingOverload(firstArgument.GetLocation())); 79 return Result<InterceptedMethodType>.Failure(DiagnosticsFactory.SuboptimalSetBindingOverload(invocation.GetLocation())); 92 return Result<InterceptedMethodType>.Failure(DiagnosticsFactory.SuboptimalSetBindingOverload(invocation.GetLocation())); 101 { Name: "Func", ContainingNamespace.Name: "System" } => Result<InterceptedMethodType>.Failure(DiagnosticsFactory.GetterIsNotLambda(secondArgument.GetLocation())), 102 _ => Result<InterceptedMethodType>.Failure(DiagnosticsFactory.SuboptimalSetBindingOverload(secondArgument.GetLocation())),
PathParser.cs (6)
49 return Result<List<IPathPart>>.Failure(DiagnosticsFactory.UnableToResolvePath(memberAccess.GetLocation())); 76 var elementAccessResult = CreateIndexAccess(elementAccessSymbol, elementType, elementAccess.ArgumentList.Arguments, elementAccess.GetLocation()); 121 var elementAccessResult = CreateIndexAccess(elementAccessSymbol, elementType, elementBinding.ArgumentList.Arguments, elementBinding.GetLocation()); 144 return Result<List<IPathPart>>.Failure(DiagnosticsFactory.UnableToResolvePath(castTo.GetLocation())); 163 return Result<List<IPathPart>>.Failure(DiagnosticsFactory.UnableToResolvePath(castExpression.GetLocation())); 187 return Result<List<IPathPart>>.Failure(DiagnosticsFactory.UnableToResolvePath(indexExpression.GetLocation()));
Microsoft.ML.InternalCodeAnalyzer (4)
ContractsCheckAnalyzer.cs (4)
212ExceptionDiagnostic.Rule, invocation.GetLocation(), name)); 232NameofDiagnostic.Rule, arg.GetLocation(), name, parameter.Name, arg.Expression)); 239SimpleMessageDiagnostic.Rule, arg.GetLocation(), name, arg.Expression)); 244DecodeMessageWithLoadContextDiagnostic.Rule, arg.GetLocation(), name, arg.Expression));
System.Private.CoreLib.Generators (5)
IntrinsicsInSystemPrivateCoreLibAnalyzer.cs (5)
332context.ReportDiagnostic(Diagnostic.Create(RuleCantParse, expressionToDecompose.GetLocation())); 343context.ReportDiagnostic(Diagnostic.Create(RuleCantParse, expressionToDecompose.GetLocation())); 356context.ReportDiagnostic(Diagnostic.Create(RuleCantParse, expressionToDecompose.GetLocation())); 365context.ReportDiagnostic(Diagnostic.Create(RuleCantParse, expressionToDecompose.GetLocation())); 373context.ReportDiagnostic(Diagnostic.Create(RuleCantParse, expressionToDecompose.GetLocation()));
System.Windows.Forms.Analyzers.CSharp (1)
System\Windows\Forms\CSharp\Analyzers\AvoidPassingTaskWithoutCancellationToken\AvoidPassingTaskWithoutCancellationTokenAnalyzer.cs (1)
71invocationExpr.GetLocation());