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