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)
289Debug.Assert(span.End == switchExpression.CloseBraceToken.Span.End);
331=> position < node.OpenBraceToken.Span.End ? BlockPart.OpenBrace : BlockPart.CloseBrace;
336BlockPart.OpenBrace => node.OpenBraceToken.Span,
337BlockPart.CloseBrace => node.CloseBraceToken.Span,
350ForEachPart.ForEach => node.ForEachKeyword.Span,
351ForEachPart.VariableDeclaration => TextSpan.FromBounds(node.Type.SpanStart, node.Identifier.Span.End),
352ForEachPart.In => node.InKeyword.Span,
360ForEachPart.ForEach => node.ForEachKeyword.Span,
362ForEachPart.In => node.InKeyword.Span,
371SwitchExpressionPart.SwitchBody => TextSpan.FromBounds(node.SwitchKeyword.SpanStart, node.CloseBraceToken.Span.End),
601=> BreakpointSpans.TryGetClosestBreakpointSpan(token.Parent!, token.SpanStart, minLength: token.Span.Length, out span);
1282oldTypeDeclaration.Identifier.Span != newTypeDeclaration.Identifier.Span ||
1731return typeParameter.Identifier.Span;
1764return ((BlockSyntax)node).OpenBraceToken.Span;
1768return TextSpan.FromBounds(usingStatement.UsingKeyword.SpanStart, usingStatement.CloseParenToken.Span.End);
1772return TextSpan.FromBounds(fixedStatement.FixedKeyword.SpanStart, fixedStatement.CloseParenToken.Span.End);
1776return TextSpan.FromBounds(lockStatement.LockKeyword.SpanStart, lockStatement.CloseParenToken.Span.End);
1779return ((StackAllocArrayCreationExpressionSyntax)node).StackAllocKeyword.Span;
1782return ((ImplicitStackAllocArrayCreationExpressionSyntax)node).StackAllocKeyword.Span;
1785return ((TryStatementSyntax)node).TryKeyword.Span;
1788return ((CatchClauseSyntax)node).CatchKeyword.Span;
1795return ((FinallyClauseSyntax)node).FinallyKeyword.Span;
1799return TextSpan.FromBounds(ifStatement.IfKeyword.SpanStart, ifStatement.CloseParenToken.Span.End);
1802return ((ElseClauseSyntax)node).ElseKeyword.Span;
1807(switchStatement.CloseParenToken != default) ? switchStatement.CloseParenToken.Span.End : switchStatement.Expression.Span.End);
1814return TextSpan.FromBounds(whileStatement.WhileKeyword.SpanStart, whileStatement.CloseParenToken.Span.End);
1817return ((DoStatementSyntax)node).DoKeyword.Span;
1821return TextSpan.FromBounds(forStatement.ForKeyword.SpanStart, forStatement.CloseParenToken.Span.End);
1827(commonForEachStatement.AwaitKeyword.Span.Length > 0) ? commonForEachStatement.AwaitKeyword.SpanStart : commonForEachStatement.ForEachKeyword.SpanStart,
1828commonForEachStatement.CloseParenToken.Span.End);
1831return ((LabeledStatementSyntax)node).Identifier.Span;
1835return ((CheckedStatementSyntax)node).Keyword.Span;
1838return ((UnsafeStatementSyntax)node).UnsafeKeyword.Span;
1842return lfd.Identifier.Span;
1859return CombineSpans(localDeclarationStatement.AwaitKeyword.Span, localDeclarationStatement.UsingKeyword.Span, node.Span);
1862return ((AwaitExpressionSyntax)node).AwaitKeyword.Span;
1865return ((AnonymousObjectCreationExpressionSyntax)node).NewKeyword.Span;
1875return ((AnonymousMethodExpressionSyntax)node).DelegateKeyword.Span;
1878return ((QueryExpressionSyntax)node).FromClause.FromKeyword.Span;
1885return ((QueryContinuationSyntax)node).IntoKeyword.Span;
1888return ((FromClauseSyntax)node).FromKeyword.Span;
1891return ((JoinClauseSyntax)node).JoinKeyword.Span;
1894return ((JoinIntoClauseSyntax)node).IntoKeyword.Span;
1897return ((LetClauseSyntax)node).LetKeyword.Span;
1900return ((WhereClauseSyntax)node).WhereKeyword.Span;
1903return ((OrderByClauseSyntax)node).OrderByKeyword.Span;
1910return ((SelectClauseSyntax)node).SelectKeyword.Span;
1913return ((GroupClauseSyntax)node).GroupKeyword.Span;
1929return ((SwitchExpressionSyntax)node).SwitchKeyword.Span;
1932return ((SwitchExpressionArmSyntax)node).EqualsGreaterThanToken.Span;
1952return ((ParenthesizedLambdaExpressionSyntax)lambda).ParameterList.Parameters[ordinal].Identifier.Span;
1956return ((SimpleLambdaExpressionSyntax)lambda).Parameter.Identifier.Span;
1960return ((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)
212var shouldCheckTrivia = _stringAndCommentTextSpans.ContainsKey(token.Span);
337AddModifiedSpan(annotation.OriginalSpan, newToken.Span);
348var symbols = RenameUtilities.GetSymbolsTouchingPosition(token.Span.Start, _semanticModel, _solution.Services, _cancellationToken);
351var prefix = isRenameLocation && _renameLocations[token.Span].IsRenamableAccessor
388var oldSpan = token.Span;
391AddModifiedSpan(oldSpan, newToken.Span);
407token.Span,
417newToken = _renameAnnotations.WithAdditionalAnnotations(newToken, renameAnnotation, new RenameTokenSimplificationAnnotation() { OriginalTextSpan = token.Span });
484identifierToken.Span,
521return _renameLocations.ContainsKey(token.Span);
641var oldSpan = oldToken.Span;
643AddModifiedSpan(oldSpan, newToken.Span);
683!_stringAndCommentTextSpans.TryGetValue(oldToken.Span, out subSpansToReplace)))
710newToken = newToken.CopyAnnotationsTo(_renameAnnotations.WithAdditionalAnnotations(newIdentifierToken, new RenameTokenSimplificationAnnotation() { OriginalTextSpan = oldToken.Span }));
711AddModifiedSpan(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)
332Return BreakpointSpans.TryGetClosestBreakpointSpan(token.Parent, token.SpanStart, minLength:=token.Span.Length, span)
1179Return DirectCast(node, TypeParameterSyntax).Identifier.Span
1218Return DirectCast(node, SingleLineElseClauseSyntax).ElseKeyword.Span
1221Return DirectCast(node, TryBlockSyntax).TryStatement.TryKeyword.Span
1224Return DirectCast(node, CatchBlockSyntax).CatchStatement.CatchKeyword.Span
1227Return DirectCast(node, FinallyBlockSyntax).FinallyStatement.FinallyKeyword.Span
1253Return DirectCast(node, AwaitExpressionSyntax).AwaitKeyword.Span
1257Return TextSpan.FromBounds(newWith.NewKeyword.Span.Start,
1258newWith.Initializer.WithKeyword.Span.End)
1270Return DirectCast(node, WhereClauseSyntax).WhereKeyword.Span
1273Return DirectCast(node, SelectClauseSyntax).SelectKeyword.Span
1276Return DirectCast(node, FromClauseSyntax).FromKeyword.Span
1279Return DirectCast(node, AggregateClauseSyntax).AggregateKeyword.Span
1282Return DirectCast(node, LetClauseSyntax).LetKeyword.Span
1285Return DirectCast(node, SimpleJoinClauseSyntax).JoinKeyword.Span
1289Return TextSpan.FromBounds(groupJoin.GroupKeyword.SpanStart, groupJoin.JoinKeyword.Span.End)
1292Return DirectCast(node, GroupByClauseSyntax).GroupKeyword.Span
1304Return TextSpan.FromBounds(partition.SkipOrTakeKeyword.SpanStart, partition.WhileKeyword.Span.End)
1311Return DirectCast(node, JoinConditionSyntax).EqualsKeyword.Span
1319Return TextSpan.FromBounds(ifKeyword.Span.Start,
1320If(thenKeywordOpt.RawKind <> 0, thenKeywordOpt.Span.End, condition.Span.End))
1399Return TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End)
1412Return TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End)