492 references to GetLocation
Microsoft.CodeAnalysis (1)
Syntax\SyntaxNodeOrToken.cs (1)
832
return token.
GetLocation
();
Microsoft.CodeAnalysis.CodeStyle (17)
AbstractAddRequiredParenthesesDiagnosticAnalyzer.cs (1)
148
operatorToken.
GetLocation
(),
AbstractConsecutiveStatementPlacementDiagnosticAnalyzer.cs (1)
109
additionalLocations: ImmutableArray.Create(nextToken.
GetLocation
()),
AbstractForEachCastDiagnosticAnalyzer.cs (1)
131
node.GetFirstToken().
GetLocation
(),
AbstractMultipleBlankLinesDiagnosticAnalyzer.cs (1)
80
additionalLocations: ImmutableArray.Create(token.
GetLocation
()),
AbstractOrderModifiersDiagnosticAnalyzer.cs (1)
81
DiagnosticHelper.Create(Descriptor, modifiers.First().
GetLocation
(), severity, additionalLocations: null, properties: null));
AbstractPopulateSwitchStatementDiagnosticAnalyzer.cs (1)
36
=> switchBlock.GetFirstToken().
GetLocation
();
AbstractRemoveRedundantEqualityDiagnosticAnalyzer.cs (1)
81
operatorToken.
GetLocation
(),
AbstractRemoveUnnecessaryParenthesesDiagnosticAnalyzer.cs (2)
112
parenthesizedExpression.GetFirstToken().
GetLocation
(),
113
parenthesizedExpression.GetLastToken().
GetLocation
());
AbstractUseCoalesceExpressionForIfNullCheckDiagnosticAnalyzer.cs (1)
120
ifStatement.GetFirstToken().
GetLocation
(),
AbstractUseCollectionInitializerDiagnosticAnalyzer.cs (1)
125
objectCreationExpression.GetFirstToken().
GetLocation
(),
AbstractUseCompoundAssignmentDiagnosticAnalyzer.cs (3)
149
assignmentToken.
GetLocation
(),
160
assignmentToken.
GetLocation
(),
171
assignmentToken.
GetLocation
(),
AbstractUseConditionalExpressionDiagnosticAnalyzer.cs (1)
57
ifStatement.GetFirstToken().
GetLocation
(),
AbstractUseNullPropagationDiagnosticAnalyzer_IfStatement.cs (1)
96
ifStatement.GetFirstToken().
GetLocation
(),
AbstractUseObjectInitializerDiagnosticAnalyzer.cs (1)
112
objectCreationExpression.GetFirstToken().
GetLocation
(),
Microsoft.CodeAnalysis.CSharp (251)
Binder\Binder.cs (2)
546
diagnostics.Add(new CSDiagnostic(new CSDiagnosticInfo(code), token.
GetLocation
()));
551
diagnostics.Add(new CSDiagnostic(new CSDiagnosticInfo(code, args), token.
GetLocation
()));
Binder\Binder.QueryTranslationState.cs (2)
75
var result = new RangeVariableSymbol(name, binder.ContainingMemberOrLambda, identifier.
GetLocation
());
82
diagnostics.Add(ErrorCode.ERR_QueryDuplicateRangeVariable, identifier.
GetLocation
(), name);
Binder\Binder_AnonymousTypes.cs (2)
23
MessageID.IDS_FeatureAnonymousTypes.CheckFeatureAvailability(diagnostics, node, node.NewKeyword.
GetLocation
());
106
AnonymousTypeDescriptor descriptor = new AnonymousTypeDescriptor(fields.AsImmutableOrNull(), node.NewKeyword.
GetLocation
());
Binder\Binder_Await.cs (1)
21
MessageID.IDS_FeatureAsync.CheckFeatureAvailability(diagnostics, node, node.AwaitKeyword.
GetLocation
());
Binder\Binder_Constraints.cs (3)
201
diagnostics.Add(ErrorCode.ERR_NewBoundWithVal, syntax.GetFirstToken().
GetLocation
());
205
diagnostics.Add(ErrorCode.ERR_NewBoundWithUnmanaged, syntax.GetFirstToken().
GetLocation
());
210
diagnostics.Add(ErrorCode.ERR_NewBoundMustBeLast, syntax.GetFirstToken().
GetLocation
());
Binder\Binder_Deconstruct.cs (5)
824
diagnostics.Add(ErrorCode.ERR_ScopedDiscard, scopedType.ScopedKeyword.
GetLocation
());
830
diagnostics.Add(ErrorCode.ERR_DeconstructVariableCannotBeByRef, refType.RefKeyword.
GetLocation
());
888
diagnostics.Add(ErrorCode.ERR_DeconstructVariableCannotBeByRef, refType.RefKeyword.
GetLocation
());
932
diagnostics.Add(ErrorCode.ERR_UnexpectedToken, scopedType.ScopedKeyword.
GetLocation
(), scopedType.ScopedKeyword.ValueText);
938
diagnostics.Add(ErrorCode.ERR_UnexpectedToken, refType.RefKeyword.
GetLocation
(), refType.RefKeyword.ValueText);
Binder\Binder_Expressions.cs (27)
294
diagnostics.Add(ErrorCode.ERR_SwitchExpressionNoBestType, exprSyntax.SwitchKeyword.
GetLocation
());
816
diagnostics.Add(ErrorCode.ERR_UnexpectedToken, firstToken.
GetLocation
(), firstToken.ValueText);
825
diagnostics.Add(ErrorCode.ERR_UnexpectedToken, firstToken.
GetLocation
(), firstToken.ValueText);
832
diagnostics.Add(ErrorCode.ERR_UnexpectedToken, firstToken.
GetLocation
(), firstToken.ValueText);
838
MessageID.IDS_FeatureThrowExpression.CheckFeatureAvailability(diagnostics, node, node.ThrowKeyword.
GetLocation
());
843
diagnostics.Add(ErrorCode.ERR_ThrowMisplaced, node.ThrowKeyword.
GetLocation
());
1444
MessageID.IDS_FeatureDefault.CheckFeatureAvailability(diagnostics, node, node.Keyword.
GetLocation
());
2871
MessageID.IDS_FeatureReadOnlyReferences.CheckFeatureAvailability(diagnostics, argumentSyntax, argumentSyntax.RefKindKeyword.
GetLocation
());
2876
MessageID.IDS_FeatureOutVar.CheckFeatureAvailability(diagnostics, argumentSyntax, argumentSyntax.RefKindKeyword.
GetLocation
());
2899
diagnostics.Add(ErrorCode.ERR_ScopedDiscard, scopedType.ScopedKeyword.
GetLocation
());
2992
diagnostics.Add(ErrorCode.ERR_UnexpectedToken, scopedType.ScopedKeyword.
GetLocation
(), scopedType.ScopedKeyword.ValueText);
2998
diagnostics.Add(ErrorCode.ERR_UnexpectedToken, refType.RefKeyword.
GetLocation
(), refType.RefKeyword.ValueText);
3406
MessageID.IDS_FeatureImplicitArray.CheckFeatureAvailability(diagnostics, node, node.NewKeyword.
GetLocation
());
3877
MessageID.IDS_FeatureNestedStackalloc.CheckFeatureAvailability(diagnostics, node, node.GetFirstToken().
GetLocation
());
3959
MessageID.IDS_FeatureStackAllocInitializer.CheckFeatureAvailability(diagnostics, node, stackAllocKeyword.
GetLocation
());
4198
errorLocation = initializerSyntax.ThisOrBaseKeyword.
GetLocation
();
4405
MessageID.IDS_FeatureImplicitObjectCreation.CheckFeatureAvailability(diagnostics, node, node.NewKeyword.
GetLocation
());
4828
MessageID.IDS_FeatureObjectInitializer.CheckFeatureAvailability(diagnostics, initializerSyntax, initializerSyntax.OpenBraceToken.
GetLocation
());
4975
diagnostics, implicitIndexing, implicitIndexing.ArgumentList.OpenBracketToken.
GetLocation
());
5291
BaseObjectCreationExpressionSyntax { NewKeyword: { } newKeyword } => newKeyword.
GetLocation
(),
5325
MessageID.IDS_FeatureCollectionInitializer.CheckFeatureAvailability(diagnostics, initializerSyntax, initializerSyntax.OpenBraceToken.
GetLocation
());
6562
diagnostics.Add(ErrorCode.ERR_BadUnaryOp, operatorToken.
GetLocation
(), SyntaxFacts.GetText(operatorToken.Kind()), leftType);
6570
diagnostics.Add(new CSDiagnostic(diagnosticInfo, operatorToken.
GetLocation
()));
9336
MessageID.IDS_FeatureNullPropagatingOperator.CheckFeatureAvailability(diagnostics, node, node.OperatorToken.
GetLocation
());
9524
Error(diagnostics, ErrorCode.ERR_BadUnaryOp, operatorToken.
GetLocation
(), operatorToken.Text, receiver.Display);
9531
Error(diagnostics, ErrorCode.ERR_BadUnaryOp, operatorToken.
GetLocation
(), operatorToken.Text, receiverType);
9538
Error(diagnostics, ErrorCode.ERR_BadUnaryOp, operatorToken.
GetLocation
(), operatorToken.Text, receiverType);
Binder\Binder_InterpolatedString.cs (2)
36
node.StringStartToken.
GetLocation
(),
84
interpolation.CloseBraceToken.
GetLocation
(),
Binder\Binder_Lambda.cs (8)
59
MessageID.IDS_FeatureLambda.CheckFeatureAvailability(diagnostics, syntax, lambdaSyntax.ArrowToken.
GetLocation
());
89
MessageID.IDS_FeatureAnonDelegates.CheckFeatureAvailability(diagnostics, anon, anon.DelegateKeyword.
GetLocation
());
108
MessageID.IDS_FeatureAsync.CheckFeatureAvailability(diagnostics, syntax, modifier.
GetLocation
());
113
MessageID.IDS_FeatureStaticAnonymousFunction.CheckFeatureAvailability(diagnostics, syntax, modifier.
GetLocation
());
158
MessageID.IDS_FeatureLambdaOptionalParameters.CheckFeatureAvailability(diagnostics, syntax, p.Default.EqualsToken.
GetLocation
());
193
paramsKeyword.
GetLocation
());
330
parameter.Type?.GetLocation() ?? parameter.Identifier.
GetLocation
());
343
param.Identifier.
GetLocation
(), param.Identifier.Text);
Binder\Binder_Operators.cs (4)
2410
MessageID.IDS_FeatureNullableReferenceTypes.CheckFeatureAvailability(diagnostics, node, node.OperatorToken.
GetLocation
());
4092
MessageID.IDS_FeatureCoalesceAssignmentExpression.CheckFeatureAvailability(diagnostics, node, node.OperatorToken.
GetLocation
());
4203
diagnostics.Add(ErrorCode.ERR_RefConditionalNeedsTwoRefs, whenFalse.GetFirstToken().
GetLocation
());
4208
diagnostics.Add(ErrorCode.ERR_RefConditionalNeedsTwoRefs, whenTrue.GetFirstToken().
GetLocation
());
Binder\Binder_Patterns.cs (12)
20
MessageID.IDS_FeaturePatternMatching.CheckFeatureAvailability(diagnostics, node, node.IsKeyword.
GetLocation
());
147
MessageID.IDS_FeatureRecursivePatterns.CheckFeatureAvailability(diagnostics, node, node.SwitchKeyword.
GetLocation
());
197
MessageID.IDS_FeatureParenthesizedPattern.CheckFeatureAvailability(diagnostics, node, node.OpenParenToken.
GetLocation
());
873
diagnostics.Add(ErrorCode.ERR_DesignatorBeneathPatternCombinator, identifier.
GetLocation
());
1082
MessageID.IDS_FeatureExtendedPropertyPatterns.CheckFeatureAvailability(diagnostics, subPattern, subPattern.ExpressionColon.ColonToken.
GetLocation
());
1326
diagnostics.Add(ErrorCode.ERR_VarMayNotBindToType, node.VarKeyword.
GetLocation
(), foundSymbol.ToDisplayString());
1460
MessageID.IDS_FeatureExtendedPropertyPatterns.CheckFeatureAvailability(diagnostics, p, p.ExpressionColon.ColonToken.
GetLocation
());
1620
MessageID.IDS_FeatureRelationalPattern.CheckFeatureAvailability(diagnostics, node, node.OperatorToken.
GetLocation
());
1628
diagnostics.Add(ErrorCode.ERR_InvalidExprTerm, node.OperatorToken.
GetLocation
(), node.OperatorToken.Text);
1713
MessageID.IDS_FeatureNotPattern.CheckFeatureAvailability(diagnostics, node, node.OperatorToken.
GetLocation
());
1730
MessageID.IDS_FeatureOrPattern.CheckFeatureAvailability(diagnostics, node, node.OperatorToken.
GetLocation
());
1815
MessageID.IDS_FeatureAndPattern.CheckFeatureAvailability(diagnostics, node, node.OperatorToken.
GetLocation
());
Binder\Binder_Query.cs (1)
26
MessageID.IDS_FeatureQueryExpression.CheckFeatureAvailability(diagnostics, node, node.FromClause.FromKeyword.
GetLocation
());
Binder\Binder_QueryErrors.cs (1)
210
symbols), queryClause.GetFirstToken().
GetLocation
());
Binder\Binder_Statements.cs (14)
218
MessageID.IDS_FeatureIterators.CheckFeatureAvailability(diagnostics, statement, statement.YieldKeyword.
GetLocation
());
443
diagnostics.Add(ErrorCode.ERR_BadEmptyThrow, node.ThrowKeyword.
GetLocation
());
454
diagnostics.Add(ErrorCode.ERR_BadEmptyThrowInFinally, node.ThrowKeyword.
GetLocation
());
553
MessageID.IDS_FeatureLocalFunctions.CheckFeatureAvailability(diagnostics, node, node.Identifier.
GetLocation
());
598
MessageID.IDS_FeatureStaticLocalFunctions.CheckFeatureAvailability(diagnostics, node, modifier.
GetLocation
());
600
MessageID.IDS_FeatureExternLocalFunctions.CheckFeatureAvailability(diagnostics, node, modifier.
GetLocation
());
1429
MessageID.IDS_FeatureRefReassignment.CheckFeatureAvailability(diagnostics, node.Right, node.Right.GetFirstToken().
GetLocation
());
2912
diagnostics.Add(ErrorCode.ERR_ReturnInIterator, syntax.ReturnKeyword.
GetLocation
());
2920
diagnostics.Add(ErrorCode.ERR_MustNotHaveRefReturn, syntax.ReturnKeyword.
GetLocation
());
2925
diagnostics.Add(ErrorCode.ERR_ReturnInIterator, syntax.ReturnKeyword.
GetLocation
());
2934
diagnostics.Add(errorCode, syntax.ReturnKeyword.
GetLocation
());
3124
diagnostics.Add(ErrorCode.ERR_TooManyCatches, catchSyntax.CatchKeyword.
GetLocation
());
3250
MessageID.IDS_FeatureExceptionFilter.CheckFeatureAvailability(diagnostics, filter, filter.WhenKeyword.
GetLocation
());
3462
messageId?.CheckFeatureAvailability(diagnostics, expressionBody, expressionBody.ArrowToken.
GetLocation
());
Binder\Binder_Symbols.cs (7)
447
MessageID.IDS_FeatureFunctionPointers.CheckFeatureAvailability(diagnostics, syntax, functionPointerTypeSyntax.DelegateKeyword.
GetLocation
());
487
diagnostics.Add(ErrorCode.ERR_BadRefInUsingAlias, refToken.
GetLocation
());
491
diagnostics.Add(ErrorCode.ERR_UnexpectedToken, refToken.
GetLocation
(), refToken.ToString());
505
diagnostics.Add(ErrorCode.ERR_UnexpectedToken, scopedToken.
GetLocation
(), scopedToken.ToString());
538
MessageID.IDS_FeatureNullable.CheckFeatureAvailability(diagnostics, nullableSyntax, nullableSyntax.QuestionToken.
GetLocation
());
704
locations.Add(nameToken.
GetLocation
());
2703
=> CheckFeatureAvailability(syntax.SyntaxTree!, feature, diagnostics, location ?? syntax.
GetLocation
());
Binder\Binder_WithExpression.cs (1)
17
MessageID.IDS_FeatureRecords.CheckFeatureAvailability(diagnostics, syntax, syntax.WithKeyword.
GetLocation
());
Binder\BindingDiagnosticBag.cs (1)
103
return ReportUseSite(symbol, token.
GetLocation
());
Binder\ExpressionVariableFinder.cs (1)
660
designation.Identifier.ValueText, designation, designation.Identifier.
GetLocation
(),
Binder\ForEachLoopBinder.cs (9)
205
CheckFeatureAvailability(_syntax, MessageID.IDS_FeatureAsyncStreams, diagnostics, _syntax.AwaitKeyword.
GetLocation
());
239
ReportBadAwaitDiagnostics(expr, _syntax.AwaitKeyword.
GetLocation
(), diagnostics, ref hasErrors);
435
ReportDiagnosticsIfUnmanagedCallersOnly(diagnostics, getEnumeratorMethod, foreachKeyword.
GetLocation
(), isDelegateConversion: false);
463
diagnostics.Add(ErrorCode.ERR_AmbigUDConv, foreachKeyword.
GetLocation
(), originalUserDefinedConversions[0], originalUserDefinedConversions[1], inferredType.Type, iterationVariableType);
468
diagnostics.Add(ErrorCode.ERR_NoExplicitConv, foreachKeyword.
GetLocation
(), distinguisher.First, distinguisher.Second);
485
var location = _syntax.ForEachKeyword.
GetLocation
();
508
diagnostics.Add(ErrorCode.ERR_BadSpecialByRefIterator, foreachKeyword.
GetLocation
(), getEnumeratorType);
511
diagnostics.Add(_syntax.ForEachKeyword.
GetLocation
(), useSiteInfo);
599
ReportBadAwaitDiagnostics(expr, _syntax.AwaitKeyword.
GetLocation
(), diagnostics, ref hasErrors);
Binder\LocalBinderFactory.cs (1)
413
if (candidate.Locations[0] == node.Identifier.
GetLocation
())
Binder\SwitchBinder_Patterns.cs (2)
35
diagnostics.Add(ErrorCode.WRN_EmptySwitch, node.OpenBraceToken.
GetLocation
());
270
MessageID.IDS_FeaturePatternMatching.CheckFeatureAvailability(diagnostics, node, node.Keyword.
GetLocation
());
Binder\SwitchExpressionBinder.cs (1)
102
node.SwitchKeyword.
GetLocation
(),
Binder\UsingStatementBinder.cs (3)
98
CheckFeatureAvailability(syntax, MessageID.IDS_FeatureUsingDeclarations, diagnostics, usingKeyword.
GetLocation
());
102
CheckFeatureAvailability(syntax, MessageID.IDS_FeatureAsyncUsing, diagnostics, awaitKeyword.
GetLocation
());
149
originalBinder.ReportBadAwaitDiagnostics(syntax, awaitKeyword.
GetLocation
(), diagnostics, ref hasErrors);
Binder\WithLambdaParametersBinder.cs (1)
82
diagnostics.Add(ErrorCode.ERR_YieldInAnonMeth, node.YieldKeyword.
GetLocation
());
BoundTree\BoundTreeVisitors.cs (1)
192
return syntax.GetFirstToken().
GetLocation
();
BoundTree\UnboundLambda.cs (3)
1472
return ((SimpleLambdaExpressionSyntax)syntax).Parameter.Identifier.
GetLocation
();
1474
return ((ParenthesizedLambdaExpressionSyntax)syntax).ParameterList.Parameters[index].Identifier.
GetLocation
();
1476
return ((AnonymousMethodExpressionSyntax)syntax).ParameterList!.Parameters[index].Identifier.
GetLocation
();
CommandLine\CSharpCompiler.cs (1)
364
directive.File.
GetLocation
(),
Compilation\SyntaxAndDeclarationManager.cs (2)
211
fileToken.
GetLocation
(),
245
fileToken.
GetLocation
());
Compiler\MethodCompiler.cs (1)
1806
constructorSyntax.Initializer.ThisOrBaseKeyword.
GetLocation
(),
Declarations\DeclarationTreeBuilder.cs (14)
120
bag.Add(ErrorCode.ERR_SimpleProgramIsEmpty, ((EmptyStatementSyntax)firstGlobalStatement.Statement).SemicolonToken.
GetLocation
());
365
diagnostics.Add(ErrorCode.ERR_GlobalUsingOutOfOrder, directive.GlobalKeyword.
GetLocation
());
396
MessageID.IDS_FeatureUsingStatic.CheckFeatureAvailability(diagnostics, usingDirective, usingDirective.StaticKeyword.
GetLocation
());
399
MessageID.IDS_FeatureGlobalUsing.CheckFeatureAvailability(diagnostics, usingDirective, usingDirective.GlobalKeyword.
GetLocation
());
406
MessageID.IDS_FeatureExternAlias.CheckFeatureAvailability(diagnostics, externAlias, externAlias.ExternKeyword.
GetLocation
());
444
MessageID.IDS_FeatureFileScopedNamespace.CheckFeatureAvailability(diagnostics, node, node.NamespaceKeyword.
GetLocation
());
512
diagnostics.Add(ErrorCode.ERR_BadModifiersOnNamespace, node.Modifiers[0].
GetLocation
());
519
diagnostics.Add(ErrorCode.ERR_GlobalUsingInNamespace, directive.GlobalKeyword.
GetLocation
());
634
MessageID.IDS_FeatureRecordStructs.CheckFeatureAvailability(diagnostics, record, record.ClassOrStructKeyword.
GetLocation
());
652
MessageID.IDS_FeaturePrimaryConstructors.CheckFeatureAvailability(diagnostics, node, node.SemicolonToken.
GetLocation
());
663
MessageID.IDS_FeatureStaticClasses.CheckFeatureAvailability(diagnostics, node, modifier.
GetLocation
());
667
MessageID.IDS_FeatureReadOnlyStructs.CheckFeatureAvailability(diagnostics, node, modifier.
GetLocation
());
671
MessageID.IDS_FeatureRefStructs.CheckFeatureAvailability(diagnostics, node, modifier.
GetLocation
());
758
MessageID.IDS_FeaturePrimaryConstructors.CheckFeatureAvailability(diagnostics, node, node.SemicolonToken.
GetLocation
());
Errors\DiagnosticBagExtensions.cs (1)
78
return !useSiteDiagnostics.IsNullOrEmpty() && diagnostics.Add(token.
GetLocation
(), useSiteDiagnostics);
Errors\LazyMissingNonNullTypesContextDiagnosticInfo.cs (1)
48
var location = questionToken.
GetLocation
();
FlowAnalysis\NullableWalker.cs (7)
765
Diagnostics.Add(ErrorCode.WRN_MemberNotNull, syntaxOpt?.GetLocation() ?? methodMainNode.Syntax.GetLastToken().
GetLocation
(), member.Name);
836
Diagnostics.Add(ErrorCode.WRN_MemberNotNullWhen, syntaxOpt?.GetLocation() ?? methodMainNode.Syntax.GetLastToken().
GetLocation
(), member.Name, sense ? "true" : "false");
1166
location = blockSyntax.CloseBraceToken.
GetLocation
();
1170
location = syntaxOpt?.GetLocation() ?? methodMainNode.Syntax.GetLastToken().
GetLocation
();
1256
var location = syntaxOpt?.GetLocation() ?? methodMainNode.Syntax.GetLastToken().
GetLocation
();
1279
ReportDiagnostic(ErrorCode.WRN_ShouldNotReturn, syntaxOpt?.GetLocation() ?? methodMainNode.Syntax.GetLastToken().
GetLocation
());
10157
ForEachStatementSyntax statement => statement.Identifier.
GetLocation
(),
FlowAnalysis\NullableWalker_Patterns.cs (1)
867
((SwitchExpressionSyntax)node.Syntax).SwitchKeyword.
GetLocation
(),
Lowering\LocalRewriter\LocalRewriter_UsingStatement.cs (1)
456
TryGetWellKnownTypeMember<MethodSymbol>(syntax: null, WellKnownMember.System_IAsyncDisposable__DisposeAsync, out disposeMethod, location: awaitKeyword.
GetLocation
());
Symbols\AliasSymbol.cs (6)
75
return new AliasSymbolFromResolvedTarget(targetSymbol, aliasToken.ValueText, containingSymbol, ImmutableArray.Create(aliasToken.
GetLocation
()), isExtern);
291
: base(syntax.Alias!.Name.Identifier.ValueText, containingSymbol, ImmutableArray.Create(syntax.Alias!.Name.Identifier.
GetLocation
()), isExtern: false)
299
: base(syntax.Identifier.ValueText, containingSymbol, ImmutableArray.Create(syntax.Identifier.
GetLocation
()), isExtern: true)
382
MessageID.IDS_FeatureUsingTypeAlias.CheckFeatureAvailability(diagnostics, usingDirective, usingDirective.UnsafeKeyword.
GetLocation
());
393
this.CheckUnsafeModifier(DeclarationModifiers.Unsafe, usingDirective.UnsafeKeyword.
GetLocation
(), diagnostics);
417
diagnostics.Add(ErrorCode.ERR_BadNullableReferenceTypeInUsingAlias, nullableType.QuestionToken.
GetLocation
());
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (5)
61
diagnostics.Add(ErrorCode.ERR_DupReturnTypeMod, modifier.
GetLocation
(), modifier.Text);
66
diagnostics.Add(ErrorCode.ERR_InvalidFuncPointerReturnTypeModifier, modifier.
GetLocation
(), modifier.Text);
145
checkUnmanagedSupport(compilation, callingConventionSyntax.ManagedOrUnmanagedKeyword.
GetLocation
(), diagnostics);
166
diagnostics.Add(ErrorCode.ERR_InvalidFunctionPointerCallingConvention, unmanagedList.OpenBracketToken.
GetLocation
(), "");
172
checkUnmanagedSupport(compilation, callingConventionSyntax.ManagedOrUnmanagedKeyword.
GetLocation
(), diagnostics);
Symbols\Source\LambdaSymbol.cs (2)
234
AnonymousMethodExpressionSyntax syntax => syntax.DelegateKeyword.
GetLocation
(),
235
LambdaExpressionSyntax syntax => syntax.ArrowToken.
GetLocation
(),
Symbols\Source\LocalFunctionSymbol.cs (5)
130
addTo.Add(ErrorCode.WRN_MainIgnored, Syntax.Identifier.
GetLocation
(), this);
184
diagnostics.Add(ErrorCode.ERR_IllegalVarArgs, arglistToken.
GetLocation
());
304
public override ImmutableArray<Location> Locations => ImmutableArray.Create(Syntax.Identifier.
GetLocation
());
382
diagnostics.Add(ErrorCode.ERR_IllegalVarianceSyntax, parameter.VarianceKeyword.
GetLocation
());
388
var location = identifier.
GetLocation
();
Symbols\Source\ModifierUtils.cs (6)
31
modifierErrors |= !MessageID.IDS_FeatureReadOnlyMembers.CheckFeatureAvailability(diagnostics, readonlyToken.Parent, readonlyToken.
GetLocation
());
125
diagnostics.Add(diagnosticInfo, modifier.
GetLocation
());
137
diagnostics.Add(ErrorCode.ERR_PartialMisplaced, partialToken.
GetLocation
());
405
messageId.CheckFeatureAvailability(diagnostics, modifier.Parent, modifier.
GetLocation
());
416
modifier.
GetLocation
());
454
modifierToken.
GetLocation
(),
Symbols\Source\ParameterHelpers.cs (24)
145
diagnostics.Add(ErrorCode.ERR_ThisInBadContext, thisKeyword.
GetLocation
());
160
diagnostics.Add(ErrorCode.ERR_IllegalVarArgs, arglistToken.
GetLocation
());
186
diagnostics.Add(ErrorCode.ERR_IllegalRefParam, refnessKeyword.
GetLocation
());
427
diagnostics.Add(ErrorCode.ERR_ThisInBadContext, modifier.
GetLocation
());
439
diagnostics.Add(ErrorCode.ERR_BadParamModThis, modifier.
GetLocation
());
505
diagnostics.Add(ErrorCode.ERR_IllegalParams, modifier.
GetLocation
());
513
diagnostics.Add(ErrorCode.ERR_BadParamModThis, modifier.
GetLocation
());
534
MessageID.IDS_FeatureLambdaParamsArray.CheckFeatureAvailability(diagnostics, parameter, modifier.
GetLocation
());
579
diagnostics.Add(ErrorCode.ERR_ReadOnlyNotSuppAsParamModDidYouMeanIn, modifier.
GetLocation
());
584
diagnostics.Add(ErrorCode.ERR_BadFuncPointerParamModifier, modifier.
GetLocation
(), SyntaxFacts.GetText(modifier.Kind()));
594
diagnostics.Add(ErrorCode.ERR_DupParamMod, modifier.
GetLocation
(), SyntaxFacts.GetText(modifier.Kind()));
599
diagnostics.Add(ErrorCode.ERR_BadParameterModifiers, modifier.
GetLocation
(), SyntaxFacts.GetText(modifier.Kind()), SyntaxFacts.GetText(otherModifierKind));
604
diagnostics.Add(ErrorCode.ERR_ParamsCantBeWithModifier, modifier.
GetLocation
(), SyntaxFacts.GetText(otherModifierKind));
632
diagnostics.Add(ErrorCode.ERR_BadThisParam, thisKeyword.
GetLocation
(), owner?.Name ?? "");
637
diagnostics.Add(ErrorCode.ERR_IllegalParams, paramsKeyword.
GetLocation
());
642
diagnostics.Add(ErrorCode.ERR_ParamsMustBeArray, paramsKeyword.
GetLocation
());
656
Location loc = ((ParameterSyntax)syntax).Identifier.GetNextToken(includeZeroWidth: true).
GetLocation
(); //could be missing
722
diagnostics.Add(ErrorCode.ERR_RefOutDefaultValue, refnessKeyword.
GetLocation
());
728
diagnostics.Add(ErrorCode.ERR_DefaultValueForParamsParameter, paramsKeyword.
GetLocation
());
738
diagnostics.Add(ErrorCode.ERR_DefaultValueForExtensionParameter, thisKeyword.
GetLocation
());
760
diagnostics.Add(ErrorCode.ERR_NoConversionForDefaultParam, parameterSyntax.Identifier.
GetLocation
(),
772
diagnostics.Add(ErrorCode.ERR_NotNullRefDefaultParameter, parameterSyntax.Identifier.
GetLocation
(),
794
diagnostics.Add(ErrorCode.ERR_NoConversionForNubDefaultParam, parameterSyntax.Identifier.
GetLocation
(),
824
parameterSyntax.Identifier.
GetLocation
(),
Symbols\Source\SourceComplexParameterSymbol.cs (1)
370
MessageID.IDS_FeatureOptionalParameter.CheckFeatureAvailability(diagnostics, defaultSyntax, defaultSyntax.EqualsToken.
GetLocation
());
Symbols\Source\SourceConstructorSymbol.cs (1)
25
return new SourceConstructorSymbol(containingType, syntax.Identifier.
GetLocation
(), syntax, methodKind, isNullableAnalysisEnabled, diagnostics);
Symbols\Source\SourceCustomEventAccessorSymbol.cs (2)
32
ImmutableArray.Create(syntax.Keyword.
GetLocation
()), explicitlyImplementedEventOpt, aliasQualifierOpt,
54
diagnostics.Add(ErrorCode.ERR_NoModifiersOnAccessor, syntax.Modifiers[0].
GetLocation
());
Symbols\Source\SourceCustomEventSymbol.cs (5)
95
diagnostics.Add(ErrorCode.ERR_DuplicateAccessor, accessor.Keyword.
GetLocation
());
106
diagnostics.Add(ErrorCode.ERR_DuplicateAccessor, accessor.Keyword.
GetLocation
());
112
diagnostics.Add(ErrorCode.ERR_AddOrRemoveExpected, accessor.Keyword.
GetLocation
());
126
diagnostics.Add(ErrorCode.ERR_AddRemoveMustHaveBody, accessor.SemicolonToken.
GetLocation
());
134
diagnostics.Add(ErrorCode.ERR_AbstractEventHasAccessors, syntax.AccessorList.OpenBraceToken.
GetLocation
(), this);
Symbols\Source\SourceDelegateMethodSymbol.cs (1)
28
: base(delegateType, syntax.GetReference(), location: syntax.Identifier.
GetLocation
(), isIterator: false)
Symbols\Source\SourceDestructorSymbol.cs (2)
24
base(containingType, syntax.GetReference(), syntax.Identifier.
GetLocation
(), isIterator: SyntaxFacts.HasYieldOperations(syntax.Body))
35
diagnostics.Add(ErrorCode.ERR_BadDestructorName, syntax.Identifier.
GetLocation
());
Symbols\Source\SourceEnumConstantSymbol.cs (1)
51
: base(containingEnum, syntax.Identifier.ValueText, syntax.GetReference(), syntax.Identifier.
GetLocation
())
Symbols\Source\SourceEventSymbol.cs (1)
51
_location = nameTokenSyntax.
GetLocation
();
Symbols\Source\SourceLocalSymbol.cs (1)
74
_locations = ImmutableArray.Create(identifierToken.
GetLocation
());
Symbols\Source\SourceMemberContainerSymbol.cs (2)
1769
ReportReservedTypeName(identifier?.Text, this.DeclaringCompilation, diagnostics.DiagnosticBag, identifier?.
GetLocation
() ?? Location.None);
3427
diagnostics.Add(ErrorCode.ERR_ConstructorInStaticClass, syntax.Identifier.
GetLocation
());
Symbols\Source\SourceMemberFieldSymbol.cs (3)
83
diagnostics.Add(ErrorCode.ERR_BadConstType, constToken.
GetLocation
(), type);
199
MessageID.IDS_FeatureFixedBuffer.CheckFeatureAvailability(diagnostics, modifier.Parent, modifier.
GetLocation
());
341
: base(containingType, modifiers, declarator.Identifier.ValueText, declarator.GetReference(), declarator.Identifier.
GetLocation
())
Symbols\Source\SourceMethodSymbol.cs (1)
36
diagnostics.Add(ErrorCode.ERR_UnexpectedToken, refKeyword.
GetLocation
(), refKeyword.ToString());
Symbols\Source\SourceNamedTypeSymbol.cs (3)
184
MessageID.IDS_FeatureGenerics.CheckFeatureAvailability(diagnostics, tpl, tpl.LessThanToken.
GetLocation
());
196
diagnostics.Add(ErrorCode.ERR_IllegalVarianceSyntax, tp.VarianceKeyword.
GetLocation
());
200
MessageID.IDS_FeatureTypeVariance.CheckFeatureAvailability(diagnostics, tp, tp.VarianceKeyword.
GetLocation
());
Symbols\Source\SourceNamespaceSymbol.AliasesAndUsings.cs (2)
488
diagnostics.Add(ErrorCode.ERR_GlobalExternAlias, aliasSyntax.Identifier.
GetLocation
());
725
diagnostics.Add(ErrorCode.ERR_BadUnsafeInUsingDirective, usingDirective.UnsafeKeyword.
GetLocation
());
Symbols\Source\SourceOrdinaryMethodSymbol.cs (6)
179
syntax.ConstraintClauses[0].WhereKeyword.
GetLocation
());
249
var loc = identifier.
GetLocation
();
260
Location thisLocation = syntax.ParameterList.Parameters[0].Modifiers.FirstOrDefault(SyntaxKind.ThisKeyword).
GetLocation
();
535
MessageID.IDS_FeatureGenerics.CheckFeatureAvailability(diagnostics, syntax.TypeParameterList, syntax.TypeParameterList.LessThanToken.
GetLocation
());
555
diagnostics.Add(ErrorCode.ERR_IllegalVarianceSyntax, parameter.VarianceKeyword.
GetLocation
());
559
var location = identifier.
GetLocation
();
Symbols\Source\SourcePropertyAccessorSymbol.cs (2)
53
syntax.Keyword.
GetLocation
(),
238
MessageID.IDS_FeaturePropertyAccessorMods.CheckFeatureAvailability(diagnostics, syntax, modifiers[0].
GetLocation
());
Symbols\Source\SourcePropertySymbol.cs (9)
19
var location = nameToken.
GetLocation
();
25
var location = syntax.ThisKeyword.
GetLocation
();
136
MessageID.IDS_FeatureAutoPropertyInitializer.CheckFeatureAvailability(diagnostics, syntax, initializer.EqualsToken.
GetLocation
());
194
diagnostics.Add(ErrorCode.ERR_DuplicateAccessor, accessor.Keyword.
GetLocation
());
209
diagnostics.Add(ErrorCode.ERR_DuplicateAccessor, accessor.Keyword.
GetLocation
());
214
diagnostics.Add(ErrorCode.ERR_GetOrSetExpected, accessor.Keyword.
GetLocation
());
494
diagnostics.Add(ErrorCode.ERR_IndexerNeedsParam, parameterSyntaxOpt.GetLastToken().
GetLocation
());
507
diagnostics.Add(ErrorCode.ERR_IllegalVarArgs, arglistToken.
GetLocation
());
518
diagnostics.Add(ErrorCode.WRN_DefaultValueForUnconsumedLocation, paramNameToken.
GetLocation
(), paramNameToken.ValueText);
Symbols\Source\SourceUserDefinedConversionSymbol.cs (2)
30
MessageID.IDS_FeatureCheckedUserDefinedOperators.CheckFeatureAvailability(diagnostics, syntax, syntax.CheckedKeyword.
GetLocation
());
34
diagnostics.Add(ErrorCode.ERR_ImplicitConversionOperatorCantBeChecked, syntax.CheckedKeyword.
GetLocation
());
Symbols\Source\SourceUserDefinedOperatorSymbol.cs (4)
24
var location = syntax.OperatorToken.
GetLocation
();
30
MessageID.IDS_FeatureCheckedUserDefinedOperators.CheckFeatureAvailability(diagnostics, syntax, syntax.CheckedKeyword.
GetLocation
());
34
diagnostics.Add(ErrorCode.ERR_OperatorCantBeChecked, syntax.CheckedKeyword.
GetLocation
(), SyntaxFacts.GetText(SyntaxFacts.GetOperatorKind(name)));
39
MessageID.IDS_FeatureUnsignedRightShift.CheckFeatureAvailability(diagnostics, syntax, syntax.OperatorToken.
GetLocation
());
Symbols\Symbol.cs (1)
1350
constraintClauses[0].WhereKeyword.
GetLocation
());
Symbols\Symbol_Attributes.cs (3)
690
targetOpt.Identifier.
GetLocation
(), targetOpt.Identifier.ValueText, allowedTargets.ToDisplayString());
708
diagnostics.Add(ErrorCode.ERR_GlobalAttributesNotAllowed, targetOpt.Identifier.
GetLocation
());
719
targetOpt.Identifier.
GetLocation
(), targetOpt.Identifier.ToString(), allowedTargets.ToDisplayString());
Symbols\Synthesized\Records\SynthesizedPrimaryConstructor.cs (1)
21
base(containingType, syntax.Identifier.
GetLocation
(), syntax, isIterator: false)
Symbols\Synthesized\Records\SynthesizedRecordPropertySymbol.cs (1)
81
((ParameterSyntax)syntax).Identifier.
GetLocation
(),
Syntax\SyntaxFactory.cs (1)
1648
/// the <see cref="SyntaxToken.
GetLocation
"/> API may yield surprising results for
Syntax\SyntaxNodeExtensions.cs (3)
274
MessageID.IDS_FeatureRefLocalsReturns.CheckFeatureAvailability(diagnostics, refType, refType.RefKeyword.
GetLocation
());
277
MessageID.IDS_FeatureReadOnlyReferences.CheckFeatureAvailability(diagnostics, refType, refType.ReadOnlyKeyword.
GetLocation
());
329
diagnostics, refExpression, refExpression.RefKeyword.
GetLocation
());
Microsoft.CodeAnalysis.CSharp.CodeStyle (29)
ArrowExpressionClausePlacementDiagnosticAnalyzer.cs (1)
75
arrowExpressionClause.ArrowToken.
GetLocation
(),
ConditionalExpressionPlacementDiagnosticAnalyzer.cs (1)
79
conditionalExpression.QuestionToken.
GetLocation
(),
ConsecutiveBracePlacementDiagnosticAnalyzer.cs (1)
81
secondBrace.
GetLocation
(),
ConstructorInitializerPlacementDiagnosticAnalyzer.cs (1)
89
colonToken.
GetLocation
(),
ConvertProgramAnalysis_ProgramMain.cs (1)
68
return root.Members.OfType<GlobalStatementSyntax>().First().GetFirstToken().
GetLocation
();
ConvertProgramAnalysis_TopLevelStatements.cs (1)
34
return isHidden ? methodDeclaration.GetLocation() : methodDeclaration.Identifier.
GetLocation
();
ConvertSwitchStatementToExpressionDiagnosticAnalyzer.cs (1)
71
location: switchStatement.GetFirstToken().
GetLocation
(),
CSharpAddAccessibilityModifiersDiagnosticAnalyzer.cs (1)
74
name.
GetLocation
(),
CSharpAddBracesDiagnosticAnalyzer.cs (1)
111
firstToken.
GetLocation
(),
CSharpConsecutiveStatementPlacementDiagnosticAnalyzer.cs (1)
44
=> block.GetLastToken().
GetLocation
();
CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
116
nameToken.Value.
GetLocation
(),
CSharpMakeStructReadOnlyDiagnosticAnalyzer.cs (1)
63
typeDeclaration.Identifier.
GetLocation
(),
CSharpPopulateSwitchExpressionDiagnosticAnalyzer.cs (1)
16
=> switchBlock.SwitchKeyword.
GetLocation
();
CSharpRemoveConfusingSuppressionDiagnosticAnalyzer.cs (1)
45
((PostfixUnaryExpressionSyntax)left).OperatorToken.
GetLocation
(),
CSharpRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (2)
91
return variableDeclarator.Identifier.
GetLocation
();
103
return forEachStatement.Identifier.
GetLocation
();
CSharpSemanticFacts.cs (1)
58
var location = token.
GetLocation
();
CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (2)
97
coalesceExpression.OperatorToken.
GetLocation
(),
178
ifStatement.IfKeyword.
GetLocation
(),
CSharpUseDeconstructionDiagnosticAnalyzer.cs (2)
67
variableDeclaration.Variables[0].Identifier.
GetLocation
(),
81
forEachStatement.Identifier.
GetLocation
(),
CSharpUseLocalFunctionDiagnosticAnalyzer.cs (1)
137
localDeclaration.Declaration.Variables[0].Identifier.
GetLocation
(),
CSharpUseNotPatternDiagnosticAnalyzer.cs (2)
73
IsPatternExpressionSyntax { Pattern: DeclarationPatternSyntax or ConstantPatternSyntax } isPattern => isPattern.IsKeyword.
GetLocation
(),
76
BinaryExpressionSyntax(SyntaxKind.IsExpression) { Right: TypeSyntax } isExpression => isExpression.OperatorToken.
GetLocation
(),
CSharpUseTupleSwapDiagnosticAnalyzer.cs (1)
124
localDeclarationStatement.GetFirstToken().
GetLocation
(),
EmbeddedStatementPlacementDiagnosticAnalyzer.cs (1)
75
statement.GetFirstToken().
GetLocation
(),
MakeLocalFunctionStaticDiagnosticAnalyzer.cs (1)
55
localFunction.Identifier.
GetLocation
(),
UseSimpleUsingStatementDiagnosticAnalyzer.cs (1)
122
outermostUsing.UsingKeyword.
GetLocation
(),
UseUtf8StringLiteralDiagnosticAnalyzer.cs (1)
133
var location = syntaxNode.GetFirstToken().
GetLocation
();
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (13)
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.cs (1)
237
=> context.ReportDiagnostic(Diagnostic.Create(s_syntaxDiagnosticDescriptor, context.Tree.GetRoot().GetFirstToken().
GetLocation
()));
Diagnostics\Suppression\RemoveSuppressionTests.cs (1)
49
var location = _reportDiagnosticsWithoutLocation ? Location.None : classDecl.Identifier.
GetLocation
();
Diagnostics\Suppression\SuppressionTest_FixMultipleTests.cs (1)
51
var location = classDecl.Identifier.
GetLocation
();
Diagnostics\Suppression\SuppressionTests.cs (10)
712
context.ReportDiagnostic(Diagnostic.Create(Decsciptor, classDecl.Identifier.
GetLocation
()));
822
context.ReportDiagnostic(Diagnostic.Create(_descriptor, classDecl.Identifier.
GetLocation
()));
885
context.ReportDiagnostic(Diagnostic.Create(_descriptor, classDecl.Identifier.
GetLocation
()));
1079
context.ReportDiagnostic(Diagnostic.Create(Descriptor, classDecl.Identifier.
GetLocation
()));
1089
context.ReportDiagnostic(Diagnostic.Create(Descriptor, method.Identifier.
GetLocation
()));
1094
context.ReportDiagnostic(Diagnostic.Create(Descriptor, property.Identifier.
GetLocation
()));
1099
context.ReportDiagnostic(Diagnostic.Create(Descriptor, field.Declaration.Variables.First().Identifier.
GetLocation
()));
1104
context.ReportDiagnostic(Diagnostic.Create(Descriptor, e.Identifier.
GetLocation
()));
2073
context.ReportDiagnostic(Diagnostic.Create(_descriptor, classDecl.Identifier.
GetLocation
()));
2083
context.ReportDiagnostic(Diagnostic.Create(_descriptor, method.Identifier.
GetLocation
()));
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (8)
Diagnostics\DiagnosticAnalyzerTests.cs (1)
3628
Assert.Equal(field1.
GetLocation
(), diagnostic.Location);
Diagnostics\GetDiagnosticsTests.cs (7)
957
PropertyDeclarationSyntax propertyDecl => propertyDecl.Identifier.
GetLocation
(),
958
IndexerDeclarationSyntax indexerDecl => indexerDecl.ThisKeyword.
GetLocation
(),
959
EventDeclarationSyntax eventDecl => eventDecl.Identifier.
GetLocation
(),
967
MethodDeclarationSyntax methodDecl => methodDecl.Identifier.
GetLocation
(),
968
OperatorDeclarationSyntax operatorDecl => operatorDecl.OperatorToken.
GetLocation
(),
969
ConstructorDeclarationSyntax constructorDecl => constructorDecl.Identifier.
GetLocation
(),
970
DestructorDeclarationSyntax destructorDecl => destructorDecl.Identifier.
GetLocation
(),
Microsoft.CodeAnalysis.CSharp.Features (30)
ArrowExpressionClausePlacementDiagnosticAnalyzer.cs (1)
75
arrowExpressionClause.ArrowToken.
GetLocation
(),
Completion\CompletionProviders\ObjectAndWithInitializerCompletionProvider.cs (1)
143
return Tuple.Create(type, token.
GetLocation
());
ConditionalExpressionPlacementDiagnosticAnalyzer.cs (1)
79
conditionalExpression.QuestionToken.
GetLocation
(),
ConsecutiveBracePlacementDiagnosticAnalyzer.cs (1)
81
secondBrace.
GetLocation
(),
ConstructorInitializerPlacementDiagnosticAnalyzer.cs (1)
89
colonToken.
GetLocation
(),
ConvertProgramAnalysis_ProgramMain.cs (1)
68
return root.Members.OfType<GlobalStatementSyntax>().First().GetFirstToken().
GetLocation
();
ConvertProgramAnalysis_TopLevelStatements.cs (1)
34
return isHidden ? methodDeclaration.GetLocation() : methodDeclaration.Identifier.
GetLocation
();
ConvertSwitchStatementToExpressionDiagnosticAnalyzer.cs (1)
71
location: switchStatement.GetFirstToken().
GetLocation
(),
CSharpAddAccessibilityModifiersDiagnosticAnalyzer.cs (1)
74
name.
GetLocation
(),
CSharpAddBracesDiagnosticAnalyzer.cs (1)
111
firstToken.
GetLocation
(),
CSharpConsecutiveStatementPlacementDiagnosticAnalyzer.cs (1)
44
=> block.GetLastToken().
GetLocation
();
CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
116
nameToken.Value.
GetLocation
(),
CSharpMakeStructReadOnlyDiagnosticAnalyzer.cs (1)
63
typeDeclaration.Identifier.
GetLocation
(),
CSharpPopulateSwitchExpressionDiagnosticAnalyzer.cs (1)
16
=> switchBlock.SwitchKeyword.
GetLocation
();
CSharpRemoveConfusingSuppressionDiagnosticAnalyzer.cs (1)
45
((PostfixUnaryExpressionSyntax)left).OperatorToken.
GetLocation
(),
CSharpRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (2)
91
return variableDeclarator.Identifier.
GetLocation
();
103
return forEachStatement.Identifier.
GetLocation
();
CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (2)
97
coalesceExpression.OperatorToken.
GetLocation
(),
178
ifStatement.IfKeyword.
GetLocation
(),
CSharpUseDeconstructionDiagnosticAnalyzer.cs (2)
67
variableDeclaration.Variables[0].Identifier.
GetLocation
(),
81
forEachStatement.Identifier.
GetLocation
(),
CSharpUseLocalFunctionDiagnosticAnalyzer.cs (1)
137
localDeclaration.Declaration.Variables[0].Identifier.
GetLocation
(),
CSharpUseNotPatternDiagnosticAnalyzer.cs (2)
73
IsPatternExpressionSyntax { Pattern: DeclarationPatternSyntax or ConstantPatternSyntax } isPattern => isPattern.IsKeyword.
GetLocation
(),
76
BinaryExpressionSyntax(SyntaxKind.IsExpression) { Right: TypeSyntax } isExpression => isExpression.OperatorToken.
GetLocation
(),
CSharpUseTupleSwapDiagnosticAnalyzer.cs (1)
124
localDeclarationStatement.GetFirstToken().
GetLocation
(),
EmbeddedStatementPlacementDiagnosticAnalyzer.cs (1)
75
statement.GetFirstToken().
GetLocation
(),
GenerateType\CSharpGenerateTypeService.cs (1)
581
return (namespaceSymbol, namedTypeSymbol, enclosingNamespace.GetLastToken().
GetLocation
());
MakeLocalFunctionStaticDiagnosticAnalyzer.cs (1)
55
localFunction.Identifier.
GetLocation
(),
UseSimpleUsingStatementDiagnosticAnalyzer.cs (1)
122
outermostUsing.UsingKeyword.
GetLocation
(),
UseUtf8StringLiteralDiagnosticAnalyzer.cs (1)
133
var location = syntaxNode.GetFirstToken().
GetLocation
();
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Symbols\Source\DeclaringSyntaxNodeTests.cs (1)
350
Assert.Equal(localType.Locations[0], anonObjectCreation.NewKeyword.
GetLocation
());
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (6)
Syntax\SyntaxFactoryTests.cs (5)
413
Assert.Equal(Location.None, literal.
GetLocation
());
427
Assert.Equal(Location.None, literal.
GetLocation
());
441
Assert.Equal(expectedLocation, expression.Token.
GetLocation
());
455
Assert.Equal(expectedLocation, expression.Token.
GetLocation
());
465
Assert.Equal(Location.None, token.
GetLocation
());
Syntax\SyntaxNodeTests.cs (1)
2048
var tokenLocation = method.Identifier.
GetLocation
();
Microsoft.CodeAnalysis.CSharp.Workspaces (8)
CSharpSemanticFacts.cs (1)
58
var location = token.
GetLocation
();
Rename\CSharpRenameRewriterLanguageService.cs (7)
424
if (_renameRenamableSymbolDeclaration != null && _renamableDeclarationLocation == token.
GetLocation
())
825
conflicts.AddRange(visitor.ConflictingTokens.Select(t => reverseMappedLocations[t.
GetLocation
()]));
839
conflicts.AddRange(visitor.ConflictingTokens.Select(t => reverseMappedLocations[t.
GetLocation
()]));
849
conflicts.AddRange(visitor.ConflictingTokens.Select(t => reverseMappedLocations[t.
GetLocation
()]));
911
conflicts.Add(reverseMappedLocations[typeParameter.Identifier.
GetLocation
()]);
926
conflicts.Add(reverseMappedLocations[typeParameterToken.
GetLocation
()]);
1017
return ImmutableArray.Create(token.
GetLocation
());
Microsoft.CodeAnalysis.EditorFeatures (1)
RenameTracking\RenameTrackingTaggerProvider.TrackingSession.cs (1)
245
return sourceSymbol.Locations.Any(static (loc, token) => loc == token.
GetLocation
(), token)
Microsoft.CodeAnalysis.Features (27)
AbstractAddRequiredParenthesesDiagnosticAnalyzer.cs (1)
148
operatorToken.
GetLocation
(),
AbstractConsecutiveStatementPlacementDiagnosticAnalyzer.cs (1)
109
additionalLocations: ImmutableArray.Create(nextToken.
GetLocation
()),
AbstractForEachCastDiagnosticAnalyzer.cs (1)
131
node.GetFirstToken().
GetLocation
(),
AbstractMultipleBlankLinesDiagnosticAnalyzer.cs (1)
80
additionalLocations: ImmutableArray.Create(token.
GetLocation
()),
AbstractOrderModifiersDiagnosticAnalyzer.cs (1)
81
DiagnosticHelper.Create(Descriptor, modifiers.First().
GetLocation
(), severity, additionalLocations: null, properties: null));
AbstractPopulateSwitchStatementDiagnosticAnalyzer.cs (1)
36
=> switchBlock.GetFirstToken().
GetLocation
();
AbstractRemoveRedundantEqualityDiagnosticAnalyzer.cs (1)
81
operatorToken.
GetLocation
(),
AbstractRemoveUnnecessaryParenthesesDiagnosticAnalyzer.cs (2)
112
parenthesizedExpression.GetFirstToken().
GetLocation
(),
113
parenthesizedExpression.GetLastToken().
GetLocation
());
AbstractUseCoalesceExpressionForIfNullCheckDiagnosticAnalyzer.cs (1)
120
ifStatement.GetFirstToken().
GetLocation
(),
AbstractUseCollectionInitializerDiagnosticAnalyzer.cs (1)
125
objectCreationExpression.GetFirstToken().
GetLocation
(),
AbstractUseCompoundAssignmentDiagnosticAnalyzer.cs (3)
149
assignmentToken.
GetLocation
(),
160
assignmentToken.
GetLocation
(),
171
assignmentToken.
GetLocation
(),
AbstractUseConditionalExpressionDiagnosticAnalyzer.cs (1)
57
ifStatement.GetFirstToken().
GetLocation
(),
AbstractUseNullPropagationDiagnosticAnalyzer_IfStatement.cs (1)
96
ifStatement.GetFirstToken().
GetLocation
(),
AbstractUseObjectInitializerDiagnosticAnalyzer.cs (1)
112
objectCreationExpression.GetFirstToken().
GetLocation
(),
BraceCompletion\AbstractBraceCompletionService.cs (2)
98
return new BraceCompletionContext(document, leftToken.
GetLocation
().SourceSpan.Start, rightToken.
GetLocation
().SourceSpan.End, caretLocation);
EmbeddedLanguages\Json\LanguageServices\AbstractJsonDetectionAnalyzer.cs (1)
96
token.
GetLocation
(),
GenerateMember\GenerateConstructor\AbstractGenerateConstructorService.State.cs (2)
602
new CodeGenerationContext(Token.
GetLocation
()),
651
new CodeGenerationContext(Token.
GetLocation
()),
GenerateMember\GenerateEnumMember\AbstractGenerateEnumMemberService.CodeAction.cs (1)
48
contextLocation: _state.IdentifierToken.
GetLocation
()),
GenerateMember\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.CodeAction.cs (1)
80
afterThisLocation: _state.IdentifierToken.
GetLocation
(),
GenerateMember\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.State.cs (1)
50
return IdentifierToken.
GetLocation
();
GenerateMember\GenerateVariable\AbstractGenerateVariableService.CodeAction.cs (1)
62
contextLocation: _state.IdentifierToken.
GetLocation
()),
GenerateMember\GenerateVariable\AbstractGenerateVariableService.GenerateLocalCodeAction.cs (1)
75
var context = new CodeGenerationContext(beforeThisLocation: _state.IdentifierToken.
GetLocation
());
Microsoft.CodeAnalysis.Test.Utilities (2)
Diagnostics\CommonDiagnosticAnalyzers.cs (2)
1555
ReportDiagnosticsCore(addDiagnostic, tree.GetRoot().GetLastToken().
GetLocation
(), tree.FilePath);
2432
context.ReportDiagnostic(Diagnostic.Create(Descriptor, variable.Identifier.
GetLocation
()));
Microsoft.CodeAnalysis.UnitTests (1)
Diagnostics\SuppressMessageTargetSymbolResolverTests.cs (1)
1400
var location = token.
GetLocation
();
Microsoft.CodeAnalysis.VisualBasic (44)
Binding\Binder_AnonymousTypes.vb (1)
281
typeLocationToken.
GetLocation
(),
Binding\Binder_Attributes.vb (1)
804
cast.Keyword.
GetLocation
(),
Binding\Binder_Delegates.vb (2)
929
Dim location = token.
GetLocation
()
936
Dim location = token.
GetLocation
()
Binding\Binder_Imports.vb (1)
138
If(binder.BindingLocation = BindingLocation.ProjectImportsDeclaration, NoLocation.Singleton, aliasIdentifier.
GetLocation
()))
Binding\Binder_Invocation.vb (1)
3056
argumentNamesLocationsBuilder.Add(id.
GetLocation
())
Binding\Binder_Query.vb (5)
263
aggregate.IntoKeyword.
GetLocation
(),
2793
selectorSyntax.QueryClauseKeywordOrRangeVariableIdentifier.
GetLocation
(),
3242
syntax.QueryClauseKeywordOrRangeVariableIdentifier.
GetLocation
(),
3355
join.OnKeyword.
GetLocation
(),
3872
syntaxNode.QueryClauseKeywordOrRangeVariableIdentifier.
GetLocation
(),
Binding\Binder_Symbols.vb (1)
645
locations.Add(nameSyntax.
GetLocation
)
Binding\Binder_Utils.vb (5)
227
privateProtectedToken.
GetLocation
(),
927
diagnostics.Add(ERRID.ERR_ByRefIllegal1, token.
GetLocation
(), container.GetKindText())
932
diagnostics.Add(ERRID.ERR_ParamArrayIllegal1, token.
GetLocation
(), container.GetKindText())
937
diagnostics.Add(ERRID.ERR_OptionalIllegal1, token.
GetLocation
(), container.GetKindText())
990
Dim location = token.
GetLocation
()
Binding\BindingDiagnosticBag.vb (1)
98
Return ReportUseSite(symbol, token.
GetLocation
())
BoundTree\BoundTreeVisitor.vb (1)
168
Return syntax.GetFirstToken().
GetLocation
()
BoundTree\GroupTypeInferenceLambda.vb (2)
25
Syntax.QueryClauseKeywordOrRangeVariableIdentifier.
GetLocation
(),
27
Syntax.QueryClauseKeywordOrRangeVariableIdentifier.
GetLocation
(),
CommandLine\VisualBasicCompiler.vb (1)
289
directive.ExternalSource.
GetLocation
(),
Symbols\Source\CustomEventAccessorSymbol.vb (3)
256
Dim location = token.
GetLocation
()
262
Dim location = token.
GetLocation
()
273
Dim location = token.
GetLocation
()
Symbols\Source\LocalSymbol.vb (1)
594
Return _identifierToken.
GetLocation
()
Symbols\Source\RangeVariableSymbol.vb (1)
185
Return ImmutableArray.Create(Of Location)(_identifierToken.
GetLocation
())
Symbols\Source\SourceComplexParameterSymbol.vb (1)
390
Return Create(container, name, ordinal, paramType, syntax.Identifier.Identifier.
GetLocation
(), syntaxRef, flags, defaultValue)
Symbols\Source\SourceEnumConstantSymbol.vb (2)
41
diagnostics.Add(ERRID.ERR_ClashWithReservedEnumMember1, syntax.Identifier.
GetLocation
(), Me.Name)
59
Return ImmutableArray.Create(DirectCast(Syntax, EnumMemberDeclarationSyntax).Identifier.
GetLocation
())
Symbols\Source\SourceEventSymbol.vb (1)
93
Dim location = identifier.
GetLocation
()
Symbols\Source\SourceLabelSymbol.vb (1)
56
Return ImmutableArray.Create(Of Location)(_labelName.
GetLocation
())
Symbols\Source\SourceMemberMethodSymbol.vb (1)
368
syntax.Identifier.
GetLocation
(), syntax.Identifier.ToString())
Symbols\Source\SourceMethodSymbol.vb (4)
233
diagBag.Add(ERRID.ERR_OverloadsModifierInModule, keyword.
GetLocation
(), keyword.ValueText)
236
diagBag.Add(ERRID.ERR_ModuleCantUseDLLDeclareSpecifier1, keyword.
GetLocation
(), keyword.ValueText)
241
diagBag.Add(ERRID.ERR_StructCantUseDLLDeclareSpecifier1, keyword.
GetLocation
(), keyword.ValueText)
247
diagBag.Add(ERRID.ERR_DeclaresCantBeInGeneric, syntax.Identifier.
GetLocation
())
Symbols\Source\SourceNamedTypeSymbol.vb (1)
1442
GetTypeIdentifierToken(syntax).
GetLocation
())
Symbols\Source\SourcePropertyAccessorSymbol.vb (2)
114
ImmutableArray.Create(syntax.DeclarationKeyword.
GetLocation
()))
462
Dim location = token.
GetLocation
()
Symbols\Source\SourcePropertySymbol.vb (2)
95
Dim location = identifier.
GetLocation
()
245
Dim location = identifier.
GetLocation
()
Symbols\Source\UnboundLambdaParameterSymbol.vb (1)
96
Return New UnboundLambdaParameterSymbol(name, ordinal, paramType, syntax.Identifier.Identifier.
GetLocation
(), flags,
Syntax\SyntaxNodeFactories.vb (1)
142
''' the <see cref="SyntaxToken.
GetLocation
"/> API may yield surprising results for
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (4)
VisualBasicAddAccessibilityModifiersDiagnosticAnalyzer.vb (1)
64
name.
GetLocation
(),
VisualBasicRemoveUnnecessaryByValDiagnosticAnalyzer.vb (1)
29
syntaxContext.ReportDiagnostic(Diagnostic.Create(Descriptor, modifier.
GetLocation
(), additionalLocations:={parameterSyntax.GetLocation()}))
VisualBasicSemanticFacts.vb (1)
65
Dim location = token.
GetLocation
()
VisualBasicUseIsNotDiagnosticAnalyzer.vb (1)
73
isKeyword.
GetLocation
(),
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures.UnitTests (12)
Diagnostics\Suppression\SuppressionTests.vb (12)
711
context.ReportDiagnostic(Diagnostic.Create(_descriptor, classDecl.Identifier.
GetLocation
()))
784
context.ReportDiagnostic(Diagnostic.Create(_descriptor, classDecl.Identifier.
GetLocation
()))
828
context.ReportDiagnostic(Diagnostic.Create(_descriptor, classDecl.Identifier.
GetLocation
()))
892
context.ReportDiagnostic(Diagnostic.Create(_descriptor, classDecl.Identifier.
GetLocation
()))
1012
context.ReportDiagnostic(Diagnostic.Create(_descriptor, classDecl.Identifier.
GetLocation
()))
1022
context.ReportDiagnostic(Diagnostic.Create(_descriptor, method.Identifier.
GetLocation
()))
1027
context.ReportDiagnostic(Diagnostic.Create(_descriptor, p.Identifier.
GetLocation
()))
1037
context.ReportDiagnostic(Diagnostic.Create(_descriptor, e.Identifier.
GetLocation
()))
1728
context.ReportDiagnostic(Diagnostic.Create(_descriptor, classDecl.Identifier.
GetLocation
()))
1738
context.ReportDiagnostic(Diagnostic.Create(_descriptor, method.Identifier.
GetLocation
()))
1743
context.ReportDiagnostic(Diagnostic.Create(_descriptor, p.Identifier.
GetLocation
()))
1753
context.ReportDiagnostic(Diagnostic.Create(_descriptor, e.Identifier.
GetLocation
()))
Microsoft.CodeAnalysis.VisualBasic.ExpressionEvaluator.ExpressionCompiler (1)
Binders\PlaceholderLocalBinder.vb (1)
84
diagnostics.Add(ERRID.ERR_IllegalChar, identifier.
GetLocation
())
Microsoft.CodeAnalysis.VisualBasic.Features (5)
CodeFixes\MoveToTopOfFile\MoveToTopOfFileCodeFixProvider.MoveToLineCodeAction.vb (1)
36
Dim lineToMove = _token.
GetLocation
().GetLineSpan().StartLinePosition.Line
Completion\CompletionProviders\ObjectInitializerCompletionProvider.vb (1)
93
Dim initializerLocation As Location = token.
GetLocation
()
VisualBasicAddAccessibilityModifiersDiagnosticAnalyzer.vb (1)
64
name.
GetLocation
(),
VisualBasicRemoveUnnecessaryByValDiagnosticAnalyzer.vb (1)
29
syntaxContext.ReportDiagnostic(Diagnostic.Create(Descriptor, modifier.
GetLocation
(), additionalLocations:={parameterSyntax.GetLocation()}))
VisualBasicUseIsNotDiagnosticAnalyzer.vb (1)
73
isKeyword.
GetLocation
(),
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (1)
Diagnostics\DiagnosticAnalyzerTests.vb (1)
366
location = DirectCast(context.Node, ClassBlockSyntax).BlockStatement.Identifier.
GetLocation
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (15)
SymbolsTests\AnonymousTypes\AnonymousTypesSemanticsTests.vb (15)
153
Assert.Equal(localType.Locations(0), anonObjectCreation.NewKeyword.
GetLocation
())
252
tree.GetRoot().FindToken(select1).
GetLocation
,
255
tree.GetRoot().FindToken(x2 - 2).
GetLocation
(),
256
tree.GetRoot().FindToken(y4 - 2).
GetLocation
())
262
tree.GetRoot().FindToken(select2).
GetLocation
,
265
tree.GetRoot().FindToken(x5 - 2).
GetLocation
(),
266
tree.GetRoot().FindToken(y5 - 2).
GetLocation
())
326
tree.GetRoot().FindToken(x1 - 2).
GetLocation
(),
327
tree.GetRoot().FindToken(y1 - 2).
GetLocation
())
336
tree.GetRoot().FindToken(x2 - 2).
GetLocation
(),
337
tree.GetRoot().FindToken(y2 - 2).
GetLocation
())
393
tree.GetRoot().FindToken(x1 - 2).
GetLocation
(),
394
tree.GetRoot().FindToken(y1 - 2).
GetLocation
())
404
tree.GetRoot().FindToken(x2 - 2).
GetLocation
(),
405
tree.GetRoot().FindToken(y2 - 2).
GetLocation
())
Microsoft.CodeAnalysis.VisualBasic.Workspaces (7)
Rename\VisualBasicRenameRewriterLanguageService.vb (6)
383
If Me._renameRenamableSymbolDeclaration IsNot Nothing AndAlso _renamableDeclarationLocation = token.
GetLocation
() Then
709
conflicts.AddRange(visitor.ConflictingTokens.Select(Function(t) t.
GetLocation
()) _
725
conflicts.AddRange(visitor.ConflictingTokens.Select(Function(t) t.
GetLocation
()) _
753
conflicts.AddRange(visitor.ConflictingTokens.Select(Function(t) t.
GetLocation
()) _
777
conflicts.Add(reverseMappedLocations(typeParameter.Identifier.
GetLocation
()))
791
conflicts.Add(reverseMappedLocations(typeParameterToken.
GetLocation
()))
VisualBasicSemanticFacts.vb (1)
65
Dim location = token.
GetLocation
()
Microsoft.CodeAnalysis.Workspaces (7)
FindSymbols\FindReferences\Finders\AbstractReferenceFinder.cs (5)
216
token.
GetLocation
(),
416
var location = node.GetFirstToken().
GetLocation
();
454
var location = expression.GetFirstToken().
GetLocation
();
521
var location = node.GetFirstToken().
GetLocation
();
552
var location = node.GetFirstToken().
GetLocation
();
FindSymbols\FindReferences\Finders\AbstractReferenceFinder_GlobalSuppressions.cs (1)
234
var containingStringLocation = token.
GetLocation
();
FindSymbols\FindReferences\Finders\ConstructorSymbolReferenceFinder.cs (1)
241
var location = node.GetFirstToken().
GetLocation
();
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
BatchFixAllProviderTests.cs (1)
74
context.ReportDiagnostic(Diagnostic.Create(Descriptor, node.Token.
GetLocation
()));