src\Analyzers\CSharp\CodeFixes\NewLines\ArrowExpressionClausePlacement\ArrowExpressionClausePlacementCodeFixProvider.cs (1)
82var end = token.Span.End;
src\Analyzers\CSharp\CodeFixes\NewLines\ConditionalExpressionPlacement\ConditionalExpressionPlacementCodeFixProvider.cs (1)
84var end = token.Span.End;
CodeLens\CSharpCodeLensMemberFinder.cs (14)
45_memberBuilder.Add(new CodeLensMember(node, node.Identifier.Span));
51_memberBuilder.Add(new CodeLensMember(node, node.Identifier.Span));
57_memberBuilder.Add(new CodeLensMember(node, node.Identifier.Span));
63_memberBuilder.Add(new CodeLensMember(node, node.Identifier.Span));
68_memberBuilder.Add(new CodeLensMember(node, node.Identifier.Span));
73_memberBuilder.Add(new CodeLensMember(node, node.Identifier.Span));
79_memberBuilder.Add(new CodeLensMember(node, node.Identifier.Span));
84_memberBuilder.Add(new CodeLensMember(node, node.Identifier.Span));
90_memberBuilder.Add(new CodeLensMember(node, node.Identifier.Span));
95_memberBuilder.Add(new CodeLensMember(node, node.Identifier.Span));
102_memberBuilder.Add(new CodeLensMember(variable, variable.Identifier.Span));
110_memberBuilder.Add(new CodeLensMember(variable, variable.Identifier.Span));
116_memberBuilder.Add(new CodeLensMember(node, node.Identifier.Span));
121_memberBuilder.Add(new CodeLensMember(node, node.Identifier.Span));
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (55)
281Debug.Assert(span.End == switchExpression.CloseBraceToken.Span.End);
323=> position < node.OpenBraceToken.Span.End ? BlockPart.OpenBrace : BlockPart.CloseBrace;
328BlockPart.OpenBrace => node.OpenBraceToken.Span,
329BlockPart.CloseBrace => node.CloseBraceToken.Span,
342ForEachPart.ForEach => node.ForEachKeyword.Span,
343ForEachPart.VariableDeclaration => TextSpan.FromBounds(node.Type.SpanStart, node.Identifier.Span.End),
344ForEachPart.In => node.InKeyword.Span,
352ForEachPart.ForEach => node.ForEachKeyword.Span,
354ForEachPart.In => node.InKeyword.Span,
363SwitchExpressionPart.SwitchBody => TextSpan.FromBounds(node.SwitchKeyword.SpanStart, node.CloseBraceToken.Span.End),
593=> BreakpointSpans.TryGetClosestBreakpointSpan(token.Parent!, token.SpanStart, minLength: token.Span.Length, out span);
1274oldTypeDeclaration.Identifier.Span != newTypeDeclaration.Identifier.Span ||
1723return typeParameter.Identifier.Span;
1756return ((BlockSyntax)node).OpenBraceToken.Span;
1760return TextSpan.FromBounds(usingStatement.UsingKeyword.SpanStart, usingStatement.CloseParenToken.Span.End);
1764return TextSpan.FromBounds(fixedStatement.FixedKeyword.SpanStart, fixedStatement.CloseParenToken.Span.End);
1768return TextSpan.FromBounds(lockStatement.LockKeyword.SpanStart, lockStatement.CloseParenToken.Span.End);
1771return ((StackAllocArrayCreationExpressionSyntax)node).StackAllocKeyword.Span;
1774return ((ImplicitStackAllocArrayCreationExpressionSyntax)node).StackAllocKeyword.Span;
1777return ((TryStatementSyntax)node).TryKeyword.Span;
1780return ((CatchClauseSyntax)node).CatchKeyword.Span;
1787return ((FinallyClauseSyntax)node).FinallyKeyword.Span;
1791return TextSpan.FromBounds(ifStatement.IfKeyword.SpanStart, ifStatement.CloseParenToken.Span.End);
1794return ((ElseClauseSyntax)node).ElseKeyword.Span;
1799(switchStatement.CloseParenToken != default) ? switchStatement.CloseParenToken.Span.End : switchStatement.Expression.Span.End);
1806return TextSpan.FromBounds(whileStatement.WhileKeyword.SpanStart, whileStatement.CloseParenToken.Span.End);
1809return ((DoStatementSyntax)node).DoKeyword.Span;
1813return TextSpan.FromBounds(forStatement.ForKeyword.SpanStart, forStatement.CloseParenToken.Span.End);
1819(commonForEachStatement.AwaitKeyword.Span.Length > 0) ? commonForEachStatement.AwaitKeyword.SpanStart : commonForEachStatement.ForEachKeyword.SpanStart,
1820commonForEachStatement.CloseParenToken.Span.End);
1823return ((LabeledStatementSyntax)node).Identifier.Span;
1827return ((CheckedStatementSyntax)node).Keyword.Span;
1830return ((UnsafeStatementSyntax)node).UnsafeKeyword.Span;
1834return lfd.Identifier.Span;
1851return CombineSpans(localDeclarationStatement.AwaitKeyword.Span, localDeclarationStatement.UsingKeyword.Span, node.Span);
1854return ((AwaitExpressionSyntax)node).AwaitKeyword.Span;
1857return ((AnonymousObjectCreationExpressionSyntax)node).NewKeyword.Span;
1867return ((AnonymousMethodExpressionSyntax)node).DelegateKeyword.Span;
1870return ((QueryExpressionSyntax)node).FromClause.FromKeyword.Span;
1877return ((QueryContinuationSyntax)node).IntoKeyword.Span;
1880return ((FromClauseSyntax)node).FromKeyword.Span;
1883return ((JoinClauseSyntax)node).JoinKeyword.Span;
1886return ((JoinIntoClauseSyntax)node).IntoKeyword.Span;
1889return ((LetClauseSyntax)node).LetKeyword.Span;
1892return ((WhereClauseSyntax)node).WhereKeyword.Span;
1895return ((OrderByClauseSyntax)node).OrderByKeyword.Span;
1902return ((SelectClauseSyntax)node).SelectKeyword.Span;
1905return ((GroupClauseSyntax)node).GroupKeyword.Span;
1921return ((SwitchExpressionSyntax)node).SwitchKeyword.Span;
1924return ((SwitchExpressionArmSyntax)node).EqualsGreaterThanToken.Span;
1944return ((ParenthesizedLambdaExpressionSyntax)lambda).ParameterList.Parameters[ordinal].Identifier.Span;
1948return ((SimpleLambdaExpressionSyntax)lambda).Parameter.Identifier.Span;
1952return ((AnonymousMethodExpressionSyntax)lambda).ParameterList!.Parameters[ordinal].Identifier.Span;
src\Analyzers\CSharp\CodeFixes\NewLines\ArrowExpressionClausePlacement\ArrowExpressionClausePlacementCodeFixProvider.cs (1)
82var end = token.Span.End;
src\Analyzers\CSharp\CodeFixes\NewLines\ConditionalExpressionPlacement\ConditionalExpressionPlacementCodeFixProvider.cs (1)
84var end = token.Span.End;
Classification\SyntaxClassification\NameSyntaxClassifier.cs (10)
189classifiedSpan = new ClassifiedSpan(token.Span, classification);
197classifiedSpan = new ClassifiedSpan(token.Span, GetClassificationForField(fieldSymbol));
201classifiedSpan = new ClassifiedSpan(token.Span, GetClassificationForMethod(methodSymbol));
205classifiedSpan = new ClassifiedSpan(token.Span, ClassificationTypeNames.PropertyName);
209classifiedSpan = new ClassifiedSpan(token.Span, ClassificationTypeNames.EventName);
218classifiedSpan = new ClassifiedSpan(token.Span, ClassificationTypeNames.ParameterName);
222classifiedSpan = new ClassifiedSpan(token.Span, GetClassificationForLocal(localSymbol));
226classifiedSpan = new ClassifiedSpan(token.Span, ClassificationTypeNames.LabelName);
294result.Add(new ClassifiedSpan(token.Span, ClassificationTypeNames.Keyword));
309result.Add(new ClassifiedSpan(name.Identifier.Span, ClassificationTypeNames.Keyword));
FindSymbols\CSharpDeclaredSymbolInfoFactoryService.cs (12)
195localFunction.Identifier.Span,
239typeDeclaration.Identifier.Span,
261enumDeclaration.Identifier.Span,
289ctorDecl.Identifier.Span,
305delegateDecl.Identifier.Span,
319enumMember.Identifier.Span,
333eventDecl.Identifier.Span,
347indexerDecl.ThisKeyword.Span,
362method.Identifier.Span,
378property.Identifier.Span,
401variableDeclarator.Identifier.Span,
451parameter.Identifier.Span,
Rename\CSharpRenameRewriterLanguageService.cs (16)
209var shouldCheckTrivia = _stringAndCommentTextSpans.ContainsKey(token.Span);
334AddModifiedSpan(annotation.OriginalSpan, newToken.Span);
345var symbols = RenameUtilities.GetSymbolsTouchingPosition(token.Span.Start, _semanticModel, _solution.Services, _cancellationToken);
348var prefix = isRenameLocation && _renameLocations[token.Span].IsRenamableAccessor
385var oldSpan = token.Span;
388AddModifiedSpan(oldSpan, newToken.Span);
404token.Span,
414newToken = _renameAnnotations.WithAdditionalAnnotations(newToken, renameAnnotation, new RenameTokenSimplificationAnnotation() { OriginalTextSpan = token.Span });
481identifierToken.Span,
518return _renameLocations.ContainsKey(token.Span);
638var oldSpan = oldToken.Span;
640AddModifiedSpan(oldSpan, newToken.Span);
680!_stringAndCommentTextSpans.TryGetValue(oldToken.Span, out subSpansToReplace)))
707newToken = newToken.CopyAnnotationsTo(_renameAnnotations.WithAdditionalAnnotations(newIdentifierToken, new RenameTokenSimplificationAnnotation() { OriginalTextSpan = oldToken.Span }));
708AddModifiedSpan(oldToken.Span, newToken.Span);
CodeLens\VisualBasicCodeLensMemberFinder.vb (12)
44_memberBuilder.Add(New CodeLensMember(node, node.Identifier.Span))
49_memberBuilder.Add(New CodeLensMember(node, node.Identifier.Span))
54_memberBuilder.Add(New CodeLensMember(node, node.Identifier.Span))
59_memberBuilder.Add(New CodeLensMember(node, node.Identifier.Span))
63_memberBuilder.Add(New CodeLensMember(node, node.Identifier.Span))
67_memberBuilder.Add(New CodeLensMember(node, node.Identifier.Span))
72_memberBuilder.Add(New CodeLensMember(node, node.NewKeyword.Span))
76_memberBuilder.Add(New CodeLensMember(node, node.Identifier.Span))
81_memberBuilder.Add(New CodeLensMember(node, node.Identifier.Span))
85_memberBuilder.Add(New CodeLensMember(node, node.Identifier.Span))
91_memberBuilder.Add(New CodeLensMember(name, name.Identifier.Span))
97_memberBuilder.Add(New CodeLensMember(node, node.Identifier.Span))
EditAndContinue\VisualBasicEditAndContinueAnalyzer.vb (23)
319Return BreakpointSpans.TryGetClosestBreakpointSpan(token.Parent, token.SpanStart, minLength:=token.Span.Length, span)
1166Return DirectCast(node, TypeParameterSyntax).Identifier.Span
1205Return DirectCast(node, SingleLineElseClauseSyntax).ElseKeyword.Span
1208Return DirectCast(node, TryBlockSyntax).TryStatement.TryKeyword.Span
1211Return DirectCast(node, CatchBlockSyntax).CatchStatement.CatchKeyword.Span
1214Return DirectCast(node, FinallyBlockSyntax).FinallyStatement.FinallyKeyword.Span
1240Return DirectCast(node, AwaitExpressionSyntax).AwaitKeyword.Span
1244Return TextSpan.FromBounds(newWith.NewKeyword.Span.Start,
1245newWith.Initializer.WithKeyword.Span.End)
1257Return DirectCast(node, WhereClauseSyntax).WhereKeyword.Span
1260Return DirectCast(node, SelectClauseSyntax).SelectKeyword.Span
1263Return DirectCast(node, FromClauseSyntax).FromKeyword.Span
1266Return DirectCast(node, AggregateClauseSyntax).AggregateKeyword.Span
1269Return DirectCast(node, LetClauseSyntax).LetKeyword.Span
1272Return DirectCast(node, SimpleJoinClauseSyntax).JoinKeyword.Span
1276Return TextSpan.FromBounds(groupJoin.GroupKeyword.SpanStart, groupJoin.JoinKeyword.Span.End)
1279Return DirectCast(node, GroupByClauseSyntax).GroupKeyword.Span
1291Return TextSpan.FromBounds(partition.SkipOrTakeKeyword.SpanStart, partition.WhileKeyword.Span.End)
1298Return DirectCast(node, JoinConditionSyntax).EqualsKeyword.Span
1306Return TextSpan.FromBounds(ifKeyword.Span.Start,
1307If(thenKeywordOpt.RawKind <> 0, thenKeywordOpt.Span.End, condition.Span.End))
1386Return TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End)
1399Return TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End)