480 references to GetLocation
ILLink.RoslynAnalyzer (17)
COMAnalyzer.cs (1)
55 operationContext.Operation.Syntax.GetLocation (), targetMethod.GetDisplayName ()));
DataFlow\LocalDataFlowVisitor.cs (7)
104 $"{OwningSymbol.GetType ()}: {branchValueOperation.Syntax.GetLocation ().GetLineSpan ()}"); 112 $"{OwningSymbol.GetType ()}: {branchValueOperation.Syntax.GetLocation ().GetLineSpan ()}"); 205 $"{local.ContainingSymbol.GetType ()}: {localReference.Syntax.GetLocation ().GetLineSpan ()}"); 452 $"{operation.Syntax.GetLocation ().GetLineSpan ()}"); 454 $"{operation.Syntax.GetLocation ().GetLineSpan ()}"); 473 $"{operation.Syntax.GetLocation ().GetLineSpan ()}"); 475 $"{operation.Syntax.GetLocation ().GetLineSpan ()}");
DataFlow\UnexpectedOperationHandler.cs (1)
47 throw new NotImplementedException ($"Unexpected operation type {operation.GetType ()}: {operation.Syntax.GetLocation ().GetLineSpan ()}");
RequiresAnalyzerBase.cs (1)
109 syntaxNodeAnalysisContext.Node.GetLocation (),
TrimAnalysis\DiagnosticContext.cs (1)
76 symbolLocation = symbol.DeclaringSyntaxReferences[0].GetSyntax ().GetLocation ();
TrimAnalysis\FeatureCheckReturnValuePattern.cs (1)
35 var diagnosticContext = new DiagnosticContext (Operation.Syntax.GetLocation (), reportDiagnostic);
TrimAnalysis\TrimAnalysisAssignmentPattern.cs (1)
58 var diagnosticContext = new DiagnosticContext (Operation.Syntax.GetLocation (), reportDiagnostic);
TrimAnalysis\TrimAnalysisFieldAccessPattern.cs (1)
49 DiagnosticContext diagnosticContext = new (Operation.Syntax.GetLocation (), reportDiagnostic);
TrimAnalysis\TrimAnalysisGenericInstantiationPattern.cs (1)
51 var location = Operation.Syntax.GetLocation ();
TrimAnalysis\TrimAnalysisMethodCallPattern.cs (1)
74 var location = Operation.Syntax.GetLocation ();
TrimAnalysis\TrimAnalysisReflectionAccessPattern.cs (1)
48 var location = Operation.Syntax.GetLocation ();
Microsoft.Analyzers.Extra (16)
AsyncCallInsideUsingBlockAnalyzer.cs (1)
123Diagnostic.Create(DiagDescriptors.AsyncCallInsideUsingBlock, invocation.Syntax.GetLocation());
AsyncMethodWithoutCancellation.cs (1)
110Diagnostic.Create(DiagDescriptors.AsyncMethodWithoutCancellation, analysisContext.Node.GetLocation());
CallAnalysis\Arrays.cs (2)
101static void HandleMethod(OperationAnalysisContext context, IInvocationOperation op) => HandleSuspectType(context, (INamedTypeSymbol)op.TargetMethod.ReturnType, op.Syntax.GetLocation()); 103static void HandleConstructor(OperationAnalysisContext context, IObjectCreationOperation op) => HandleSuspectType(context, (INamedTypeSymbol)op.Type!, op.Syntax.GetLocation());
CallAnalysis\LegacyCollection.cs (1)
33var diagnostic = Diagnostic.Create(DiagDescriptors.LegacyCollection, op.Syntax.GetLocation());
CallAnalysis\LegacyLogging.cs (1)
38var diagnostic = Diagnostic.Create(DiagDescriptors.LegacyLogging, op.Syntax.GetLocation());
CallAnalysis\Split.cs (1)
28var diagnostic = Diagnostic.Create(DiagDescriptors.Split, op.Syntax.GetLocation());
CallAnalysis\StartsEndsWith.cs (1)
59var diagnostic = Diagnostic.Create(DiagDescriptors.StartsEndsWith, op.Syntax.GetLocation(), op.TargetMethod.Name);
CallAnalysis\StaticTime.cs (2)
52var diagnostic = Diagnostic.Create(DiagDescriptors.StaticTime, op.Syntax.GetLocation()); 58var diagnostic = Diagnostic.Create(DiagDescriptors.StaticTime, op.Syntax.GetLocation());
CallAnalysis\ValueTuple.cs (2)
42var diagnostic = Diagnostic.Create(DiagDescriptors.ValueTuple, op.Syntax.GetLocation()); 48var diagnostic = Diagnostic.Create(DiagDescriptors.ValueTuple, op.Syntax.GetLocation());
CoalesceAnalyzer.cs (2)
52var diagnostic = Diagnostic.Create(DiagDescriptors.CoalesceAssignment, op.Syntax.GetLocation()); 79var diagnostic = Diagnostic.Create(DiagDescriptors.Coalesce, op.Syntax.GetLocation());
ConditionalAccessAnalyzer.cs (1)
111var diagnostic = Diagnostic.Create(DiagDescriptors.ConditionalAccess, op.Syntax.GetLocation());
UsingToStringInLoggersAnalyzer.cs (1)
69yield return Diagnostic.Create(DiagDescriptors.UsingToStringInLoggers, arg.Syntax.GetLocation());
Microsoft.Analyzers.Local (2)
CallAnalysis\Throws.cs (1)
39op.Syntax.GetLocation(),
CallAnalysis\ToInvariantString.cs (1)
51var diagnostic = Diagnostic.Create(DiagDescriptors.ToInvariantString, op.Syntax.GetLocation());
Microsoft.AspNetCore.Analyzers (4)
BuildServiceProviderAnalyzer.cs (1)
33serviceItem.Operation.Syntax.GetLocation(),
UseAuthorizationAnalyzer.cs (2)
51middlewareItem.Operation.Syntax.GetLocation(), 71useAuthorizationItem.Operation.Syntax.GetLocation(),
UseMvcAnalyzer.cs (1)
45middlewareItem.Operation.Syntax.GetLocation(),
Microsoft.AspNetCore.App.Analyzers (15)
Authorization\AddAuthorizationBuilderAnalyzer.cs (1)
62AddDiagnosticInformation(context, invocation.Syntax.GetLocation());
Http\HeaderDictionaryAddAnalyzer.cs (1)
38AddDiagnosticWarning(context, invocation.Syntax.GetLocation());
Http\HeaderDictionaryIndexerAnalyzer.cs (1)
41AddDiagnosticWarning(context, propertyReference.Syntax.GetLocation(), indexerValue, propertyName);
Http\RequestDelegateReturnTypeAnalyzer.cs (2)
40AddDiagnosticWarning(context, methodReference.Syntax.GetLocation(), returnType); 66AddDiagnosticWarning(context, anonymousFunction.Syntax.GetLocation(), returnType);
Mvc\DetectOverriddenAuthorizeAttribute.cs (1)
218syntaxReference.GetSyntax(context.CancellationToken).GetLocation(),
RenderTreeBuilder\RenderTreeBuilderAnalyzer.cs (1)
47argument.Syntax.GetLocation(),
RouteHandlers\AtMostOneFromBodyAttribute.cs (1)
53var location = syntax.GetLocation();
RouteHandlers\DetectMismatchedParameterOptionality.cs (1)
35var location = parameter.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax().GetLocation();
RouteHandlers\DetectMisplacedLambdaAttribute.cs (1)
41var location = lambda.Syntax.GetLocation();
RouteHandlers\DisallowMvcBindArgumentsOnParameters.cs (1)
33location = syntax.GetLocation();
RouteHandlers\DisallowReturningActionResultFromMapMethods.cs (2)
49nodeForError.GetLocation(), 83returnOperation.Syntax.GetLocation(),
WebApplicationBuilder\PublicPartialProgramClassAnalyzer.cs (1)
29syntaxNode.GetLocation()));
WebApplicationBuilder\WebApplicationBuilderAnalyzer.cs (1)
258var location = operation.Syntax.GetLocation();
Microsoft.AspNetCore.Components.Analyzers (5)
ComponentParameterUsageAnalyzer.cs (1)
107propertyReference.Syntax.GetLocation(),
InternalUsageAnalyzer.cs (4)
139context.Operation.Syntax.GetLocation(), 149context.Operation.Syntax.GetLocation(), 168symbolForDiagnostic.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax().GetLocation() ?? Location.None, 178symbolForDiagnostic.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax().GetLocation() ?? Location.None,
Microsoft.AspNetCore.Components.SdkAnalyzers (5)
ComponentParameterUsageAnalyzer.cs (1)
107propertyReference.Syntax.GetLocation(),
InternalUsageAnalyzer.cs (4)
139context.Operation.Syntax.GetLocation(), 149context.Operation.Syntax.GetLocation(), 168symbolForDiagnostic.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax().GetLocation() ?? Location.None, 178symbolForDiagnostic.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax().GetLocation() ?? Location.None,
Microsoft.AspNetCore.Http.RequestDelegateGenerator (8)
StaticRouteHandlerModel\Endpoint.cs (4)
31Diagnostics.Add(Diagnostic.Create(DiagnosticDescriptors.UnableToResolveMethod, Operation.Syntax.GetLocation())); 36Response.EmitRequiredDiagnostics(Diagnostics, Operation.Syntax.GetLocation()); 58parameterSymbol.EmitRequiredDiagnostics(Diagnostics, Operation.Syntax.GetLocation()); 79Operation.Syntax.GetLocation(),
StaticRouteHandlerModel\EndpointParameter.cs (4)
115var location = endpoint.Operation.Syntax.GetLocation(); 151var location = endpoint.Operation.Syntax.GetLocation(); 164var location = endpoint.Operation.Syntax.GetLocation(); 462var location = endpoint.Operation.Syntax.GetLocation();
Microsoft.AspNetCore.Mvc.Analyzers (4)
AttributesShouldNotBeAppliedToPageModelAnalyzer.cs (1)
140return syntax?.GetLocation() ?? Location.None;
AvoidHtmlPartialAnalyzer.cs (2)
33context.Operation.Syntax.GetLocation(), 40context.Operation.Syntax.GetLocation(),
TagHelpersInCodeBlocksAnalyzer.cs (1)
88capturedDiagnosticLocations.Add(parent.Syntax.GetLocation());
Microsoft.AspNetCore.Mvc.Api.Analyzers (4)
ApiActionsDoNotRequireExplicitModelValidationCheckAnalyzer.cs (3)
117ifOperation.Syntax.GetLocation(), 118returnStatementSyntax.GetLocation(), 124ifOperation.Syntax.GetLocation(),
ApiConventionAnalyzer.cs (1)
53var location = actualMetadata.ReturnOperation.ReturnedValue.Syntax.GetLocation();
Microsoft.CodeAnalysis (3)
Compilation\Compilation.cs (1)
2499diagnostics.Add(MessageProvider.CreateDiagnostic(MessageProvider.ERR_EncodinglessSyntaxTree, tree.GetRoot().GetLocation()));
Symbols\Attributes\MarshalAsAttributeDecoder.cs (1)
277arguments.Diagnostics.Add(messageProvider.CreateDiagnostic(warningCode, arguments.AttributeSyntaxOpt.GetLocation()));
Syntax\SyntaxNodeOrToken.cs (1)
835return _nodeOrParent?.GetLocation();
Microsoft.CodeAnalysis.CodeStyle (51)
src\Analyzers\Core\Analyzers\AddRequiredParentheses\AbstractAddRequiredParenthesesDiagnosticAnalyzer.cs (1)
122var additionalLocations = ImmutableArray.Create(binaryLike.GetLocation());
src\Analyzers\Core\Analyzers\ConvertTypeofToNameof\AbstractConvertTypeOfToNameOfDiagnosticAnalyzer.cs (1)
49var location = parent.GetLocation();
src\Analyzers\Core\Analyzers\MatchFolderAndNamespace\AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (1)
84nameSyntax.GetLocation(),
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchDiagnosticAnalyzer.cs (1)
78additionalLocations: [switchBlock.GetLocation()]);
src\Analyzers\Core\Analyzers\RemoveUnnecessaryCast\AbstractRemoveUnnecessaryCastDiagnosticAnalyzer.cs (1)
74ImmutableArray.Create(node.GetLocation()));
src\Analyzers\Core\Analyzers\RemoveUnnecessaryParentheses\AbstractRemoveUnnecessaryParenthesesDiagnosticAnalyzer.cs (2)
108parenthesizedExpression.GetLocation()); 129var parenthesizedExpressionLocation = parenthesizedExpression.GetLocation();
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryAttributeSuppressionsDiagnosticAnalyzer.cs (2)
83reportDiagnostic(Diagnostic.Create(s_invalidScopeDescriptor, attributeSyntax.GetLocation())); 90reportDiagnostic(Diagnostic.Create(s_invalidOrMissingTargetDescriptor, attributeSyntax.GetLocation()));
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (1)
670var diagnostic = Diagnostic.Create(s_removeUnnecessarySuppressionDescriptor, attribute.GetLocation(), severity, additionalLocations: null, properties: null);
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
570? [fadingNode.GetLocation()]
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (1)
216value.Syntax.GetLocation(),
src\Analyzers\Core\Analyzers\SimplifyBooleanExpression\AbstractSimplifyConditionalDiagnosticAnalyzer.cs (1)
142conditionalExpression.GetLocation(),
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationDiagnosticAnalyzer.cs (1)
71additionalLocations: [interpolation.Syntax.GetLocation()],
src\Analyzers\Core\Analyzers\SimplifyLinqExpression\AbstractSimplifyLinqExpressionDiagnosticAnalyzer.cs (1)
174context.ReportDiagnostic(Diagnostic.Create(Descriptor, nextInvocation.Syntax.GetLocation()));
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (4)
650propertyDeclaration.GetLocation(), 651variableDeclarator.GetLocation()); 663fieldNode.GetLocation(), 672Descriptor, propertyDeclaration.GetLocation(),
src\Analyzers\Core\Analyzers\UseCoalesceExpression\AbstractUseCoalesceExpressionForNullableTernaryConditionalCheckDiagnosticAnalyzer.cs (4)
120conditionalExpression.GetLocation(), 121conditionExpression.GetLocation(), 122whenPartToKeep.GetLocation()); 126conditionalExpression.GetLocation(),
src\Analyzers\Core\Analyzers\UseCoalesceExpression\AbstractUseCoalesceExpressionForTernaryConditionalCheckDiagnosticAnalyzer.cs (4)
124conditionalExpression.GetLocation(), 125conditionPartToCheck.GetLocation(), 126whenPartToCheck.GetLocation()); 130conditionalExpression.GetLocation(),
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerDiagnosticAnalyzer.cs (1)
182var locations = ImmutableArray.Create(objectCreationExpression.GetLocation());
src\Analyzers\Core\Analyzers\UseCompoundAssignment\AbstractUseCompoundAssignmentDiagnosticAnalyzer.cs (3)
163additionalLocations: ImmutableArray.Create(assignment.GetLocation()), 183additionalLocations: ImmutableArray.Create(assignment.GetLocation()), 196additionalLocations: ImmutableArray.Create(assignment.GetLocation()),
src\Analyzers\Core\Analyzers\UseConditionalExpression\AbstractUseConditionalExpressionDiagnosticAnalyzer.cs (1)
60additionalLocations: ImmutableArray.Create(ifStatement.GetLocation()),
src\Analyzers\Core\Analyzers\UseExplicitTupleName\UseExplicitTupleNameDiagnosticAnalyzer.cs (1)
65nameNode.GetLocation(),
src\Analyzers\Core\Analyzers\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsDiagnosticAnalyzer.cs (2)
132var additionalLocations = ImmutableArray.Create(invocation.GetLocation()); 142Descriptor, nameNode.GetLocation(),
src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer.cs (4)
191conditionalExpression.GetLocation(), 192conditionPartToCheck.GetLocation(), 193whenPartToCheck.GetLocation()); 205conditionalExpression.GetLocation(),
src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer_IfStatement.cs (3)
100ifStatement.GetLocation(), 101trueStatement.GetLocation(), 102whenPartMatch.GetLocation()),
src\Analyzers\Core\Analyzers\UseObjectInitializer\AbstractUseObjectInitializerDiagnosticAnalyzer.cs (1)
123var locations = ImmutableArray.Create(objectCreationExpression.GetLocation());
src\Analyzers\Core\Analyzers\UseSystemHashCode\UseSystemHashCodeDiagnosticAnalyzer.cs (2)
77var operationLocation = operation.Syntax.GetLocation(); 78var declarationLocation = context.OwningSymbol.DeclaringSyntaxReferences[0].GetSyntax(cancellationToken).GetLocation();
src\Analyzers\Core\Analyzers\UseThrowExpression\AbstractUseThrowExpressionDiagnosticAnalyzer.cs (5)
130ifOperation.Syntax.GetLocation(), 131throwOperation.Exception.Syntax.GetLocation(), 132assignmentExpression.Value.Syntax.GetLocation(), 133expressionStatement.Syntax.GetLocation()); 136DiagnosticHelper.Create(Descriptor, throwStatementSyntax.GetLocation(), option.Notification, context.Options, additionalLocations: allLocations, properties: null));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (1)
34result.Add(syntaxRef.GetSyntax(cancellationToken).GetLocation());
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateConversionService.State.cs (1)
76location = node.GetLocation();
Microsoft.CodeAnalysis.CSharp (30)
Binder\Binder_Expressions.cs (5)
353diagnostics.Add(ErrorCode.ERR_DefaultLiteralNoTargetType, defaultExpr.Syntax.GetLocation()); 376diagnostics.Add(ErrorCode.ERR_ImplicitObjectCreationNoTargetType, expr.Syntax.GetLocation(), expr.Display); 396diagnostics.Add(ErrorCode.ERR_CollectionExpressionNoTargetType, expr.Syntax.GetLocation()); 422diagnostics.Add(ErrorCode.ERR_CannotInferDelegateType, syntax.GetLocation()); 9142location = expr.Syntax.GetLocation();
Binder\Binder_Invocation.cs (1)
1817return expression.GetLocation();
Binder\Binder_Symbols.cs (1)
2748=> CheckFeatureAvailability(syntax.SyntaxTree, feature, diagnostics, (location, syntax), static tuple => tuple.location ?? tuple.syntax.GetLocation());
Binder\ExecutableCodeBinder.cs (1)
122Location errorLocation = (iterator as SynthesizedSimpleProgramEntryPointSymbol)?.ReturnTypeSyntax.GetLocation() ?? iterator.GetFirstLocation();
Binder\ForEachLoopBinder.cs (2)
847diagnostics.Add(ErrorCode.ERR_InlineArrayForEachNotSupported, collectionExpr.Syntax.GetLocation(), collectionExpr.Type); 895diagnostics.Add(ErrorCode.ERR_InlineArrayForEachNotSupported, collectionExpr.Syntax.GetLocation(), collectionExpr.Type);
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (1)
274if (HadStaticInstanceMismatch(diagnostics, symbols, invokedExpression?.GetLocation() ?? location, binder, receiver, nodeOpt, delegateOrFunctionPointerType))
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());
Lowering\Instrumentation\CodeCoverageInstrumenter.cs (2)
478return GetSourceDocument(debugDocumentProvider, syntax, syntax.GetLocation().GetMappedLineSpan()); 500return AddAnalysisPoint(syntaxForSpan, syntaxForSpan.GetLocation().GetMappedLineSpan(), statementFactory);
Lowering\LocalRewriter\LocalRewriter_ObjectCreationExpression.cs (1)
343method.CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(_compilation, _compilation.Conversions, syntax.GetLocation(), _diagnostics));
Lowering\MethodToClassRewriter.cs (1)
738: base(containingType, methodBeingWrapped, syntax.SyntaxTree.GetReference(syntax), syntax.GetLocation(), name, DeclarationModifiers.Private,
Symbols\Source\SourceLocalSymbol.cs (1)
599diagnostics.Add(ErrorCode.ERR_CircConstValue, node.GetLocation(), this);
Symbols\Source\SourceParameterSymbol.cs (1)
55identifier.Parent.GetLocation());
Symbols\Synthesized\SynthesizedLocal.cs (1)
145get { return (_syntaxOpt == null) ? ImmutableArray<Location>.Empty : ImmutableArray.Create(_syntaxOpt.GetLocation()); }
Symbols\TypeWithAnnotations.cs (1)
1184diagnostics.Add(new LazyObsoleteDiagnosticInfo(type, binder.ContainingMemberOrLambda, binder.Flags), syntax.GetLocation());
Microsoft.CodeAnalysis.CSharp.CodeStyle (16)
src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.cs (1)
66additionalLocations.Add(switchStatement.GetLocation());
src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (2)
233invocationOrCreation.GetLocation()); 243reportNode.GetLocation(),
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
213return (nameToken.Value.GetLocation(), declaration.GetLocation());
src\Analyzers\CSharp\Analyzers\QualifyMemberAccess\CSharpQualifyMemberAccessDiagnosticAnalyzer.cs (1)
67protected override Location GetLocation(IOperation operation) => operation.Syntax.GetLocation();
src\Analyzers\CSharp\Analyzers\RemoveConfusingSuppression\CSharpRemoveConfusingSuppressionDiagnosticAnalyzer.cs (1)
48ImmutableArray.Create(node.GetLocation()),
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveRedundantNullableDirectiveDiagnosticAnalyzer.cs (1)
103context.ReportDiagnostic(Diagnostic.Create(Descriptor, directive.GetLocation()));
src\Analyzers\CSharp\Analyzers\RemoveUnusedParametersAndValues\CSharpRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (1)
109return unusedDefinition.Syntax.GetLocation();
src\Analyzers\CSharp\Analyzers\UseExpressionBody\UseExpressionBodyDiagnosticAnalyzer.cs (4)
101? declaration.GetLocation() 104var additionalLocations = ImmutableArray.Create(declaration.GetLocation()); 116? declaration.GetLocation() 123var additionalLocations = ImmutableArray.Create(declaration.GetLocation());
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));
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpUseNotPatternDiagnosticAnalyzer.cs (1)
100[node.GetLocation()],
src\Analyzers\CSharp\Analyzers\UseUtf8StringLiteral\UseUtf8StringLiteralDiagnosticAnalyzer.cs (1)
141var additionalLocations = ImmutableArray.Create(syntaxNode.GetLocation());
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (2)
CommandLineTests.cs (2)
15946context.ReportDiagnostic(Diagnostic.Create(Hidden01, context.Node.GetLocation())); 15972context.ReportDiagnostic(Diagnostic.Create(Info01, context.Node.GetLocation()));
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.cs (1)
326context.ReportDiagnostic(Diagnostic.Create(Descriptor, context.Node.GetLocation()));
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);
Diagnostics\GetDiagnosticsTests.cs (2)
971blockEndContext.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(DescriptorForBlockEnd, blockEndContext.CodeBlock.GetLocation())); 990blockEndContext.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(DescriptorForBlockEnd, operationBlock.Syntax.GetLocation()));
Microsoft.CodeAnalysis.CSharp.Features (21)
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.cs (1)
102return CompletionUtilities.GetTargetCaretNodeForInsertedMember(caretTarget).GetLocation().SourceSpan.End;
Completion\CompletionProviders\OverrideCompletionProvider.cs (1)
209return CompletionUtilities.GetTargetCaretNodeForInsertedMember(caretTarget).GetLocation().SourceSpan.End;
Completion\CompletionProviders\PartialMethodCompletionProvider.cs (1)
67return CompletionUtilities.GetTargetCaretPositionForMethod(methodDeclaration).GetLocation().SourceSpan.End;
InitializeParameter\CSharpInitializeMemberFromPrimaryConstructorParameterCodeRefactoringProvider_Update.cs (2)
149? new CodeGenerationContext(afterThisLocation: syntax.GetLocation()) 150: new CodeGenerationContext(beforeThisLocation: syntax.GetLocation()));
src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.cs (1)
66additionalLocations.Add(switchStatement.GetLocation());
src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (2)
233invocationOrCreation.GetLocation()); 243reportNode.GetLocation(),
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
213return (nameToken.Value.GetLocation(), declaration.GetLocation());
src\Analyzers\CSharp\Analyzers\QualifyMemberAccess\CSharpQualifyMemberAccessDiagnosticAnalyzer.cs (1)
67protected override Location GetLocation(IOperation operation) => operation.Syntax.GetLocation();
src\Analyzers\CSharp\Analyzers\RemoveConfusingSuppression\CSharpRemoveConfusingSuppressionDiagnosticAnalyzer.cs (1)
48ImmutableArray.Create(node.GetLocation()),
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveRedundantNullableDirectiveDiagnosticAnalyzer.cs (1)
103context.ReportDiagnostic(Diagnostic.Create(Descriptor, directive.GetLocation()));
src\Analyzers\CSharp\Analyzers\RemoveUnusedParametersAndValues\CSharpRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (1)
109return unusedDefinition.Syntax.GetLocation();
src\Analyzers\CSharp\Analyzers\UseExpressionBody\UseExpressionBodyDiagnosticAnalyzer.cs (4)
101? declaration.GetLocation() 104var additionalLocations = ImmutableArray.Create(declaration.GetLocation()); 116? declaration.GetLocation() 123var additionalLocations = ImmutableArray.Create(declaration.GetLocation());
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));
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpUseNotPatternDiagnosticAnalyzer.cs (1)
100[node.GetLocation()],
src\Analyzers\CSharp\Analyzers\UseUtf8StringLiteral\UseUtf8StringLiteralDiagnosticAnalyzer.cs (1)
141var additionalLocations = ImmutableArray.Create(syntaxNode.GetLocation());
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (3)
Diagnostics\Configuration\ConfigureSeverity\AllAnalyzersSeverityConfigurationTests.cs (1)
38c => c.ReportDiagnostic(Diagnostic.Create(Rule, c.Node.GetLocation())),
Diagnostics\Configuration\ConfigureSeverity\CategoryBasedSeverityConfigurationTests.cs (1)
38c => c.ReportDiagnostic(Diagnostic.Create(Rule, c.Node.GetLocation())),
Diagnostics\Configuration\ConfigureSeverity\DotNetDiagnosticSeverityBasedSeverityConfigurationTests.cs (1)
38c => c.ReportDiagnostic(Diagnostic.Create(Rule, c.Node.GetLocation())),
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Symbols\Source\NullablePublicAPITests.cs (1)
1171syntaxContext.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(s_descriptor1, syntaxContext.Node.GetLocation(), syntaxContext.Node, info.Nullability.FlowState, info.Nullability.Annotation, specInfo.Nullability.FlowState));
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
Rename\CSharpRenameRewriterLanguageService.cs (1)
1014return [deconstructionLeft.GetLocation()];
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (9)
CodeFixes\CodeFixServiceTests.cs (2)
1194context.ReportDiagnostic(Diagnostic.Create(Descriptor, decl.GetLocation())); 1210context.ReportDiagnostic(Diagnostic.Create(Descriptor, context.Operation.Syntax.GetLocation())),
Diagnostics\DiagnosticAnalyzerServiceTests.cs (7)
923context.RegisterSyntaxTreeAction(c => c.ReportDiagnostic(Diagnostic.Create(s_syntaxRule, c.Tree.GetRoot().GetLocation()))); 924context.RegisterSemanticModelAction(c => c.ReportDiagnostic(Diagnostic.Create(s_semanticRule, c.SemanticModel.SyntaxTree.GetRoot().GetLocation()))); 925context.RegisterCompilationAction(c => c.ReportDiagnostic(Diagnostic.Create(s_compilationRule, c.Compilation.SyntaxTrees.First().GetRoot().GetLocation()))); 939context.RegisterSyntaxTreeAction(c => c.ReportDiagnostic(Diagnostic.Create(s_syntaxRule, c.Tree.GetRoot().GetLocation()))); 940context.RegisterSemanticModelAction(c => c.ReportDiagnostic(Diagnostic.Create(s_semanticRule, c.SemanticModel.SyntaxTree.GetRoot().GetLocation()))); 941context.RegisterCompilationAction(c => c.ReportDiagnostic(Diagnostic.Create(s_compilationRule, c.Compilation.SyntaxTrees.First().GetRoot().GetLocation()))); 1016return ImmutableArray.Create(Diagnostic.Create(s_syntaxRule, root.GetLocation()));
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (3)
Diagnostics\DiagnosticServiceTests.vb (3)
1702context.ReportDiagnostic(Diagnostic.Create(Descriptor, context.CodeBlock.GetLocation)) 1724context.ReportDiagnostic(Diagnostic.Create(Descriptor, context.CodeBlock.GetLocation)) 1827context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(Descriptor1, context.CodeBlock.GetLocation()))
Microsoft.CodeAnalysis.Features (59)
ChangeSignature\DelegateInvokeMethodReferenceFinder.cs (1)
131node.GetLocation(),
CodeLens\CodeLensReferencesService.cs (1)
278var document = solution.GetDocument(syntaxNode.GetLocation().SourceTree);
Diagnostics\Analyzers\UnboundIdentifiersDiagnosticAnalyzerBase.cs (1)
81context.ReportDiagnostic(Diagnostic.Create(DiagnosticDescriptor, typeName.GetLocation(), typeName.ToString()));
ExtractMethod\MethodExtractor.CodeGenerator.cs (1)
182afterThisLocation: mappedMember.GetLocation(),
GenerateComparisonOperators\GenerateComparisonOperatorsCodeRefactoringProvider.cs (1)
153new CodeGenerationContext(contextLocation: typeDeclaration.GetLocation()));
GenerateType\AbstractGenerateTypeService.Editor.cs (1)
554new CodeGenerationContext(contextLocation: _state.SimpleName.GetLocation())),
InitializeParameter\AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs (2)
558return new CodeGenerationContext(afterThisLocation: symbolSyntax.GetLocation()); 564return new CodeGenerationContext(beforeThisLocation: symbolSyntax.GetLocation());
PreferFrameworkType\PreferFrameworkTypeDiagnosticAnalyzerBase.cs (1)
103Descriptor, typeNode.GetLocation(),
SimplifyThisOrMe\AbstractSimplifyThisOrMeDiagnosticAnalyzer.cs (2)
76Descriptor, thisExpression.GetLocation(), notification, 78ImmutableArray.Create(memberAccessExpression.GetLocation()),
src\Analyzers\Core\Analyzers\AddRequiredParentheses\AbstractAddRequiredParenthesesDiagnosticAnalyzer.cs (1)
122var additionalLocations = ImmutableArray.Create(binaryLike.GetLocation());
src\Analyzers\Core\Analyzers\ConvertTypeofToNameof\AbstractConvertTypeOfToNameOfDiagnosticAnalyzer.cs (1)
49var location = parent.GetLocation();
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchDiagnosticAnalyzer.cs (1)
78additionalLocations: [switchBlock.GetLocation()]);
src\Analyzers\Core\Analyzers\RemoveUnnecessaryCast\AbstractRemoveUnnecessaryCastDiagnosticAnalyzer.cs (1)
74ImmutableArray.Create(node.GetLocation()));
src\Analyzers\Core\Analyzers\RemoveUnnecessaryParentheses\AbstractRemoveUnnecessaryParenthesesDiagnosticAnalyzer.cs (2)
108parenthesizedExpression.GetLocation()); 129var parenthesizedExpressionLocation = parenthesizedExpression.GetLocation();
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryAttributeSuppressionsDiagnosticAnalyzer.cs (2)
83reportDiagnostic(Diagnostic.Create(s_invalidScopeDescriptor, attributeSyntax.GetLocation())); 90reportDiagnostic(Diagnostic.Create(s_invalidOrMissingTargetDescriptor, attributeSyntax.GetLocation()));
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (1)
216value.Syntax.GetLocation(),
src\Analyzers\Core\Analyzers\SimplifyBooleanExpression\AbstractSimplifyConditionalDiagnosticAnalyzer.cs (1)
142conditionalExpression.GetLocation(),
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationDiagnosticAnalyzer.cs (1)
71additionalLocations: [interpolation.Syntax.GetLocation()],
src\Analyzers\Core\Analyzers\SimplifyLinqExpression\AbstractSimplifyLinqExpressionDiagnosticAnalyzer.cs (1)
174context.ReportDiagnostic(Diagnostic.Create(Descriptor, nextInvocation.Syntax.GetLocation()));
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (4)
650propertyDeclaration.GetLocation(), 651variableDeclarator.GetLocation()); 663fieldNode.GetLocation(), 672Descriptor, propertyDeclaration.GetLocation(),
src\Analyzers\Core\Analyzers\UseCoalesceExpression\AbstractUseCoalesceExpressionForNullableTernaryConditionalCheckDiagnosticAnalyzer.cs (4)
120conditionalExpression.GetLocation(), 121conditionExpression.GetLocation(), 122whenPartToKeep.GetLocation()); 126conditionalExpression.GetLocation(),
src\Analyzers\Core\Analyzers\UseCoalesceExpression\AbstractUseCoalesceExpressionForTernaryConditionalCheckDiagnosticAnalyzer.cs (3)
124conditionalExpression.GetLocation(), 126whenPartToCheck.GetLocation()); 130conditionalExpression.GetLocation(),
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerDiagnosticAnalyzer.cs (1)
182var locations = ImmutableArray.Create(objectCreationExpression.GetLocation());
src\Analyzers\Core\Analyzers\UseCompoundAssignment\AbstractUseCompoundAssignmentDiagnosticAnalyzer.cs (3)
163additionalLocations: ImmutableArray.Create(assignment.GetLocation()), 183additionalLocations: ImmutableArray.Create(assignment.GetLocation()), 196additionalLocations: ImmutableArray.Create(assignment.GetLocation()),
src\Analyzers\Core\Analyzers\UseConditionalExpression\AbstractUseConditionalExpressionDiagnosticAnalyzer.cs (1)
60additionalLocations: ImmutableArray.Create(ifStatement.GetLocation()),
src\Analyzers\Core\Analyzers\UseExplicitTupleName\UseExplicitTupleNameDiagnosticAnalyzer.cs (1)
65nameNode.GetLocation(),
src\Analyzers\Core\Analyzers\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsDiagnosticAnalyzer.cs (1)
132var additionalLocations = ImmutableArray.Create(invocation.GetLocation());
src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer.cs (4)
191conditionalExpression.GetLocation(), 192conditionPartToCheck.GetLocation(), 193whenPartToCheck.GetLocation()); 205conditionalExpression.GetLocation(),
src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer_IfStatement.cs (3)
100ifStatement.GetLocation(), 101trueStatement.GetLocation(), 102whenPartMatch.GetLocation()),
src\Analyzers\Core\Analyzers\UseObjectInitializer\AbstractUseObjectInitializerDiagnosticAnalyzer.cs (1)
123var locations = ImmutableArray.Create(objectCreationExpression.GetLocation());
src\Analyzers\Core\Analyzers\UseSystemHashCode\UseSystemHashCodeDiagnosticAnalyzer.cs (2)
77var operationLocation = operation.Syntax.GetLocation(); 78var declarationLocation = context.OwningSymbol.DeclaringSyntaxReferences[0].GetSyntax(cancellationToken).GetLocation();
src\Analyzers\Core\Analyzers\UseThrowExpression\AbstractUseThrowExpressionDiagnosticAnalyzer.cs (5)
130ifOperation.Syntax.GetLocation(), 131throwOperation.Exception.Syntax.GetLocation(), 132assignmentExpression.Value.Syntax.GetLocation(), 133expressionStatement.Syntax.GetLocation()); 136DiagnosticHelper.Create(Descriptor, throwStatementSyntax.GetLocation(), option.Notification, context.Options, additionalLocations: allLocations, properties: null));
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateConversionService.State.cs (1)
76location = node.GetLocation();
ValueTracking\ValueTracker.cs (1)
68await progressCollector.TryReportAsync(document.Project.Solution, node.GetLocation(), symbol, cancellationToken).ConfigureAwait(false);
ValueTracking\ValueTracker.OperationCollector.cs (1)
176operation.Syntax.GetLocation(),
Microsoft.CodeAnalysis.Features.Test.Utilities (1)
EditAndContinue\EditAndContinueTestVerifier.cs (1)
514.OrderBy(partners => partners.Key.GetLocation().SourceSpan.Start)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (2)
Diagnostics\PullDiagnosticTests.cs (2)
137context.ReportDiagnostic(Diagnostic.Create(_descriptor, context.Tree.GetRoot(context.CancellationToken).GetLocation()))); 151context.ReportDiagnostic(Diagnostic.Create(_descriptor, context.Node.GetLocation())),
Microsoft.CodeAnalysis.Test.Utilities (89)
Diagnostics\BoxingOperationAnalyzer.cs (1)
79context.ReportDiagnostic(Diagnostic.Create(BoxingDescriptor, boxingExpression.GetLocation()));
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\EmptyArrayAnalyzer.cs (1)
56context.ReportDiagnostic(Diagnostic.Create(UseArrayEmptyDescriptor, arrayCreationExpression.GetLocation()));
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()));
Diagnostics\SuppressMessageAttributeTests.DiagnosticAnalyzers.cs (2)
160context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(s_rule, context.Node.GetLocation(), messageArgs: context.Node.ToFullString())); 179context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(s_rule, context.Node.GetLocation(), messageArgs: context.Node.ToFullString()));
Microsoft.CodeAnalysis.VisualBasic (46)
Analysis\FlowAnalysis\ControlFlowPass.vb (1)
141Me.diagnostics.Add(ERRID.ERR_BadYieldInTryHandler, branch.Branch.Syntax.GetLocation)
Analysis\FlowAnalysis\DataFlowPass.vb (2)
1213Me.diagnostics.Add(warning, node.GetLocation(), If(sym.Name, "dummy")) 1310Me.diagnostics.Add(warning, node.GetLocation(), localName)
Analysis\ForLoopVerification.vb (2)
81controlVariable.Syntax.GetLocation(), 115nextVariable.Syntax.GetLocation(),
Binding\Binder.vb (1)
993diagnostics.Add(info, node.GetLocation())
Binding\Binder_Delegates.vb (1)
1159Dim addressOfLocation As Location = syntaxNode.GetLocation()
Binding\Binder_Invocation.vb (5)
1304Return result.GetLocation() 1307Return node.GetLocation() 1313Return node.GetLocation() 1322Return result.GetLocation() 1336Return result.GetLocation()
Binding\Binder_Lambda.vb (2)
810parameterDescriptors(i) = New AnonymousTypeField(returnParamName, returnType, source.Syntax.GetLocation(), False) 812Dim typeDescriptor As New AnonymousTypeDescriptor(parameterDescriptors.AsImmutableOrNull(), source.Syntax.GetLocation(), True)
Binding\Binder_Statements.vb (1)
4318diagnostics.Add(New VBDiagnostic(result.Diagnostic, syntax.GetLocation()))
Compilation\DocumentationComments\DocumentationCommentWalker.vb (1)
251Me._diagnostics.Add(ERRID.WRN_XMLDocCrefAttributeNotFound1, node.GetLocation(), strValue.Trim())
Emit\NoPia\EmbeddedEvent.vb (1)
98diagnostics.Add(If(syntaxNodeOpt Is Nothing, NoLocation.Singleton, syntaxNodeOpt.GetLocation()), useSiteInfo.Diagnostics)
Emit\NoPia\EmbeddedTypesManager.vb (1)
291diagnostics.Add(New VBDiagnostic(info, If(syntaxNodeOpt Is Nothing, NoLocation.Singleton, syntaxNodeOpt.GetLocation())))
Emit\PEModuleBuilder.vb (1)
604Binder.ReportDiagnostic(diagnostics, If(syntaxNodeOpt IsNot Nothing, syntaxNodeOpt.GetLocation(), NoLocation.Singleton), info.DiagnosticInfo)
Emit\SymbolTranslator.vb (2)
146If(syntaxNodeOpt Is Nothing, NoLocation.Singleton, syntaxNodeOpt.GetLocation()))) 226Dim location = If(syntaxNodeOpt Is Nothing, NoLocation.Singleton, syntaxNodeOpt.GetLocation())
Errors\DiagnosticBagExtensions.vb (1)
72Return Not useSiteDiagnostics.IsNullOrEmpty AndAlso diagnostics.Add(node.Syntax.GetLocation, useSiteDiagnostics)
Lowering\AsyncRewriter\AsyncRewriter.vb (2)
568Me.F.Syntax.GetLocation()) 626Me.F.Syntax.GetLocation())
Lowering\Diagnostics\DiagnosticsPass_ExpressionLambdas.vb (1)
405Me._diagnostics.Add(New VBDiagnostic(ErrorFactory.ErrorInfo(code), node.Syntax.GetLocation()))
Lowering\ExpressionLambdaRewriter\ExpressionLambdaRewriter.vb (1)
181Me.Diagnostics.Add(New VBDiagnostic(ErrorFactory.ErrorInfo(code, args), node.Syntax.GetLocation()))
Lowering\Instrumentation\CodeCoverageInstrumenter.vb (3)
94Return syntax.GetLocation().GetMappedLineSpan().IsValid 436Return GetSourceDocument(debugDocumentProvider, syntax, syntax.GetLocation().GetMappedLineSpan()) 454Return AddAnalysisPoint(syntaxForSpan, syntaxForSpan.GetLocation().GetMappedLineSpan(), statementFactory)
Lowering\LambdaRewriter\LambdaRewriter.Analysis.vb (2)
459_diagnostics.Add(ERRID.ERR_CannotLiftRestrictedTypeQuery, syntax.GetLocation(), type) 461_diagnostics.Add(ERRID.ERR_CannotLiftRestrictedTypeLambda, syntax.GetLocation(), type)
Lowering\LambdaRewriter\LambdaRewriter.vb (3)
452diagnostics.Add(useSiteError, syntaxNode.GetLocation()) 1393Me.Diagnostics.Add(ERRID.ERR_CannotGotoNonScopeBlocksWithClosure, node.Syntax.GetLocation(), 1396Me.Diagnostics.Add(ERRID.ERR_CannotGotoNonScopeBlocksWithClosure, node.Syntax.GetLocation(), "Goto ", label.Name, label.Name)
Lowering\LambdaRewriter\SynthesizedLambdaMethod.vb (1)
63Me._locations = ImmutableArray.Create(lambdaNode.Syntax.GetLocation())
Lowering\LocalRewriter\LocalRewriter.vb (2)
655diagnostics.Add(New VBDiagnostic(diagnostic, node.Syntax.GetLocation())) 659Return diagnostics.Add(useSiteInfo, node.Syntax.GetLocation())
Lowering\LocalRewriter\LocalRewriter_LateAddressOf.vb (1)
45Dim addressOfLocation As Location = syntaxNode.GetLocation()
Lowering\LocalRewriter\LocalRewriter_LateBindingHelpers.vb (2)
973Binder.ReportUseSite(_diagnostics, syntax.GetLocation(), useSiteInfo) 998Binder.ReportUseSite(_diagnostics, syntax.GetLocation(), useSiteInfo)
Lowering\LocalRewriter\LocalRewriter_RaiseEvent.vb (1)
162_diagnostics.Add(info, syntax.GetLocation())
Lowering\MethodToClassRewriter\MethodToClassRewriter.MyBaseMyClassWrapper.vb (1)
174Me._locations = ImmutableArray.Create(Of Location)(syntax.GetLocation())
Lowering\StateMachineRewriter\SynthesizedStateMachineMethod.vb (1)
40Me._locations = ImmutableArray.Create(syntax.GetLocation())
Symbols\Source\LambdaSymbol.vb (1)
260Return ImmutableArray.Create(_syntaxNode.GetLocation())
Symbols\SynthesizedSymbols\SynthesizedLocal.vb (1)
36Return If(_syntaxOpt Is Nothing, ImmutableArray(Of Location).Empty, ImmutableArray.Create(_syntaxOpt.GetLocation()))
Symbols\Tuples\TupleTypeSymbol.vb (1)
652diagnostics.Add(useSiteInfo, syntax.GetLocation())
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (3)
src\Analyzers\VisualBasic\Analyzers\NewLines\ConsecutiveStatementPlacement\VisualBasicConsecutiveStatementPlacementDiagnosticAnalyzer.vb (1)
44Return block.GetLocation()
src\Analyzers\VisualBasic\Analyzers\QualifyMemberAccess\VisualBasicQualifyMemberAccessDiagnosticAnalyzer.vb (1)
46Return operation.Syntax.GetLocation()
src\Analyzers\VisualBasic\Analyzers\RemoveUnusedParametersAndValues\VisualBasicRemoveUnusedParametersAndValuesDiagnosticAnalyzer.vb (1)
75Return unusedDefinition.Syntax.GetLocation()
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (3)
CommandLineTests.vb (3)
10991context.ReportDiagnostic(Diagnostic.Create(Hidden01, context.Node.GetLocation())) 11016context.ReportDiagnostic(Diagnostic.Create(Info01, context.Node.GetLocation())) 11090context.ReportDiagnostic(Diagnostic.Create(Error01, context.Node.GetLocation()))
Microsoft.CodeAnalysis.VisualBasic.ExpressionCompiler (1)
Rewriters\CapturedVariableRewriter.vb (1)
158_diagnostics.Add(New VBDiagnostic(ErrorFactory.ErrorInfo(ERRID.ERR_UseOfKeywordNotInInstanceMethod1, syntax.ToString()), syntax.GetLocation()))
Microsoft.CodeAnalysis.VisualBasic.Features (3)
src\Analyzers\VisualBasic\Analyzers\NewLines\ConsecutiveStatementPlacement\VisualBasicConsecutiveStatementPlacementDiagnosticAnalyzer.vb (1)
44Return block.GetLocation()
src\Analyzers\VisualBasic\Analyzers\QualifyMemberAccess\VisualBasicQualifyMemberAccessDiagnosticAnalyzer.vb (1)
46Return operation.Syntax.GetLocation()
src\Analyzers\VisualBasic\Analyzers\RemoveUnusedParametersAndValues\VisualBasicRemoveUnusedParametersAndValuesDiagnosticAnalyzer.vb (1)
75Return unusedDefinition.Syntax.GetLocation()
Microsoft.CodeAnalysis.VisualBasic.Features.UnitTests (1)
Diagnostics\Configuration\ConfigureSeverity\DotNetDiagnosticSeverityBasedSeverityConfigurationTests.vb (1)
35Sub(c) c.ReportDiagnostic(Diagnostic.Create(Rule, c.Node.GetLocation())),
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (4)
Diagnostics\DiagnosticAnalyzerTests.vb (2)
279context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(desc1, context.Node.GetLocation)) 962nodeContext.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(ExpressionDescriptor, nodeContext.Node.GetLocation()))
Diagnostics\GetDiagnosticsTests.vb (2)
632context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(DescriptorForBlockEnd, context.CodeBlock.GetLocation())) 646context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(DescriptorForBlockEnd, operationBlock.Syntax.GetLocation()))
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (4)
SymbolsTests\AnonymousTypes\AnonymousTypesSemanticsTests.vb (4)
323tree.GetRoot().FindToken(sub2).Parent.Parent.GetLocation, 333tree.GetRoot().FindToken(sub4).Parent.Parent.GetLocation, 390tree.GetRoot().FindToken(sub1).Parent.Parent.GetLocation, 401tree.GetRoot().FindToken(sub2).Parent.Parent.GetLocation,
Microsoft.CodeAnalysis.Workspaces (3)
Editing\SymbolEditorExtensions.cs (1)
73typeRef.GetLocation(),
FindSymbols\FindReferences\Finders\FinderLocation.cs (1)
21/// cref="SyntaxNode.GetLocation"/>. Instead, this location is where we want to navigate
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (1)
34result.Add(syntaxRef.GetSyntax(cancellationToken).GetLocation());
Microsoft.DotNet.CodeAnalysis (1)
Analyzers\PinvokeAnalyzer.cs (1)
163context.ReportDiagnostic(Diagnostic.Create(InvalidPinvokeCall, synref.GetSyntax().GetLocation(), data.ModuleName + "!" + (data.EntryPointName ?? methodSymbol.Name), altMsg));
Microsoft.Extensions.Options.SourceGeneration (1)
Parser.cs (1)
353var attrLoc = attribute.ApplicationSyntaxReference?.GetSyntax().GetLocation();
Microsoft.Gen.Logging (4)
Parsing\Parser.LogProperties.cs (2)
255Diag(DiagDescriptors.InvalidAttributeUsage, logPropertiesAttribute.ApplicationSyntaxReference?.GetSyntax(_cancellationToken).GetLocation(), "LogProperties"); 295Diag(DiagDescriptors.InvalidAttributeUsage, tagProviderAttribute.ApplicationSyntaxReference?.GetSyntax(_cancellationToken).GetLocation(), "TagProvider");
Parsing\Parser.TagProvider.cs (2)
35tagProviderAttribute.ApplicationSyntaxReference!.GetSyntax(_cancellationToken).GetLocation()); 63tagProviderAttribute.ApplicationSyntaxReference!.GetSyntax(_cancellationToken).GetLocation());
Microsoft.Interop.ComInterfaceGenerator (6)
Analyzers\RuntimeComApiUsageWithSourceGeneratedComAnalyzer.cs (5)
163operation.Syntax.GetLocation())); 183operation.Syntax.GetLocation())); 193operation.Syntax.GetLocation())); 202IConversionOperation conversion => (conversion.Operand.Type, conversion.Operand.Syntax.GetLocation()), 203IOperation op => (op.Type, op.Syntax.GetLocation())
ComMethodInfo.cs (1)
127if (declaringSyntax.GetLocation().SourceSpan.Contains(methodLocationInAttributedInterfaceDeclaration.SourceSpan))
Microsoft.Interop.LibraryImportGenerator (5)
Analyzers\CustomMarshallerAttributeAnalyzer.cs (3)
652DiagnosticReporter managedTypeReporter = DiagnosticReporter.CreateForLocation(managedTypeArgument.Value.Syntax.GetLocation(), context.ReportDiagnostic); 673DiagnosticReporter marshallerTypeReporter = DiagnosticReporter.CreateForLocation(marshallerTypeArgument.Value.Syntax.GetLocation(), context.ReportDiagnostic); 692DiagnosticReporter marshalModeReporter = DiagnosticReporter.CreateForLocation(marshalModeArgument.Syntax.GetLocation(), context.ReportDiagnostic);
Analyzers\CustomMarshallerAttributeFixer.cs (1)
161var managedTypeSymbolInAttribute = GetManagedTypeInAttributeSyntax(node.GetLocation(), entryPointTypeSymbol);
Analyzers\NativeMarshallingAttributeAnalyzer.cs (1)
93DiagnosticReporter diagnosticFactory = DiagnosticReporter.CreateForLocation(marshallerEntryPointTypeArgument.Value.Syntax.GetLocation(), context.ReportDiagnostic);
Microsoft.Maui.Controls.BindingSourceGen (1)
PathParser.cs (1)
173 return Result<List<IPathPart>>.Failure(DiagnosticsFactory.UnableToResolvePath(_context.Node.GetLocation()));
Microsoft.ML.InternalCodeAnalyzer (3)
BestFriendAnalyzer.cs (1)
110var diagnostic = Diagnostic.Create(Rule, node.GetLocation(), symbol.Name);
BestFriendOnPublicDeclarationsAnalyzer.cs (1)
66var diagnostic = Diagnostic.Create(Rule, attribute.ApplicationSyntaxReference.GetSyntax().GetLocation(), context.Symbol.Name);
SingleVariableDeclarationAnalyzer.cs (1)
47var diagnostic = Diagnostic.Create(Rule, context.Node.GetLocation(), jointVariableNames);
System.Private.CoreLib.Generators (4)
IntrinsicsInSystemPrivateCoreLibAnalyzer.cs (4)
546context.ReportDiagnostic(Diagnostic.Create(RuleAttributeNotSpecificEnough, operation.Syntax.GetLocation(), attributeExplicitlyAllowsRelatedSymbol.ToDisplayString())); 613context.ReportDiagnostic(Diagnostic.Create(RuleCantParse, operation.Syntax.GetLocation())); 686context.ReportDiagnostic(Diagnostic.Create(Rule, operation.Syntax.GetLocation(), symbol.ContainingSymbol.ToDisplayString())); 688context.ReportDiagnostic(Diagnostic.Create(RuleHelper, operation.Syntax.GetLocation(), symbol.ToDisplayString()));
System.Text.RegularExpressions.Generator (3)
RegexGenerator.Parser.cs (1)
254var location = syntax.GetLocation();
UpgradeToGeneratedRegexAnalyzer.cs (2)
113context.ReportDiagnostic(Diagnostic.Create(DiagnosticDescriptors.UseRegexSourceGeneration, syntaxNodeForDiagnostic.GetLocation())); 145context.ReportDiagnostic(Diagnostic.Create(DiagnosticDescriptors.UseRegexSourceGeneration, syntaxNodeForDiagnostic.GetLocation()));