480 references to GetLocation
ILLink.RoslynAnalyzer (17)
Microsoft.Analyzers.Extra (16)
Microsoft.Analyzers.Local (2)
Microsoft.AspNetCore.Analyzers (4)
Microsoft.AspNetCore.App.Analyzers (15)
Microsoft.AspNetCore.Components.Analyzers (5)
Microsoft.AspNetCore.Components.SdkAnalyzers (5)
Microsoft.AspNetCore.Http.RequestDelegateGenerator (8)
Microsoft.AspNetCore.Mvc.Analyzers (4)
Microsoft.AspNetCore.Mvc.Api.Analyzers (4)
Microsoft.CodeAnalysis (3)
Microsoft.CodeAnalysis.CodeStyle (51)
src\Analyzers\Core\Analyzers\MatchFolderAndNamespace\AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (1)
84nameSyntax.GetLocation(),
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (1)
216value.Syntax.GetLocation(),
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
Microsoft.CodeAnalysis.CSharp (30)
FlowAnalysis\NullableWalker.cs (11)
1124Diagnostics.Add(ErrorCode.WRN_MemberNotNullWhen, syntaxOpt?.GetLocation() ?? methodMainNode.Syntax.GetLastToken().GetLocation(), member.Name, sense ? "true" : "false");
1279location = syntaxOpt?.GetLocation() ?? methodMainNode.Syntax.GetLastToken().GetLocation();
1365var location = syntaxOpt?.GetLocation() ?? methodMainNode.Syntax.GetLastToken().GetLocation();
1388ReportDiagnostic(ErrorCode.WRN_ShouldNotReturn, syntaxOpt?.GetLocation() ?? methodMainNode.Syntax.GetLastToken().GetLocation());
2379location ??= value.Syntax.GetLocation();
2635ReportDiagnostic(errorCode, syntaxNode.GetLocation(), arguments);
8673diagnosticLocation: (conversionOpt ?? convertedNode).Syntax.GetLocation());
9186diagnosticLocation ??= (conversionOpt ?? conversionOperand).Syntax.GetLocation();
9456Location operandLocation = conversionOperand.Syntax.GetLocation();
10684ReportNullabilityMismatchInArgument(argument.GetLocation(), argumentType, parameter, parameterType, forOutput);
11078ReportDiagnostic(ErrorCode.WRN_NullReferenceReceiver, expr.Syntax.GetLocation());
Microsoft.CodeAnalysis.CSharp.CodeStyle (16)
src\Analyzers\CSharp\Analyzers\UseIsNullCheck\CSharpUseNullCheckOverTypeCheckDiagnosticAnalyzer.cs (2)
81Descriptor, context.Operation.Syntax.GetLocation(), notificationOption, context.Options, additionalLocations: null, properties: null));
111Descriptor, syntax.GetLocation(), notificationOption, context.Options, additionalLocations: null, properties: null));
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (11)
Diagnostics\DiagnosticAnalyzerTests.cs (9)
254var diag1 = CodeAnalysis.Diagnostic.Create(s_descriptor, context.Node.GetLocation(), "Attribute");
259var diag2 = CodeAnalysis.Diagnostic.Create(s_descriptor, context.Node.GetLocation(), "ClassDeclaration");
264var diag3 = CodeAnalysis.Diagnostic.Create(s_descriptor, context.Node.GetLocation(), "UsingDirective");
1655nodeContext.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(ExpressionDescriptor, nodeContext.Node.GetLocation()));
3850context => context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(Rule, context.Node.GetLocation())),
3856context => context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(Rule, context.Node.GetLocation())),
3863context => context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(Rule, context.Operation.Syntax.GetLocation())),
3869context => context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(Rule, context.Operation.Syntax.GetLocation())),
4135var diagnostic = CodeAnalysis.Diagnostic.Create(Rule, context.Node.GetLocation(), context.Node.Kind(), context.ContainingSymbol.Name);
Microsoft.CodeAnalysis.CSharp.Features (21)
src\Analyzers\CSharp\Analyzers\UseIsNullCheck\CSharpUseNullCheckOverTypeCheckDiagnosticAnalyzer.cs (2)
81Descriptor, context.Operation.Syntax.GetLocation(), notificationOption, context.Options, additionalLocations: null, properties: null));
111Descriptor, syntax.GetLocation(), notificationOption, context.Options, additionalLocations: null, properties: null));
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (3)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (9)
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (3)
Microsoft.CodeAnalysis.Features (59)
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (1)
216value.Syntax.GetLocation(),
Microsoft.CodeAnalysis.Features.Test.Utilities (1)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (2)
Microsoft.CodeAnalysis.Test.Utilities (89)
Diagnostics\CommonDiagnosticAnalyzers.cs (22)
71var location = context.Tree.GetRoot().GetLocation();
107var expectedLineSpan = root.GetLocation().GetLineSpan();
185var expectedLineSpan = root.GetLocation().GetLineSpan();
262var expectedLineSpan = root.GetLocation().GetLineSpan();
315var expectedLineSpan = root.GetLocation().GetLineSpan();
658syntaxNodeContext.ReportDiagnostic(Diagnostic.Create(DiagnosticDescriptor, syntaxNodeContext.Node.GetLocation()));
688context.ReportDiagnostic(Diagnostic.Create(Rule, context.Node.GetLocation()));
728context.ReportDiagnostic(Diagnostic.Create(Rule, context.Node.GetLocation()));
943_invalidLocation = treeInAnotherCompilation.GetRoot().GetLocation();
1081context.ReportDiagnostic(Diagnostic.Create(Descriptor, tree.GetRoot().GetLocation()));
1107Diagnostic.Create(Descriptor, context.SemanticModel.SyntaxTree.GetRoot().GetLocation())));
1353ReportDiagnostic(operationContext.ReportDiagnostic, operationContext.Operation.Syntax.GetLocation());
1365ReportDiagnostic(operationContext.ReportDiagnostic, operationContext.Operation.Syntax.GetLocation());
1445var diagnostic = Diagnostic.Create(Descriptor, operation.Syntax.GetLocation(), operation.Field.Name, operation.Field.ConstantValue);
1466var diagnostic = Diagnostic.Create(Descriptor, operationContext.Operation.Syntax.GetLocation(), operationContext.ContainingSymbol.Name);
2697context.ReportDiagnostic(Diagnostic.Create(s_descriptor, context.Tree.GetRoot().GetLocation()));
2882context => context.ReportDiagnostic(Diagnostic.Create(Descriptor, context.Node.GetLocation())),
2888context => context.ReportDiagnostic(Diagnostic.Create(Descriptor, context.Operation.Syntax.GetLocation())),
2934context.RegisterSyntaxTreeAction(syntaxContext => HandleCallback(syntaxContext.Tree.GetRoot().GetLocation(), context.Compilation, syntaxContext.ReportDiagnostic, syntaxContext.CancellationToken));
2937context.RegisterSyntaxNodeAction(context => HandleCallback(context.Node.GetLocation(), context.Compilation, context.ReportDiagnostic, context.CancellationToken), CodeAnalysis.CSharp.SyntaxKind.ClassDeclaration);
2943context.RegisterOperationAction(context => HandleCallback(context.Operation.Syntax.GetLocation(), context.Compilation, context.ReportDiagnostic, context.CancellationToken), OperationKind.VariableDeclaration);
2946context.RegisterSemanticModelAction(context => HandleCallback(context.SemanticModel.SyntaxTree.GetRoot().GetLocation(), context.SemanticModel.Compilation, context.ReportDiagnostic, context.CancellationToken));
Diagnostics\OperationTestAnalyzer.cs (63)
59operationContext.ReportDiagnostic(Diagnostic.Create(InvalidStatementDescriptor, operationContext.Operation.Syntax.GetLocation()));
63operationContext.ReportDiagnostic(Diagnostic.Create(InvalidExpressionDescriptor, operationContext.Operation.Syntax.GetLocation()));
73operationContext.ReportDiagnostic(Diagnostic.Create(IsInvalidDescriptor, operationContext.Operation.Syntax.GetLocation()));
109operationContext.ReportDiagnostic(Diagnostic.Create(ExpressionDescriptor, operationContext.Operation.Syntax.GetLocation()));
288context.ReportDiagnostic(Diagnostic.Create(descriptor, syntax.GetLocation()));
484context.ReportDiagnostic(Diagnostic.Create(descriptor, syntax.GetLocation()));
549operationContext.ReportDiagnostic(Diagnostic.Create(InvalidArgumentDescriptor, argument.Syntax.GetLocation()));
555operationContext.ReportDiagnostic(Diagnostic.Create(UseDefaultArgumentDescriptor, invocation.Syntax.GetLocation(), argument.Parameter.Name));
601context.ReportDiagnostic(Diagnostic.Create(descriptor, syntax.GetLocation()));
635operationContext.ReportDiagnostic(Diagnostic.Create(SeventeenDescriptor, literal.Syntax.GetLocation()));
678context.ReportDiagnostic(Diagnostic.Create(descriptor, syntax.GetLocation()));
724context.ReportDiagnostic(Diagnostic.Create(descriptor, syntax.GetLocation()));
765context.ReportDiagnostic(Diagnostic.Create(descriptor, syntax.GetLocation()));
805context.ReportDiagnostic(Diagnostic.Create(descriptor, syntax.GetLocation()));
862context.ReportDiagnostic(Diagnostic.Create(descriptor, syntax.GetLocation()));
923context.ReportDiagnostic(Diagnostic.Create(descriptor, syntax.GetLocation()));
955instanceReference.Syntax.GetLocation()));
1034operationContext.ReportDiagnostic(Diagnostic.Create(EventReferenceDescriptor, operationContext.Operation.Syntax.GetLocation()));
1042operationContext.ReportDiagnostic(Diagnostic.Create(eventAssignment.Adds ? HandlerAddedDescriptor : HandlerRemovedDescriptor, operationContext.Operation.Syntax.GetLocation()));
1046operationContext.ReportDiagnostic(Diagnostic.Create(InvalidEventDescriptor, eventAssignment.Syntax.GetLocation()));
1054operationContext.ReportDiagnostic(Diagnostic.Create(PropertyReferenceDescriptor, operationContext.Operation.Syntax.GetLocation()));
1061operationContext.ReportDiagnostic(Diagnostic.Create(FieldReferenceDescriptor, operationContext.Operation.Syntax.GetLocation()));
1068operationContext.ReportDiagnostic(Diagnostic.Create(MethodBindingDescriptor, operationContext.Operation.Syntax.GetLocation()));
1111operationContext.ReportDiagnostic(Diagnostic.Create(LongParamsDescriptor, argument.Value.Syntax.GetLocation()));
1126operationContext.ReportDiagnostic(Diagnostic.Create(InvalidConstructorDescriptor, creation.Syntax.GetLocation()));
1138operationContext.ReportDiagnostic(Diagnostic.Create(LongParamsDescriptor, argument.Value.Syntax.GetLocation()));
1184operationContext.ReportDiagnostic(Diagnostic.Create(EqualsValueDescriptor, equalsValue.Syntax.GetLocation()));
1195operationContext.ReportDiagnostic(Diagnostic.Create(EqualsValueDescriptor, equalsValue.Syntax.GetLocation()));
1226operationContext.ReportDiagnostic(Diagnostic.Create(NoneOperationDescriptor, operationContext.Operation.Syntax.GetLocation()));
1262operationContext.ReportDiagnostic(Diagnostic.Create(AddressOfDescriptor, addressOfOperation.Syntax.GetLocation()));
1266operationContext.ReportDiagnostic(Diagnostic.Create(InvalidAddressOfReferenceDescriptor, addressOfOperation.Reference.Syntax.GetLocation()));
1314operationContext.ReportDiagnostic(Diagnostic.Create(LambdaExpressionDescriptor, operationContext.Operation.Syntax.GetLocation()));
1323operationContext.ReportDiagnostic(Diagnostic.Create(TooManyStatementsInLambdaExpressionDescriptor, operationContext.Operation.Syntax.GetLocation()));
1336operationContext.ReportDiagnostic(Diagnostic.Create(NoneOperationInLambdaExpressionDescriptor, operationContext.Operation.Syntax.GetLocation()));
1408operationContext.ReportDiagnostic(Diagnostic.Create(StaticMemberDescriptor, operation.Syntax.GetLocation()));
1412operationContext.ReportDiagnostic(Diagnostic.Create(StaticMemberWithInstanceDescriptor, operation.Syntax.GetLocation()));
1452operationContext.ReportDiagnostic(Diagnostic.Create(LabelDescriptor, operationContext.Operation.Syntax.GetLocation()));
1466operationContext.ReportDiagnostic(Diagnostic.Create(GotoDescriptor, branch.Syntax.GetLocation()));
1518operationContext.ReportDiagnostic(Diagnostic.Create(OperatorAddMethodDescriptor, binary.Syntax.GetLocation()));
1523operationContext.ReportDiagnostic(Diagnostic.Create(DoubleMultiplyDescriptor, binary.Syntax.GetLocation()));
1534operationContext.ReportDiagnostic(Diagnostic.Create(OperatorMinusMethodDescriptor, unary.Syntax.GetLocation()));
1539operationContext.ReportDiagnostic(Diagnostic.Create(BooleanNotDescriptor, unary.Syntax.GetLocation()));
1544operationContext.ReportDiagnostic(Diagnostic.Create(BooleanNotDescriptor, unary.Syntax.GetLocation()));
1574binary.Syntax.GetLocation(),
1627binary.Syntax.GetLocation(),
1651unary.Syntax.GetLocation(),
1707paramsarrayArgumentOperation.Syntax.GetLocation()));
1791operationContext.ReportDiagnostic(Diagnostic.Create(InvalidBinaryDescriptor, binary.Syntax.GetLocation()));
1799operationContext.ReportDiagnostic(Diagnostic.Create(InvalidUnaryDescriptor, unary.Syntax.GetLocation()));
1807operationContext.ReportDiagnostic(Diagnostic.Create(InvalidIncrementDescriptor, inc.Syntax.GetLocation()));
1848operationContext.ReportDiagnostic(Diagnostic.Create(ConditionalAccessOperationDescriptor, conditionalAccess.Syntax.GetLocation()));
1857operationContext.ReportDiagnostic(Diagnostic.Create(ConditionalAccessInstanceOperationDescriptor, conditionalAccessInstance.Syntax.GetLocation()));
1897operationContext.ReportDiagnostic(Diagnostic.Create(InvalidConversionExpressionDescriptor, conversion.Syntax.GetLocation()));
1935operationContext.ReportDiagnostic(Diagnostic.Create(ForLoopConditionCrashDescriptor, forLoop.LimitValue.Syntax.GetLocation()));
1974operationContext.ReportDiagnostic(Diagnostic.Create(UnaryTrueDescriptor, unary.Syntax.GetLocation()));
1978operationContext.ReportDiagnostic(Diagnostic.Create(UnaryFalseDescriptor, unary.Syntax.GetLocation()));
2015operationContext.ReportDiagnostic(Diagnostic.Create(AssignmentOperationDescriptor, operationContext.Operation.Syntax.GetLocation()));
2023syntaxContext.ReportDiagnostic(Diagnostic.Create(AssignmentSyntaxDescriptor, syntaxContext.Node.GetLocation()));
2052operationContext.ReportDiagnostic(Diagnostic.Create(LiteralDescriptor, literal.Syntax.GetLocation(), literal.Syntax.ToString()));
2080Diagnostic.Create(OperationActionDescriptor, operationContext.Operation.Syntax.GetLocation(), "Operation", "Analysis"));
2111Diagnostic.Create(OperationActionDescriptor, operationContext.Operation.Syntax.GetLocation(), "Operation", "CompilationStart within Analysis"));
2143syntaxContext.ReportDiagnostic(Diagnostic.Create(GetOperationDescriptor, node.GetLocation()));
2155syntaxContext.ReportDiagnostic(Diagnostic.Create(GetOperationDescriptor, node.GetLocation()));
Microsoft.CodeAnalysis.VisualBasic (46)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (3)
src\Analyzers\VisualBasic\Analyzers\NewLines\ConsecutiveStatementPlacement\VisualBasicConsecutiveStatementPlacementDiagnosticAnalyzer.vb (1)
44Return block.GetLocation()
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (3)
Microsoft.CodeAnalysis.VisualBasic.ExpressionCompiler (1)
Microsoft.CodeAnalysis.VisualBasic.Features (3)
src\Analyzers\VisualBasic\Analyzers\NewLines\ConsecutiveStatementPlacement\VisualBasicConsecutiveStatementPlacementDiagnosticAnalyzer.vb (1)
44Return block.GetLocation()
Microsoft.CodeAnalysis.VisualBasic.Features.UnitTests (1)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (4)
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (4)
Microsoft.CodeAnalysis.Workspaces (3)
Microsoft.DotNet.CodeAnalysis (1)
Microsoft.Extensions.Options.SourceGeneration (1)
Microsoft.Gen.Logging (4)
Microsoft.Interop.ComInterfaceGenerator (6)
Microsoft.Interop.LibraryImportGenerator (5)
Microsoft.Maui.Controls.BindingSourceGen (1)
Microsoft.ML.InternalCodeAnalyzer (3)
System.Private.CoreLib.Generators (4)
System.Text.RegularExpressions.Generator (3)