1589 references to End
AnalyzerRunner (1)
DiagnosticAnalyzerRunner.cs (1)
207.ThenBy(tuple => tuple.Item2.Location.SourceSpan.End);
Microsoft.AspNetCore.App.Analyzers (25)
Infrastructure\EmbeddedSyntax\EmbeddedSyntaxHelpers.cs (1)
26=> TextSpan.FromBounds(firstChar.Span.Start, lastChar.Span.End);
Infrastructure\EmbeddedSyntax\EmbeddedSyntaxNode.cs (2)
81return span.Value.End; 103end = Math.Max(token.VirtualChars.Last().Span.End, end);
Infrastructure\EmbeddedSyntax\EmbeddedSyntaxToken.cs (1)
69var end = VirtualChars.Length == 0 ? int.MinValue : VirtualChars[VirtualChars.Length - 1].Span.End;
Infrastructure\RoutePattern\RoutePatternLexer.cs (1)
68=> TextSpan.FromBounds(Text[startInclusive].Span.Start, Text[endExclusive - 1].Span.End);
Infrastructure\RoutePattern\RoutePatternParser.cs (1)
620? new TextSpan(_lexer.Text.Last().Span.End, 0)
Infrastructure\VirtualChars\AbstractVirtualCharService.cs (6)
95Debug.Assert(currentVC.Span.End <= nextVC.Span.Start, "Virtual character spans have to be ordered."); 104Debug.Assert(currentVC.Span.End == nextVC.Span.Start, "Virtual character spans have to be touching."); 114Debug.Assert(lastVC.Span.End == token.Span.End - "\"".Length, "Last span has to end right before the end of the string token."); 118Debug.Assert(lastVC.Span.End == token.Span.End - "\"u8".Length, "Last span has to end right before the end of the string token.");
Infrastructure\VirtualChars\CSharpVirtualCharService.cs (3)
200var indentationLength = parentSourceText.Lines.GetLineFromPosition(parentExpression.Span.End).GetFirstNonWhitespaceOffset() ?? 0; 227: lineSpan.End; 334runeResults.Add(VirtualChar.Create(rune, TextSpan.FromBounds(span.Start, nextSpan.End)));
Infrastructure\VirtualChars\VirtualCharSequence.Chunks.cs (2)
54if (position < _array[0].Span.Start || position >= _array[_array.Count - 1].Span.End) 65if (position >= ch.Span.End)
Infrastructure\VirtualChars\VirtualCharSequence.cs (3)
61if (span.End > sequence.Length) 215Debug.Assert(_span.End == virtualChars._span.Start); 229TextSpan.FromBounds(chars1._span.Start, chars2._span.End));
RouteEmbeddedLanguage\FrameworkParametersCompletionProvider.cs (1)
518? parentOpt.Value.GetLocation().SourceSpan.End
RouteEmbeddedLanguage\Infrastructure\SyntaxNodeExtensions.cs (2)
98else if (token.Span.End < position) 119return position < root.FullSpan.End || !(root is ICompilationUnitSyntax)
RouteEmbeddedLanguage\RoutePatternCompletionProvider.cs (2)
103context.Position >= stringToken.Span.End) 364? parentOpt.GetSpan().End
Microsoft.AspNetCore.App.Analyzers.Test (1)
RouteEmbeddedLanguage\Infrastructure\CompletionTestHelpers.cs (1)
27Assert.Equal(cursorPosition, results.CompletionListSpan.End);
Microsoft.CodeAnalysis (59)
DiagnosticAnalyzer\AnalysisContextInfo.cs (1)
135lastEnd = token.Span.End;
DiagnosticAnalyzer\DiagnosticAnalysisContextHelpers.cs (1)
102if (location.SourceSpan.End > location.SourceTree.Length)
Syntax\LineDirectiveMap.cs (1)
52var unmappedEndPos = sourceText.Lines.GetLinePosition(span.End);
Syntax\SyntaxDiffer.cs (5)
568int start = _oldNodes.Count > 0 ? _oldNodes.Peek().Position : _oldSpan.End; 577if (last.Range.Span.End == change.Range.Span.Start) 587Debug.Assert(change.Range.Span.Start >= last.Range.Span.End); 598if (last.Range.Span.End == textChangeRange.Span.Start) 610Debug.Assert(textChangeRange.Span.Start >= last.Range.Span.End);
Syntax\SyntaxList`1.cs (2)
167return TextSpan.FromBounds(this[0].FullSpan.Start, this[this.Count - 1].FullSpan.End); 185return TextSpan.FromBounds(this[0].Span.Start, this[this.Count - 1].Span.End);
Syntax\SyntaxNode.cs (1)
1539else if (position >= span.End && token.HasTrailingTrivia)
Text\ChangedText.cs (2)
52if (change.Span.End > oldText.Length) 55position = change.Span.End;
Text\LargeText.cs (1)
184if (span.Start < 0 || span.Start > _length || span.End > _length)
Text\SourceText.cs (7)
488Debug.Assert(0 <= span.Start && span.Start <= span.End); 490if (span.End > this.Length) 557int end = span.End; 726int length = Math.Min(span.End, this.Length) - position; 768if (change.Span.End > this.Length) 777if (change.Span.End <= changeRanges.Last().Span.Start) 808position = change.Span.End;
Text\StringBuilderText.cs (1)
80if (span.End > _builder.Length)
Text\StringText.cs (2)
73if (span.End > this.Source.Length) 93if (span.Start == 0 && span.End == this.Length)
Text\SubText.cs (6)
27|| span.End < 0 28|| span.End > text.Length) 114var endLineInUnderlyingText = _subText.UnderlyingText.Lines.GetLineFromPosition(_subText.UnderlyingSpan.End); 127var underlyingSpanEnd = _subText.UnderlyingSpan.End; 154return TextLine.FromSpanUnsafe(_subText, new TextSpan(_subText.UnderlyingSpan.End, 0)); 174var endInUnderlyingText = Math.Min(underlyingTextLine.EndIncludingLineBreak, _subText.UnderlyingSpan.End);
Text\TextChangeRange.cs (2)
114if (change.Span.End > end) 116end = change.Span.End;
Text\TextChangeRangeExtensions.cs (5)
39var currentOldEnd = accumulatedTextChangeSoFar.Value.Span.End; 78if (currentNewEnd > newChange.Span.End) 96currentOldEnd = currentOldEnd + newChange.Span.End - currentNewEnd; 388if (last.Span.End == change.Span.Start) 394else if (last.Span.End > change.Span.Start)
Text\TextLine.cs (10)
41if (span.Start > text.Length || span.Start < 0 || span.End > text.Length) 55if (span.End > span.Start) 57endIncludesLineBreak = TextUtilities.IsAnyLineBreakCharacter(text[span.End - 1]); 60if (!endIncludesLineBreak && span.End < text.Length) 62var lineBreakLen = TextUtilities.GetLengthOfLineBreak(text, span.End); 72if (span.End < text.Length && !endIncludesLineBreak) 77return new TextLine(text, span.Start, span.End); 91Debug.Assert(span.End == text.Length || TextUtilities.IsAnyLineBreakCharacter(text[span.End - 1])); 93return new TextLine(text, span.Start, span.End);
Text\TextLineCollection.cs (1)
57return new LinePositionSpan(GetLinePosition(span.Start), GetLinePosition(span.End));
Text\TextSpan.cs (11)
86return span.Start >= Start && span.End <= this.End; 103int overlapEnd = Math.Min(this.End, span.End); 120int overlapEnd = Math.Min(this.End, span.End); 140return span.Start <= this.End && span.End >= Start; 171int intersectEnd = Math.Min(this.End, span.End); 245return $"[{Start}..{End})";
Microsoft.CodeAnalysis.CodeStyle (197)
src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderHelper.cs (3)
64fileHeaderEnd = trivia.FullSpan.End; 87fileHeaderEnd = trivia.FullSpan.End; 104missingHeaderOffset = trivia.FullSpan.End;
src\Analyzers\Core\Analyzers\OrderModifiers\AbstractOrderModifiersDiagnosticAnalyzer.cs (1)
82context.Tree.GetLocation(TextSpan.FromBounds(modifiers.First().SpanStart, modifiers.Last().Span.End)),
src\Analyzers\Core\Analyzers\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (2)
181var end = node.Span.End; 185end = trivia.Span.End;
src\Analyzers\Core\Analyzers\RemoveUnnecessaryParentheses\AbstractRemoveUnnecessaryParenthesesDiagnosticAnalyzer.cs (2)
134var textSpanEndPosition = Math.Min(parenthesizedExpressionLocation.SourceSpan.End, expressionFirstLine.Span.End);
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (1)
565if (pragma.Span.End <= diagnostic.Location.SourceSpan.Start)
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationHelpers.cs (1)
188: TextSpan.FromBounds(sequence.First().Span.Start, sequence.Last().Span.End);
src\Analyzers\Core\Analyzers\SimplifyTypeNames\SimplifyTypeNamesDiagnosticAnalyzerBase.cs (1)
256if (intervalTree.HasIntervalThatOverlapsWith(span.Start, span.End))
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UseCollectionInitializerHelpers.cs (4)
37syntaxTree.GetLocation(TextSpan.FromBounds(arguments.Last().FullSpan.End, match.Span.End))); 49syntaxTree.GetLocation(TextSpan.FromBounds(expression.FullSpan.End, match.Span.End)));
src\Analyzers\Core\Analyzers\UseObjectInitializer\AbstractUseObjectInitializerDiagnosticAnalyzer.cs (2)
148? syntaxFacts.GetOperatorTokenOfMemberAccessExpression(match.MemberAccessExpression).Span.End 149: syntaxFacts.GetExpressionOfMemberAccessExpression(match.MemberAccessExpression)!.Span.End;
src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (5)
39var currentOldEnd = accumulatedTextChangeSoFar.Value.Span.End; 78if (currentNewEnd > newChange.Span.End) 96currentOldEnd = currentOldEnd + newChange.Span.End - currentNewEnd; 388if (last.Span.End == change.Span.Start) 394else if (last.Span.End > change.Span.Start)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\ImmutableIntervalTree`1.cs (1)
227var thisEndValue = introspector.GetSpan(currentNode.Value).End;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\IntervalTreeAlgorithms`2.cs (3)
106var thisEnd = thisSpan.End; 126var thisEnd = thisSpan.End; 139var thisEnd = thisSpan.End;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\IntervalTreeHelpers.cs (2)
126introspector.GetSpan(witness.GetValue(tree, witness.GetMaxEndNode(tree, rightNode))).End >= start) 152introspector.GetSpan(witness.GetValue(tree, witness.GetMaxEndNode(tree, left))).End >= start)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\MutableIntervalTree`1.cs (1)
137=> introspector.GetSpan(value).End;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\NormalizedTextSpanCollection.cs (26)
169if (span1.End < span2.End) 173else if (span1.End == span2.End) 229if (span1.End < span2.End) 286if ((span2.Length == 0) || (span1.Start >= span2.End)) 290else if (span1.End <= span2.Start) 295Debug.Assert(lastEnd < span1.End); 296spans.Add(TextSpan.FromBounds(Math.Max(lastEnd, span1.Start), span1.End)); 310if (span1.End < span2.End) 314else if (span1.End == span2.End) 324lastEnd = span2.End; 334spans.Add(TextSpan.FromBounds(Math.Max(lastEnd, span1.Start), span1.End)); 406if (span1.End < span2.End) 410else if (span1.End == span2.End) 466if (span1.End < span2.End) 577end = span.End; 581end = Math.Max(end, span.End); 604var oldEnd = sorted[0].End; 608var newEnd = sorted[i].End;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxHelpers.cs (1)
19=> TextSpan.FromBounds(firstChar.Span.Start, lastChar.Span.End);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxNode.cs (2)
98return span.Value.End; 119end = Math.Max(token.VirtualChars.Last().Span.End, end);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxToken.cs (3)
87Math.Max(LeadingTrivia.Length == 0 ? int.MinValue : LeadingTrivia[^1].GetSpan().End, 88Math.Max(VirtualChars.Length == 0 ? int.MinValue : VirtualChars[^1].Span.End, 89TrailingTrivia.Length == 0 ? int.MinValue : TrailingTrivia[^1].GetSpan().End));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (6)
99Debug.Assert(currentVC.Span.End <= nextVC.Span.Start, "Virtual character spans have to be ordered."); 108Debug.Assert(currentVC.Span.End == nextVC.Span.Start, "Virtual character spans have to be touching."); 118Debug.Assert(lastVC.Span.End == token.Span.End - "\"".Length, "Last span has to end right before the end of the string token."); 122Debug.Assert(lastVC.Span.End == token.Span.End - "\"u8".Length, "Last span has to end right before the end of the string token.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.cs (3)
59if (span.End > sequence.Length) 197Debug.Assert(_span.End == virtualChars._span.Start); 211TextSpan.FromBounds(chars1._span.Start, chars2._span.End));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SourceTextExtensions_SharedWithCodeStyle.cs (2)
49var endLineNumber = text.Lines.IndexOf(span.End); 86text.AreOnSameLine(token1.Span.End, token2.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (12)
306Math.Max(fullSpan.End, node.Span.End)); 320var start = startNode.Span.End; 420var d = x.End - y.End; 555if (token.Span.Length > 0 && position <= token.Span.End) 604return (position < root.FullSpan.End || !(root is ICompilationUnitSyntax)) 629else if (token.Span.End <= position) 638while (token.RawKind != 0 && token.Span.End <= position && token.Span.End <= root.FullSpan.End); 674else if (token.Span.End < position)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTokenExtensions.cs (1)
77previousToken.Span.End == position)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (5)
80if ((token.Span.Contains(position) || token.Span.End == position) && predicate(semanticModel, token)) 87if (token.Span.End == position && predicate(semanticModel, token)) 105var endLineNumber = text.Lines.IndexOf(span.End); 153if (token.Span.End == position) 160if (position == root.FullSpan.End)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\TextLineExtensions.cs (1)
69for (var i = line.Span.Start; i < line.Span.End; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\TextSpanExtensions.cs (8)
36if (span.End > end) 38end = span.End; 62var innerSpan = TextSpan.FromBounds(startNode.Span.Start, endNode.Span.End); 63var outerSpan = TextSpan.FromBounds(startNode.FullSpan.Start, endNode.FullSpan.End); 79var startSegmentEnd = Math.Min(span.End, except.Start); 83var endSegmentStart = Math.Max(span.Start, except.End); 84if (endSegmentStart < span.End) 85yield return TextSpan.FromBounds(endSegmentStart, span.End);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (7)
59if (token.Span.End <= operation.TextSpan.Start && 349if (operation.TextSpan.End == position && nextToken.IsMissing) 357if (operation.TextSpan.End == position && position == nextToken.SpanStart) 366if (root.FullSpan.End == position && operation.TextSpan.End == position) 374if (lastVisibleToken.Span.End <= position && operation.TextSpan.End == position)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (2)
644var spanBetweenTwoTokens = TextSpan.FromBounds(token1.SpanStart, token2.Span.End); 659var spanBetweenTwoTokens = TextSpan.FromBounds(token1.SpanStart, token2.Span.End);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.IndentationData.cs (2)
68this.InseparableRegionSpan = TextSpan.FromBounds(inseparableRegionSpanStart, textSpan.End); 82this.InseparableRegionSpan = TextSpan.FromBounds(inseparableRegionSpanStart, textSpan.End);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
69var span = TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\ContextMutableIntervalTree.cs (2)
49var thisEnd = thisSpan.End; 61var thisEnd = thisSpan.End;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (2)
339var endPosition = this.TreeData.IsLastToken(_endToken) ? this.TreeData.EndPosition : _endToken.Span.End; 458var spanBetweenTokens = TextSpan.FromBounds(token1.Span.End, token2.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.OperationApplier.cs (1)
337var spanBetweenTokens = TextSpan.FromBounds(previousToken.Token.Span.End, currentToken.Token.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormattingResult.cs (1)
78var span = TextSpan.FromBounds(token1.RawKind == 0 ? this.TreeInfo.StartPosition : token1.Span.End, token2.RawKind == 0 ? this.TreeInfo.EndPosition : token2.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenData.cs (2)
76var end = this.Token.Span.End - other.Token.Span.End;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenStream.cs (4)
87Debug.Assert(previousToken.FullSpan.End <= currentToken.FullSpan.Start); 211if (token1.Span.End > token2.SpanStart) 390Debug.Assert(token1.Token.Span.End <= token2.Token.SpanStart); 415Debug.Assert(token1.Token.Span.End <= token2.Token.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.cs (1)
66get { return this.Root.FullSpan.End; }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.NodeAndText.cs (3)
44return _text.ToString(TextSpan.FromBounds(token1.Span.End, token1.FullSpan.End)); 47return _text.ToString(TextSpan.FromBounds(token1.Span.End, token2.SpanStart));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (2)
305return TextSpan.FromBounds(firstToken.SpanStart, lastToken.Span.End); 324last = TextSpan.FromBounds(last.Start, span.End);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\BaseIndentationFormattingRule.cs (9)
131=> TextSpan.FromBounds(Math.Max(_span.Start, textSpan.Start), Math.Min(_span.End, textSpan.End)); 153token2 = root.FindTokenFromEnd(span.End); 157if (span.End < token1.Span.Start) 162if (token2.Span.End < span.Start) 174var start = token1.Span.End; 180start = token1.Span.End; 193if (token2.Span.End <= span.End)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\FormattingOperations.cs (3)
31=> CreateAnchorIndentationOperation(anchorToken, endToken, TextSpan.FromBounds(anchorToken.Span.End, endToken.Span.End)); 43=> CreateSuppressOperation(startToken, endToken, TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End), option);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\IndentBlockOperation.cs (1)
39Contract.ThrowIfFalse(baseToken.Span.End <= textSpan.Start);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (6)
206return this.Token1.Span.End; 474if (ContainsOnlyWhitespace(lastToken.Span.End, lastToken.FullSpan.End)) 502for (var i = span.Start - this.Token1.Span.End; i < span.Length; i++) 841return TextSpan.FromBounds(trivia1.FullSpan.End, this.EndPosition); 844return TextSpan.FromBounds(trivia1.FullSpan.End, trivia2.FullSpan.Start);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (3)
184for (int i = span.Start, n = span.End; i < n; i++) 197for (int i = span.Start, n = span.End; i < n; i++) 410newWords[i] = name[parts[i].Start..parts[i].End];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.WordSpanEnumerator.cs (10)
50var nextWordSeparator = _name.IndexOf(_wordSeparator, Current.End); 51if (nextWordSeparator == Current.End) 54Current = new TextSpan(Current.End + _wordSeparator.Length, 0); 61nextWordSeparator = _nameSpan.End; 65if (Current.End > _nameSpan.End) 72Current = TextSpan.FromBounds(Current.End, Math.Min(_nameSpan.End, nextWordSeparator)); 76return Current.Length > 0 && Current.End <= _nameSpan.End;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\HeaderFacts\AbstractHeaderFacts.cs (3)
48end: lastTokenOrNodeOfHeader.FullSpan.End); 94var endOfAttributeLists = attributeList.Last().Span.End; 97return Math.Min(afterAttributesToken.Span.Start, node.Span.End);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SelectedMembers\AbstractSelectedMembers.cs (2)
176position >= token.Span.End && 177text.AreOnSameLine(position, token.Span.End))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (3)
164var span = TextSpan.FromBounds(nodes.First().Span.Start, nodes.Last().Span.End); 455var endOfAttributeLists = attributeList.Last().Span.End; 458var endOfNode = node.Span.End;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (27)
31d = o2.TextSpan.End - o1.TextSpan.End; 64if (currentOne.Item1.SpanStart <= previousOne.Item2.Span.End) 67previousOne = ValueTuple.Create(previousOne.Item1, previousOne.Item2.Span.End < currentOne.Item2.Span.End ? currentOne.Item2 : previousOne.Item2); 104var endToken = (root.FullSpan.End <= textSpan.End) ? 105root.GetLastToken(includeZeroWidth: true) : root.FindToken(textSpan.End); 114if (endToken.Span.End < textSpan.End) 124Contract.ThrowIfFalse(startToken.Equals(endToken) || startToken.Span.End <= endToken.SpanStart); 143return root.FullSpan.End == startToken.SpanStart || startToken.FullSpan.End > endToken.FullSpan.Start; 158=> (token1.RawKind == 0) ? text.ToString(TextSpan.FromBounds(0, token2.SpanStart)) : text.ToString(TextSpan.FromBounds(token1.Span.End, token2.SpanStart)); 185if (token1.FullSpan.End == token2.FullSpan.Start) 193for (var token = token1.GetNextToken(includeZeroWidth: true); token.FullSpan.End <= token2.FullSpan.Start; token = token.GetNextToken(includeZeroWidth: true)) 198AppendPartialLeadingTriviaText(token2, builder, token1.TrailingTrivia.FullSpan.End); 233if (trivia.FullSpan.End <= token1FullSpanEnd) 278var backwardPosition = token.FullSpan.End; 283return token.FullSpan.End; 286Contract.ThrowIfFalse(backwardPosition < parentNode.FullSpan.End); 300return previousToken.Span.End; 318return previousToken.Span.End; 335if (position > fullSpan.End) 363var endToken = root.FindTokenFromEnd(span.End).GetNextToken(); 366var endPosition = endToken.RawKind == 0 ? root.Span.End : endToken.Span.End;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (1)
36start = span.End;
Microsoft.CodeAnalysis.CodeStyle.Fixes (17)
src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (1)
389=> text.Lines.GetLineFromPosition(position).SpanIncludingLineBreak.End;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
530var nextToken = root.FindToken(attributeToRemove.FullSpan.End + 1);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
51return TextSpan.FromBounds(start.SpanStart, end.Span.End);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (2)
221var beforeMember = declarationList.FirstOrDefault(m => m.Span.End >= info.Context.BeforeThisLocation.SourceSpan.End);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeRefactorings\AbstractRefactoringHelpersService.cs (7)
164if (tokenOnLocation.RawKind == syntaxKinds.CommaToken && location >= tokenOnLocation.Span.End) 184else if (previousToken != default && previousToken.Span.End == commaToken.Span.Start) 200var previousToken = tokenOnLocation.Span.End == location 204tokenToLeft = previousToken.Span.End == location 270var location = tokenToLeft.Span.End; 288if (leftNode.GetLastToken().Span.End != location && leftNode.Span.End != location)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeRefactorings\CodeRefactoringHelpers.cs (4)
85var endNode = node.FindToken(node.Span.End - 1).Parent; 96return beginningNode.Span.End <= selection.Start || endNode.Span.Start >= selection.End; 113var end = span.End;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
172var affectedSpan = TextSpan.FromBounds(previousToken.SpanStart, FirstStatementAffectedInInnermostBlock.Span.End);
Microsoft.CodeAnalysis.CSharp (27)
Binder\BinderFactory.BinderFactoryVisitor.cs (2)
1069if (containingNode.Kind() != SyntaxKind.CompilationUnit && _position == containingSpan.End) 1075else if (_position < containingSpan.Start || _position > containingSpan.End) //NB: > not >=
Compilation\CSharpSemanticModel.cs (4)
1275int fullEnd = this.Root.FullSpan.End; 1276bool atEOF = position == fullEnd && position == this.SyntaxTree.GetRoot().FullSpan.End; 1322if (betterPosition < node.Span.End) 1336else if (position == fullSpan.End)
FlowAnalysis\AbstractFlowPass.cs (1)
203int endLocation = lastInRegion.Syntax.Span.End;
FlowAnalysis\DefiniteAssignment.cs (1)
1217(symbol.TryGetFirstLocation() is var location && (location is null || node.Span.End < location.SourceSpan.Start)))
FlowAnalysis\RegionAnalysisContext.cs (1)
45firstInRegion.Syntax.SpanStart > lastInRegion.Syntax.Span.End;
Lowering\Instrumentation\DebugInfoInjector_SequencePoints.cs (1)
85=> nodeOrToken.AsNode(out var node) ? node.GetLastToken().Span.End : nodeOrToken.Span.End;
Parser\Blender.cs (1)
155var finalSpan = TextSpan.FromBounds(start, changeRange.Span.End);
Parser\Blender.Reader.cs (1)
129while (!_changes.IsEmpty && oldPosition >= _changes.Peek().Span.End)
Symbols\Source\SourceMemberContainerSymbol.cs (1)
1175position < group.Last().Syntax.Span.End)
Symbols\Symbol.cs (1)
456wasZeroWidthMatch = loc.SourceSpan.IsEmpty && loc.SourceSpan.End == declarationSpan.Start;
Syntax\CSharpLineDirectiveMap.cs (1)
232var unmappedEndPos = lines.GetLinePosition(span.End);
Syntax\CSharpSyntaxTree.cs (1)
647=> new(FilePath, GetLinePosition(span.Start, cancellationToken), GetLinePosition(span.End, cancellationToken));
Syntax\NullableContextStateMap.cs (1)
127if (context.Position >= span.End)
Syntax\SyntaxNodeRemover.cs (8)
71int end = span0.End; 77end = Math.Max(end, span.End); 344var span = TextSpan.FromBounds(token.Span.Start, node.Span.End); 345var fullSpan = TextSpan.FromBounds(token.FullSpan.Start, node.FullSpan.End); 378var span = TextSpan.FromBounds(node.Span.Start, token.Span.End); 379var fullSpan = TextSpan.FromBounds(node.FullSpan.Start, token.FullSpan.End); 410removedSpan = TextSpan.FromBounds(span.Start, removedSpan.End); 415removedSpan = TextSpan.FromBounds(removedSpan.Start, span.End);
Syntax\SyntaxReplacer.cs (2)
143end = span.End; 149end = Math.Max(end, span.End);
Microsoft.CodeAnalysis.CSharp.CodeStyle (69)
src\Analyzers\CSharp\Analyzers\AddBraces\CSharpAddBracesDiagnosticAnalyzer.cs (1)
133var ifStatementSpanWithoutElse = TextSpan.FromBounds(statement.Span.Start, embeddedStatement.Span.End);
src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertToBlockScopedNamespaceDiagnosticAnalyzer.cs (1)
55: declaration.SyntaxTree.GetLocation(TextSpan.FromBounds(declaration.SpanStart, declaration.SemicolonToken.Span.End));
src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertToFileScopedNamespaceDiagnosticAnalyzer.cs (1)
58: declaration.SyntaxTree.GetLocation(TextSpan.FromBounds(declaration.SpanStart, declaration.Name.Span.End));
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertProgramAnalysis_ProgramMain.cs (2)
68var start = lastPragma == default ? 0 : lastPragma.FullSpan.End; 72TextSpan.FromBounds(start, root.Members.OfType<GlobalStatementSyntax>().Last().FullSpan.End));
src\Analyzers\CSharp\Analyzers\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessAnalyzer.cs (3)
184var fadeLocation = Location.Create(tree, TextSpan.FromBounds(firstStatement.SpanStart, previousToken.Span.End)); 203if (nextToken.Span.Start < ifStatement.Span.End) 205fadeLocation = Location.Create(tree, TextSpan.FromBounds(nextToken.Span.Start, ifStatement.Span.End));
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryCast\CSharpRemoveUnnecessaryCastDiagnosticAnalyzer.cs (2)
32CastExpressionSyntax cast => TextSpan.FromBounds(cast.OpenParenToken.SpanStart, cast.CloseParenToken.Span.End), 33BinaryExpressionSyntax binary => TextSpan.FromBounds(binary.OperatorToken.SpanStart, node.Span.End),
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
225var endReportSpan = TextSpan.FromBounds(invokedExpression.Span.End, anonymousFunction.Span.End);
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveDiagnosticAnalyzer.cs (6)
127|| !possibleNullableImpactIntervalTree.HasIntervalThatOverlapsWith(currentOptionsDirective.Span.End, nullableDirectiveTrivia.SpanStart - currentOptionsDirective.Span.End)) 159|| !possibleNullableImpactIntervalTree.HasIntervalThatOverlapsWith(currentOptionsDirective.Span.End, root.Span.End - currentOptionsDirective.Span.End)) 235if (IntervalTree.HasIntervalThatOverlapsWith(span.Start, span.End))
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\NullableImpactingSpanWalker.cs (1)
47if (node.Span.End < _positionOfFirstReducingNullableDirective)
src\Analyzers\CSharp\Analyzers\RemoveUnreachableCode\CSharpRemoveUnreachableCodeDiagnosticAnalyzer.cs (1)
134var span = TextSpan.FromBounds(section[0].FullSpan.Start, section.Last().FullSpan.End);
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForArrayDiagnosticAnalyzer.cs (2)
221? arrayCreationExpression.Type.Span.End 222: ((ImplicitArrayCreationExpressionSyntax)expression).CloseBracketToken.Span.End)));
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForCreateDiagnosticAnalyzer.cs (1)
63invocationExpression.ArgumentList.OpenParenToken.Span.End)),
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs (1)
303text.Lines.GetLineFromPosition(expression.SpanStart).LineNumber + 1 == text.Lines.GetLineFromPosition(expression.Span.End).LineNumber &&
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForNewDiagnosticAnalyzer.cs (1)
88objectCreationExpression.ArgumentList.OpenParenToken.Span.End)),
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForStackAllocDiagnosticAnalyzer.cs (2)
72expression.CloseBracketToken.Span.End))); 112expression.Type.Span.End)));
src\Analyzers\CSharp\Analyzers\UseDefaultLiteral\CSharpUseDefaultLiteralDiagnosticAnalyzer.cs (1)
47var fadeSpan = TextSpan.FromBounds(defaultExpression.OpenParenToken.SpanStart, defaultExpression.CloseParenToken.Span.End);
src\Analyzers\CSharp\Analyzers\UseExpressionBodyForLambda\UseExpressionBodyForLambdaDiagnosticAnalyzer.cs (1)
105TextSpan.FromBounds(declaration.SpanStart, declaration.ArrowToken.Span.End));
src\Analyzers\CSharp\Analyzers\UseInferredMemberName\CSharpUseInferredMemberNameDiagnosticAnalyzer.cs (2)
55var fadeSpan = TextSpan.FromBounds(nameColon.Name.SpanStart, nameColon.ColonToken.Span.End); 81var fadeSpan = TextSpan.FromBounds(nameEquals.Name.SpanStart, nameEquals.EqualsToken.Span.End);
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.Analyzer.cs (2)
256if (node.SpanStart < _localStatement.Span.End) 260if (node.Span.End >= _comparison.SpanStart)
src\Analyzers\CSharp\Analyzers\UseUnboundGenericTypeInNameOf\CSharpUseUnboundGenericTypeInNameOfDiagnosticAnalyzer.cs (1)
81TextSpan.FromBounds(typeArgumentList.LessThanToken.Span.End, typeArgumentList.GreaterThanToken.Span.Start))]));
src\Analyzers\CSharp\Analyzers\UseUtf8StringLiteral\UseUtf8StringLiteralDiagnosticAnalyzer.cs (1)
124var span = TextSpan.FromBounds(elements[0].Syntax.SpanStart, elements[^1].Syntax.Span.End);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\EmbeddedLanguages\VirtualChars\CSharpVirtualCharService.cs (2)
189var indentationLength = parentSourceText.Lines.GetLineFromPosition(parentExpression.Span.End).GetFirstNonWhitespaceOffset() ?? 0; 216: lineSpan.End;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\BlockSyntaxExtensions.cs (3)
73conditionalDirectives.Last().Span.End >= block.CloseBraceToken.Span.End) 79if (conditionalDirectives.Last().Span.End <= statement.Span.Start)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
37directive.FullSpan.End == syntaxTree.GetRoot(cancellationToken).FullSpan.End;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (1)
239var name = SyntaxFactory.ParseName(syntaxTree.GetText(cancellationToken).ToString(TextSpan.FromBounds(genericIdentifier.SpanStart, lastToken.Span.End)));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs (9)
206if (position > fullSpan.Start && position < fullSpan.End) 213if (position > fullSpan.Start && position <= fullSpan.End) 232if (position > span.Start && position < span.End) 346if (position != token.Span.End) 354for (int i = token.SpanStart, n = token.Span.End; i < n; i++) 362for (int i = token.Span.End - 1, n = token.Span.Start; i >= n; i--) 416return (position > span.Start && position < span.End) 427return token.SpanStart < position && token.Span.End > position; 462return (position > span.Start && position < span.End)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\CSharpTriviaFormatter.DocumentationCommentExteriorCommentRewriter.cs (3)
75if (trivia.Span.End == currentParent.SpanStart || 76trivia.Span.End == currentParent.Span.End)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaRewriter.cs (3)
108return TextSpan.FromBounds(pair.Item1.Span.End, _node.FullSpan.End); 111return TextSpan.FromBounds(pair.Item1.Span.End, pair.Item2.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\BaseFormattingRule.cs (1)
51var endPosition = endToken.Span.End;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\IndentBlockFormattingRule.cs (5)
120TextSpan.FromBounds(lastTokenOfLabel.FullSpan.End, nextToken.SpanStart) : TextSpan.FromBounds(lastTokenOfLabel.FullSpan.End, lastTokenOfLabel.FullSpan.End)); 129span = lastSection ? span : TextSpan.FromBounds(span.Start, endToken.FullSpan.End); 369AddIndentBlockOperation(list, firstToken, lastToken, TextSpan.FromBounds(firstToken.FullSpan.Start, lastToken.FullSpan.End));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (1)
335var textSpan = TextSpan.FromBounds(startToken.Span.End, endToken.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\WrappingFormattingRule.cs (1)
188var span = TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Indentation\CSharpSmartTokenFormatter.cs (2)
67_root, [TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End)], _options.FormattingOptions, smartTokenformattingRules, cancellationToken); 94var adjustedEndPosition = token.Span.End;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
125return model.TryGetSpeculativeSemanticModelForMethodBody(oldMethod.Body.OpenBraceToken.Span.End, newMethod, out speculativeModel);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (2)
713var end = root.FullSpan.End; 1002=> TextSpan.FromBounds(body.OpenBraceToken.Span.End, body.CloseBraceToken.SpanStart);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (16)
src\Analyzers\CSharp\CodeFixes\ConditionalExpressionInStringInterpolation\CSharpAddParenthesesAroundConditionalExpressionInInterpolatedStringCodeFixProvider.cs (1)
114var closeParenPosition = endToken.Span.End;
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (1)
165lastRawStringLiteralData = (stringNode, ComputeCommonIndentationLength(text.Lines.GetLineFromPosition(stringNode.Span.End)));
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;
src\Analyzers\CSharp\CodeFixes\UseImplicitObjectCreation\CSharpUseImplicitObjectCreationCodeFixProvider.cs (1)
50.OrderBy(d => d.Location.SourceSpan.End)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\CompilationUnitSyntaxExtensions.cs (4)
43var end = usings.Last().Span.End; 52var end = rootUsings.Last().Span.End; 59? root.Members.First().GetFirstToken().Span.End 60: root.Span.End;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
882if (firstConstructorConstraint == null || firstConstructorConstraint.SpanStart > token.Span.End)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeDeclarationSyntaxExtensions.cs (3)
28var start = destination.OpenBraceToken.Span.End; 35var start = destination.OpenBraceToken.Span.End; 47start = members.Last().Span.End;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.Indenter.cs (1)
86var endLine = sourceText.Lines.GetLineFromPosition(token.Span.End);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.cs (1)
67spansToFormat.Add(TextSpan.FromBounds(baseNamespace.Name.Span.End, firstMemberB.SpanStart));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
2217if (descendant.SpanStart <= afterNode.Span.End)
Microsoft.CodeAnalysis.CSharp.EditorFeatures (56)
AutomaticCompletion\AutomaticLineEnderCommandHandler.cs (12)
129return CommonFormattingHelpers.GetFormattingSpan(root, TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End)); 209var endingString = text.ToString(TextSpan.FromBounds(lastToken.Span.End, line.End)); 257if (!locatedAtTheEndOfLine && text.Lines.IndexOf(lastToken.Span.End) != line.LineNumber) 275=> lastToken.IsMissing && lastToken.Span.End == line.EndIncludingLineBreak; 585return annotatedOpenBraceToken.Span.End; 603return switchStatementNode.SwitchKeyword.Span.End; 607return switchStatementNode.CloseParenToken.Span.End; 613IndexerDeclarationSyntax indexerNode => indexerNode.ParameterList.Span.End, 614TryStatementSyntax tryStatementNode => tryStatementNode.TryKeyword.Span.End, 617CheckedStatementSyntax checkedStatementNode => checkedStatementNode.Keyword.Span.End, 618FieldDeclarationSyntax fieldDeclarationNode => fieldDeclarationNode.Declaration.Variables[0].Identifier.Span.End, 619EventFieldDeclarationSyntax eventFieldDeclarationNode => eventFieldDeclarationNode.Declaration.Variables[0].Identifier.Span.End,
AutomaticCompletion\AutomaticLineEnderCommandHandler_Helpers.cs (2)
57var nextCaretPosition = formattedNewRoot.GetAnnotatedTokens(s_openBracePositionAnnotation).Single().Span.End; 354var nextCaretPosition = formattedNewRoot.GetAnnotatedTokens(s_openBracePositionAnnotation).Single().Span.End;
BlockCommentEditing\BlockCommentEditingCommandHandler.cs (1)
291if (span.Start < caretPosition && caretPosition < span.End)
CompleteStatement\CompleteStatementCommandHandler.cs (12)
234var newCaretPosition = currentNode.Span.End; 316return (caret >= condition.Span.Start && caret <= condition.Span.End); 372targetPosition = caret.Snapshot.GetPoint(((DoStatementSyntax)statementNode).CloseParenToken.Span.End); 439return caretPosition > condition.SpanStart && caretPosition <= condition.Span.End; 448return caretPosition > declaration.Span.Start && caretPosition <= declaration.Span.End; 455&& caretPosition <= forStatementSyntax.Initializers.Span.End) 466relocatedPosition = forStatementSyntax.Initializers[separatorIndex].Span.End; 471relocatedPosition = forStatementSyntax.Initializers.Span.End; 501return caret.Position <= currentNode.Span.End; 507return caret.Position <= currentNode.Span.End; 513return caret.Position < currentNode.Span.End - 2; 516return caret.Position < currentNode.Span.End;
InlineRename\CSharpEditorInlineRenameService.cs (4)
114endPosition = surroundingSpanOfInterest.Value.End; 116endLine = documentText.Lines.GetLineFromPosition(surroundingSpanOfInterest.Value.End).LineNumber; 124var fallbackEndLine = Math.Min(documentText.Lines.Count - 1, documentText.Lines.GetLineFromPosition(fallbackSpan.End).LineNumber + NumberOfContextLines); 152endLine = Math.Min(documentText.Lines.Count - 1, documentText.Lines.GetLineFromPosition(fallbackSpan.End).LineNumber + NumberOfContextLines);
Interactive\CSharpSendToInteractiveSubmissionProvider.cs (2)
55if (startToken != endToken && startToken.Span.End > endToken.SpanStart) 124endToken = root.FindTokenOnLeftOfPosition(selectionSpan.End);
RawStringLiteral\RawStringLiteralCommandHandler_Return.cs (2)
228var index = expression.Span.End; 238return interpolatedStringExpression.StringStartToken.Span.End;
StringCopyPaste\KnownSourcePasteProcessor.cs (2)
232if (beforeSelection && interpolation.Span.End > _selectionSpanBeforePaste.Start) 238edits.Add(new TextChange(new TextSpan(interpolation.OpenBraceToken.Span.End, 0), new string('{', dollarSignsToAdd)));
StringCopyPaste\StringCopyPasteCommandHandler.cs (2)
250var lastLine = textBeforePaste.Lines.GetLineFromPosition(stringExpressionBeforePaste.Span.End); 351if (span.End < position)
StringCopyPaste\StringCopyPasteData.cs (1)
110if (selectionSpan.End < lastOverlappingChar.Value.Span.End)
StringCopyPaste\StringCopyPasteHelpers.cs (5)
24=> line.Span.End != line.SpanIncludingLineBreak.End; 200for (int currentIndex = span.Start, contentEnd = span.End; currentIndex < contentEnd;) 554if (spans.Last().Length > 0 && text[spans.Last().End - 1] == '"') 560for (var i = span.Start; i < span.End; i++)
StringCopyPaste\StringInfo.cs (10)
91var end = SkipU8Suffix(text, literal.Span.End); 105endDelimiterSpan: TextSpan.FromBounds(end, literal.Span.End), 146TextSpan.FromBounds(rawEnd, literal.Span.End), 167var end = SkipU8Suffix(text, literal.Span.End); 176endDelimiterSpan: TextSpan.FromBounds(end, literal.Span.End), 193while (start < interpolatedString.StringStartToken.Span.End && text[start] == '"') 197var end = SkipU8Suffix(text, interpolatedString.Span.End); 210currentPosition = content.Span.End; 219startDelimiterSpan: TextSpan.FromBounds(interpolatedString.SpanStart, interpolatedString.StringStartToken.Span.End), 220endDelimiterSpan: TextSpan.FromBounds(interpolatedString.StringEndToken.SpanStart, interpolatedString.Span.End),
TextStructureNavigation\CSharpTextStructureNavigatorProvider.cs (1)
100var end = token.Span.End;
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (3)
CommentSelection\CSharpCommentSelectionTests.cs (1)
132SetupSelection(doc.GetTextView(), doc.SelectedSpans.Select(s => Span.FromBounds(s.Start, s.End)));
PdbSourceDocument\AbstractPdbSourceDocumentTests.cs (2)
118Assert.Equal(expectedSpan.End, actualSpan.End);
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (2)
PDB\CSharpPDBTestBase.cs (2)
44var endLine = text.Lines.GetLineFromPosition(span.End); 46var endColumn = span.End - endLine.Start + 1;
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (4)
FlowAnalysis\FlowTestBase.cs (4)
127if (expr.SpanStart >= start && expr.Span.End <= end) 148if (expr.SpanStart >= start && expr.Span.End <= end) 180if (expr.SpanStart >= start && expr.Span.End <= end) 206if (firstStatement != null && stmt.Span.End <= end && stmt.Parent == firstStatement.Parent)
Microsoft.CodeAnalysis.CSharp.Features (185)
BraceCompletion\AbstractCurlyBraceOrBracketCompletionService.cs (1)
128closingPoint = annotatedNewline.Token.Span.End;
BraceCompletion\InterpolatedStringBraceCompletionService.cs (1)
43=> IsValidOpeningBraceToken(token) && token.Span.End - 1 == position;
BraceMatching\BlockCommentBraceMatcher.cs (4)
50return new BraceMatchingResult(new TextSpan(trivia.SpanStart, "/*".Length), TextSpan.FromBounds(trivia.Span.End - "*/".Length, trivia.Span.End)); 55var endBrace = TextSpan.FromBounds(trivia.FullSpan.End - "*/".Length, trivia.FullSpan.End);
BraceMatching\CSharpDirectiveTriviaBraceMatcher.cs (1)
36=> TextSpan.FromBounds(directive.HashToken.SpanStart, directive.DirectiveNameToken.Span.End);
BraceMatching\StringLiteralBraceMatcher.cs (2)
66new TextSpan(token.Span.End - endTokenLength, endTokenLength)); 72new TextSpan(token.Span.End - endTokenLength, endTokenLength));
ChangeSignature\ChangeSignatureFormattingRule.cs (2)
46span = TextSpan.FromBounds(Math.Max(baseToken.Span.End, span.Start), span.End);
ChangeSignature\CSharpChangeSignatureService.cs (1)
232return position <= parameterList.FullSpan.End;
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.cs (1)
248if (firstSemanticToken.IsKind(SyntaxKind.None) || firstSemanticToken.SpanStart > nullableDirective.Span.End)
Completion\CompletionProviders\AttributeNamedParameterCompletionProvider.cs (2)
207argumentList.Arguments.Where(a => a.Span.End <= position) 211argumentList.Arguments.Where(a => a.Span.End <= position)
Completion\CompletionProviders\AwaitCompletionProvider.cs (1)
120if (position > leftToken.FullSpan.End)
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.cs (1)
102return CompletionUtilities.GetTargetCaretNodeForInsertedMember(caretTarget).GetLocation().SourceSpan.End;
Completion\CompletionProviders\ExplicitInterfaceTypeCompletionProvider.cs (1)
80if (typeNode.Parent is TypeSyntax parentType && parentType.Span.End < position)
Completion\CompletionProviders\NamedParameterCompletionProvider.cs (1)
144var existingArguments = argumentList.Arguments.Where(a => a.Span.End <= position && a.NameColon != null)
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider_Operators.cs (1)
147dotLikeToken.Kind() == SyntaxKind.DotDotToken ? dotLikeToken.Span.Start + 1 : dotLikeToken.Span.End),
Completion\CompletionProviders\OverrideCompletionProvider.cs (1)
209return CompletionUtilities.GetTargetCaretNodeForInsertedMember(caretTarget).GetLocation().SourceSpan.End;
Completion\CompletionProviders\PartialMethodCompletionProvider.cs (1)
67return CompletionUtilities.GetTargetCaretPositionForMethod(methodDeclaration).GetLocation().SourceSpan.End;
Completion\KeywordRecommenders\InKeywordRecommender.cs (1)
74if (statement != null && token.Span.End == statement.Variable.Span.End)
Completion\KeywordRecommenders\NewKeywordRecommender.cs (1)
69token.Span.End < t.CloseBraceToken.SpanStart);
ConvertNamespace\ConvertNamespaceCodeRefactoringProvider.cs (2)
79return position <= fileScopedNamespace.SemicolonToken.Span.End; 82return position <= namespaceDeclaration.Name.Span.End;
ConvertToRawString\ConvertInterpolatedStringToRawStringCodeRefactoringProvider.cs (3)
495interpolationInteriorSpans.Add(TextSpan.FromBounds(interpolation.OpenBraceToken.Span.End, interpolation.CloseBraceToken.Span.Start)); 509if (startLine != text.Lines.GetLineFromPosition(descendantSpan.End)) 516restrictedSpans.Add(TextSpan.FromBounds(start, descendantSpan.End));
Debugging\BreakpointResolver.cs (3)
51var lengthOfParsedText = name.FullSpan.End; 64lengthOfParsedText += parameterList.FullSpan.End; 75lengthOfParsedText += token.FullSpan.End;
Debugging\DataTipInfoGetter.cs (1)
68: TextSpan.FromBounds(current.SpanStart, expression.Span.End);
EditAndContinue\BreakpointSpans.cs (12)
110=> TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End); 116=> TextSpan.FromBounds(node.SpanStart, token.Span.End); 119=> TextSpan.FromBounds(token.SpanStart, token.Span.End); 156return nodeOrToken.Span.End; 160return nodeOrToken.AsNode()!.GetLastToken().Span.End; 221if (position < typeDeclaration.ParameterList.CloseParenToken.Span.End) 300=> CreateSpan((position <= switchArm.WhenClause?.FullSpan.End == true) ? switchArm.WhenClause : switchArm.Expression); 305position >= switchExpression.OpenBraceToken.Span.End && 486return TextSpan.FromBounds(typeDeclaration.Identifier.SpanStart, typeDeclaration.ParameterList.Span.End); 567if (position >= block.OpenBraceToken.FullSpan.End) 668if (position < forEachStatement.OpenParenToken.Span.End || position > forEachStatement.CloseParenToken.SpanStart) 978if (position <= accessors[i].FullSpan.End || i == accessors.Count - 1)
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (21)
289Debug.Assert(span.End == switchExpression.CloseBraceToken.Span.End); 331=> position < node.OpenBraceToken.Span.End ? BlockPart.OpenBrace : BlockPart.CloseBrace; 351ForEachPart.VariableDeclaration => TextSpan.FromBounds(node.Type.SpanStart, node.Identifier.Span.End), 361ForEachPart.VariableDeclaration => TextSpan.FromBounds(node.Variable.SpanStart, node.Variable.Span.End), 371SwitchExpressionPart.SwitchBody => TextSpan.FromBounds(node.SwitchKeyword.SpanStart, node.CloseBraceToken.Span.End), 1644return TextSpan.FromBounds(ns.NamespaceKeyword.SpanStart, ns.Name.Span.End); 1727return TextSpan.FromBounds(constraint.WhereKeyword.SpanStart, constraint.Constraints.Last().Span.End); 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); 1799return TextSpan.FromBounds(ifStatement.IfKeyword.SpanStart, ifStatement.CloseParenToken.Span.End); 1807(switchStatement.CloseParenToken != default) ? switchStatement.CloseParenToken.Span.End : switchStatement.Expression.Span.End); 1814return TextSpan.FromBounds(whileStatement.WhileKeyword.SpanStart, whileStatement.CloseParenToken.Span.End); 1821return TextSpan.FromBounds(forStatement.ForKeyword.SpanStart, forStatement.CloseParenToken.Span.End); 1828commonForEachStatement.CloseParenToken.Span.End); 1940=> TextSpan.FromBounds((modifiers.Count != 0) ? modifiers.First().SpanStart : start.SpanStart, end.Span.End); 1943=> (first.Length > 0 && second.Length > 0) ? TextSpan.FromBounds(first.Start, second.End) : (first.Length > 0) ? first : (second.Length > 0) ? second : defaultSpan; 2698? tryStatement.Finally.Span.End 2699: tryStatement.Catches.Last().Span.End);
EmbeddedLanguages\CSharpTestEmbeddedLanguageClassifier.cs (2)
75var lastLine = lines.GetLineFromPosition(token.Span.End); 250var endIndexExclusive = classifiedSpan.TextSpan.End;
ExtractMethod\CSharpSelectionResult.cs (2)
97current.GetLastToken().Span.End <= lastToken.Span.End;
ExtractMethod\CSharpSelectionValidator.cs (6)
319var blockSpan = TextSpan.FromBounds(block.OpenBraceToken.Span.End, block.CloseBraceToken.SpanStart); 330var expressionBodiedMemberBody = TextSpan.FromBounds(expressionBodiedMember.Expression.SpanStart, expressionBodiedMember.Expression.Span.End); 485var lastToken = root.FindToken(textSpan.End); 532if (textSpan.IsEmpty || textSpan.End == 0) 538var line = text.Lines.GetLineFromPosition(textSpan.End); 539if (line.Start != textSpan.End)
GenerateType\CSharpGenerateTypeService.cs (1)
565? semanticModel.SyntaxTree.GetLocation(new TextSpan(lastMember.Span.End, 0))
GoToDefinition\CSharpGoToDefinitionSymbolService.cs (1)
50? foundBrokenLoop.GetLastToken().Span.End
Highlighting\KeywordHighlighters\AsyncAwaitHighlighter.cs (1)
109spans[^1] = TextSpan.FromBounds(lastSpan.Start, mod.Span.End);
Highlighting\KeywordHighlighters\IfStatementHighlighter.cs (1)
57elseIfStatement.IfKeyword.Span.End));
Highlighting\KeywordHighlighters\LoopHighlighter.cs (3)
63spans.Add(EmptySpan(statement.SemicolonToken.Span.End)); 86spans.Add(EmptySpan(breakStatement.SemicolonToken.Span.End)); 91spans.Add(EmptySpan(continueStatement.SemicolonToken.Span.End));
Highlighting\KeywordHighlighters\RegionHighlighter.cs (1)
39directive.DirectiveNameToken.Span.End));
Highlighting\KeywordHighlighters\ReturnStatementHighlighter.cs (1)
54spans.Add(EmptySpan(statement.SemicolonToken.Span.End));
Highlighting\KeywordHighlighters\SwitchStatementHighlighter.cs (5)
45spans.Add(EmptySpan(label.ColonToken.Span.End)); 64spans.Add(EmptySpan(breakStatement.SemicolonToken.Span.End)); 76? gotoStatement.CaseOrDefaultKeyword.Span.End 77: gotoStatement.GotoKeyword.Span.End; 80spans.Add(EmptySpan(gotoStatement.SemicolonToken.Span.End));
Highlighting\KeywordHighlighters\YieldStatementHighlighter.cs (2)
56statement.ReturnOrBreakKeyword.Span.End)); 58spans.Add(EmptySpan(statement.SemicolonToken.Span.End));
ImplementInterface\AbstractChangeImplementationCodeRefactoringProvider.cs (1)
146: TextSpan.FromBounds(explicitName.FullSpan.Start, identifier.FullSpan.End);
InlineHints\CSharpInlineTypeHintsService.cs (1)
95var span = new TextSpan(implicitNew.NewKeyword.Span.End, 0);
LineSeparators\CSharpLineSeparatorService.cs (1)
332var line = syntaxTree.GetText(cancellationToken).Lines.IndexOf(textSpan.End);
MoveToNamespace\CSharpMoveToNamespaceService.cs (1)
35FileScopedNamespaceDeclarationSyntax fileScopedNamespace => fileScopedNamespace.SemicolonToken.Span.End,
NavigationBar\CSharpNavigationBarItemService.cs (1)
228var spanEnd = declaringNode.Span.End;
QuickInfo\CSharpSyntacticQuickInfoProvider.cs (3)
75var spanEnd = openBrace.Span.End; 109var nextToken = block.FindToken(openBrace.FullSpan.End); 113spanEnd = nearbyComment.Span.End;
SignatureHelp\ElementAccessExpressionSignatureHelpProvider.cs (2)
121return TextSpan.FromBounds(conditional.Span.Start, openBracket.FullSpan.End); 344return TextSpan.FromBounds(expression.SpanStart, openBracket.Parent.Span.End);
Snippets\AbstractCSharpAutoPropertySnippetProvider.cs (1)
76=> propertyDeclaration.AccessorList!.CloseBraceToken.Span.End;
Snippets\AbstractCSharpTypeSnippetProvider.cs (1)
87return line.Span.End;
Snippets\CSharpIntMainSnippetProvider.cs (1)
47return line.Span.End;
Snippets\CSharpSnippetHelpers.cs (1)
26return line.Span.End;
SplitStringLiteral\InterpolatedStringSplitter.cs (2)
45if (content.Span.End <= CursorPosition) 59afterSplitContents.Insert(0, CreateInterpolatedStringText(CursorPosition, content.Span.End));
SplitStringLiteral\SimpleStringSplitter.cs (4)
33return _token.IsKind(SyntaxKind.Utf8StringLiteralToken) && CursorPosition >= _token.Span.End - "u8".Length; 42var suffix = Document.Text.GetSubText(TextSpan.FromBounds(CursorPosition, _token.Span.End)).ToString(); 47? Document.Text.GetSubText(TextSpan.FromBounds(_token.Span.End - "u8".Length, _token.Span.End)).ToString()
src\Analyzers\CSharp\Analyzers\AddBraces\CSharpAddBracesDiagnosticAnalyzer.cs (1)
133var ifStatementSpanWithoutElse = TextSpan.FromBounds(statement.Span.Start, embeddedStatement.Span.End);
src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertToBlockScopedNamespaceDiagnosticAnalyzer.cs (1)
55: declaration.SyntaxTree.GetLocation(TextSpan.FromBounds(declaration.SpanStart, declaration.SemicolonToken.Span.End));
src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertToFileScopedNamespaceDiagnosticAnalyzer.cs (1)
58: declaration.SyntaxTree.GetLocation(TextSpan.FromBounds(declaration.SpanStart, declaration.Name.Span.End));
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertProgramAnalysis_ProgramMain.cs (2)
68var start = lastPragma == default ? 0 : lastPragma.FullSpan.End; 72TextSpan.FromBounds(start, root.Members.OfType<GlobalStatementSyntax>().Last().FullSpan.End));
src\Analyzers\CSharp\Analyzers\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessAnalyzer.cs (3)
184var fadeLocation = Location.Create(tree, TextSpan.FromBounds(firstStatement.SpanStart, previousToken.Span.End)); 203if (nextToken.Span.Start < ifStatement.Span.End) 205fadeLocation = Location.Create(tree, TextSpan.FromBounds(nextToken.Span.Start, ifStatement.Span.End));
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryCast\CSharpRemoveUnnecessaryCastDiagnosticAnalyzer.cs (2)
32CastExpressionSyntax cast => TextSpan.FromBounds(cast.OpenParenToken.SpanStart, cast.CloseParenToken.Span.End), 33BinaryExpressionSyntax binary => TextSpan.FromBounds(binary.OperatorToken.SpanStart, node.Span.End),
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
225var endReportSpan = TextSpan.FromBounds(invokedExpression.Span.End, anonymousFunction.Span.End);
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveDiagnosticAnalyzer.cs (6)
127|| !possibleNullableImpactIntervalTree.HasIntervalThatOverlapsWith(currentOptionsDirective.Span.End, nullableDirectiveTrivia.SpanStart - currentOptionsDirective.Span.End)) 159|| !possibleNullableImpactIntervalTree.HasIntervalThatOverlapsWith(currentOptionsDirective.Span.End, root.Span.End - currentOptionsDirective.Span.End)) 235if (IntervalTree.HasIntervalThatOverlapsWith(span.Start, span.End))
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\NullableImpactingSpanWalker.cs (1)
47if (node.Span.End < _positionOfFirstReducingNullableDirective)
src\Analyzers\CSharp\Analyzers\RemoveUnreachableCode\CSharpRemoveUnreachableCodeDiagnosticAnalyzer.cs (1)
134var span = TextSpan.FromBounds(section[0].FullSpan.Start, section.Last().FullSpan.End);
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForArrayDiagnosticAnalyzer.cs (2)
221? arrayCreationExpression.Type.Span.End 222: ((ImplicitArrayCreationExpressionSyntax)expression).CloseBracketToken.Span.End)));
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForCreateDiagnosticAnalyzer.cs (1)
63invocationExpression.ArgumentList.OpenParenToken.Span.End)),
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs (1)
303text.Lines.GetLineFromPosition(expression.SpanStart).LineNumber + 1 == text.Lines.GetLineFromPosition(expression.Span.End).LineNumber &&
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForNewDiagnosticAnalyzer.cs (1)
88objectCreationExpression.ArgumentList.OpenParenToken.Span.End)),
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForStackAllocDiagnosticAnalyzer.cs (2)
72expression.CloseBracketToken.Span.End))); 112expression.Type.Span.End)));
src\Analyzers\CSharp\Analyzers\UseDefaultLiteral\CSharpUseDefaultLiteralDiagnosticAnalyzer.cs (1)
47var fadeSpan = TextSpan.FromBounds(defaultExpression.OpenParenToken.SpanStart, defaultExpression.CloseParenToken.Span.End);
src\Analyzers\CSharp\Analyzers\UseExpressionBodyForLambda\UseExpressionBodyForLambdaDiagnosticAnalyzer.cs (1)
105TextSpan.FromBounds(declaration.SpanStart, declaration.ArrowToken.Span.End));
src\Analyzers\CSharp\Analyzers\UseInferredMemberName\CSharpUseInferredMemberNameDiagnosticAnalyzer.cs (2)
55var fadeSpan = TextSpan.FromBounds(nameColon.Name.SpanStart, nameColon.ColonToken.Span.End); 81var fadeSpan = TextSpan.FromBounds(nameEquals.Name.SpanStart, nameEquals.EqualsToken.Span.End);
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.Analyzer.cs (2)
256if (node.SpanStart < _localStatement.Span.End) 260if (node.Span.End >= _comparison.SpanStart)
src\Analyzers\CSharp\Analyzers\UseUnboundGenericTypeInNameOf\CSharpUseUnboundGenericTypeInNameOfDiagnosticAnalyzer.cs (1)
81TextSpan.FromBounds(typeArgumentList.LessThanToken.Span.End, typeArgumentList.GreaterThanToken.Span.Start))]));
src\Analyzers\CSharp\Analyzers\UseUtf8StringLiteral\UseUtf8StringLiteralDiagnosticAnalyzer.cs (1)
124var span = TextSpan.FromBounds(elements[0].Syntax.SpanStart, elements[^1].Syntax.Span.End);
src\Analyzers\CSharp\CodeFixes\ConditionalExpressionInStringInterpolation\CSharpAddParenthesesAroundConditionalExpressionInInterpolatedStringCodeFixProvider.cs (1)
114var closeParenPosition = endToken.Span.End;
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (1)
165lastRawStringLiteralData = (stringNode, ComputeCommonIndentationLength(text.Lines.GetLineFromPosition(stringNode.Span.End)));
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;
src\Analyzers\CSharp\CodeFixes\UseImplicitObjectCreation\CSharpUseImplicitObjectCreationCodeFixProvider.cs (1)
50.OrderBy(d => d.Location.SourceSpan.End)
StringIndentation\CSharpStringIndentationService.cs (3)
54if (childSpan.Start > textSpan.End) 143var holeEndLine = text.Lines.GetLineFromPosition(interpolation.Span.End).LineNumber; 162var lastLine = text.Lines.GetLineFromPosition(expression.Span.End);
Structure\CSharpStructureHelpers.cs (5)
32return lastTrailingCommentOrWhitespaceTrivia?.Span.End ?? firstToken.Span.End; 47var end = lastToken.Span.End; 153var span = TextSpan.FromBounds(startComment.SpanStart, endComment.Span.End); 257hintSpan: TextSpan.FromBounds(startPosition, hintTextEndToken.Span.End), 450var spanStart = syntaxList.First().GetFirstToken().FullSpan.End;
Structure\Providers\AnonymousObjectCreationExpressionStructureProvider.cs (2)
38textSpan: TextSpan.FromBounds(node.NewKeyword.Span.End, node.Span.End),
Structure\Providers\ArrowExpressionClauseStructureProvider.cs (2)
27textSpan: TextSpan.FromBounds(previousToken.Span.End, node.Parent.Span.End),
Structure\Providers\BlockSyntaxStructureProvider.cs (2)
171return TextSpan.FromBounds(previousToken.Span.End, GetEnd(node)); 189return node.Span.End;
Structure\Providers\CollectionExpressionStructureProvider.cs (4)
39? nextToken.Span.End 40: node.Span.End; 61var textSpan = TextSpan.FromBounds(previousToken.Span.End, node.Span.End);
Structure\Providers\DisabledTextTriviaStructureProvider.cs (1)
70var endPos = trivia.FullSpan.End;
Structure\Providers\InitializerExpressionStructureProvider.cs (4)
41? nextToken.Span.End 42: node.Span.End; 64textSpan: TextSpan.FromBounds(previousToken.Span.End, node.Span.End),
Structure\Providers\RegionDirectiveStructureProvider.cs (1)
19var prefixLength = kw.Span.End - simpleDirective.Span.Start;
Structure\Providers\StringLiteralExpressionStructureProvider.cs (1)
51sourceText.Lines.GetLineFromPosition(span.End).LineNumber)
Structure\Providers\SwitchStatementStructureProvider.cs (5)
24textSpan: TextSpan.FromBounds(node.CloseParenToken != default ? node.CloseParenToken.Span.End : node.Expression.Span.End, node.CloseBraceToken.Span.End), 32var start = section.Labels.Last().ColonToken.Span.End; 33var end = section.Statements.Last().Span.End;
UsePatternMatching\CSharpIsAndCastCheckWithoutNameDiagnosticAnalyzer.cs (2)
171if (node.Span.End >= type.Span.End)
Wrapping\SeparatedSyntaxList\CSharpArgumentWrapper.cs (1)
91var span = TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End);
Wrapping\SeparatedSyntaxList\CSharpParameterWrapper.cs (1)
69var headerSpan = TextSpan.FromBounds(firstToken.SpanStart, lastToken.Span.End);
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (2)
EditAndContinue\BreakpointSpansTests.cs (2)
85var expectedEnvelope = expectedSpans.IsEmpty ? default : TextSpan.FromBounds(expectedSpans[0].Start, expectedSpans[^1].End); 95var endPosition = root.Span.End;
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (14)
Semantics\AccessibilityTests.cs (1)
53s_testModel.IsAccessible(s_testModel.SyntaxTree.GetCompilationUnitRoot().FullSpan.End + 1, s_testSymbol));
Semantics\GlobalUsingDirectiveTests.cs (4)
4979Assert.Equal("alias1=C1", model.GetSpeculativeAliasInfo(tree.GetRoot().Span.End, alias1, SpeculativeBindingOption.BindAsExpression).ToTestDisplayString()); 4980Assert.Equal("alias1=C1", model.GetSpeculativeAliasInfo(tree.GetRoot().Span.End, alias1, SpeculativeBindingOption.BindAsTypeOrNamespace).ToTestDisplayString()); 4984Assert.Equal("alias1=C1", model.GetSpeculativeAliasInfo(tree.GetRoot().Span.End, alias1, SpeculativeBindingOption.BindAsExpression).ToTestDisplayString()); 4985Assert.Equal("alias1=C1", model.GetSpeculativeAliasInfo(tree.GetRoot().Span.End, alias1, SpeculativeBindingOption.BindAsTypeOrNamespace).ToTestDisplayString());
Semantics\LookupTests.cs (1)
1369var eof = tree.GetCompilationUnitRoot().FullSpan.End;
Semantics\QueryTests.cs (3)
3424bool success = model.TryGetSpeculativeSemanticModel(methodM.Body.Statements[1].Span.End, queryStatement, out speculativeModel); 3468bool success = model.TryGetSpeculativeSemanticModel(methodM.Body.Statements[1].Span.End, queryStatement, out speculativeModel); 3554bool success = model.TryGetSpeculativeSemanticModel(methodM.Body.Statements[0].Span.End, queryStatement, out speculativeModel);
Semantics\TopLevelStatementsTests.cs (5)
8653for (int i = id.SpanStart; i <= id.Span.End; i++) 8675for (int i = id.SpanStart; i <= id.Span.End; i++) 8697for (int i = id.SpanStart; i <= id.Span.End; i++) 9707model.TryGetSpeculativeSemanticModel(root.DescendantNodes().Single(n => n is ExpressionStatementSyntax { Parent: GlobalStatementSyntax }).Span.End, nodeToSpeculate, out var speculativeModelInTopLevel); 9712model.TryGetSpeculativeSemanticModel(root.DescendantNodes().Single(n => n is ExpressionStatementSyntax { Parent: BlockSyntax }).Span.End, nodeToSpeculate, out var speculativeModelOutsideTopLevel);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (9)
Compilation\SemanticModelAPITests.cs (5)
1394var info = model.GetSpeculativeSymbolInfo(oldSyntax.ParameterList.Span.End, newSyntax); 1920bool success = model.TryGetSpeculativeSemanticModel(methodDecl.Body.Statements[0].Span.End, switchStatement, out statModel); 1958bool success = model.TryGetSpeculativeSemanticModel(methodDecl.Body.Statements[0].Span.End, speculatedStatement, out speculativeModel); 2264var success = model.TryGetSpeculativeSemanticModel(methodDecl.Body.Statements[0].Span.End, unsafeStatement, out speculativeModel); 2679var success = model.TryGetSpeculativeSemanticModelForMethodBody(methodDecl.Body.Statements[0].Span.End, speculatedMethod, out speculativeModel);
Compilation\UsedAssembliesTests.cs (1)
146var afterUsings = source.Substring(unit.Usings.Last().FullSpan.End);
Symbols\AnonymousTypesSemanticsTests.cs (2)
1494var pos = data.Nodes[0].Span.End; 1513pos = data.Nodes[3].Span.End;
Symbols\Source\NullablePublicAPITests.cs (1)
4120var position = localFunction.DescendantNodes().OfType<VariableDeclarationSyntax>().Single().Span.End;
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (16)
Diagnostics\LocationsTests.cs (2)
400Assert.InRange(diag.Location.SourceSpan.End, diag.Location.SourceSpan.Start, syntaxTree.GetText().Length); 466Assert.InRange(diag.Location.SourceSpan.End, 0, syntaxTree.GetText().Length);
Parsing\RoundTrippingTests.cs (1)
66Assert.Equal(prevSpan.End, span.Start);
Syntax\SyntaxNodeTests.cs (10)
714for (int i = 0; i < node.FullSpan.End; i++) 745var EOFSpan = new TextSpan(root.FullSpan.End, 0); 754var nodeEndPositionSpan = new TextSpan(classDecl.FullSpan.End, 0); 766invalidSpan = new TextSpan(root.FullSpan.End - 1, 2); 768invalidSpan = new TextSpan(classDecl2.FullSpan.Start - 1, root.FullSpan.End); 770invalidSpan = new TextSpan(classDecl.FullSpan.End, root.FullSpan.End); 793Assert.Equal(0, trivia.Span.End); 3586Assert.InRange(0, root.FullSpan.Start, root.FullSpan.End); 3591Assert.NotInRange(0, method.FullSpan.Start, method.FullSpan.End);
TextExtensions.cs (3)
26var newFullText = oldFullText.Substring(0, offset) + newText + oldFullText.Substring(span.End); 36var newFullText = oldFullText.Substring(0, offset) + newText + oldFullText.Substring(span.End); 46var newFullText = oldFullText.Substring(0, offset) + newText + oldFullText.Substring(span.End);
Microsoft.CodeAnalysis.CSharp.Workspaces (60)
Classification\SyntaxClassification\SyntaxTokenClassifier.cs (1)
35if (syntaxTree.IsInPartiallyWrittenGeneric(lessThanToken.Span.End, cancellationToken, out var identifier))
Classification\Worker.cs (6)
88var textSpanEnd = _textSpan.End; 135AddClassification(TextSpan.FromBounds(token.Span.Start, token.Span.End - "u8".Length), type); 136AddClassification(TextSpan.FromBounds(token.Span.End - "u8".Length, token.Span.End), ClassificationTypeNames.Keyword); 181if (enumerator.Current.FullSpan.End > classificationSpanStart) 194if (trivia.SpanStart >= _textSpan.End)
Classification\Worker_DocumentationComments.cs (3)
24if (childFullSpan.Start > _textSpan.End) 28else if (childFullSpan.End < _textSpan.Start) 123var span = TextSpan.FromBounds(spanStart.Value, trivia.Span.End);
OrganizeImports\CSharpOrganizeImportsService.Rewriter.cs (1)
81=> TextSpan.FromBounds(list.First().FullSpan.Start, list.Last().FullSpan.End);
Simplification\Reducers\CSharpNullableAnnotationReducer.cs (1)
37var context = semanticModel.GetNullableContext(node.Span.End);
Simplification\Simplifiers\NameSimplifier.cs (1)
535issueSpan = new TextSpan(identifierToken.Span.End - 9, 9);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\EmbeddedLanguages\VirtualChars\CSharpVirtualCharService.cs (2)
189var indentationLength = parentSourceText.Lines.GetLineFromPosition(parentExpression.Span.End).GetFirstNonWhitespaceOffset() ?? 0; 216: lineSpan.End;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\BlockSyntaxExtensions.cs (3)
73conditionalDirectives.Last().Span.End >= block.CloseBraceToken.Span.End) 79if (conditionalDirectives.Last().Span.End <= statement.Span.Start)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
37directive.FullSpan.End == syntaxTree.GetRoot(cancellationToken).FullSpan.End;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (1)
239var name = SyntaxFactory.ParseName(syntaxTree.GetText(cancellationToken).ToString(TextSpan.FromBounds(genericIdentifier.SpanStart, lastToken.Span.End)));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs (9)
206if (position > fullSpan.Start && position < fullSpan.End) 213if (position > fullSpan.Start && position <= fullSpan.End) 232if (position > span.Start && position < span.End) 346if (position != token.Span.End) 354for (int i = token.SpanStart, n = token.Span.End; i < n; i++) 362for (int i = token.Span.End - 1, n = token.Span.Start; i >= n; i--) 416return (position > span.Start && position < span.End) 427return token.SpanStart < position && token.Span.End > position; 462return (position > span.Start && position < span.End)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\CSharpTriviaFormatter.DocumentationCommentExteriorCommentRewriter.cs (3)
75if (trivia.Span.End == currentParent.SpanStart || 76trivia.Span.End == currentParent.Span.End)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaRewriter.cs (3)
108return TextSpan.FromBounds(pair.Item1.Span.End, _node.FullSpan.End); 111return TextSpan.FromBounds(pair.Item1.Span.End, pair.Item2.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\BaseFormattingRule.cs (1)
51var endPosition = endToken.Span.End;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\IndentBlockFormattingRule.cs (5)
120TextSpan.FromBounds(lastTokenOfLabel.FullSpan.End, nextToken.SpanStart) : TextSpan.FromBounds(lastTokenOfLabel.FullSpan.End, lastTokenOfLabel.FullSpan.End)); 129span = lastSection ? span : TextSpan.FromBounds(span.Start, endToken.FullSpan.End); 369AddIndentBlockOperation(list, firstToken, lastToken, TextSpan.FromBounds(firstToken.FullSpan.Start, lastToken.FullSpan.End));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (1)
335var textSpan = TextSpan.FromBounds(startToken.Span.End, endToken.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\WrappingFormattingRule.cs (1)
188var span = TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Indentation\CSharpSmartTokenFormatter.cs (2)
67_root, [TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End)], _options.FormattingOptions, smartTokenformattingRules, cancellationToken); 94var adjustedEndPosition = token.Span.End;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
125return model.TryGetSpeculativeSemanticModelForMethodBody(oldMethod.Body.OpenBraceToken.Span.End, newMethod, out speculativeModel);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (2)
713var end = root.FullSpan.End; 1002=> TextSpan.FromBounds(body.OpenBraceToken.Span.End, body.CloseBraceToken.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\CompilationUnitSyntaxExtensions.cs (4)
43var end = usings.Last().Span.End; 52var end = rootUsings.Last().Span.End; 59? root.Members.First().GetFirstToken().Span.End 60: root.Span.End;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (2)
882if (firstConstructorConstraint == null || firstConstructorConstraint.SpanStart > token.Span.End) 2376position >= token.Span.End)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeDeclarationSyntaxExtensions.cs (3)
28var start = destination.OpenBraceToken.Span.End; 35var start = destination.OpenBraceToken.Span.End; 47start = members.Last().Span.End;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.Indenter.cs (1)
86var endLine = sourceText.Lines.GetLineFromPosition(token.Span.End);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.cs (1)
67spansToFormat.Add(TextSpan.FromBounds(baseNamespace.Name.Span.End, firstMemberB.SpanStart));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
2217if (descendant.SpanStart <= afterNode.Span.End)
Microsoft.CodeAnalysis.EditorFeatures (17)
CommentSelection\AbstractCommentSelectionBase.cs (1)
176return snapshot.CreateTrackingSpan(Span.FromBounds(textSpan.Start, textSpan.End), spanTrackingMode);
CommentSelection\AbstractToggleBlockCommentBase.cs (13)
153var trackingSpan = TextSpan.FromBounds(intersectingBlockComments.First().Start, intersectingBlockComments.Last().End); 243if (blockCommentSelection.IsLocationCommented(selectedSpan.End) && !endsWithCommentMarker) 245InsertText(textChanges, selectedSpan.End, commentInfo.BlockCommentEndString); 246InsertText(textChanges, selectedSpan.End, commentInfo.BlockCommentStartString); 257InsertText(textChanges, span.End, commentInfo.BlockCommentEndString); 264var endMarkerPosition = spanToRemove.End - commentInfo.BlockCommentEndString.Length; 303for (var i = span.Start; i < span.End; i++) 379&& SelectedSpan.Start > blockComment.End 380&& snapshot.AreOnSameLine(SelectedSpan.Start, blockComment.End)) 382if (IsSpanWhitespace(TextSpan.FromBounds(blockComment.End, SelectedSpan.Start))) 423spanStart = commentedSpan.End; 427if (spanStart < SelectedSpan.End) 429var uncommentedSpan = TextSpan.FromBounds(spanStart, SelectedSpan.End);
EditorConfigSettings\Updater\SettingsUpdateHelper.cs (2)
306return (editorConfigText.WithChanges(new TextChange(new TextSpan(lastValidSpecificHeaderSpanEnd.Value.Span.End, 0), newEntry)), lastValidHeaderSpanEnd, lastValidSpecificHeaderSpanEnd); 315return (editorConfigText.WithChanges(new TextChange(new TextSpan(lastValidHeaderSpanEnd.Value.Span.End, 0), newEntry)), lastValidHeaderSpanEnd, lastValidSpecificHeaderSpanEnd);
TextStructureNavigation\AbstractTextStructureNavigatorProvider.TextStructureNavigator.cs (1)
298while (node != null && (span.End.Position > node.Value.Span.End))
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (17)
AbstractCommandHandlerTestState.cs (6)
90Assert.True(cursorPosition == firstSpan.Start || cursorPosition == firstSpan.End 91|| cursorPosition == lastSpan.Start || cursorPosition == lastSpan.End, 101if (cursorPosition == firstSpan.Start || cursorPosition == lastSpan.End) 105boxSelectionEnd = new SnapshotPoint(_subjectBuffer.CurrentSnapshot, lastSpan.End); 111boxSelectionStart = new SnapshotPoint(_subjectBuffer.CurrentSnapshot, firstSpan.End); 113isReversed = cursorPosition == firstSpan.End;
CommentSelection\AbstractToggleCommentTestBase.cs (2)
38SetupSelection(doc.GetTextView(), doc.SelectedSpans.Select(s => Span.FromBounds(s.Start, s.End))); 55SetupSelection(document.GetTextView(), document.SelectedSpans.Select(s => Span.FromBounds(s.Start, s.End)));
CompleteStatement\AbstractCompleteStatementTests.cs (3)
60output.Insert(span.End, "|]").Insert(span.Start, "[|"), 61output.Insert(span.End, ";$$|]").Insert(span.Start, "[|")); 104var startCaretPosition = testDocument.CursorPosition ?? testDocument.SelectedSpans.Last().End;
Completion\AbstractArgumentProviderTests`1.cs (1)
106? arguments.IndexOf(arguments.Single(argument => argument.FullSpan.Start <= position && argument.FullSpan.End >= position))
Completion\AbstractCompletionProviderTests.cs (1)
763var textChange = new TextChange(new TextSpan(firstItem.Span.End, 0), commitChar.ToString());
Structure\AbstractSyntaxNodeStructureProviderTests.cs (2)
34(position == node.Span.End && position == node.Parent.Span.End))
Workspaces\EditorTestWorkspace.cs (2)
275mappedSpans[string.Empty] = mappedSpans[string.Empty].OrderBy(s => s.End).ThenBy(s => -s.Start).ToImmutableArray(); 383(matchingSpan.Contains(documentWithSpan.CursorPosition.Value) || matchingSpan.End == documentWithSpan.CursorPosition.Value))
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (3)
CodeGeneration\CodeGenerationTests.cs (2)
920return token.Parent.AncestorsAndSelf().OfType<T>().FirstOrDefault(t => !fullSpanCoverage || t.Span.End >= destSpan.End);
MetadataAsSource\AbstractMetadataAsSourceTests.TestContext.cs (1)
147Assert.Equal(expectedSpan.End, actualSpan.End);
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (4)
Expansion\AbstractExpansionTest.vb (3)
36Dim node = GetExpressionSyntaxWithSameSpan(root.FindToken(span.Start).Parent, span.End) 41Dim node = GetExpressionSyntaxWithSameSpan(root.FindToken(span.Start).Parent, span.End) 61If node.Span.End = spanEnd Then
Simplification\AbstractSimplificationTests.vb (1)
136If node.Span.End = spanEnd Then
Microsoft.CodeAnalysis.Features (76)
BraceMatching\IBraceMatchingServiceExtensions.cs (4)
36if (braces1.HasValue && position >= braces1.Value.LeftSpan.Start && position < braces1.Value.LeftSpan.End) 41else if (braces2.HasValue && position > braces2.Value.RightSpan.Start && position <= braces2.Value.RightSpan.End) 46else if (braces2.HasValue && position > braces2.Value.LeftSpan.Start && position <= braces2.Value.LeftSpan.End) 51else if (braces1.HasValue && position >= braces1.Value.RightSpan.Start && position < braces1.Value.RightSpan.End)
ChangeSignature\AbstractChangeSignatureService.cs (1)
662if (position > parameters.Span.End)
ClassifiedSpansAndHighlightSpanFactory.cs (2)
85new ClassifiedSpan(ClassificationTypeNames.Text, TextSpan.FromBounds(narrowSpan.End, widenedSpan.End)),
CodeFixes\Configuration\ConfigurationUpdater.cs (2)
720var textChange = new TextChange(new TextSpan(lastValidSpecificHeaderSpanEnd.Value.Span.End, 0), newEntry); 730var textChange = new TextChange(new TextSpan(lastValidHeaderSpanEnd.Value.Span.End, 0), newEntry);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.cs (2)
282var spanEnd = Math.Max(startToken.Span.End, span.End);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaBatchFixHelpers.cs (2)
132static bool IsPriorSpan(TextSpan span, TextChange textChange) => span.End <= textChange.Span.Start; 133static bool IsFollowingSpan(TextSpan span, TextChange textChange) => span.Start >= textChange.Span.End;
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaHelpers.cs (4)
73? trivia.FullSpan.End <= currentDiagnosticSpan.Start 74: trivia.FullSpan.Start >= currentDiagnosticSpan.End; 223var spanEnd = !isEndTokenEOF ? nextOfEnd.FullSpan.End : endToken.FullSpan.End;
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction_Pragma.cs (2)
125bool shouldIncludeTrivia(SyntaxTrivia t) => isStartToken ? t.FullSpan.End <= diagnosticSpan.Start : t.FullSpan.Start >= diagnosticSpan.End;
CodeRefactorings\AddMissingImports\AbstractAddMissingImportsFeatureService.cs (1)
191Debug.Assert(textChanges.Last().Span.IntersectsWith(insertSpan.End));
Completion\Providers\AbstractAwaitCompletionProvider.cs (1)
229builder.Add(new TextChange(TextSpan.FromBounds(dotToken.Value.SpanStart, item.Span.End), replacementText));
Completion\Providers\AbstractDocCommentCompletionProvider.cs (4)
281var replacementSpan = TextSpan.FromBounds(text[itemSpan.Start - 1] == '<' && beforeCaretText[0] == '<' ? itemSpan.Start - 1 : itemSpan.Start, itemSpan.End); 286if (text.Length > replacementSpan.End + 1 287&& text[replacementSpan.End] == '=' 288&& text[replacementSpan.End + 1] == '"')
Completion\Providers\AbstractSymbolCompletionProvider.cs (1)
72if (declarationSyntax != null && position < declarationSyntax.FullSpan.End)
Completion\Providers\MemberInsertingCompletionItem.cs (1)
33KeyValuePairUtil.Create("TokenSpanEnd", token.Span.End.ToString())],
Completion\Providers\Snippets\AbstractSnippetCompletionProvider.cs (1)
55var textSpan = TextSpan.FromBounds(item.Span.Start, change.Span.End);
Completion\Utilities.cs (1)
31var totalOldSpan = TextSpan.FromBounds(changes.First().Span.Start, changes.Last().Span.End);
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (1)
2233rudeEditSpan = TextSpan.FromBounds(lastNewToken.Span.End, newTokensEnum.Current.SpanStart);
EditAndContinue\MemberBody.cs (1)
51envelope.End,
ExtractMethod\AbstractSyntaxTriviaService.cs (3)
95var triviaAtBeginning = SplitTrivia(tokens[TriviaLocation.BeforeBeginningOfSpan], tokens[TriviaLocation.AfterBeginningOfSpan], t => t.FullSpan.End <= textSpan.Start); 96var triviaAtEnd = SplitTrivia(tokens[TriviaLocation.BeforeEndOfSpan], tokens[TriviaLocation.AfterEndOfSpan], t => t.FullSpan.Start < textSpan.End); 116tokens[TriviaLocation.BeforeEndOfSpan] = root.FindTokenOnLeftOfPosition(textSpan.End, includeSkipped: false);
ExtractMethod\AbstractSyntaxTriviaService.Result.cs (1)
117tokens[TriviaLocation.AfterBeginningOfSpan].Span.End <= tokens[TriviaLocation.BeforeEndOfSpan].SpanStart);
ExtractMethod\SelectionValidator.cs (5)
90var token2 = root.FindTokenFromEnd(textSpan.End); 112if (textSpan.End < stmt.SpanStart) 123if (textSpan.End <= stmt.Span.End && spine.Any(s => CanMergeExistingSpineWithCurrent(syntaxFacts, s, stmt))) 150var token2 = root.FindTokenFromEnd(textSpan.End); 166if (firstStatement != null && stmt.Span.End <= textSpan.End && stmt.Parent == firstStatement.Parent)
Formatting\FormattingRuleUtilities.cs (1)
18var position = (span.Start + span.End) / 2;
NavigateTo\NavigateToUtilities.cs (1)
32var spanEnd = item.SourceSpan.End;
QuickInfo\IndentationHelper.cs (7)
50var endLineNumber = lines.GetLineFromPosition(span.End).LineNumber; 61var spanBeforeDeletion = TextSpan.FromBounds(span.Start, Math.Min(span.End, deletion.Start)); 68if (deletion.End > span.Start) 70span = TextSpan.FromBounds(Math.Min(deletion.End, span.End), span.End); 94var endLineNumber = lines.GetLineFromPosition(span.TextSpan.End).LineNumber;
SignatureHelp\CommonSignatureHelpUtilities.cs (2)
56if (position < getOpenToken(argumentList).Span.End) 65if (element.IsToken && position >= element.Span.End)
Snippets\SnippetProviders\AbstractConsoleSnippetProvider.cs (2)
68return caretTarget.Span.End; 71return openParenToken.Span.End;
SplitOrMergeIfStatements\AbstractMergeIfStatementsCodeRefactoringProvider.cs (1)
60TextSpan.FromBounds(upperIfOrElseIfSpan.Start, lowerIfOrElseIfSpan.End));
src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderHelper.cs (3)
64fileHeaderEnd = trivia.FullSpan.End; 87fileHeaderEnd = trivia.FullSpan.End; 104missingHeaderOffset = trivia.FullSpan.End;
src\Analyzers\Core\Analyzers\OrderModifiers\AbstractOrderModifiersDiagnosticAnalyzer.cs (1)
82context.Tree.GetLocation(TextSpan.FromBounds(modifiers.First().SpanStart, modifiers.Last().Span.End)),
src\Analyzers\Core\Analyzers\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (2)
181var end = node.Span.End; 185end = trivia.Span.End;
src\Analyzers\Core\Analyzers\RemoveUnnecessaryParentheses\AbstractRemoveUnnecessaryParenthesesDiagnosticAnalyzer.cs (2)
134var textSpanEndPosition = Math.Min(parenthesizedExpressionLocation.SourceSpan.End, expressionFirstLine.Span.End);
src\Analyzers\Core\Analyzers\SimplifyTypeNames\SimplifyTypeNamesDiagnosticAnalyzerBase.cs (1)
256if (intervalTree.HasIntervalThatOverlapsWith(span.Start, span.End))
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UseCollectionInitializerHelpers.cs (3)
37syntaxTree.GetLocation(TextSpan.FromBounds(arguments.Last().FullSpan.End, match.Span.End))); 49syntaxTree.GetLocation(TextSpan.FromBounds(expression.FullSpan.End, match.Span.End)));
src\Analyzers\Core\Analyzers\UseObjectInitializer\AbstractUseObjectInitializerDiagnosticAnalyzer.cs (1)
149: syntaxFacts.GetExpressionOfMemberAccessExpression(match.MemberAccessExpression)!.Span.End;
src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (1)
389=> text.Lines.GetLineFromPosition(position).SpanIncludingLineBreak.End;
Structure\BlockSpan.cs (1)
139var endLine = lines.GetLinePosition(this.TextSpan.End).Line;
TaskList\AbstractTaskListService.cs (2)
134var endLine = text.Lines.GetLineFromPosition(fullSpan.End); 156var length = fullSpan.End - endLine.Start;
Wrapping\AbstractCodeActionComputer.cs (3)
90new TextChange(TextSpan.FromBounds(nodeOrToken.Span.End, OriginalSourceText.Length), newLine)); 98var originalLineNumber = newSourceText.Lines.GetLineFromPosition(nodeOrToken.Span.End).LineNumber; 179var span = TextSpan.FromBounds(edit.Left.Span.End, edit.Right.Span.Start);
Wrapping\Edit.cs (1)
26if (left.Span.End > right.Span.Start)
Wrapping\SeparatedSyntaxList\SeparatedSyntaxListCodeActionComputer.cs (1)
107var afterOpenTokenOffset = OriginalSourceText.GetOffset(openToken.Span.End);
Microsoft.CodeAnalysis.Features.UnitTests (1)
EditAndContinue\ActiveStatementsMapTests.cs (1)
60Assert.Equal(new Range(5, 6), ActiveStatementsMap.GetSpansStartingInSpan(span.Start, span.End, array, startPositionComparer: (x, y) => x.Start.CompareTo(y)));
Microsoft.CodeAnalysis.LanguageServer.Protocol (13)
Extensions\ProtocolConversions.cs (1)
505Math.Min(text.Length, span.End));
Features\Diagnostics\DocumentAnalysisExecutor.cs (1)
316var endNode = service.GetContainingMemberDeclaration(root, span.Value.End);
Features\Diagnostics\DocumentAnalysisExecutor_Helpers.cs (2)
352if (location.SourceSpan.End > location.SourceTree.Length) 375if (location.SourceSpan.End > text.Length)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.IncrementalMemberEditAnalyzer.cs (4)
323var delta = member.FullSpan.End - oldSpan.End; 354if (oldSpan.End <= diagnosticSpan.Start) 357if (diagnostic.AdditionalLocations.Any(l => l.DocumentId != null && oldSpan.End > l.UnmappedFileSpan.GetClampedTextSpan(text).Start))
Features\UnifiedSuggestions\UnifiedSuggestedActionSetComparer.cs (2)
47var endsDistance = Math.Abs(a.End - b.End);
Handler\Breakpoints\ValidateBreakableRangeHandler.cs (1)
98var secondResult = await breakpointService.ResolveBreakpointAsync(document, new TextSpan(span.End, length: 0), cancellationToken).ConfigureAwait(false);
Handler\Completion\CompletionHandler.cs (1)
156if (!capabilityHelper.SupportVSInternalClientCapabilities && position < completionList.Span.End)
Handler\InlineCompletions\InlineCompletionsHandler.cs (1)
236var textChangesBefore = textChanges.Where(t => t.Span.End <= originalSpan.Start);
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (5)
ProtocolConversionsTests.cs (4)
198Assert.Equal(10, textSpan.End); 212Assert.Equal(25, textSpan.End); 225Assert.Equal(30, textSpan.End); 245Assert.Equal(32, textSpan.End);
SpellCheck\SpellCheckTests.cs (1)
579lastSpanEnd = span.End;
Microsoft.CodeAnalysis.UnitTests (11)
CommonSyntaxTests.cs (2)
121Assert.Equal(17, correctSpan.End); 158Assert.Equal(14, correctSpan.End);
Text\TextChangeTests.cs (3)
980i = newChange.Span.End; 1000i = newChange.Span.End; 1252position = change.Span.End;
Text\TextSpanTest.cs (6)
24Assert.Equal(42, span.End); 33Assert.Equal(41, span.End); 91Assert.Equal(0, span.End); 102Assert.Equal(1, span.End); 114Assert.Equal(1500, span.End); 124Assert.Equal(int.MaxValue - 1, span.End);
Microsoft.CodeAnalysis.VisualBasic (33)
Binding\Binder_Query.vb (1)
2273operatorNameSpan = TextSpan.FromBounds(operatorNameSpan.Start, right.Span.End)
Binding\Binder_Utils.vb (2)
71Dim endLoc As Integer = Math.Max(badKeyword.Span.End, friendToken.Span.End)
CommandLine\CommandLineDiagnosticFormatter.vb (2)
39text.Length < diagnosticSpanOpt.Value.End Then 62Dim sourceSpanEnd = sourceSpan.End
Compilation\SemanticModel.vb (2)
570Dim atEOF As Boolean = (position = fullEnd AndAlso position = SyntaxTree.GetRoot().FullSpan.End) 614Dim atEOF As Boolean = (position = fullEnd AndAlso position = SyntaxTree.GetRoot().FullSpan.End)
Lowering\Instrumentation\DebugInfoInjector.vb (1)
138sequencePointSpan = TextSpan.FromBounds(original.Syntax.SpanStart, original.Syntax.Span.End)
Scanner\Blender.vb (7)
99Dim [end] = NearestStatementThatContainsPosition(root, span.End - 1, fullSpan) 100Debug.Assert([end].End >= span.End) 101Return TextSpan.FromBounds(start.Start, [end].End) 114Debug.Assert(node.FullSpan.End = position) 157Dim [end] = span.End 210Dim [end] = _change.Span.End
Scanner\Scanner.vb (1)
348If span.Start >= 0 AndAlso span.End <= _bufferLen Then
Symbols\Source\SourceMethodSymbol.vb (2)
179Dim endLoc As Integer = Math.Max(token.Span.End, nextToken.Span.End)
Syntax\SyntaxFacts.vb (2)
205ElseIf position >= span.End AndAlso position < node.FullSpan.End Then
Syntax\SyntaxNodeRemover.vb (8)
50Dim [end] As Integer = span0.End 56[end] = Math.Max([end], span.End) 239Dim fullSpan = TextSpan.FromBounds(token.FullSpan.Start, node.FullSpan.End) 240Dim span = TextSpan.FromBounds(token.Span.Start, node.Span.End) 263Dim fullSpan = TextSpan.FromBounds(node.FullSpan.Start, token.FullSpan.End) 264Dim span = TextSpan.FromBounds(node.Span.Start, token.Span.End) 285removedSpan = TextSpan.FromBounds(span.Start, removedSpan.End) 288removedSpan = TextSpan.FromBounds(removedSpan.Start, span.End)
Syntax\SyntaxReplacer.vb (2)
121[end] = span.End 124[end] = Math.Max([end], span.End)
Syntax\VisualBasicLineDirectiveMap.vb (1)
211Dim unmappedEndPos = sourceText.Lines.GetLinePosition(span.End)
Syntax\VisualBasicSyntaxTree.vb (1)
435Return New FileLinePositionSpan(Me.FilePath, GetLinePosition(span.Start), GetLinePosition(span.End))
Syntax\VisualBasicWarningStateMap.vb (1)
91entries(index) = New WarningStateMapEntry(currentDirective.GetLocation().SourceSpan.End, accumulatedGeneralWarningState, accumulatedSpecificWarningState)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (24)
src\Analyzers\VisualBasic\Analyzers\UseInferredMemberName\VisualBasicUseInferredMemberNameDiagnosticAnalyzer.vb (2)
54Dim fadeSpan = TextSpan.FromBounds(nameColonEquals.Name.SpanStart, nameColonEquals.ColonEqualsToken.Span.End) 75Dim fadeSpan = TextSpan.FromBounds(fieldInitializer.Name.SpanStart, fieldInitializer.EqualsToken.Span.End)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\ParenthesizedExpressionSyntaxExtensions.vb (2)
141If interpolation.OpenBraceToken.Span.End = node.OpenParenToken.Span.Start AndAlso 142node.OpenParenToken.Span.End = expression.Span.Start Then
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxNodeExtensions.vb (1)
885Dim blockSpan = TextSpan.FromBounds(block.BlockStatement.Span.End, block.EndBlockStatement.SpanStart)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTreeExtensions.vb (8)
53If current.FullSpan.End <> token.FullSpan.End Then 128If (child.FullSpan.Start < position) AndAlso (position <= child.FullSpan.End) Then 134If (trivia.SpanStart < position) AndAlso (position <= child.FullSpan.End) Then 140If (trivia.SpanStart < position) AndAlso (position <= child.FullSpan.End) Then 232position = token.Span.End AndAlso 353directive.FullSpan.End = syntaxTree.GetRoot(cancellationToken).FullSpan.End
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Indentation\VisualBasicSmartTokenFormatter.vb (1)
40Dim spans = SpecializedCollections.SingletonEnumerable(TextSpan.FromBounds(previousToken.SpanStart, token.Span.End))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SemanticFacts\VisualBasicSemanticFacts.vb (1)
137position = oldMethod.BlockStatement.FullSpan.End
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SyntaxFacts\VisualBasicSyntaxFacts.vb (3)
750Dim [end] = root.FullSpan.End 886Return TextSpan.FromBounds(list.First.SpanStart, list.Last.Span.End) 891Return TextSpan.FromBounds(list.First.SpanStart, list.Last.Span.End)
src\Workspaces\VisualBasic\Portable\Formatting\Engine\Trivia\TriviaDataFactory.TriviaRewriter.vb (1)
90Return TextSpan.FromBounds(pair.Item1.Span.End, _node.FullSpan.End)
src\Workspaces\VisualBasic\Portable\Formatting\Rules\BaseFormattingRule.vb (3)
52Return TextSpan.FromBounds(previousToken.Span.End, endToken.FullSpan.End) 57Dim spanStart = startToken.GetPreviousToken(includeZeroWidth:=True).Span.End
src\Workspaces\VisualBasic\Portable\Formatting\Rules\NodeBasedFormattingRule.vb (2)
79AddIndentBlockOperation(operations, baseToken, startToken, endToken, TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End)) 157operations.Add(FormattingOperations.CreateIndentBlockOperation(caseBlockLastToken, nextTokenAfterCase, TextSpan.FromBounds(caseBlockLastToken.Span.End, nextTokenAfterCase.SpanStart), 1, IndentBlockOption.RelativePosition))
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (15)
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\GenerateParameterizedMemberCodeFixProvider.vb (2)
63If node.Span.Start = diagnosticSpan.Start AndAlso node.Span.End < diagnosticSpan.End Then
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationService.vb (1)
86TextSpan.FromBounds(destination.Members.Last.Span.End, destination.EndOfFileToken.SpanStart), cancellationToken))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\SyntaxTokenExtensions.vb (2)
26If trivia.IsKind(SyntaxKind.LineContinuationTrivia) AndAlso trivia.Span.End <= position Then 29ElseIf trivia.IsKind(SyntaxKind.EndOfLineTrivia) AndAlso trivia.Span.End <= position Then
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\VisualBasicSyntaxContext.vb (1)
264If targetToken.IsKind(SyntaxKind.HashToken) AndAlso targetToken.Span.End = position Then
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\TypeBlockSyntaxExtensions.vb (1)
19Dim start = destination.BlockStatement.Span.End
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Indentation\SpecialFormattingOperation.vb (4)
72TextSpan.FromBounds(startToken.FullSpan.Start, node.FullSpan.End), indentationDelta:=1, [option]:=IndentBlockOption.RelativePosition)) 110baseToken, startToken, endToken, TextSpan.FromBounds(baseToken.Span.End, closeBrace.Span.End), indentationDelta, IndentBlockOption.RelativePosition)) 159span = TextSpan.FromBounds(baseToken.Span.End, closeBrace.Span.End)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Indentation\VisualBasicIndentationService.Indenter.vb (4)
73Dim firstTrivia As SyntaxTrivia = indenter.Tree.GetRoot(indenter.CancellationToken).FindTrivia(tokenOpt.Value.Span.End + 1) 103If token.Span.End <= trivia.SpanStart AndAlso Not token.IsMissing Then 116If HasLinesBetween(indenter.Tree.GetText().Lines.IndexOf(token.Span.End), indenter.LineToBeIndented.LineNumber) Then 289If IsCommaInParameters(token) AndAlso (token.Span.End <= position AndAlso position <= token.GetNextToken().SpanStart) Then
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (1)
CommandLineTests.vb (1)
11138Dim linePosSpan = New LinePositionSpan(New LinePosition(0, 0), New LinePosition(0, span.End))
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (21)
AutomaticCompletion\AutomaticLineEnderCommandHandler.vb (3)
76If lastToken.Kind = SyntaxKind.None OrElse line.End < lastToken.Span.End Then 89If (line.Span.Contains(nonMissingToken.Span.End)) Then 91Dim endingString = text.ToString(TextSpan.FromBounds(nonMissingToken.Span.End, line.End))
EndConstructGeneration\EndConstructCommandHandler.vb (1)
181If(nextToken.Kind <> SyntaxKind.None, nextToken, lastToken).Span.End)
EndConstructGeneration\EndConstructStatementVisitor_IfStatement.vb (1)
47Dim position = If(ifBlock.Statements.Any(), ifBlock.Statements(0).SpanStart, ifBlock.IfStatement.Span.End + _state.NewLineCharacter.Length)
EndConstructGeneration\VisualBasicEndConstructGenerationService.vb (6)
273Dim span = TextSpan.FromBounds(asSingleLine.IfKeyword.SpanStart, asSingleLine.ThenKeyword.Span.End) 374Return InsertEndTextAndUpdateCaretPosition(textView, subjectBuffer, state.CaretPosition, state.TokenToLeft.Span.End, endText) 402Return InsertEndTextAndUpdateCaretPosition(textView, subjectBuffer, state.CaretPosition, state.TokenToLeft.Span.End, endText) 430Return InsertEndTextAndUpdateCaretPosition(textView, subjectBuffer, state.CaretPosition, state.TokenToLeft.Span.End, endTagText) 454Return InsertEndTextAndUpdateCaretPosition(textView, subjectBuffer, state.CaretPosition, state.TokenToLeft.Span.End + 1, endText) 483Return InsertEndTextAndUpdateCaretPosition(textView, subjectBuffer, state.CaretPosition, state.TokenToLeft.Span.End, endText)
LineCommit\CommitBufferManager.vb (2)
206finalSpanEnd = Math.Max(finalSpanEnd, endingStatementInfo.TextSpan.End) 209finalSpanEnd = Math.Max(finalSpanEnd, endingStatementInfo.MatchingBlockConstruct.Span.End)
LineCommit\CommitFormatter.vb (2)
237Dim endPosition = If(containingStatement Is Nothing, span.End.Position + 1, containingStatement.TextSpan.End + 1) 240Dim token = syntaxTree.GetRoot(cancellationToken).FindToken(Math.Min(endPosition, syntaxTree.GetRoot(cancellationToken).FullSpan.End))
LineCommit\ContainingStatementInfo.vb (2)
186Return New ContainingStatementInfo(node, TextSpan.FromBounds(attributes.Last.Span.End, node.Span.End))
TextStructureNavigation\VisualBasicTextStructureNavigatorProvider.vb (2)
36If position = token.Span.End - 1 AndAlso token.Text.EndsWith("""", StringComparison.Ordinal) Then 64If token.Kind() = SyntaxKind.StringLiteralToken AndAlso position.Position = token.Span.End - 1 AndAlso token.Text.EndsWith("""", StringComparison.Ordinal) Then
Utilities\NavigationPointHelpers.vb (2)
17line = text.Lines.GetLineFromPosition(eventBlock.EventStatement.Span.End).LineNumber + 1 28line = text.Lines.GetLineFromPosition(methodBlock.BlockStatement.Span.End).LineNumber + 1
Microsoft.CodeAnalysis.VisualBasic.Features (80)
BraceCompletion\BracketBraceCompletionService.vb (1)
55If span.End < position Then
BraceCompletion\InterpolatedStringBraceCompletionService.vb (1)
27Return IsValidOpeningBraceToken(token) AndAlso token.Span.End - 1 = position
BraceMatching\InterpolatedStringBraceMatcher.vb (1)
39New TextSpan(interpolatedString.DoubleQuoteToken.Span.End - 1, 1))
BraceMatching\StringLiteralBraceMatcher.vb (2)
28If position = token.SpanStart OrElse position = token.Span.End - 1 Then 32New TextSpan(token.Span.End - 1, 1))
ChangeSignature\ChangeSignatureFormattingRule.vb (1)
30New TextSpan(firstToken.SpanStart, lastToken.Span.End - firstToken.SpanStart),
CodeFixes\GenerateEndConstruct\GenerateEndConstructCodeFixProvider.vb (1)
251Dim insertionPoint = GetBeginStatement(endStatement.Parent).FullSpan.End
CodeFixes\MoveToTopOfFile\MoveToTopOfFileCodeFixProvider.vb (1)
97node.Span.End > m.SpanStart)
Completion\CompletionProviders\OverrideCompletionProvider.vb (3)
206Return methodStatement.GetLocation().SourceSpan.End 213Return lastStatement.GetLocation().SourceSpan.End 223Return lastAccessorStatement.GetLocation().SourceSpan.End
Debugging\BreakpointResolver.vb (2)
55Dim lengthOfParsedText = name.FullSpan.End 64lengthOfParsedText += parameterList.FullSpan.End
Debugging\DataTipInfoGetter.vb (1)
64span = TextSpan.FromBounds(conditionalAccess.SpanStart, span.End)
EditAndContinue\BreakpointSpans.vb (9)
92Return TextSpan.FromBounds(node.SpanStart, node.Span.End) 100Return TextSpan.FromBounds(list.First.SpanStart, list.Last.Span.End) 173If position >= asSingleLine.IfKeyword.SpanStart AndAlso position < asSingleLine.ThenKeyword.Span.End Then 174Return TextSpan.FromBounds(asSingleLine.IfKeyword.SpanStart, asSingleLine.ThenKeyword.Span.End) 237Return TextSpan.FromBounds(methodBase.DeclarationKeyword.SpanStart, methodBase.Span.End) 240Return TextSpan.FromBounds(methodBase.Modifiers.First().SpanStart, methodBase.Span.End) 250Return TextSpan.FromBounds(node.Identifier.Span.Start, node.Initializer.Span.End) 254Return TextSpan.FromBounds(node.Identifier.Span.Start, node.AsClause.Span.End) 417Return TextSpan.FromBounds(clause.Keys.First.SpanStart, clause.Span.End)
EditAndContinue\DeclarationBody\FieldWithMultipleAsNewClauseDeclarationBody.vb (2)
37Return TextSpan.FromBounds(_modifedIdentifier.Span.Start, OtherActiveStatementContainer.Span.End) 43Return TextSpan.FromBounds(_modifedIdentifier.Span.End, OtherActiveStatementContainer.Span.Start).Contains(span)
EditAndContinue\DeclarationBody\PropertyWithInitializerDeclarationBody.vb (1)
37Return TextSpan.FromBounds(PropertyStatement.Identifier.Span.Start, PropertyStatement.Initializer.Span.End)
EditAndContinue\DeclarationBody\PropertyWithNewClauseDeclarationBody.vb (1)
37Return TextSpan.FromBounds(PropertyStatement.Identifier.Span.Start, PropertyStatement.AsClause.Span.End)
EditAndContinue\VisualBasicEditAndContinueAnalyzer.vb (12)
1004Return DirectCast(model.GetEnclosingSymbol(lambdaExpressionSyntax.SubOrFunctionHeader.Span.End, cancellationToken), IMethodSymbol) 1258newWith.Initializer.WithKeyword.Span.End) 1289Return TextSpan.FromBounds(groupJoin.GroupKeyword.SpanStart, groupJoin.JoinKeyword.Span.End) 1304Return TextSpan.FromBounds(partition.SkipOrTakeKeyword.SpanStart, partition.WhileKeyword.Span.End) 1320If(thenKeywordOpt.RawKind <> 0, thenKeywordOpt.Span.End, condition.Span.End)) 1324Return TextSpan.FromBounds(node.NamespaceKeyword.SpanStart, node.Name.Span.End) 1335endNode.Span.End) 1399Return TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End) 1412Return TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End) 2135Return TextSpan.FromBounds(tryBlock.FinallyBlock.SpanStart, tryBlock.EndTryStatement.Span.End) 2138Return TextSpan.FromBounds(tryBlock.CatchBlocks.First().SpanStart, tryBlock.EndTryStatement.Span.End)
ExtractMethod\Extensions.vb (3)
283Dim span = TextSpan.FromBounds(asNewClause.NewExpression.NewKeyword.Span.End, asNewClause.NewExpression.Span.End) 320Dim blockSpan = TextSpan.FromBounds(block.BlockStatement.Span.End, block.EndBlockStatement.SpanStart)
ExtractMethod\VisualBasicSelectionResult.vb (2)
88current.GetLastToken().Span.End <= lastToken.Span.End
ExtractMethod\VisualBasicSelectionValidator.vb (5)
465Dim lastTokenInSelection = root.FindTokenOnLeftOfPosition(adjustedSpan.End, includeSkipped:=False) 606Dim lastToken = root.FindToken(textSpan.End) 636If textSpan.IsEmpty OrElse textSpan.End = 0 Then 641Dim line = root.GetText().Lines.GetLineFromPosition(textSpan.End) 642If line.Start <> textSpan.End Then
GenerateType\VisualBasicGenerateTypeService.vb (2)
393simpleName.Span.End <= t.Members.Last().Span.End) 446semanticModel.SyntaxTree.GetLocation(New TextSpan(lastMember.Span.End, 0)))
GoToDefinition\VisualBasicGoToDefinitionSymbolService.vb (1)
52Return exitTarget.GetLastToken().Span.End
Highlighting\KeywordHighlighters\AccessorDeclarationHighlighter.vb (1)
39highlights.Add(TextSpan.FromBounds(firstKeyword.SpanStart, .DeclarationKeyword.Span.End))
Highlighting\KeywordHighlighters\ConditionalPreprocessorHighlighter.vb (3)
27highlights.Add(TextSpan.FromBounds(.HashToken.SpanStart, .IfOrElseIfKeyword.Span.End)) 34highlights.Add(TextSpan.FromBounds(.HashToken.SpanStart, .ElseKeyword.Span.End)) 38highlights.Add(TextSpan.FromBounds(.HashToken.SpanStart, .IfKeyword.Span.End))
Highlighting\KeywordHighlighters\ConstructorDeclarationHighlighter.vb (1)
31highlights.Add(TextSpan.FromBounds(firstKeyword.SpanStart, .NewKeyword.Span.End))
Highlighting\KeywordHighlighters\EventDeclarationHighlighter.vb (1)
32highlights.Add(TextSpan.FromBounds(firstKeyword.SpanStart, .DeclarationKeyword.Span.End))
Highlighting\KeywordHighlighters\ForLoopBlockHighlighter.vb (1)
38highlights.Add(TextSpan.FromBounds(.ForKeyword.SpanStart, .EachKeyword.Span.End))
Highlighting\KeywordHighlighters\MethodDeclarationHighlighter.vb (1)
37highlights.Add(TextSpan.FromBounds(firstKeyword.SpanStart, .DeclarationKeyword.Span.End))
Highlighting\KeywordHighlighters\OperatorDeclarationHighlighter.vb (1)
31highlights.Add(TextSpan.FromBounds(firstKeyword.SpanStart, .DeclarationKeyword.Span.End))
Highlighting\KeywordHighlighters\PropertyDeclarationHighlighter.vb (1)
32highlights.Add(TextSpan.FromBounds(firstKeyword.SpanStart, .DeclarationKeyword.Span.End))
Highlighting\KeywordHighlighters\RegionHighlighter.vb (2)
37highlights.Add(TextSpan.FromBounds(region.HashToken.SpanStart, region.RegionKeyword.Span.End)) 38highlights.Add(TextSpan.FromBounds(endRegion.HashToken.SpanStart, endRegion.RegionKeyword.Span.End))
Highlighting\KeywordHighlighters\SelectBlockHighlighter.vb (1)
44highlights.Add(TextSpan.FromBounds(.CaseKeyword.SpanStart, elseKeyword.Span.End))
Highlighting\KeywordHighlightingHelpers.vb (1)
96highlights(index) = TextSpan.FromBounds(span.Start, .AwaitKeyword.Span.End)
src\Analyzers\VisualBasic\Analyzers\UseInferredMemberName\VisualBasicUseInferredMemberNameDiagnosticAnalyzer.vb (2)
54Dim fadeSpan = TextSpan.FromBounds(nameColonEquals.Name.SpanStart, nameColonEquals.ColonEqualsToken.Span.End) 75Dim fadeSpan = TextSpan.FromBounds(fieldInitializer.Name.SpanStart, fieldInitializer.EqualsToken.Span.End)
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\GenerateParameterizedMemberCodeFixProvider.vb (2)
63If node.Span.Start = diagnosticSpan.Start AndAlso node.Span.End < diagnosticSpan.End Then
Structure\Providers\CollectionInitializerStructureProvider.vb (2)
39nextToken.Span.End, 40node.Span.End)
Structure\Providers\CompilationUnitStructureProvider.vb (1)
25Dim endPos = compilationUnit.Imports.Last().Span.End
Structure\Providers\ObjectCreationInitializerStructureProvider.vb (2)
34textSpan:=TextSpan.FromBounds(previousToken.Span.End, node.Span.End),
Structure\VisualBasicStructureHelpers.vb (3)
29Dim span = TextSpan.FromBounds(startComment.SpanStart, endComment.Span.End) 116hintSpan:=TextSpan.FromBounds(startPosition, hintTextEndToken.Span.End), 219Return TextSpan.FromBounds(child.SpanStart, blockNode.Span.End)
Wrapping\SeparatedSyntaxList\VisualBasicArgumentWrapper.vb (1)
68Dim span = TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End)
Wrapping\SeparatedSyntaxList\VisualBasicParameterWrapper.vb (1)
60Dim headerSpan = TextSpan.FromBounds(firstToken.SpanStart, lastToken.Span.End)
Microsoft.CodeAnalysis.VisualBasic.Features.UnitTests (4)
EditAndContinue\BreakpointSpansTests.vb (4)
85Dim endPosition = root.Span.End 89If BreakpointSpans.TryGetClosestBreakpointSpan(root, position, minLength:=0, span) AndAlso span.End > lastSpanEnd Then 90position = span.End 91lastSpanEnd = span.End
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (10)
Compilation\SemanticModelAPITests.vb (4)
936Dim position1 = originalStatement.Span.End 971Dim position1 = originalStatement.Span.End 1661Dim position1 = originalStatement.Span.End 1697Dim position1 = originalStatement.Span.End
FlowAnalysis\FlowTestBase.vb (6)
175While startToken.Span.End <= region.Start 190If nextToken.SpanStart >= region.End Then 197Dim endPosition = endToken.Span.End 199If endPosition >= endNode.Span.End Then endPosition = endNode.Span.End 200While endNode IsNot Nothing AndAlso endNode.Span.End = endPosition
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (69)
TestSyntaxNodes.vb (69)
223Assert.Equal(expectedFullSpan.End, list(list.Count - 1).FullSpan.End) 228Assert.Equal(list(i - 1).FullSpan.End, list(i).FullSpan.Start) 231Assert.Equal(list(i).FullSpan.End, list(i + 1).FullSpan.Start) 245Assert.Equal(expectedFullSpan.End, list(list.Count - 1).FullSpan.End) 250Assert.Equal(list(i).FullSpan.End, list(i + 1).FullSpan.Start) 267Assert.Equal(expectedFullSpan.End, list(list.Count - 1).FullSpan.End) 272Assert.Equal(list(i - 1).FullSpan.End, list(i).FullSpan.Start) 275Assert.Equal(list(i).FullSpan.End, list(i + 1).FullSpan.Start) 291Assert.Equal(expectedFullSpan.End, list(list.Count - 1).FullSpan.End) 296Assert.Equal(list(i - 1).FullSpan.End, list(i).FullSpan.Start) 299Assert.Equal(list(i).FullSpan.End, list(i + 1).FullSpan.Start) 310Assert.Equal(expectedFullSpan.End, list(list.Count - 1).FullSpan.End) 315Assert.Equal(list(i).FullSpan.End, list(i + 1).FullSpan.Start) 340Assert.Equal(tree.Span.End, tree.FullSpan.End) 342VerifyListSpans(followingTrivia, New TextSpan(tree.Span.End, (tree.FullSpan.End - tree.Span.End))) 365Assert.Equal(tree.Span.End, tree.FullSpan.End) 367VerifyListSpans(followingTrivia, New TextSpan(tree.Span.End, (tree.FullSpan.End - tree.Span.End))) 411VerifyListSpans(statements, TextSpan.FromBounds(statements(0).FullSpan.Start, statements(statements.Count - 1).FullSpan.End)) 487Assert.Equal(5, l(0).Span.End) 496Assert.Equal(9, param.Modifiers(0).Span.End) 504Assert.Equal(5, param.Modifiers(0).Span.End) 522Assert.Equal(5, l(0).Span.End) 524Assert.Equal(14, l(1).Span.End) 526Assert.Equal(20, l(2).Span.End) 537Assert.Equal(9, param.Modifiers(0).Span.End) 539Assert.Equal(18, param.Modifiers(1).Span.End) 541Assert.Equal(24, param.Modifiers(2).Span.End) 551Assert.Equal(9, param.Modifiers(0).Span.End) 553Assert.Equal(18, param.Modifiers(1).Span.End) 555Assert.Equal(24, param.Modifiers(2).Span.End) 596Assert.Equal(start + 3, seplist(0).Span.End) 597Assert.Equal(start + 4, seplist(0).FullSpan.End) 687Assert.Equal(1, tok.FullSpan.End) 688Assert.Equal(1, tok.Span.End) 703Assert.Equal(5, tok.FullSpan.End) 704Assert.Equal(1, tok.Span.End) 710Assert.Equal(4, follTrivia(0).Span.End) 711Assert.Equal(4, follTrivia(0).FullSpan.End) 716Assert.Equal(5, follTrivia(1).Span.End) 717Assert.Equal(5, follTrivia(1).FullSpan.End) 729Assert.Equal(11, tok.FullSpan.End) 731Assert.Equal(10, tok.Span.End) 741Assert.Equal(4, precTrivia(0).Span.End) 742Assert.Equal(4, precTrivia(0).FullSpan.End) 747Assert.Equal(6, precTrivia(1).Span.End) 748Assert.Equal(6, precTrivia(1).FullSpan.End) 753Assert.Equal(9, precTrivia(2).Span.End) 754Assert.Equal(9, precTrivia(2).FullSpan.End) 762Assert.Equal(11, follTrivia(0).Span.End) 763Assert.Equal(11, follTrivia(0).FullSpan.End) 2273Dim EOFSpan = New TextSpan(root.FullSpan.End, 0) 2283Dim nodeEndPositionSpan = New TextSpan(classDecl.FullSpan.End, 0) 2296invalidSpan = New TextSpan(root.FullSpan.End - 1, 2) 2298invalidSpan = New TextSpan(classDecl2.FullSpan.Start - 1, root.FullSpan.End) 2300invalidSpan = New TextSpan(classDecl.FullSpan.End, root.FullSpan.End) 2335For i As Integer = 1 To node.FullSpan.End - 1 2355Assert.Equal(24, trivia.Span.End)
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (5)
ParserTestUtilities.vb (5)
453node.Span.End <= node.Parent.Span.End, "Span of child (" & 621If spanEnd IsNot Nothing AndAlso CInt(spanEnd) <> syntaxErrorSpan.End Then 858node.Span.End <= node.Parent.Span.End, "Span of child (" &
Microsoft.CodeAnalysis.VisualBasic.Workspaces (43)
Classification\Worker.DocumentationCommentClassifier.vb (3)
25If childFullSpan.Start > _worker._textSpan.End Then 27ElseIf childFullSpan.End < _worker._textSpan.Start Then 98Dim span = TextSpan.FromBounds(spanStart.Value, trivia.Span.End)
Formatting\Engine\Trivia\TriviaDataFactory.TriviaRewriter.vb (1)
90Return TextSpan.FromBounds(pair.Item1.Span.End, _node.FullSpan.End)
Formatting\Rules\BaseFormattingRule.vb (3)
52Return TextSpan.FromBounds(previousToken.Span.End, endToken.FullSpan.End) 57Dim spanStart = startToken.GetPreviousToken(includeZeroWidth:=True).Span.End
Formatting\Rules\NodeBasedFormattingRule.vb (2)
79AddIndentBlockOperation(operations, baseToken, startToken, endToken, TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End)) 157operations.Add(FormattingOperations.CreateIndentBlockOperation(caseBlockLastToken, nextTokenAfterCase, TextSpan.FromBounds(caseBlockLastToken.Span.End, nextTokenAfterCase.SpanStart), 1, IndentBlockOption.RelativePosition))
OrganizeImports\VisualBasicOrganizeImportsService.Rewriter.vb (2)
75Return TextSpan.FromBounds(list.First().FullSpan.Start, list.Last().FullSpan.[End]) 79Return TextSpan.FromBounds(list.First().FullSpan.Start, list.Last().FullSpan.[End])
SemanticModelReuse\VisualBasicSemanticModelReuseLanguageService.vb (1)
65If previousSemanticModel.TryGetSpeculativeSemanticModelForMethodBody(previousMethodBlockBaseNode.BlockStatement.FullSpan.End, DirectCast(currentBodyNode, MethodBlockBaseSyntax), speculativeModel) Then
Simplification\Reducers\VisualBasicEscapingReducer.vb (1)
155Dim endLineOfQuery = text.Lines.GetLineFromPosition(lastTokenOfQuery.Span.End).LineNumber
Simplification\Simplifiers\NameSimplifier.vb (1)
376issueSpan = New TextSpan(name.Span.End - 9, 9)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\ParenthesizedExpressionSyntaxExtensions.vb (2)
141If interpolation.OpenBraceToken.Span.End = node.OpenParenToken.Span.Start AndAlso 142node.OpenParenToken.Span.End = expression.Span.Start Then
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxNodeExtensions.vb (1)
885Dim blockSpan = TextSpan.FromBounds(block.BlockStatement.Span.End, block.EndBlockStatement.SpanStart)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTreeExtensions.vb (8)
53If current.FullSpan.End <> token.FullSpan.End Then 128If (child.FullSpan.Start < position) AndAlso (position <= child.FullSpan.End) Then 134If (trivia.SpanStart < position) AndAlso (position <= child.FullSpan.End) Then 140If (trivia.SpanStart < position) AndAlso (position <= child.FullSpan.End) Then 232position = token.Span.End AndAlso 353directive.FullSpan.End = syntaxTree.GetRoot(cancellationToken).FullSpan.End
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Indentation\VisualBasicSmartTokenFormatter.vb (1)
40Dim spans = SpecializedCollections.SingletonEnumerable(TextSpan.FromBounds(previousToken.SpanStart, token.Span.End))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SemanticFacts\VisualBasicSemanticFacts.vb (1)
137position = oldMethod.BlockStatement.FullSpan.End
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SyntaxFacts\VisualBasicSyntaxFacts.vb (3)
750Dim [end] = root.FullSpan.End 886Return TextSpan.FromBounds(list.First.SpanStart, list.Last.Span.End) 891Return TextSpan.FromBounds(list.First.SpanStart, list.Last.Span.End)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationService.vb (1)
86TextSpan.FromBounds(destination.Members.Last.Span.End, destination.EndOfFileToken.SpanStart), cancellationToken))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\SyntaxTokenExtensions.vb (2)
26If trivia.IsKind(SyntaxKind.LineContinuationTrivia) AndAlso trivia.Span.End <= position Then 29ElseIf trivia.IsKind(SyntaxKind.EndOfLineTrivia) AndAlso trivia.Span.End <= position Then
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\VisualBasicSyntaxContext.vb (1)
264If targetToken.IsKind(SyntaxKind.HashToken) AndAlso targetToken.Span.End = position Then
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\TypeBlockSyntaxExtensions.vb (1)
19Dim start = destination.BlockStatement.Span.End
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Indentation\SpecialFormattingOperation.vb (4)
72TextSpan.FromBounds(startToken.FullSpan.Start, node.FullSpan.End), indentationDelta:=1, [option]:=IndentBlockOption.RelativePosition)) 110baseToken, startToken, endToken, TextSpan.FromBounds(baseToken.Span.End, closeBrace.Span.End), indentationDelta, IndentBlockOption.RelativePosition)) 159span = TextSpan.FromBounds(baseToken.Span.End, closeBrace.Span.End)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Indentation\VisualBasicIndentationService.Indenter.vb (4)
73Dim firstTrivia As SyntaxTrivia = indenter.Tree.GetRoot(indenter.CancellationToken).FindTrivia(tokenOpt.Value.Span.End + 1) 103If token.Span.End <= trivia.SpanStart AndAlso Not token.IsMissing Then 116If HasLinesBetween(indenter.Tree.GetText().Lines.IndexOf(token.Span.End), indenter.LineToBeIndented.LineNumber) Then 289If IsCommaInParameters(token) AndAlso (token.Span.End <= position AndAlso position <= token.GetNextToken().SpanStart) Then
Microsoft.CodeAnalysis.Workspaces (233)
Classification\ClassifierHelper.cs (7)
92var widenedSpan = new TextSpan(spans[0].Start, spans[^1].End); 310if (semanticPart1Span.End < semanticPart2Span.Start) 313semanticPart1Span.End, 318if (lastSemanticPartSpan.End < syntacticPartSpan.End) 321lastSemanticPartSpan.End, 322syntacticPartSpan.End)));
Classification\SyntaxClassification\SyntacticChangeRangeComputer.cs (8)
190Contract.ThrowIfFalse((oldRoot.FullSpan.End - currentOld.FullSpan.End) == 191(newRoot.FullSpan.End - currentNew.FullSpan.End)); 211return oldRoot.FullSpan.End - currentOld.FullSpan.End; 216return oldRoot.FullSpan.End - currentOld.FullSpan.End;
CodeCleanup\AbstractCodeCleanerService.cs (10)
205return TryCreateTextSpan(GetPreviousTokenStartPosition(previousTokenMarker.Type, previousToken), node.Span.End, out span); 226span = TextSpan.FromBounds(GetPreviousTokenStartPosition(previousTokenMarker.Type, previousToken), node.Span.End); 260return nextToken.GetPreviousToken(includeZeroWidth: true, includeSkipped: true, includeDirectives: true, includeDocumentationComments: true).Span.End; 263return nextToken.Span.End; 344? nextToken.Span.End 345: endToken.Span.End; 368endToken = root.FindTokenFromEnd(span.End, findInsideTrivia: true); 386endToken = FindTokenOnRightOfPosition(root, span.End); 389if (startToken.Span.End <= endToken.SpanStart) 391return TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End);
CodeFixes\FixAllOccurrences\TextChangeMerger.cs (1)
190otherChange.Span.End == change.Span.Start;
LanguageServices\FixAllSpanMappingService\AbstractFixAllSpanMappingService.cs (2)
94? syntaxFacts.GetContainingMemberDeclaration(root, span.End) 95: syntaxFacts.GetContainingTypeDeclaration(root, span.End);
LinkedFileDiffMerging\AbstractLinkedFileMergeConflictCommentAdditionService.cs (4)
38var currentPartitionEndLine = originalSourceText.Lines.GetLineFromPosition(changes.First().Span.End); 51currentPartitionEndLine = originalSourceText.Lines.GetLineFromPosition(change.Span.End); 69var endPosition = changePartition.Last().Span.End; 75var adjustedChanges = changePartition.Select(c => new TextChange(TextSpan.FromBounds(c.Span.Start - startLineStartPosition, c.Span.End - startLineStartPosition), c.NewText!));
LinkedFileDiffMerging\LinkedFileDiffMergingSession.cs (3)
151while (cumulativeChangeIndex < cumulativeChanges.Length && cumulativeChanges[cumulativeChangeIndex].Span.End < change.Span.Start) 280if (nextChange.Span.Start == currentChange.Span.End) 282currentChange = new TextChange(TextSpan.FromBounds(currentChange.Span.Start, nextChange.Span.End), currentChange.NewText + nextChange.NewText);
Rename\RenameUtilities.cs (1)
265Debug.Assert(subSpan.End <= replaceInsideString.Length);
Shared\Extensions\SourceTextExtensions.cs (1)
58text.GetLineAndOffset(textSpan.End, out endLineNumber, out endOffset);
src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (5)
39var currentOldEnd = accumulatedTextChangeSoFar.Value.Span.End; 78if (currentNewEnd > newChange.Span.End) 96currentOldEnd = currentOldEnd + newChange.Span.End - currentNewEnd; 388if (last.Span.End == change.Span.Start) 394else if (last.Span.End > change.Span.Start)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\ImmutableIntervalTree`1.cs (1)
227var thisEndValue = introspector.GetSpan(currentNode.Value).End;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\IntervalTreeAlgorithms`2.cs (3)
106var thisEnd = thisSpan.End; 126var thisEnd = thisSpan.End; 139var thisEnd = thisSpan.End;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\IntervalTreeHelpers.cs (2)
126introspector.GetSpan(witness.GetValue(tree, witness.GetMaxEndNode(tree, rightNode))).End >= start) 152introspector.GetSpan(witness.GetValue(tree, witness.GetMaxEndNode(tree, left))).End >= start)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\MutableIntervalTree`1.cs (1)
137=> introspector.GetSpan(value).End;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\NormalizedTextSpanCollection.cs (26)
169if (span1.End < span2.End) 173else if (span1.End == span2.End) 229if (span1.End < span2.End) 286if ((span2.Length == 0) || (span1.Start >= span2.End)) 290else if (span1.End <= span2.Start) 295Debug.Assert(lastEnd < span1.End); 296spans.Add(TextSpan.FromBounds(Math.Max(lastEnd, span1.Start), span1.End)); 310if (span1.End < span2.End) 314else if (span1.End == span2.End) 324lastEnd = span2.End; 334spans.Add(TextSpan.FromBounds(Math.Max(lastEnd, span1.Start), span1.End)); 406if (span1.End < span2.End) 410else if (span1.End == span2.End) 466if (span1.End < span2.End) 577end = span.End; 581end = Math.Max(end, span.End); 604var oldEnd = sorted[0].End; 608var newEnd = sorted[i].End;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxHelpers.cs (1)
19=> TextSpan.FromBounds(firstChar.Span.Start, lastChar.Span.End);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxNode.cs (2)
98return span.Value.End; 119end = Math.Max(token.VirtualChars.Last().Span.End, end);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxToken.cs (3)
87Math.Max(LeadingTrivia.Length == 0 ? int.MinValue : LeadingTrivia[^1].GetSpan().End, 88Math.Max(VirtualChars.Length == 0 ? int.MinValue : VirtualChars[^1].Span.End, 89TrailingTrivia.Length == 0 ? int.MinValue : TrailingTrivia[^1].GetSpan().End));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (6)
99Debug.Assert(currentVC.Span.End <= nextVC.Span.Start, "Virtual character spans have to be ordered."); 108Debug.Assert(currentVC.Span.End == nextVC.Span.Start, "Virtual character spans have to be touching."); 118Debug.Assert(lastVC.Span.End == token.Span.End - "\"".Length, "Last span has to end right before the end of the string token."); 122Debug.Assert(lastVC.Span.End == token.Span.End - "\"u8".Length, "Last span has to end right before the end of the string token.");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.cs (3)
59if (span.End > sequence.Length) 197Debug.Assert(_span.End == virtualChars._span.Start); 211TextSpan.FromBounds(chars1._span.Start, chars2._span.End));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SourceTextExtensions_SharedWithCodeStyle.cs (2)
49var endLineNumber = text.Lines.IndexOf(span.End); 86text.AreOnSameLine(token1.Span.End, token2.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (12)
306Math.Max(fullSpan.End, node.Span.End)); 320var start = startNode.Span.End; 420var d = x.End - y.End; 555if (token.Span.Length > 0 && position <= token.Span.End) 604return (position < root.FullSpan.End || !(root is ICompilationUnitSyntax)) 629else if (token.Span.End <= position) 638while (token.RawKind != 0 && token.Span.End <= position && token.Span.End <= root.FullSpan.End); 674else if (token.Span.End < position)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTokenExtensions.cs (1)
77previousToken.Span.End == position)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (5)
80if ((token.Span.Contains(position) || token.Span.End == position) && predicate(semanticModel, token)) 87if (token.Span.End == position && predicate(semanticModel, token)) 105var endLineNumber = text.Lines.IndexOf(span.End); 153if (token.Span.End == position) 160if (position == root.FullSpan.End)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\TextLineExtensions.cs (1)
69for (var i = line.Span.Start; i < line.Span.End; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\TextSpanExtensions.cs (8)
36if (span.End > end) 38end = span.End; 62var innerSpan = TextSpan.FromBounds(startNode.Span.Start, endNode.Span.End); 63var outerSpan = TextSpan.FromBounds(startNode.FullSpan.Start, endNode.FullSpan.End); 79var startSegmentEnd = Math.Min(span.End, except.Start); 83var endSegmentStart = Math.Max(span.Start, except.End); 84if (endSegmentStart < span.End) 85yield return TextSpan.FromBounds(endSegmentStart, span.End);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (7)
59if (token.Span.End <= operation.TextSpan.Start && 349if (operation.TextSpan.End == position && nextToken.IsMissing) 357if (operation.TextSpan.End == position && position == nextToken.SpanStart) 366if (root.FullSpan.End == position && operation.TextSpan.End == position) 374if (lastVisibleToken.Span.End <= position && operation.TextSpan.End == position)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (2)
644var spanBetweenTwoTokens = TextSpan.FromBounds(token1.SpanStart, token2.Span.End); 659var spanBetweenTwoTokens = TextSpan.FromBounds(token1.SpanStart, token2.Span.End);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.IndentationData.cs (2)
68this.InseparableRegionSpan = TextSpan.FromBounds(inseparableRegionSpanStart, textSpan.End); 82this.InseparableRegionSpan = TextSpan.FromBounds(inseparableRegionSpanStart, textSpan.End);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
69var span = TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\ContextMutableIntervalTree.cs (2)
49var thisEnd = thisSpan.End; 61var thisEnd = thisSpan.End;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (2)
339var endPosition = this.TreeData.IsLastToken(_endToken) ? this.TreeData.EndPosition : _endToken.Span.End; 458var spanBetweenTokens = TextSpan.FromBounds(token1.Span.End, token2.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.OperationApplier.cs (1)
337var spanBetweenTokens = TextSpan.FromBounds(previousToken.Token.Span.End, currentToken.Token.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormattingResult.cs (1)
78var span = TextSpan.FromBounds(token1.RawKind == 0 ? this.TreeInfo.StartPosition : token1.Span.End, token2.RawKind == 0 ? this.TreeInfo.EndPosition : token2.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenData.cs (2)
76var end = this.Token.Span.End - other.Token.Span.End;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenStream.cs (4)
87Debug.Assert(previousToken.FullSpan.End <= currentToken.FullSpan.Start); 211if (token1.Span.End > token2.SpanStart) 390Debug.Assert(token1.Token.Span.End <= token2.Token.SpanStart); 415Debug.Assert(token1.Token.Span.End <= token2.Token.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.cs (1)
66get { return this.Root.FullSpan.End; }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.NodeAndText.cs (3)
44return _text.ToString(TextSpan.FromBounds(token1.Span.End, token1.FullSpan.End)); 47return _text.ToString(TextSpan.FromBounds(token1.Span.End, token2.SpanStart));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (2)
305return TextSpan.FromBounds(firstToken.SpanStart, lastToken.Span.End); 324last = TextSpan.FromBounds(last.Start, span.End);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\BaseIndentationFormattingRule.cs (9)
131=> TextSpan.FromBounds(Math.Max(_span.Start, textSpan.Start), Math.Min(_span.End, textSpan.End)); 153token2 = root.FindTokenFromEnd(span.End); 157if (span.End < token1.Span.Start) 162if (token2.Span.End < span.Start) 174var start = token1.Span.End; 180start = token1.Span.End; 193if (token2.Span.End <= span.End)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\FormattingOperations.cs (3)
31=> CreateAnchorIndentationOperation(anchorToken, endToken, TextSpan.FromBounds(anchorToken.Span.End, endToken.Span.End)); 43=> CreateSuppressOperation(startToken, endToken, TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End), option);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\IndentBlockOperation.cs (1)
39Contract.ThrowIfFalse(baseToken.Span.End <= textSpan.Start);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (6)
206return this.Token1.Span.End; 474if (ContainsOnlyWhitespace(lastToken.Span.End, lastToken.FullSpan.End)) 502for (var i = span.Start - this.Token1.Span.End; i < span.Length; i++) 841return TextSpan.FromBounds(trivia1.FullSpan.End, this.EndPosition); 844return TextSpan.FromBounds(trivia1.FullSpan.End, trivia2.FullSpan.Start);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (3)
184for (int i = span.Start, n = span.End; i < n; i++) 197for (int i = span.Start, n = span.End; i < n; i++) 410newWords[i] = name[parts[i].Start..parts[i].End];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.WordSpanEnumerator.cs (10)
50var nextWordSeparator = _name.IndexOf(_wordSeparator, Current.End); 51if (nextWordSeparator == Current.End) 54Current = new TextSpan(Current.End + _wordSeparator.Length, 0); 61nextWordSeparator = _nameSpan.End; 65if (Current.End > _nameSpan.End) 72Current = TextSpan.FromBounds(Current.End, Math.Min(_nameSpan.End, nextWordSeparator)); 76return Current.Length > 0 && Current.End <= _nameSpan.End;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\HeaderFacts\AbstractHeaderFacts.cs (3)
48end: lastTokenOrNodeOfHeader.FullSpan.End); 94var endOfAttributeLists = attributeList.Last().Span.End; 97return Math.Min(afterAttributesToken.Span.Start, node.Span.End);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SelectedMembers\AbstractSelectedMembers.cs (2)
176position >= token.Span.End && 177text.AreOnSameLine(position, token.Span.End))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (3)
164var span = TextSpan.FromBounds(nodes.First().Span.Start, nodes.Last().Span.End); 455var endOfAttributeLists = attributeList.Last().Span.End; 458var endOfNode = node.Span.End;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (27)
31d = o2.TextSpan.End - o1.TextSpan.End; 64if (currentOne.Item1.SpanStart <= previousOne.Item2.Span.End) 67previousOne = ValueTuple.Create(previousOne.Item1, previousOne.Item2.Span.End < currentOne.Item2.Span.End ? currentOne.Item2 : previousOne.Item2); 104var endToken = (root.FullSpan.End <= textSpan.End) ? 105root.GetLastToken(includeZeroWidth: true) : root.FindToken(textSpan.End); 114if (endToken.Span.End < textSpan.End) 124Contract.ThrowIfFalse(startToken.Equals(endToken) || startToken.Span.End <= endToken.SpanStart); 143return root.FullSpan.End == startToken.SpanStart || startToken.FullSpan.End > endToken.FullSpan.Start; 158=> (token1.RawKind == 0) ? text.ToString(TextSpan.FromBounds(0, token2.SpanStart)) : text.ToString(TextSpan.FromBounds(token1.Span.End, token2.SpanStart)); 185if (token1.FullSpan.End == token2.FullSpan.Start) 193for (var token = token1.GetNextToken(includeZeroWidth: true); token.FullSpan.End <= token2.FullSpan.Start; token = token.GetNextToken(includeZeroWidth: true)) 198AppendPartialLeadingTriviaText(token2, builder, token1.TrailingTrivia.FullSpan.End); 233if (trivia.FullSpan.End <= token1FullSpanEnd) 278var backwardPosition = token.FullSpan.End; 283return token.FullSpan.End; 286Contract.ThrowIfFalse(backwardPosition < parentNode.FullSpan.End); 300return previousToken.Span.End; 318return previousToken.Span.End; 335if (position > fullSpan.End) 363var endToken = root.FindTokenFromEnd(span.End).GetNextToken(); 366var endPosition = endToken.RawKind == 0 ? root.Span.End : endToken.Span.End;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (1)
36start = span.End;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
530var nextToken = root.FindToken(attributeToRemove.FullSpan.End + 1);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
51return TextSpan.FromBounds(start.SpanStart, end.Span.End);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (2)
221var beforeMember = declarationList.FirstOrDefault(m => m.Span.End >= info.Context.BeforeThisLocation.SourceSpan.End);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeRefactorings\AbstractRefactoringHelpersService.cs (7)
164if (tokenOnLocation.RawKind == syntaxKinds.CommaToken && location >= tokenOnLocation.Span.End) 184else if (previousToken != default && previousToken.Span.End == commaToken.Span.Start) 200var previousToken = tokenOnLocation.Span.End == location 204tokenToLeft = previousToken.Span.End == location 270var location = tokenToLeft.Span.End; 288if (leftNode.GetLastToken().Span.End != location && leftNode.Span.End != location)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeRefactorings\CodeRefactoringHelpers.cs (4)
85var endNode = node.FindToken(node.Span.End - 1).Parent; 96return beginningNode.Span.End <= selection.Start || endNode.Span.Start >= selection.End; 113var end = span.End;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
172var affectedSpan = TextSpan.FromBounds(previousToken.SpanStart, FirstStatementAffectedInInnermostBlock.Span.End);
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (3)
MSBuildWorkspaceTestBase.cs (3)
96return classBlock.Implements[^1].FullSpan.End; 100return classBlock.Inherits[^1].FullSpan.End; 104return classBlock.BlockStatement.FullSpan.End;
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Formatting\FormattingTestBase.cs (1)
111if (span.Start == 0 && span.End == inputText.Length)
Microsoft.CodeAnalysis.Workspaces.UnitTests (5)
CodeCleanup\Extensions.cs (1)
23return TextSpan.FromBounds(previousToken.SpanStart, endToken.Span.End);
Shared\Extensions\TextSpanExtensions\SubtractTests.cs (3)
35private static int RightBeforeEnd(TextSpan span) => span.End - 1; 36private static int AtEnd(TextSpan span) => span.End; 37private static int RightAfterEnd(TextSpan span) => span.End + 1;
SyntaxPathTests.cs (1)
415var newFullText = oldFullText[..offset] + newText + oldFullText[span.End..];
Microsoft.VisualStudio.LanguageServices (32)
Snippets\AbstractSnippetCommandHandler.cs (1)
281return GetSnippetExpansionClientFactory(document).GetOrCreateSnippetExpansionClient(document, textView, subjectBuffer).TryInsertExpansion(span.Value.Start, span.Value.End, cancellationToken);
ValueTracking\TreeItemViewModel.cs (1)
78sourceText.GetLineAndOffset(textSpan.End, out var lineEnd, out var _);
Venus\ContainedDocument.cs (26)
293if (visibleSpan.End < change.Span.Start) 335if (change.Span.End <= visibleTextSpan.Start) 340if (visibleTextSpan.End <= change.Span.Start) 509var visibleLastLineInOriginalText = originalText.Lines.GetLineFromPosition(visibleSpanInOriginalText.End); 520if (visibleSpanInOriginalText.Contains(spanInOriginalText) && visibleSpanInOriginalText.End != spanInOriginalText.End) 559visibleSpanInOriginalText.Start <= spanInOriginalText.End && 560spanInOriginalText.End < visibleSpanInOriginalText.End) 566if (visibleFirstLineInOriginalText.EndIncludingLineBreak <= spanInOriginalText.End) 569TextSpan.FromBounds(visibleFirstLineInOriginalText.EndIncludingLineBreak, spanInOriginalText.End), 579spanInOriginalText.Start <= visibleSpanInOriginalText.End && 580visibleSpanInOriginalText.End <= spanInOriginalText.End) 734visibleSpansInOriginal[currentVisibleSpanIndex].End < change.Span.Start) 831var end = visibleSpan.End; 891for (var line = startingLine; line.Start < span.End; line = text.Lines[line.LineNumber + 1]) 914for (; start < visibleSpan.End; start++) 922var end = visibleSpan.End - 1; 937var lastLine = text.Lines.GetLineFromPosition(visibleSpan.End); 970var end = textSpan.End - 1; 990var end = textSpan.End - 1; 994if (CheckCode(subjectSnapshot, textSpan.End, ch, VBRazorBlock, checkAt: false) || 995CheckCode(subjectSnapshot, textSpan.End, ch, FunctionsRazor, checkAt: false)) 999if (token.Span.End == textSpan.End && syntaxFact != null)
Venus\ContainedLanguage.IVsContainedCode.cs (3)
61iEndLine = snapshot.GetLineNumberFromPosition(tuple.Item1.End), 62iEndIndex = tuple.Item1.End - snapshot.GetLineFromPosition(tuple.Item1.End).Start,
Workspace\VisualStudioDocumentNavigationService.cs (1)
377=> TextSpan.FromBounds(GetPositionWithinDocumentBounds(span.Start, documentLength), GetPositionWithinDocumentBounds(span.End, documentLength));
Microsoft.VisualStudio.LanguageServices.CSharp (42)
CodeModel\CSharpCodeModelService.cs (3)
2800var deletionEnd = attributeList.FullSpan.End; 2846var deletionEnd = node.FullSpan.End; 3204var endToken = root.FindToken(span.End).GetNextToken();
CodeModel\CSharpCodeModelService.NodeLocator.cs (39)
139var openBraceLine = text.Lines.GetLineFromPosition(openBrace.Span.End); 140var textAfterBrace = text.ToString(TextSpan.FromBounds(openBrace.Span.End, openBraceLine.End)); 144: new VirtualTreePoint(openBrace.SyntaxTree, text, openBrace.Span.End); 202return new VirtualTreePoint(openBrace.SyntaxTree, text, openBrace.Span.End); 807endPosition = node.Span.End; 836endPosition = node.Span.End; 840endPosition = node.Name.Span.End; 870endPosition = node.Span.End; 900endPosition = node.AttributeLists.Last().GetLastToken().Span.End; 904endPosition = node.Span.End; 908endPosition = node.Identifier.Span.End; 941endPosition = node.AttributeLists.Last().GetLastToken().Span.End; 945endPosition = node.Span.End; 958endPosition = ((MethodDeclarationSyntax)node).Identifier.Span.End; 961endPosition = ((ConstructorDeclarationSyntax)node).Identifier.Span.End; 964endPosition = ((DestructorDeclarationSyntax)node).Identifier.Span.End; 967endPosition = ((ConversionOperatorDeclarationSyntax)node).ImplicitOrExplicitKeyword.Span.End; 970endPosition = ((OperatorDeclarationSyntax)node).OperatorToken.Span.End; 973endPosition = node.GetFirstTokenAfterAttributes().Span.End; 1015endPosition = node.AttributeLists.Last().Span.End; 1019endPosition = node.Span.End; 1073endPosition = node.Span.End; 1114endPosition = node.AttributeLists.Last().Span.End; 1118endPosition = node.Span.End; 1122endPosition = node.Identifier.Span.End; 1153endPosition = node.Span.End; 1157endPosition = node.Name.Span.End; 1170return new VirtualTreePoint(fileScopedNamespace.SyntaxTree, text, fileScopedNamespace.Parent.Span.End); 1203endPosition = node.Span.End; 1207endPosition = node.Name.Span.End; 1237endPosition = node.AttributeLists.Last().GetLastToken().Span.End; 1241endPosition = node.Span.End; 1248endPosition = node.Identifier.Span.End; 1279endPosition = field.AttributeLists.Last().GetLastToken().Span.End; 1283endPosition = field.Span.End; 1290endPosition = node.Identifier.Span.End; 1320endPosition = node.AttributeLists.Last().GetLastToken().Span.End; 1324endPosition = node.Span.End; 1331endPosition = node.Identifier.Span.End;
Microsoft.VisualStudio.LanguageServices.UnitTests (3)
Snippets\SnippetExpansionClientTestsHelper.vb (3)
27.iEndIndex = snippetSpanInSurfaceBuffer.End - snippetEndLine.Start.Position 72Dim snippetEndLine = document.GetTextBuffer().CurrentSnapshot.GetLineFromPosition(snippetSpan.End) 78.iEndIndex = snippetSpan.End - snippetEndLine.Start.Position
Microsoft.VisualStudio.LanguageServices.VisualBasic (54)
CodeModel\VisualBasicCodeModelService.NodeLocator.vb (47)
265startPosition = attributes.Last().GreaterThanToken.Span.End 343startPosition = statement.Span.End 365startPosition = typeBlock.BlockStatement.Identifier.Span.End 371startPosition = typeBlock.BlockStatement.Span.End 374startPosition = typeBlock.Span.End 414startPosition = statement.Span.End 436startPosition = enumBlock.EnumStatement.Identifier.Span.End 442startPosition = enumBlock.EnumStatement.Span.End 445startPosition = enumBlock.Span.End 557endPosition = declareStatement.Identifier.Span.End 572endPosition = declareStatement.Span.End 624startPosition = DirectCast(methodBlock.BlockStatement, SubNewStatementSyntax).NewKeyword.Span.End 627startPosition = DirectCast(methodBlock.BlockStatement, MethodStatementSyntax).Identifier.Span.End 629startPosition = DirectCast(methodBlock.BlockStatement, OperatorStatementSyntax).OperatorToken.Span.End 657startPosition = methodBlock.BlockStatement.Span.End 660startPosition = methodBlock.Span.End 677endPosition = methodStatement.Identifier.Span.End 692endPosition = methodStatement.Span.End 728Dim beginLine = text.Lines.IndexOf(propertyStatement.Span.End) 750startPosition = propertyStatement.Identifier.Span.End 760startPosition = propertyStatement.Span.End 766DirectCast(propertyStatement.Parent, PropertyBlockSyntax).EndPropertyStatement.Span.End, 767propertyStatement.Span.End) 873startPosition = eventStatement.Identifier.Span.End 883startPosition = eventStatement.Span.End 889DirectCast(eventStatement.Parent, EventBlockSyntax).EndEventStatement.Span.End, 890eventStatement.Span.End) 898eventStatement.Span.End) 948endPosition = delegateStatement.Identifier.Span.End 963endPosition = delegateStatement.Span.End 1043endPosition = namespaceBlock.NamespaceStatement.Name.Span.End 1051endPosition = namespaceBlock.NamespaceStatement.Span.End 1055endPosition = namespaceBlock.EndNamespaceStatement.Span.End 1134endPosition = variable.Span.End 1145endPosition = fieldDeclaration.Span.End 1158endPosition = enumMember.Identifier.Span.End 1169endPosition = enumMember.Span.End 1212endPosition = parameter.Identifier.Span.End 1223endPosition = parameter.Span.End 1274endPosition = importsStatement.Span.End 1326endPosition = optionStatement.Span.End 1378endPosition = inheritsStatement.Span.End 1430endPosition = implementsStatement.Span.End 1477endPosition = attribute.Name.Span.End 1487endPosition = attribute.Span.End 1546endPosition = DirectCast(argument, SimpleArgumentSyntax).NameColonEquals.Name.Span.End 1556endPosition = argument.Span.End
CodeModel\VisualBasicCodeModelService.vb (7)
1279Dim deletionEnd = node.FullSpan.End 1356Dim spanEnd = attributeList.FullSpan.End 3733Dim endToken = GetTokenWithoutAnnotation(root.FindToken(span.End), Function(t) t.GetNextToken()) 4072position = methodStatement.ParameterList.CloseParenToken.Span.End 4075position = methodStatement.HandlesClause.Span.End 4133text = text.Replace(TextSpan.FromBounds(clauseItemToRemove.SpanStart, methodStatement.HandlesClause.Events.GetSeparator(0).Span.End), String.Empty) 4135text = text.Replace(TextSpan.FromBounds(methodStatement.HandlesClause.Events.GetSeparator(index - 1).SpanStart, clauseItemToRemove.Span.End), String.Empty)
Microsoft.VisualStudio.LanguageServices.Xaml (1)
Features\DocumentSpan.cs (1)
26return $"{Document.Name} [{TextSpan.Start}...{TextSpan.End}]";