191 references to GetLocation
Microsoft.CodeAnalysis.CSharp (45)
Binder\Binder_AnonymousTypes.cs (1)
59diagnostics.Add(ErrorCode.ERR_InvalidAnonymousTypeMemberDeclarator, expression.GetLocation());
Binder\Binder_Attributes.cs (2)
60var location = attributeToBind.Name.GetLocation(); 462diagnostics.Add(ErrorCode.ERR_NamedArgumentExpected, argument.Expression.GetLocation());
Binder\Binder_Constraints.cs (4)
220diagnostics.Add(ErrorCode.ERR_DefaultConstraintOverrideOnly, syntax.GetLocation()); 312diagnostics.Add(ErrorCode.ERR_OverrideWithConstraints, syntax.GetLocation()); 319diagnostics.Add(ErrorCode.ERR_TypeConstraintsMustBeUniqueAndFirst, syntax.GetLocation()); 579Error(diagnostics, ErrorCode.ERR_BadConstraintType, syntax.GetLocation());
Binder\Binder_Expressions.cs (2)
4204errorLocation = initializerArgumentListOpt.GetLocation(); 4677diagnostics.Add(ErrorCode.ERR_NewWithTupleTypeSyntax, node.Type.GetLocation());
Binder\Binder_Invocation.cs (2)
1500return ((QualifiedNameSyntax)expression).Right.GetLocation(); 1504return ((MemberAccessExpressionSyntax)expression).Name.GetLocation();
Binder\Binder_Lambda.cs (1)
330parameter.Type?.GetLocation() ?? parameter.Identifier.GetLocation());
Binder\Binder_Statements.cs (3)
324diagnostics.Add(ErrorCode.ERR_BadEmbeddedStmt, node.GetLocation()); 342diagnostics.Add(ErrorCode.ERR_BadEmbeddedStmt, node.GetLocation()); 377diagnostics.Add(ErrorCode.WRN_PossibleMistakenNullStatement, node.GetLocation());
Binder\Binder_Symbols.cs (4)
548diagnostics.Add(new LazyUseSiteDiagnosticsInfoForNullableType(Compilation.LanguageVersion, constructedType), syntax.GetLocation()); 604diagnostics.Add(ErrorCode.ERR_TypeExpected, syntax.GetLocation()); 652diagnostics.Add(new LazyArrayElementCantBeRefAnyDiagnosticInfo(type), node.ElementType.GetLocation()); 720ReportMissingTupleElementNamesAttributesIfNeeded(Compilation, syntax.GetLocation(), diagnostics);
Binder\ExpressionVariableFinder.cs (1)
652designation.Identifier.ValueText, designation, designation.GetLocation(),
Declarations\DeclarationTreeBuilder.cs (8)
451diagnostics.Add(ErrorCode.ERR_MultipleFileScopedNamespace, node.Name.GetLocation()); 460diagnostics.Add(ErrorCode.ERR_FileScopedAndNormalNamespace, node.Name.GetLocation()); 478diagnostics.Add(ErrorCode.ERR_FileScopedNamespaceNotBeforeAllMembers, node.Name.GetLocation()); 490diagnostics.Add(ErrorCode.ERR_FileScopedAndNormalNamespace, node.Name.GetLocation()); 497diagnostics.Add(ErrorCode.ERR_UnexpectedGenericName, node.Name.GetLocation()); 502diagnostics.Add(ErrorCode.ERR_UnexpectedAliasedName, node.Name.GetLocation()); 507diagnostics.Add(ErrorCode.ERR_BadModifiersOnNamespace, node.AttributeLists[0].GetLocation()); 643diagnostics.Add(ErrorCode.ERR_UnexpectedParameterList, node.ParameterList.GetLocation());
FlowAnalysis\NullableWalker.cs (1)
10158ForEachVariableStatementSyntax variableStatement => variableStatement.Variable.GetLocation(),
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (4)
119diagnostics.Add(ErrorCode.ERR_CannotSpecifyManagedWithUnmanagedSpecifiers, callingConventionSyntax.UnmanagedCallingConventionList.GetLocation()); 191checkUnmanagedSupport(compilation, specifier.GetLocation(), diagnostics); 221diagnostics.Add(ErrorCode.ERR_TypeMustBePublic, specifier.GetLocation(), specifierType); 224diagnostics.Add(specifierType.GetUseSiteInfo(), specifier.GetLocation());
Symbols\Source\ParameterHelpers.cs (3)
166diagnostics.Add(ErrorCode.ERR_VarargsLast, concreteParam.GetLocation()); 650syntax.Type?.Location ?? syntax.GetLocation(), 669diagnostics.Add(ErrorCode.ERR_ParamsLast, syntax.GetLocation());
Symbols\Source\SourceDelegateMethodSymbol.cs (1)
328var location = syntax.ReturnType.GetLocation();
Symbols\Source\SourceNamedTypeSymbol.cs (2)
66backupLocation = inheritedTypeDecls[0].Type.GetLocation(); 76return t.GetLocation();
Symbols\Source\SourceNamedTypeSymbol_Bases.cs (1)
461diagnostics.Add(ErrorCode.ERR_BadBaseType, typeSyntax.GetLocation());
Symbols\Source\SourcePropertyAccessorSymbol.cs (1)
78syntax.Expression.GetLocation(),
Symbols\Source\SourceUserDefinedConversionSymbol.cs (1)
81diagnostics.Add(ErrorCode.ERR_OvlUnaryOperatorExpected, syntax.ParameterList.GetLocation());
Symbols\Symbol.cs (1)
1362diagnostics.Add(ErrorCode.ERR_BlockBodyAndExpressionBody, syntax.GetLocation());
Symbols\Symbol_Attributes.cs (1)
677diagnostics.Add(ErrorCode.WRN_NonECMAFeature, targetOpt.GetLocation(), MessageID.IDS_FeatureModuleAttrLoc);
Syntax\SyntaxNodeExtensions.cs (1)
340diagnostics.Add(ErrorCode.ERR_VarInvocationLvalueReserved, expression.GetLocation());
Microsoft.CodeAnalysis.CSharp.CodeStyle (63)
ConstructorInitializerPlacementDiagnosticAnalyzer.cs (1)
91additionalLocations: ImmutableArray.Create(initializer.GetLocation()),
ConvertProgramAnalysis_TopLevelStatements.cs (1)
34return isHidden ? methodDeclaration.GetLocation() : methodDeclaration.Identifier.GetLocation();
ConvertSwitchStatementToExpressionDiagnosticAnalyzer.cs (1)
67additionalLocations.AddOptional(declaratorToRemoveOpt?.GetLocation());
ConvertToBlockScopedNamespaceDiagnosticAnalyzer.cs (2)
50? declaration.Name.GetLocation() 57ImmutableArray.Create(declaration.GetLocation()),
ConvertToFileScopedNamespaceDiagnosticAnalyzer.cs (2)
54? declaration.Name.GetLocation() 61ImmutableArray.Create(declaration.GetLocation()),
ConvertToTopLevelStatementsDiagnosticAnalyzer.cs (1)
78ImmutableArray.Create(methodDeclaration.GetLocation()),
CSharpAddAccessibilityModifiersDiagnosticAnalyzer.cs (1)
71var additionalLocations = ImmutableArray.Create(member.GetLocation());
CSharpAsAndMemberAccessDiagnosticAnalyzer.cs (1)
84asExpression.GetLocation(),
CSharpAsAndNullCheckDiagnosticAnalyzer.cs (3)
254declarator.GetLocation(), 255comparison.GetLocation(), 256asExpression.GetLocation());
CSharpInlineDeclarationDiagnosticAnalyzer.cs (2)
225localDeclarator.GetLocation(), 226identifierName.GetLocation(),
CSharpIsAndCastCheckDiagnosticAnalyzer.cs (3)
139ifStatement.GetLocation(), 140localDeclarationStatement.GetLocation()); 145localDeclarationStatement.GetLocation(),
CSharpMakeStructReadOnlyDiagnosticAnalyzer.cs (1)
65additionalLocations: ImmutableArray.Create(typeDeclaration.GetLocation()),
CSharpRemoveRedundantNullableDirectiveDiagnosticAnalyzer.cs (1)
61context.ReportDiagnostic(Diagnostic.Create(Descriptor, directive.GetLocation()));
CSharpRemoveUnnecessaryDiscardDesignationDiagnosticAnalyzer.cs (1)
96discard.GetLocation()));
CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
212additionalLocations: ImmutableArray.Create(anonymousFunction.GetLocation()),
CSharpRemoveUnnecessaryNullableDirectiveDiagnosticAnalyzer.cs (2)
130diagnostics.Add(Diagnostic.Create(Descriptor, currentOptionsDirective.GetLocation())); 162diagnostics.Add(Diagnostic.Create(Descriptor, currentOptionsDirective.GetLocation()));
CSharpRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (1)
94return declarationPattern.Designation.GetLocation();
CSharpSimplifyPropertyPatternDiagnosticAnalyzer.cs (2)
68expressionColon.GetLocation(), 70ImmutableArray.Create(subpattern.GetLocation()),
CSharpSyntaxFacts.cs (2)
220AssignmentExpressionSyntax assignment => assignment.Left.GetLocation(), 221ForEachVariableStatementSyntax @foreach => @foreach.Variable.GetLocation(),
CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (2)
99additionalLocations: ImmutableArray.Create(coalesceExpression.GetLocation()), 180additionalLocations: ImmutableArray.Create(ifStatement.GetLocation()),
CSharpUseDefaultLiteralDiagnosticAnalyzer.cs (1)
51defaultExpression.GetLocation(),
CSharpUseImplicitObjectCreationDiagnosticAnalyzer.cs (2)
132objectCreation.Type.GetLocation(), 134ImmutableArray.Create(objectCreation.GetLocation()),
CSharpUseIndexOperatorDiagnosticAnalyzer.cs (1)
208binaryExpression.GetLocation(),
CSharpUseInferredMemberNameDiagnosticAnalyzer.cs (2)
58nameColon.GetLocation(), 83nameEquals.GetLocation(),
CSharpUseIsNullCheckForCastAndEqualityOperatorDiagnosticAnalyzer.cs (1)
67Descriptor, binaryExpression.GetLocation(), severity, additionalLocations: null, properties));
CSharpUseLocalFunctionDiagnosticAnalyzer.cs (7)
126localDeclaration.GetLocation(), 127anonymousFunction.GetLocation()); 147localDeclaration.GetLocation(), 157anonymousFunctionStatement.GetLocation(), 241references.Add(invocationExpression.GetLocation()); 248references.Add(explicitInvocationExpression.GetLocation()); 259references.Add(nodeToCheck.GetLocation());
CSharpUseNameofInNullableAttributeDiagnosticAnalyzer.cs (1)
105argument.Expression.GetLocation(),
CSharpUsePatternCombinatorsDiagnosticAnalyzer.cs (1)
101expression.GetLocation(),
CSharpUseRangeOperatorDiagnosticAnalyzer.cs (1)
253invocation.GetLocation());
CSharpUseTupleSwapDiagnosticAnalyzer.cs (3)
116localDeclarationStatement.GetLocation(), 117firstAssignmentStatement.GetLocation(), 118secondAssignmentStatement.GetLocation());
EmbeddedStatementPlacementDiagnosticAnalyzer.cs (1)
72var additionalLocations = ImmutableArray.Create(statement.GetLocation());
InvokeDelegateWithConditionalAccessAnalyzer.cs (1)
195expressionStatement.GetLocation(),
MakeLocalFunctionStaticDiagnosticAnalyzer.cs (1)
57additionalLocations: ImmutableArray.Create(localFunction.GetLocation()),
MisplacedUsingDirectivesDiagnosticAnalyzer.cs (1)
101usingDirective.GetLocation(),
UseExpressionBodyDiagnosticAnalyzer.cs (1)
112: expressionBody.GetLocation();
UseExpressionBodyForIndexersHelper.cs (2)
82return body.Statements[0].GetLocation(); 86return getAccessor.ExpressionBody.GetLocation();
UseExpressionBodyForLambdaDiagnosticAnalyzer.cs (2)
75var additionalLocations = ImmutableArray.Create(declaration.GetLocation()); 89var additionalLocations = ImmutableArray.Create(declaration.GetLocation());
UseExpressionBodyForPropertiesHelper.cs (1)
86return getAccessor.ExpressionBody.GetLocation();
UseExpressionBodyHelper`1.cs (1)
85return body.Statements[0].GetLocation();
UseSimpleUsingStatementDiagnosticAnalyzer.cs (1)
124additionalLocations: ImmutableArray.Create(outermostUsing.GetLocation()),
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
EventHookup\EventHookupCommandHandler_TabKeyCommand.cs (1)
248var codeGenOptions = codeGenerator.GetInfo(new CodeGenerationContext(afterThisLocation: eventHookupExpression.GetLocation()), options, root.SyntaxTree.Options);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (4)
Diagnostics\FixAllProvider\BatchFixerTests.cs (1)
54var diagnostic = Diagnostic.Create(Descriptor, node.GetLocation());
Diagnostics\Suppression\SuppressionTests.cs (3)
935context.ReportDiagnostic(Diagnostic.Create(Decsciptor, classDecl.GetLocation())); 1084context.ReportDiagnostic(Diagnostic.Create(Descriptor, ns.Name.GetLocation())); 2078context.ReportDiagnostic(Diagnostic.Create(_descriptor, ns.Name.GetLocation()));
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (2)
CodeGen\CodeGenTupleTest.cs (2)
17382Assert.Equal(nc.Name.GetLocation(), sym.Symbol.Locations[0]); 17417Assert.Equal(secondElement.GetLocation(), bobField.Locations[0]);
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (2)
Diagnostics\DiagnosticAnalyzerTests.cs (2)
667var diagnostic = CodeAnalysis.Diagnostic.Create(Rule, fieldDeclaration.GetLocation()); 3995var diagnostic = CodeAnalysis.Diagnostic.Create(Rule, recordDeclaration.GetLocation());
Microsoft.CodeAnalysis.CSharp.Features (66)
Completion\CompletionProviders\CompletionUtilities.cs (2)
179return methodDeclaration.GetLocation().SourceSpan.End; 185return lastStatement.GetLocation().SourceSpan.End;
Completion\CompletionProviders\OverrideCompletionProvider.cs (1)
236return propertyDeclaration.GetLocation().SourceSpan.End;
ConstructorInitializerPlacementDiagnosticAnalyzer.cs (1)
91additionalLocations: ImmutableArray.Create(initializer.GetLocation()),
ConvertProgramAnalysis_TopLevelStatements.cs (1)
34return isHidden ? methodDeclaration.GetLocation() : methodDeclaration.Identifier.GetLocation();
ConvertSwitchStatementToExpressionDiagnosticAnalyzer.cs (1)
67additionalLocations.AddOptional(declaratorToRemoveOpt?.GetLocation());
ConvertToBlockScopedNamespaceDiagnosticAnalyzer.cs (2)
50? declaration.Name.GetLocation() 57ImmutableArray.Create(declaration.GetLocation()),
ConvertToFileScopedNamespaceDiagnosticAnalyzer.cs (2)
54? declaration.Name.GetLocation() 61ImmutableArray.Create(declaration.GetLocation()),
ConvertToTopLevelStatementsDiagnosticAnalyzer.cs (1)
78ImmutableArray.Create(methodDeclaration.GetLocation()),
CSharpAddAccessibilityModifiersDiagnosticAnalyzer.cs (1)
71var additionalLocations = ImmutableArray.Create(member.GetLocation());
CSharpAsAndMemberAccessDiagnosticAnalyzer.cs (1)
84asExpression.GetLocation(),
CSharpAsAndNullCheckDiagnosticAnalyzer.cs (3)
254declarator.GetLocation(), 255comparison.GetLocation(), 256asExpression.GetLocation());
CSharpInlineDeclarationDiagnosticAnalyzer.cs (2)
225localDeclarator.GetLocation(), 226identifierName.GetLocation(),
CSharpIsAndCastCheckDiagnosticAnalyzer.cs (3)
139ifStatement.GetLocation(), 140localDeclarationStatement.GetLocation()); 145localDeclarationStatement.GetLocation(),
CSharpMakeStructReadOnlyDiagnosticAnalyzer.cs (1)
65additionalLocations: ImmutableArray.Create(typeDeclaration.GetLocation()),
CSharpRemoveRedundantNullableDirectiveDiagnosticAnalyzer.cs (1)
61context.ReportDiagnostic(Diagnostic.Create(Descriptor, directive.GetLocation()));
CSharpRemoveUnnecessaryDiscardDesignationDiagnosticAnalyzer.cs (1)
96discard.GetLocation()));
CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
212additionalLocations: ImmutableArray.Create(anonymousFunction.GetLocation()),
CSharpRemoveUnnecessaryNullableDirectiveDiagnosticAnalyzer.cs (2)
130diagnostics.Add(Diagnostic.Create(Descriptor, currentOptionsDirective.GetLocation())); 162diagnostics.Add(Diagnostic.Create(Descriptor, currentOptionsDirective.GetLocation()));
CSharpRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (1)
94return declarationPattern.Designation.GetLocation();
CSharpSimplifyPropertyPatternDiagnosticAnalyzer.cs (2)
68expressionColon.GetLocation(), 70ImmutableArray.Create(subpattern.GetLocation()),
CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (2)
99additionalLocations: ImmutableArray.Create(coalesceExpression.GetLocation()), 180additionalLocations: ImmutableArray.Create(ifStatement.GetLocation()),
CSharpUseDefaultLiteralDiagnosticAnalyzer.cs (1)
51defaultExpression.GetLocation(),
CSharpUseImplicitObjectCreationDiagnosticAnalyzer.cs (2)
132objectCreation.Type.GetLocation(), 134ImmutableArray.Create(objectCreation.GetLocation()),
CSharpUseIndexOperatorDiagnosticAnalyzer.cs (1)
208binaryExpression.GetLocation(),
CSharpUseInferredMemberNameDiagnosticAnalyzer.cs (2)
58nameColon.GetLocation(), 83nameEquals.GetLocation(),
CSharpUseIsNullCheckForCastAndEqualityOperatorDiagnosticAnalyzer.cs (1)
67Descriptor, binaryExpression.GetLocation(), severity, additionalLocations: null, properties));
CSharpUseLocalFunctionDiagnosticAnalyzer.cs (7)
126localDeclaration.GetLocation(), 127anonymousFunction.GetLocation()); 147localDeclaration.GetLocation(), 157anonymousFunctionStatement.GetLocation(), 241references.Add(invocationExpression.GetLocation()); 248references.Add(explicitInvocationExpression.GetLocation()); 259references.Add(nodeToCheck.GetLocation());
CSharpUseNameofInNullableAttributeDiagnosticAnalyzer.cs (1)
105argument.Expression.GetLocation(),
CSharpUsePatternCombinatorsDiagnosticAnalyzer.cs (1)
101expression.GetLocation(),
CSharpUseRangeOperatorDiagnosticAnalyzer.cs (1)
253invocation.GetLocation());
CSharpUseTupleSwapDiagnosticAnalyzer.cs (3)
116localDeclarationStatement.GetLocation(), 117firstAssignmentStatement.GetLocation(), 118secondAssignmentStatement.GetLocation());
DocumentHighlighting\CSharpDocumentHighlightsService.cs (1)
70results.Add(type.GetLocation());
EmbeddedStatementPlacementDiagnosticAnalyzer.cs (1)
72var additionalLocations = ImmutableArray.Create(statement.GetLocation());
InvokeDelegateWithConditionalAccessAnalyzer.cs (1)
195expressionStatement.GetLocation(),
MakeLocalFunctionStaticDiagnosticAnalyzer.cs (1)
57additionalLocations: ImmutableArray.Create(localFunction.GetLocation()),
MisplacedUsingDirectivesDiagnosticAnalyzer.cs (1)
101usingDirective.GetLocation(),
UseExpressionBodyDiagnosticAnalyzer.cs (1)
112: expressionBody.GetLocation();
UseExpressionBodyForIndexersHelper.cs (2)
82return body.Statements[0].GetLocation(); 86return getAccessor.ExpressionBody.GetLocation();
UseExpressionBodyForLambdaDiagnosticAnalyzer.cs (2)
75var additionalLocations = ImmutableArray.Create(declaration.GetLocation()); 89var additionalLocations = ImmutableArray.Create(declaration.GetLocation());
UseExpressionBodyForPropertiesHelper.cs (1)
86return getAccessor.ExpressionBody.GetLocation();
UseExpressionBodyHelper`1.cs (1)
85return body.Statements[0].GetLocation();
UsePatternMatching\CSharpIsAndCastCheckWithoutNameDiagnosticAnalyzer.cs (1)
102Descriptor, isExpression.GetLocation(),
UseSimpleUsingStatementDiagnosticAnalyzer.cs (1)
124additionalLocations: ImmutableArray.Create(outermostUsing.GetLocation()),
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (2)
Symbols\Source\DeclaringSyntaxNodeTests.cs (1)
383Assert.Equal(member.Locations[0], propertyInitializer.NameEquals.Name.GetLocation());
Symbols\Source\NullablePublicAPITests.cs (1)
1177context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(s_descriptor2, declarator.GetLocation(), declaredSymbol.Name, declaredSymbol.NullableAnnotation));
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Syntax\SyntaxNodeTests.cs (1)
2043var nodeLocation = method.GetLocation();
Microsoft.CodeAnalysis.CSharp.Workspaces (4)
CSharpSyntaxFacts.cs (2)
220AssignmentExpressionSyntax assignment => assignment.Left.GetLocation(), 221ForEachVariableStatementSyntax @foreach => @foreach.Variable.GetLocation(),
Rename\CSharpRenameRewriterLanguageService.cs (2)
897conflicts.Add(reverseMappedLocations[usingDirective.Alias.Name.GetLocation()]); 1015return ImmutableArray.Create(((CommonForEachStatementSyntax)token.Parent!).Expression.GetLocation());
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (1)
Diagnostics\DiagnosticServiceTests.vb (1)
1413context.ReportDiagnostic(Diagnostic.Create(Descriptor1, fieldDecl.GetLocation, fieldDecl.ToString()))