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