6 overrides of AdditionalLocations
Microsoft.CodeAnalysis (5)
CommandLine\CommonCompiler.SuppressionDiagnostic.cs (1)
67public override IReadOnlyList<Location> AdditionalLocations => _originalDiagnostic.AdditionalLocations;
Diagnostic\Diagnostic.DiagnosticWithProgrammaticSuppression.cs (1)
76public override IReadOnlyList<Location> AdditionalLocations
Diagnostic\Diagnostic_SimpleDiagnostic.cs (1)
135public override IReadOnlyList<Location> AdditionalLocations
Diagnostic\DiagnosticWithInfo.cs (1)
38public override IReadOnlyList<Location> AdditionalLocations
DiagnosticAnalyzer\CompilerDiagnosticAnalyzer.CompilationAnalyzer.cs (1)
98public override IReadOnlyList<Location> AdditionalLocations => _original.AdditionalLocations;
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (1)
EvaluationContextBase.cs (1)
111public override IReadOnlyList<Location> AdditionalLocations
211 references to AdditionalLocations
ILLink.CodeFixProvider (2)
DynamicallyAccessedMembersCodeFixProvider.cs (2)
101 if (diagnostic.AdditionalLocations.Count == 0) 103 if (root.FindNode (diagnostic.AdditionalLocations[0].SourceSpan, getInnermostNodeForTie: true) is not SyntaxNode targetNode)
Microsoft.AspNetCore.Components.Analyzers.Tests (1)
Verifiers\DiagnosticVerifier.cs (1)
136var additionalLocations = actual.AdditionalLocations.ToArray();
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (1)
Verifiers\DiagnosticVerifier.cs (1)
136var additionalLocations = actual.AdditionalLocations.ToArray();
Microsoft.AspNetCore.Http.RequestDelegateGenerator (2)
RequestDelegateGeneratorSuppressor.cs (2)
45var location = diagnostic.AdditionalLocations.Count > 0 46? diagnostic.AdditionalLocations[0]
Microsoft.CodeAnalysis (15)
CommandLine\CommonCompiler.SuppressionDiagnostic.cs (1)
67public override IReadOnlyList<Location> AdditionalLocations => _originalDiagnostic.AdditionalLocations;
CommandLine\SarifV1ErrorLogger.cs (1)
85WriteLocations(diagnostic.Location, diagnostic.AdditionalLocations);
CommandLine\SarifV2ErrorLogger.cs (1)
113WriteLocations(diagnostic.Location, diagnostic.AdditionalLocations);
Diagnostic\Diagnostic.cs (8)
83/// If null, <see cref="AdditionalLocations"/> will return an empty list. 104/// If null, <see cref="AdditionalLocations"/> will return an empty list. 132/// If null, <see cref="AdditionalLocations"/> will return an empty list. 182/// If null, <see cref="AdditionalLocations"/> will return an empty list. 232/// If null, <see cref="AdditionalLocations"/> will return an empty list. 500if (AdditionalLocations is null || AdditionalLocations.Count == 0) 506foreach (var location in AdditionalLocations)
Diagnostic\Diagnostic.DiagnosticWithProgrammaticSuppression.cs (1)
78get { return _originalUnsuppressedDiagnostic.AdditionalLocations; }
DiagnosticAnalyzer\CompilerDiagnosticAnalyzer.CompilationAnalyzer.cs (1)
98public override IReadOnlyList<Location> AdditionalLocations => _original.AdditionalLocations;
DiagnosticAnalyzer\DiagnosticAnalysisContextHelpers.cs (2)
79if (diagnostic.AdditionalLocations != null) 81foreach (var location in diagnostic.AdditionalLocations)
Microsoft.CodeAnalysis.CodeStyle (6)
src\Analyzers\Core\Analyzers\Helpers\DiagnosticHelper.cs (6)
31/// If null, <see cref="Diagnostic.AdditionalLocations"/> will return an empty list. 79/// <see cref="Diagnostic.AdditionalLocations"/>. 84/// <see cref="Diagnostic.AdditionalLocations"/>. 143/// <see cref="Diagnostic.AdditionalLocations"/>. 148/// <see cref="Diagnostic.AdditionalLocations"/>. 246/// If null, <see cref="Diagnostic.AdditionalLocations"/> will return an empty list.
Microsoft.CodeAnalysis.CodeStyle.Fixes (29)
src\Analyzers\Core\CodeFixes\AddAccessibilityModifiers\AbstractAddAccessibilityModifiersCodeFixProvider.cs (1)
51var declaration = diagnostic.AdditionalLocations[0].FindNode(cancellationToken);
src\Analyzers\Core\CodeFixes\AddRequiredParentheses\AddRequiredParenthesesCodeFixProvider.cs (1)
50var location = diagnostic.AdditionalLocations[0];
src\Analyzers\Core\CodeFixes\NewLines\ConsecutiveStatementPlacement\ConsecutiveStatementPlacementCodeFixProvider.cs (1)
52var nextTokens = diagnostics.Select(d => d.AdditionalLocations[0].FindToken(cancellationToken));
src\Analyzers\Core\CodeFixes\NewLines\MultipleBlankLines\AbstractMultipleBlankLinesCodeFixProvider.cs (1)
53var token = root.FindToken(diagnostic.AdditionalLocations[0].SourceSpan.Start);
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchCodeFixProvider.cs (1)
144var switchLocation = diagnostic.AdditionalLocations[0];
src\Analyzers\Core\CodeFixes\RemoveUnnecessarySuppressions\RemoveUnnecessaryPragmaSuppressionsCodeFixProvider.cs (1)
60foreach (var location in diagnostic.AdditionalLocations)
src\Analyzers\Core\CodeFixes\SimplifyInterpolation\AbstractSimplifyInterpolationCodeFixProvider.cs (1)
60var loc = diagnostic.AdditionalLocations[0];
src\Analyzers\Core\CodeFixes\UseCoalesceExpression\AbstractUseCoalesceExpressionForIfNullStatementCheckCodeFixProvider.cs (3)
44var expressionToCoalesce = diagnostic.AdditionalLocations[0].FindNode(getInnermostNodeForTie: true, cancellationToken); 45var ifStatement = diagnostic.AdditionalLocations[1].FindNode(getInnermostNodeForTie: true, cancellationToken); 46var whenTrueStatement = diagnostic.AdditionalLocations[2].FindNode(getInnermostNodeForTie: true, cancellationToken);
src\Analyzers\Core\CodeFixes\UseCoalesceExpression\UseCoalesceExpressionForNullableTernaryConditionalCheckCodeFixProvider.cs (3)
51var conditionalExpression = root.FindNode(diagnostic.AdditionalLocations[0].SourceSpan, getInnermostNodeForTie: true); 52var conditionExpression = root.FindNode(diagnostic.AdditionalLocations[1].SourceSpan); 53var whenPart = root.FindNode(diagnostic.AdditionalLocations[2].SourceSpan);
src\Analyzers\Core\CodeFixes\UseCoalesceExpression\UseCoalesceExpressionForTernaryConditionalCheckCodeFixProvider.cs (3)
63var conditionalExpression = root.FindNode(diagnostic.AdditionalLocations[0].SourceSpan, getInnermostNodeForTie: true); 64var conditionalPartHigh = root.FindNode(diagnostic.AdditionalLocations[1].SourceSpan); 65var whenPart = root.FindNode(diagnostic.AdditionalLocations[2].SourceSpan);
src\Analyzers\Core\CodeFixes\UseCompoundAssignment\AbstractUseCompoundAssignmentCodeFixProvider.cs (1)
61var assignment = diagnostic.AdditionalLocations[0].FindNode(getInnermostNodeForTie: true, cancellationToken);
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentCodeFixProvider.cs (1)
63var ifStatement = diagnostic.AdditionalLocations[0].FindNode(getInnermostNodeForTie: true, cancellationToken);
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForReturn\AbstractUseConditionalExpressionForReturnCodeFixProvider.cs (1)
52var ifStatement = (TIfStatementSyntax)diagnostic.AdditionalLocations[0].FindNode(cancellationToken);
src\Analyzers\Core\CodeFixes\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsCodeFixProvider.cs (1)
64var invocation = diagnostic.AdditionalLocations[0].FindNode(getInnermostNodeForTie: true, cancellationToken: cancellationToken);
src\Analyzers\Core\CodeFixes\UseNullPropagation\AbstractUseNullPropagationCodeFixProvider.cs (5)
88var conditionalExpressionOrIfStatement = root.FindNode(diagnostic.AdditionalLocations[0].SourceSpan, getInnermostNodeForTie: true); 113var conditionalPart = root.FindNode(diagnostic.AdditionalLocations[1].SourceSpan, getInnermostNodeForTie: true); 114var whenPart = root.FindNode(diagnostic.AdditionalLocations[2].SourceSpan, getInnermostNodeForTie: true); 170var whenTrueStatement = (TStatementSyntax)root.FindNode(diagnostic.AdditionalLocations[1].SourceSpan); 171var match = (TExpressionSyntax)root.FindNode(diagnostic.AdditionalLocations[2].SourceSpan, getInnermostNodeForTie: true);
src\Analyzers\Core\CodeFixes\UseSystemHashCode\UseSystemHashCodeCodeFixProvider.cs (2)
56var operationLocation = diagnostic.AdditionalLocations[0].FindNode(cancellationToken); 59var methodDecl = diagnostic.AdditionalLocations[1].FindNode(cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\ForkingSyntaxEditorBasedCodeFixProvider.cs (2)
37/// cref="Diagnostic.AdditionalLocations"/> will not be correct. 69diagnostic.AdditionalLocations[0].SourceSpan, getInnermostNodeForTie: true);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (50)
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceCodeFixProvider.cs (1)
57var namespaceDecl = (BaseNamespaceDeclarationSyntax)diagnostic.AdditionalLocations[0].FindNode(cancellationToken);
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.cs (3)
39var switchLocation = context.Diagnostics.First().AdditionalLocations[0]; 60var switchLocation = diagnostic.AdditionalLocations[0]; 73var declaratorToRemoveLocation = diagnostic.AdditionalLocations.ElementAtOrDefault(1);
src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (4)
55declarationsToRemove.Add((LocalDeclarationStatementSyntax)diagnostic.AdditionalLocations[0].FindNode(cancellationToken).Parent.Parent); 82var declaratorLocation = diagnostic.AdditionalLocations[0]; 83var identifierLocation = diagnostic.AdditionalLocations[1]; 84var invocationOrCreationLocation = diagnostic.AdditionalLocations[2];
src\Analyzers\CSharp\CodeFixes\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessCodeFixProvider.cs (5)
77var ifStatement = (IfStatementSyntax)diagnostic.AdditionalLocations[0].FindNode(getInnermostNodeForTie: true, cancellationToken); 81var expressionStatement = (ExpressionStatementSyntax)diagnostic.AdditionalLocations[1].FindNode(getInnermostNodeForTie: true, cancellationToken); 117var localDeclarationStatement = (LocalDeclarationStatementSyntax)diagnostic.AdditionalLocations[0].FindNode(getInnermostNodeForTie: true, cancellationToken); 121var ifStatement = (IfStatementSyntax)diagnostic.AdditionalLocations[1].FindNode(getInnermostNodeForTie: true, cancellationToken); 125var expressionStatement = (ExpressionStatementSyntax)diagnostic.AdditionalLocations[2].FindNode(getInnermostNodeForTie: true, cancellationToken);
src\Analyzers\CSharp\CodeFixes\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyCodeFixProvider.cs (1)
42var declarations = diagnostics.Select(d => d.AdditionalLocations[0].FindNode(getInnermostNodeForTie: true, cancellationToken));
src\Analyzers\CSharp\CodeFixes\MakeStructReadOnly\CSharpMakeStructReadOnlyCodeFixProvider.cs (1)
39var typeDeclarations = diagnostics.Select(d => d.AdditionalLocations[0].FindNode(getInnermostNodeForTie: true, cancellationToken));
src\Analyzers\CSharp\CodeFixes\NewLines\ConstructorInitializerPlacement\ConstructorInitializerPlacementCodeFixProvider.cs (1)
52var initializer = (ConstructorInitializerSyntax)diagnostic.AdditionalLocations[0].FindNode(getInnermostNodeForTie: true, cancellationToken);
src\Analyzers\CSharp\CodeFixes\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementCodeFixProvider.cs (1)
70var node = root.FindNode(diagnostic.AdditionalLocations[0].SourceSpan);
src\Analyzers\CSharp\CodeFixes\RemoveConfusingSuppression\CSharpRemoveConfusingSuppressionCodeFixProvider.cs (1)
69var node = diagnostic.AdditionalLocations[0].FindNode(getInnermostNodeForTie: true, cancellationToken);
src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionCodeFixProvider.cs (1)
46var anonymousFunction = diagnostic.AdditionalLocations[0].FindNode(getInnermostNodeForTie: true, cancellationToken) as AnonymousFunctionExpressionSyntax;
src\Analyzers\CSharp\CodeFixes\RemoveUnreachableCode\CSharpRemoveUnreachableCodeCodeFixProvider.cs (1)
58var firstUnreachableStatementLocation = diagnostic.AdditionalLocations[0];
src\Analyzers\CSharp\CodeFixes\SimplifyLinqExpression\CSharpSimplifyLinqTypeCheckAndCastCodeFixProvider.cs (2)
46var castOrSelectInvocation = (InvocationExpressionSyntax)diagnostic.AdditionalLocations[0].FindNode(getInnermostNodeForTie: true, cancellationToken); 47var typeSyntax = (TypeSyntax)diagnostic.AdditionalLocations[1].FindNode(getInnermostNodeForTie: true, cancellationToken);
src\Analyzers\CSharp\CodeFixes\SimplifyPropertyPattern\CSharpSimplifyPropertyPatternCodeFixProvider.cs (1)
44var subpatterns = diagnostics.Select(d => (SubpatternSyntax)d.AdditionalLocations[0].FindNode(cancellationToken))
src\Analyzers\CSharp\CodeFixes\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentCodeFixProvider.cs (1)
51var coalesceOrIfStatement = diagnostic.AdditionalLocations[0].FindNode(getInnermostNodeForTie: true, cancellationToken);
src\Analyzers\CSharp\CodeFixes\UseExpressionBody\UseExpressionBodyCodeFixProvider.cs (1)
80var declarationLocation = diagnostic.AdditionalLocations[0];
src\Analyzers\CSharp\CodeFixes\UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeFixProvider.cs (1)
63var declarationLocation = diagnostic.AdditionalLocations[0];
src\Analyzers\CSharp\CodeFixes\UseIndexOrRangeOperator\CSharpUseRangeOperatorCodeFixProvider.cs (1)
82=> (InvocationExpressionSyntax)d.AdditionalLocations[0].FindNode(getInnermostNodeForTie: true, cancellationToken);
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (5)
66var localDeclaration = (LocalDeclarationStatementSyntax)diagnostic.AdditionalLocations[0].FindNode(cancellationToken); 67var anonymousFunction = (AnonymousFunctionExpressionSyntax)diagnostic.AdditionalLocations[1].FindNode(cancellationToken); 69var references = new List<ExpressionSyntax>(diagnostic.AdditionalLocations.Count - 2); 71for (var i = 2; i < diagnostic.AdditionalLocations.Count; i++) 73references.Add((ExpressionSyntax)diagnostic.AdditionalLocations[i].FindNode(getInnermostNodeForTie: true, cancellationToken));
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (4)
55if (declaratorLocations.Add(diagnostic.AdditionalLocations[0])) 90var declaratorLocation = diagnostic.AdditionalLocations[0]; 91var comparisonLocation = diagnostic.AdditionalLocations[1]; 92var asExpressionLocation = diagnostic.AdditionalLocations[2];
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpIsAndCastCheckCodeFixProvider.cs (2)
54var ifStatementLocation = diagnostic.AdditionalLocations[0]; 55var localDeclarationLocation = diagnostic.AdditionalLocations[1];
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpUseNotPatternCodeFixProvider.cs (1)
52var notExpressionLocation = diagnostic.AdditionalLocations[0];
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (1)
67var additionalNodes = diagnostic.AdditionalLocations;
src\Analyzers\CSharp\CodeFixes\UseSimpleUsingStatement\UseSimpleUsingStatementCodeFixProvider.cs (1)
50d => (UsingStatementSyntax)d.AdditionalLocations[0].FindNode(getInnermostNodeForTie: true, cancellationToken)).ToSet();
src\Analyzers\CSharp\CodeFixes\UseThrowExpression\UseThrowExpressionCodeFixProvider.cs (4)
48var ifStatement = root.FindNode(diagnostic.AdditionalLocations[0].SourceSpan); 49var throwStatementExpression = root.FindNode(diagnostic.AdditionalLocations[1].SourceSpan); 50var assignmentValue = root.FindNode(diagnostic.AdditionalLocations[2].SourceSpan); 51var assignmentExpressionStatement = root.FindNode(diagnostic.AdditionalLocations[3].SourceSpan);
src\Analyzers\CSharp\CodeFixes\UseTupleSwap\CSharpUseTupleSwapCodeFixProvider.cs (3)
49var localDeclarationStatement = (LocalDeclarationStatementSyntax)diagnostic.AdditionalLocations[0].FindNode(getInnermostNodeForTie: true, cancellationToken); 51var firstAssignmentStatement = (ExpressionStatementSyntax)diagnostic.AdditionalLocations[1].FindNode(getInnermostNodeForTie: true, cancellationToken); 52var secondAssignmentStatement = (ExpressionStatementSyntax)diagnostic.AdditionalLocations[2].FindNode(getInnermostNodeForTie: true, cancellationToken);
src\Analyzers\CSharp\CodeFixes\UseUnboundGenericTypeInNameOf\CSharpUseUnboundGenericTypeInNameOfCodeFixProvider.cs (1)
52var nameofInvocation = (InvocationExpressionSyntax)diagnostic.AdditionalLocations[0].FindNode(getInnermostNodeForTie: true, cancellationToken);
src\Analyzers\CSharp\CodeFixes\UseUtf8StringLiteral\UseUtf8StringLiteralCodeFixProvider.cs (1)
95var location = diagnostic.AdditionalLocations[0];
Microsoft.CodeAnalysis.CSharp.Features (51)
ConvertProgram\ConvertToTopLevelStatementsCodeFixProvider.cs (1)
51var methodDeclaration = (MethodDeclarationSyntax)diagnostics[0].AdditionalLocations[0].FindNode(cancellationToken);
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceCodeFixProvider.cs (1)
57var namespaceDecl = (BaseNamespaceDeclarationSyntax)diagnostic.AdditionalLocations[0].FindNode(cancellationToken);
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.cs (3)
39var switchLocation = context.Diagnostics.First().AdditionalLocations[0]; 60var switchLocation = diagnostic.AdditionalLocations[0]; 73var declaratorToRemoveLocation = diagnostic.AdditionalLocations.ElementAtOrDefault(1);
src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (4)
55declarationsToRemove.Add((LocalDeclarationStatementSyntax)diagnostic.AdditionalLocations[0].FindNode(cancellationToken).Parent.Parent); 82var declaratorLocation = diagnostic.AdditionalLocations[0]; 83var identifierLocation = diagnostic.AdditionalLocations[1]; 84var invocationOrCreationLocation = diagnostic.AdditionalLocations[2];
src\Analyzers\CSharp\CodeFixes\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessCodeFixProvider.cs (5)
77var ifStatement = (IfStatementSyntax)diagnostic.AdditionalLocations[0].FindNode(getInnermostNodeForTie: true, cancellationToken); 81var expressionStatement = (ExpressionStatementSyntax)diagnostic.AdditionalLocations[1].FindNode(getInnermostNodeForTie: true, cancellationToken); 117var localDeclarationStatement = (LocalDeclarationStatementSyntax)diagnostic.AdditionalLocations[0].FindNode(getInnermostNodeForTie: true, cancellationToken); 121var ifStatement = (IfStatementSyntax)diagnostic.AdditionalLocations[1].FindNode(getInnermostNodeForTie: true, cancellationToken); 125var expressionStatement = (ExpressionStatementSyntax)diagnostic.AdditionalLocations[2].FindNode(getInnermostNodeForTie: true, cancellationToken);
src\Analyzers\CSharp\CodeFixes\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyCodeFixProvider.cs (1)
42var declarations = diagnostics.Select(d => d.AdditionalLocations[0].FindNode(getInnermostNodeForTie: true, cancellationToken));
src\Analyzers\CSharp\CodeFixes\MakeStructReadOnly\CSharpMakeStructReadOnlyCodeFixProvider.cs (1)
39var typeDeclarations = diagnostics.Select(d => d.AdditionalLocations[0].FindNode(getInnermostNodeForTie: true, cancellationToken));
src\Analyzers\CSharp\CodeFixes\NewLines\ConstructorInitializerPlacement\ConstructorInitializerPlacementCodeFixProvider.cs (1)
52var initializer = (ConstructorInitializerSyntax)diagnostic.AdditionalLocations[0].FindNode(getInnermostNodeForTie: true, cancellationToken);
src\Analyzers\CSharp\CodeFixes\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementCodeFixProvider.cs (1)
70var node = root.FindNode(diagnostic.AdditionalLocations[0].SourceSpan);
src\Analyzers\CSharp\CodeFixes\RemoveConfusingSuppression\CSharpRemoveConfusingSuppressionCodeFixProvider.cs (1)
69var node = diagnostic.AdditionalLocations[0].FindNode(getInnermostNodeForTie: true, cancellationToken);
src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionCodeFixProvider.cs (1)
46var anonymousFunction = diagnostic.AdditionalLocations[0].FindNode(getInnermostNodeForTie: true, cancellationToken) as AnonymousFunctionExpressionSyntax;
src\Analyzers\CSharp\CodeFixes\RemoveUnreachableCode\CSharpRemoveUnreachableCodeCodeFixProvider.cs (1)
58var firstUnreachableStatementLocation = diagnostic.AdditionalLocations[0];
src\Analyzers\CSharp\CodeFixes\SimplifyLinqExpression\CSharpSimplifyLinqTypeCheckAndCastCodeFixProvider.cs (2)
46var castOrSelectInvocation = (InvocationExpressionSyntax)diagnostic.AdditionalLocations[0].FindNode(getInnermostNodeForTie: true, cancellationToken); 47var typeSyntax = (TypeSyntax)diagnostic.AdditionalLocations[1].FindNode(getInnermostNodeForTie: true, cancellationToken);
src\Analyzers\CSharp\CodeFixes\SimplifyPropertyPattern\CSharpSimplifyPropertyPatternCodeFixProvider.cs (1)
44var subpatterns = diagnostics.Select(d => (SubpatternSyntax)d.AdditionalLocations[0].FindNode(cancellationToken))
src\Analyzers\CSharp\CodeFixes\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentCodeFixProvider.cs (1)
51var coalesceOrIfStatement = diagnostic.AdditionalLocations[0].FindNode(getInnermostNodeForTie: true, cancellationToken);
src\Analyzers\CSharp\CodeFixes\UseExpressionBody\UseExpressionBodyCodeFixProvider.cs (1)
80var declarationLocation = diagnostic.AdditionalLocations[0];
src\Analyzers\CSharp\CodeFixes\UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeFixProvider.cs (1)
63var declarationLocation = diagnostic.AdditionalLocations[0];
src\Analyzers\CSharp\CodeFixes\UseIndexOrRangeOperator\CSharpUseRangeOperatorCodeFixProvider.cs (1)
82=> (InvocationExpressionSyntax)d.AdditionalLocations[0].FindNode(getInnermostNodeForTie: true, cancellationToken);
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (5)
66var localDeclaration = (LocalDeclarationStatementSyntax)diagnostic.AdditionalLocations[0].FindNode(cancellationToken); 67var anonymousFunction = (AnonymousFunctionExpressionSyntax)diagnostic.AdditionalLocations[1].FindNode(cancellationToken); 69var references = new List<ExpressionSyntax>(diagnostic.AdditionalLocations.Count - 2); 71for (var i = 2; i < diagnostic.AdditionalLocations.Count; i++) 73references.Add((ExpressionSyntax)diagnostic.AdditionalLocations[i].FindNode(getInnermostNodeForTie: true, cancellationToken));
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (4)
55if (declaratorLocations.Add(diagnostic.AdditionalLocations[0])) 90var declaratorLocation = diagnostic.AdditionalLocations[0]; 91var comparisonLocation = diagnostic.AdditionalLocations[1]; 92var asExpressionLocation = diagnostic.AdditionalLocations[2];
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpIsAndCastCheckCodeFixProvider.cs (2)
54var ifStatementLocation = diagnostic.AdditionalLocations[0]; 55var localDeclarationLocation = diagnostic.AdditionalLocations[1];
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpUseNotPatternCodeFixProvider.cs (1)
52var notExpressionLocation = diagnostic.AdditionalLocations[0];
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (1)
67var additionalNodes = diagnostic.AdditionalLocations;
src\Analyzers\CSharp\CodeFixes\UseSimpleUsingStatement\UseSimpleUsingStatementCodeFixProvider.cs (1)
50d => (UsingStatementSyntax)d.AdditionalLocations[0].FindNode(getInnermostNodeForTie: true, cancellationToken)).ToSet();
src\Analyzers\CSharp\CodeFixes\UseThrowExpression\UseThrowExpressionCodeFixProvider.cs (4)
48var ifStatement = root.FindNode(diagnostic.AdditionalLocations[0].SourceSpan); 49var throwStatementExpression = root.FindNode(diagnostic.AdditionalLocations[1].SourceSpan); 50var assignmentValue = root.FindNode(diagnostic.AdditionalLocations[2].SourceSpan); 51var assignmentExpressionStatement = root.FindNode(diagnostic.AdditionalLocations[3].SourceSpan);
src\Analyzers\CSharp\CodeFixes\UseTupleSwap\CSharpUseTupleSwapCodeFixProvider.cs (3)
49var localDeclarationStatement = (LocalDeclarationStatementSyntax)diagnostic.AdditionalLocations[0].FindNode(getInnermostNodeForTie: true, cancellationToken); 51var firstAssignmentStatement = (ExpressionStatementSyntax)diagnostic.AdditionalLocations[1].FindNode(getInnermostNodeForTie: true, cancellationToken); 52var secondAssignmentStatement = (ExpressionStatementSyntax)diagnostic.AdditionalLocations[2].FindNode(getInnermostNodeForTie: true, cancellationToken);
src\Analyzers\CSharp\CodeFixes\UseUnboundGenericTypeInNameOf\CSharpUseUnboundGenericTypeInNameOfCodeFixProvider.cs (1)
52var nameofInvocation = (InvocationExpressionSyntax)diagnostic.AdditionalLocations[0].FindNode(getInnermostNodeForTie: true, cancellationToken);
src\Analyzers\CSharp\CodeFixes\UseUtf8StringLiteral\UseUtf8StringLiteralCodeFixProvider.cs (1)
95var location = diagnostic.AdditionalLocations[0];
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (3)
Semantics\UninitializedNonNullableFieldTests.cs (3)
2752var actualAdditionalLocations = comp.GetDiagnostics().Single().AdditionalLocations; 2773var actualAdditionalLocations = comp.GetDiagnostics().Single().AdditionalLocations; 2809Assert.Single(diagnostic.AdditionalLocations);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (3)
Diagnostics\DiagnosticTest.cs (3)
88Assert.Equal(0, d1.AdditionalLocations.Count()); 102Assert.Equal(1, d3.AdditionalLocations.Count()); 103Assert.Equal(new TextSpan(14, 8), d3.AdditionalLocations.First().SourceSpan);
Microsoft.CodeAnalysis.Features (37)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaBatchFixHelpers.cs (1)
83additionalLocations: diagnostic.AdditionalLocations,
SimplifyThisOrMe\AbstractSimplifyThisOrMeCodeFixProvider.cs (1)
50d => (TMemberAccessExpressionSyntax)d.AdditionalLocations[0].FindNode(getInnermostNodeForTie: true, cancellationToken)).ToSet();
src\Analyzers\Core\Analyzers\Helpers\DiagnosticHelper.cs (6)
31/// If null, <see cref="Diagnostic.AdditionalLocations"/> will return an empty list. 79/// <see cref="Diagnostic.AdditionalLocations"/>. 84/// <see cref="Diagnostic.AdditionalLocations"/>. 143/// <see cref="Diagnostic.AdditionalLocations"/>. 148/// <see cref="Diagnostic.AdditionalLocations"/>. 246/// If null, <see cref="Diagnostic.AdditionalLocations"/> will return an empty list.
src\Analyzers\Core\CodeFixes\AddAccessibilityModifiers\AbstractAddAccessibilityModifiersCodeFixProvider.cs (1)
51var declaration = diagnostic.AdditionalLocations[0].FindNode(cancellationToken);
src\Analyzers\Core\CodeFixes\AddRequiredParentheses\AddRequiredParenthesesCodeFixProvider.cs (1)
50var location = diagnostic.AdditionalLocations[0];
src\Analyzers\Core\CodeFixes\NewLines\ConsecutiveStatementPlacement\ConsecutiveStatementPlacementCodeFixProvider.cs (1)
52var nextTokens = diagnostics.Select(d => d.AdditionalLocations[0].FindToken(cancellationToken));
src\Analyzers\Core\CodeFixes\NewLines\MultipleBlankLines\AbstractMultipleBlankLinesCodeFixProvider.cs (1)
53var token = root.FindToken(diagnostic.AdditionalLocations[0].SourceSpan.Start);
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchCodeFixProvider.cs (1)
144var switchLocation = diagnostic.AdditionalLocations[0];
src\Analyzers\Core\CodeFixes\RemoveUnnecessarySuppressions\RemoveUnnecessaryPragmaSuppressionsCodeFixProvider.cs (1)
60foreach (var location in diagnostic.AdditionalLocations)
src\Analyzers\Core\CodeFixes\SimplifyInterpolation\AbstractSimplifyInterpolationCodeFixProvider.cs (1)
60var loc = diagnostic.AdditionalLocations[0];
src\Analyzers\Core\CodeFixes\UseCoalesceExpression\AbstractUseCoalesceExpressionForIfNullStatementCheckCodeFixProvider.cs (3)
44var expressionToCoalesce = diagnostic.AdditionalLocations[0].FindNode(getInnermostNodeForTie: true, cancellationToken); 45var ifStatement = diagnostic.AdditionalLocations[1].FindNode(getInnermostNodeForTie: true, cancellationToken); 46var whenTrueStatement = diagnostic.AdditionalLocations[2].FindNode(getInnermostNodeForTie: true, cancellationToken);
src\Analyzers\Core\CodeFixes\UseCoalesceExpression\UseCoalesceExpressionForNullableTernaryConditionalCheckCodeFixProvider.cs (3)
51var conditionalExpression = root.FindNode(diagnostic.AdditionalLocations[0].SourceSpan, getInnermostNodeForTie: true); 52var conditionExpression = root.FindNode(diagnostic.AdditionalLocations[1].SourceSpan); 53var whenPart = root.FindNode(diagnostic.AdditionalLocations[2].SourceSpan);
src\Analyzers\Core\CodeFixes\UseCoalesceExpression\UseCoalesceExpressionForTernaryConditionalCheckCodeFixProvider.cs (3)
63var conditionalExpression = root.FindNode(diagnostic.AdditionalLocations[0].SourceSpan, getInnermostNodeForTie: true); 64var conditionalPartHigh = root.FindNode(diagnostic.AdditionalLocations[1].SourceSpan); 65var whenPart = root.FindNode(diagnostic.AdditionalLocations[2].SourceSpan);
src\Analyzers\Core\CodeFixes\UseCompoundAssignment\AbstractUseCompoundAssignmentCodeFixProvider.cs (1)
61var assignment = diagnostic.AdditionalLocations[0].FindNode(getInnermostNodeForTie: true, cancellationToken);
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentCodeFixProvider.cs (1)
63var ifStatement = diagnostic.AdditionalLocations[0].FindNode(getInnermostNodeForTie: true, cancellationToken);
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForReturn\AbstractUseConditionalExpressionForReturnCodeFixProvider.cs (1)
52var ifStatement = (TIfStatementSyntax)diagnostic.AdditionalLocations[0].FindNode(cancellationToken);
src\Analyzers\Core\CodeFixes\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsCodeFixProvider.cs (1)
64var invocation = diagnostic.AdditionalLocations[0].FindNode(getInnermostNodeForTie: true, cancellationToken: cancellationToken);
src\Analyzers\Core\CodeFixes\UseNullPropagation\AbstractUseNullPropagationCodeFixProvider.cs (5)
88var conditionalExpressionOrIfStatement = root.FindNode(diagnostic.AdditionalLocations[0].SourceSpan, getInnermostNodeForTie: true); 113var conditionalPart = root.FindNode(diagnostic.AdditionalLocations[1].SourceSpan, getInnermostNodeForTie: true); 114var whenPart = root.FindNode(diagnostic.AdditionalLocations[2].SourceSpan, getInnermostNodeForTie: true); 170var whenTrueStatement = (TStatementSyntax)root.FindNode(diagnostic.AdditionalLocations[1].SourceSpan); 171var match = (TExpressionSyntax)root.FindNode(diagnostic.AdditionalLocations[2].SourceSpan, getInnermostNodeForTie: true);
src\Analyzers\Core\CodeFixes\UseSystemHashCode\UseSystemHashCodeCodeFixProvider.cs (2)
56var operationLocation = diagnostic.AdditionalLocations[0].FindNode(cancellationToken); 59var methodDecl = diagnostic.AdditionalLocations[1].FindNode(cancellationToken);
UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (2)
94var locations = diagnostic.AdditionalLocations; 277var locations = diagnostic.AdditionalLocations;
Microsoft.CodeAnalysis.LanguageServer.Protocol (2)
Features\Diagnostics\DocumentAnalysisExecutor_Helpers.cs (2)
325if (diagnostic.AdditionalLocations != null) 327foreach (var location in diagnostic.AdditionalLocations)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (2)
src\Analyzers\VisualBasic\CodeFixes\RemoveUnnecessaryByVal\VisualBasicRemoveUnnecessaryByValCodeFixProvider.vb (1)
40Dim node = DirectCast(root.FindNode(diagnostic.AdditionalLocations(0).SourceSpan), ParameterSyntax)
src\Analyzers\VisualBasic\CodeFixes\UseIsNotExpression\VisualBasicUseIsNotExpressionCodeFixProvider.vb (1)
51Dim notExpressionLocation = diagnostic.AdditionalLocations(0)
Microsoft.CodeAnalysis.VisualBasic.Features (2)
src\Analyzers\VisualBasic\CodeFixes\RemoveUnnecessaryByVal\VisualBasicRemoveUnnecessaryByValCodeFixProvider.vb (1)
40Dim node = DirectCast(root.FindNode(diagnostic.AdditionalLocations(0).SourceSpan), ParameterSyntax)
src\Analyzers\VisualBasic\CodeFixes\UseIsNotExpression\VisualBasicUseIsNotExpressionCodeFixProvider.vb (1)
51Dim notExpressionLocation = diagnostic.AdditionalLocations(0)
Microsoft.CodeAnalysis.Workspaces (5)
Diagnostics\DiagnosticData.cs (3)
256if (diagnostic.AdditionalLocations.Count == 0) 261using var _ = ArrayBuilder<DiagnosticDataLocation>.GetInstance(diagnostic.AdditionalLocations.Count, out var builder); 262foreach (var location in diagnostic.AdditionalLocations)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\ForkingSyntaxEditorBasedCodeFixProvider.cs (2)
37/// cref="Diagnostic.AdditionalLocations"/> will not be correct. 69diagnostic.AdditionalLocations[0].SourceSpan, getInnermostNodeForTie: true);