892 references to FromBounds
Microsoft.AspNetCore.App.Analyzers (14)
Infrastructure\EmbeddedSyntax\EmbeddedSyntaxHelpers.cs (1)
26=> TextSpan.FromBounds(firstChar.Span.Start, lastChar.Span.End);
Infrastructure\EmbeddedSyntax\EmbeddedSyntaxNode.cs (2)
41return TextSpan.FromBounds(start, end); 56return TextSpan.FromBounds(start.Value, end.Value);
Infrastructure\EmbeddedSyntax\EmbeddedSyntaxToken.cs (1)
71return TextSpan.FromBounds(start, end);
Infrastructure\RoutePattern\RoutePatternLexer.cs (2)
32=> Text.GetSubSequence(TextSpan.FromBounds(start, end)); 68=> TextSpan.FromBounds(Text[startInclusive].Span.Start, Text[endExclusive - 1].Span.End);
Infrastructure\VirtualChars\AbstractVirtualCharService.cs (1)
240return sequence.GetSubSequence(TextSpan.FromBounds(startIndexInclusive, endIndexExclusive));
Infrastructure\VirtualChars\CSharpVirtualCharService.cs (2)
334runeResults.Add(VirtualChar.Create(rune, TextSpan.FromBounds(span.Start, nextSpan.End))); 526result.Add((character, TextSpan.FromBounds(startIndex + offset, endIndex + offset)));
Infrastructure\VirtualChars\VirtualCharSequence.cs (3)
179=> this.GetSubSequence(TextSpan.FromBounds(count, this.Length)); 194return this.GetSubSequence(TextSpan.FromBounds(start, this.Length)); 229TextSpan.FromBounds(chars1._span.Start, chars2._span.End));
RouteEmbeddedLanguage\FrameworkParametersCompletionProvider.cs (1)
521var replacementSpan = TextSpan.FromBounds(replacementStart, replacementEnd);
RouteEmbeddedLanguage\RoutePatternCompletionProvider.cs (1)
367var replacementSpan = TextSpan.FromBounds(replacementStart, replacementEnd);
Microsoft.AspNetCore.App.Analyzers.Test (1)
RouteEmbeddedLanguage\Infrastructure\MarkupTestFile.cs (1)
196var span = TextSpan.FromBounds(matchIndex, finalIndex);
Microsoft.CodeAnalysis (15)
Syntax\SyntaxDiffer.cs (2)
646return TextSpan.FromBounds(start, end); 671return TextSpan.FromBounds(start, 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\SyntaxTokenList.cs (1)
176return TextSpan.FromBounds(Position + Node.GetLeadingTriviaWidth(),
Syntax\SyntaxTriviaList.cs (1)
174return TextSpan.FromBounds(Position + Node.GetLeadingTriviaWidth(),
Text\SourceText.cs (2)
988return TextLine.FromSpanUnsafe(_text, TextSpan.FromBounds(start, _text.Length)); 993return TextLine.FromSpanUnsafe(_text, TextSpan.FromBounds(start, end));
Text\TextChangeRange.cs (1)
126var combined = TextSpan.FromBounds(start, end);
Text\TextChangeRangeExtensions.cs (1)
100return new TextChangeRange(TextSpan.FromBounds(currentStart, currentOldEnd), currentNewEnd - currentStart);
Text\TextLine.cs (2)
160get { return TextSpan.FromBounds(this.Start, this.End); } 168get { return TextSpan.FromBounds(this.Start, this.EndIncludingLineBreak); }
Text\TextLineCollection.cs (1)
78return TextSpan.FromBounds(GetPosition(span.Start), GetPosition(span.End));
Text\TextSpan.cs (2)
123? TextSpan.FromBounds(overlapStart, overlapEnd) 174? TextSpan.FromBounds(intersectStart, intersectEnd)
Microsoft.CodeAnalysis.CodeStyle (61)
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 (3)
153textSpan = TextSpan.FromBounds(node.Span.Start, nodeEnd); 161textSpan = TextSpan.FromBounds(previous.Value.textSpan.Start, nodeEnd); 167textSpan = TextSpan.FromBounds(node.Span.Start, nodeEnd);
src\Analyzers\Core\Analyzers\RemoveUnnecessaryParentheses\AbstractRemoveUnnecessaryParenthesesDiagnosticAnalyzer.cs (1)
135return Location.Create(parenthesizedExpression.SyntaxTree, TextSpan.FromBounds(parenthesizedExpressionLocation.SourceSpan.Start, textSpanEndPosition));
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationHelpers.cs (1)
188: TextSpan.FromBounds(sequence.First().Span.Start, sequence.Last().Span.End);
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UseCollectionInitializerHelpers.cs (4)
36syntaxTree.GetLocation(TextSpan.FromBounds(match.SpanStart, arguments[0].SpanStart)), 37syntaxTree.GetLocation(TextSpan.FromBounds(arguments.Last().FullSpan.End, match.Span.End))); 48syntaxTree.GetLocation(TextSpan.FromBounds(match.SpanStart, expression.SpanStart)), 49syntaxTree.GetLocation(TextSpan.FromBounds(expression.FullSpan.End, match.Span.End)));
src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (1)
100return new TextChangeRange(TextSpan.FromBounds(currentStart, currentOldEnd), currentNewEnd - currentStart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\NormalizedTextSpanCollection.cs (7)
122spans.Add(TextSpan.FromBounds(start, end)); 296spans.Add(TextSpan.FromBounds(Math.Max(lastEnd, span1.Start), span1.End)); 307spans.Add(TextSpan.FromBounds(Math.Max(lastEnd, span1.Start), span2.Start)); 334spans.Add(TextSpan.FromBounds(Math.Max(lastEnd, span1.Start), span1.End)); 568spans.Add(TextSpan.FromBounds(start, end)); 611normalized.Add(TextSpan.FromBounds(oldStart, oldEnd)); 621normalized.Add(TextSpan.FromBounds(oldStart, oldEnd));
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)
63return TextSpan.FromBounds(start, end); 76return TextSpan.FromBounds(start.Value, end.Value);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (1)
242return sequence.GetSubSequence(TextSpan.FromBounds(startIndexInclusive, endIndexExclusive));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.cs (1)
211TextSpan.FromBounds(chars1._span.Start, chars2._span.End));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (2)
304fullSpan = TextSpan.FromBounds( 323var textSpan = TextSpan.FromBounds(start, end);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\TextSpanExtensions.cs (5)
48return TextSpan.FromBounds(start, end); 62var innerSpan = TextSpan.FromBounds(startNode.Span.Start, endNode.Span.End); 63var outerSpan = TextSpan.FromBounds(startNode.FullSpan.Start, endNode.FullSpan.End); 81yield return TextSpan.FromBounds(span.Start, startSegmentEnd); 85yield return TextSpan.FromBounds(endSegmentStart, 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\Engine\AbstractFormatEngine.cs (2)
341return TextSpan.FromBounds(startPosition, endPosition); 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\TreeData.NodeAndText.cs (3)
38return _text.ToString(TextSpan.FromBounds(token2.FullSpan.Start, token2.SpanStart)); 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 (2)
131=> TextSpan.FromBounds(Math.Max(_span.Start, textSpan.Start), Math.Min(_span.End, textSpan.End)); 217return TextSpan.FromBounds(start, end);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\FormattingOperations.cs (2)
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\TriviaEngine\AbstractTriviaFormatter.cs (4)
500var span = TextSpan.FromBounds(start, end); 836return TextSpan.FromBounds(this.StartPosition, trivia2.FullSpan.Start); 841return TextSpan.FromBounds(trivia1.FullSpan.End, this.EndPosition); 844return TextSpan.FromBounds(trivia1.FullSpan.End, trivia2.FullSpan.Start);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (2)
242return TextSpan.FromBounds(LineToBeIndented.Start, position); 245return TextSpan.FromBounds(position, LineToBeIndented.Start);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (1)
159var spanToCheck = TextSpan.FromBounds(0, name.Length - Suffix.Length);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.WordSpanEnumerator.cs (1)
72Current = TextSpan.FromBounds(Current.End, Math.Min(_nameSpan.End, nextWordSeparator));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\HeaderFacts\AbstractHeaderFacts.cs (1)
46var headerSpan = TextSpan.FromBounds(
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (2)
164var span = TextSpan.FromBounds(nodes.First().Span.Start, nodes.Last().Span.End); 461return TextSpan.FromBounds(startOfNodeWithoutAttributes, endOfNode);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (4)
158=> (token1.RawKind == 0) ? text.ToString(TextSpan.FromBounds(0, token2.SpanStart)) : text.ToString(TextSpan.FromBounds(token1.Span.End, token2.SpanStart)); 267return TextSpan.FromBounds(startPosition, endPosition); 368return TextSpan.FromBounds(startPosition, endPosition);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (1)
169return TextSpan.FromBounds(wordStart, current);
Microsoft.CodeAnalysis.CodeStyle.Fixes (13)
src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (8)
333edits.Add(new TextChange(TextSpan.FromBounds(startPos, startEnd), "")); 337edits.Add(new TextChange(TextSpan.FromBounds(firstMiddlePos, bottomEnd), "")); 346edits.Add(new TextChange(TextSpan.FromBounds(startPos, equalsEnd), "")); 350edits.Add(new TextChange(TextSpan.FromBounds(endPos, bottomEnd), "")); 359edits.Add(new TextChange(TextSpan.FromBounds(startPos, startEnd), "")); 365edits.Add(new TextChange(TextSpan.FromBounds(secondMiddlePos, equalsEnd), "")); 371edits.Add(new TextChange(TextSpan.FromBounds(firstMiddlePos, equalsEnd), "")); 376edits.Add(new TextChange(TextSpan.FromBounds(endPos, bottomEnd), ""));
src\Analyzers\Core\CodeFixes\Formatting\FormattingCodeFixProvider.cs (1)
70var spanToFormat = TextSpan.FromBounds(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
51return TextSpan.FromBounds(start.SpanStart, end.Span.End);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeRefactorings\CodeRefactoringHelpers.cs (1)
121return TextSpan.FromBounds(start, end);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Indentation\IIndentationService.cs (1)
40return document.Text.ToString(TextSpan.FromBounds(tokenLine.Start, token.SpanStart));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
172var affectedSpan = TextSpan.FromBounds(previousToken.SpanStart, FirstStatementAffectedInInnermostBlock.Span.End);
Microsoft.CodeAnalysis.CSharp (13)
Compilation\CSharpCompilation.cs (1)
2957var location = syntaxTree.GetLocation(TextSpan.FromBounds(0, 0));
Lowering\Instrumentation\DebugInfoInjector_SequencePoints.cs (4)
33TextSpan part = TextSpan.FromBounds(start, end); 44TextSpan span = TextSpan.FromBounds(start, end); 81return TextSpan.FromBounds(startPos, endPos); 167part = TextSpan.FromBounds(start, end);
Parser\Lexer.cs (2)
736info.Text = TextWindow.Text.ToString(TextSpan.FromBounds(startingPosition, end)); 2011var text = TextWindow.Text.GetSubText(TextSpan.FromBounds(savePosition, TextWindow.Position));
Syntax\SyntaxNodeRemover.cs (6)
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);
Microsoft.CodeAnalysis.CSharp.CodeStyle (38)
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 (1)
72TextSpan.FromBounds(start, root.Members.OfType<GlobalStatementSyntax>().Last().FullSpan.End));
src\Analyzers\CSharp\Analyzers\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessAnalyzer.cs (2)
182var fadeLocation = Location.Create(tree, TextSpan.FromBounds(firstStatement.SpanStart, previousToken.Span.End)); 203fadeLocation = 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 (2)
228var startReportSpan = TextSpan.FromBounds(anonymousFunction.SpanStart, invokedExpression.SpanStart); 229var endReportSpan = TextSpan.FromBounds(invokedExpression.Span.End, anonymousFunction.Span.End);
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 (1)
218syntaxTree.GetLocation(TextSpan.FromBounds(
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForCreateDiagnosticAnalyzer.cs (1)
61syntaxTree.GetLocation(TextSpan.FromBounds(
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForNewDiagnosticAnalyzer.cs (1)
86syntaxTree.GetLocation(TextSpan.FromBounds(
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForStackAllocDiagnosticAnalyzer.cs (2)
70syntaxTree.GetLocation(TextSpan.FromBounds( 110syntaxTree.GetLocation(TextSpan.FromBounds(
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\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 (1)
519result.Add((character, TextSpan.FromBounds(startIndex + offset, endIndex + offset)));
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\Formatting\Engine\Trivia\TriviaRewriter.cs (3)
103return TextSpan.FromBounds(_node.FullSpan.Start, pair.Item2.SpanStart); 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)
53list.Add(FormattingOperations.CreateIndentBlockOperation(startToken, endToken, TextSpan.FromBounds(startPosition, endPosition), indentationDelta: -1, option: option));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\IndentBlockFormattingRule.cs (4)
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); 363AddIndentBlockOperation(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); 121_root, [TextSpan.FromBounds(adjustedStartPosition, adjustedEndPosition)], _options.FormattingOptions, smartTokenFormattingRules, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (2)
994=> TextSpan.FromBounds(body.OpenBraceToken.Span.End, body.CloseBraceToken.SpanStart); 1135return !branch.IsActive || !branch.BranchTaken ? TextSpan.FromBounds(branch.FullSpan.Start, position) : default;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (10)
src\Analyzers\CSharp\CodeFixes\NewLines\ArrowExpressionClausePlacement\ArrowExpressionClausePlacementCodeFixProvider.cs (1)
93edits.Add(new TextChange(TextSpan.FromBounds(start, end), ""));
src\Analyzers\CSharp\CodeFixes\NewLines\ConditionalExpressionPlacement\ConditionalExpressionPlacementCodeFixProvider.cs (1)
95edits.Add(new TextChange(TextSpan.FromBounds(start, end), ""));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\CompilationUnitSyntaxExtensions.cs (3)
57return TextSpan.FromBounds(start, end); 66return TextSpan.FromBounds(start, end); 74return TextSpan.FromBounds(start, end);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeDeclarationSyntaxExtensions.cs (3)
31indices.Add(!destination.OverlapsHiddenPosition(TextSpan.FromBounds(start, end), cancellationToken)); 37indices.Add(!destination.OverlapsHiddenPosition(TextSpan.FromBounds(start, end), cancellationToken)); 49indices.Add(!destination.OverlapsHiddenPosition(TextSpan.FromBounds(start, end), cancellationToken));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.cs (2)
78spans.Add(TextSpan.FromBounds(0, GetEndPosition(compilationUnit, compilationUnit.Members))); 90spans.Add(TextSpan.FromBounds(namespaceMember.SpanStart, GetEndPosition(namespaceMember, namespaceMember.Members)));
Microsoft.CodeAnalysis.CSharp.EditorFeatures (21)
AutomaticCompletion\AutomaticLineEnderCommandHandler.cs (2)
132return CommonFormattingHelpers.GetFormattingSpan(root, TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End)); 212var endingString = text.ToString(TextSpan.FromBounds(lastToken.Span.End, line.End));
StringCopyPaste\StringCopyPasteData.cs (1)
117var subsequence = virtualChars.GetSubSequence(TextSpan.FromBounds(firstCharIndexInclusive, lastCharIndexInclusive + 1));
StringCopyPaste\StringCopyPasteHelpers.cs (1)
514commonIndentPrefix = GetCommonIndentationPrefix(commonIndentPrefix, text, TextSpan.FromBounds(line.Start, nonWhitespaceIndex));
StringCopyPaste\StringInfo.cs (17)
98var contentSpans = ImmutableArray.Create(TextSpan.FromBounds(start, end)); 104startDelimiterSpan: TextSpan.FromBounds(literal.SpanStart, start), 105endDelimiterSpan: TextSpan.FromBounds(end, literal.Span.End), 106endDelimiterSpanWithoutSuffix: TextSpan.FromBounds(end, endBeforeU8Suffix), 145TextSpan.FromBounds(literal.SpanStart, rawStart), 146TextSpan.FromBounds(rawEnd, literal.Span.End), 147TextSpan.FromBounds(rawEnd, endBeforeU8Suffix), 148contentSpans: [TextSpan.FromBounds(start, end)]); 175startDelimiterSpan: TextSpan.FromBounds(literal.SpanStart, start), 176endDelimiterSpan: TextSpan.FromBounds(end, literal.Span.End), 177endDelimiterSpanWithoutSuffix: TextSpan.FromBounds(end, endBeforeU8Suffix), 178[TextSpan.FromBounds(start, end)]); 209result.Add(TextSpan.FromBounds(currentPosition, content.SpanStart)); 215result.Add(TextSpan.FromBounds(currentPosition, end)); 219startDelimiterSpan: TextSpan.FromBounds(interpolatedString.SpanStart, interpolatedString.StringStartToken.Span.End), 220endDelimiterSpan: TextSpan.FromBounds(interpolatedString.StringEndToken.SpanStart, interpolatedString.Span.End), 221endDelimiterSpanWithoutSuffix: TextSpan.FromBounds(interpolatedString.StringEndToken.SpanStart, endBeforeU8Suffix),
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
Completion\CompletionProviders\OverrideCompletionProviderTests.cs (1)
3074Assert.Equal(change.Span, TextSpan.FromBounds(136, 145));
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.cs (1)
355=> context.ReportDiagnostic(Diagnostic.Create(Descriptor, Location.Create(context.Tree, TextSpan.FromBounds(1000, 2000))));
Microsoft.CodeAnalysis.CSharp.Features (102)
BraceMatching\BlockCommentBraceMatcher.cs (2)
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);
ChangeSignature\ChangeSignatureFormattingRule.cs (1)
46span = TextSpan.FromBounds(Math.Max(baseToken.Span.End, span.Start), span.End);
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider_Operators.cs (2)
143var replacement = item.DisplayText + text.ToString(TextSpan.FromBounds(expressionStart, dotLikeToken.SpanStart)); 145TextSpan.FromBounds(
ConvertToRawString\ConvertInterpolatedStringToRawStringCodeRefactoringProvider.cs (3)
310builder.Append(text.ToString(TextSpan.FromBounds(line.End, line.EndIncludingLineBreak))); 489interpolationInteriorSpans.Add(TextSpan.FromBounds(interpolation.OpenBraceToken.Span.End, interpolation.CloseBraceToken.Span.Start)); 510restrictedSpans.Add(TextSpan.FromBounds(start, descendantSpan.End));
ConvertToRawString\ConvertRegularStringToRawStringCodeRefactoringProvider.cs (3)
328return leadingWhitespace1.GetSubSequence(TextSpan.FromBounds(0, current)); 337return line.GetSubSequence(TextSpan.FromBounds(0, current)); 359var result = characters.GetSubSequence(TextSpan.FromBounds(index, end));
EditAndContinue\BreakpointSpans.cs (5)
110=> TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End); 116=> TextSpan.FromBounds(node.SpanStart, token.Span.End); 119=> TextSpan.FromBounds(token.SpanStart, token.Span.End); 149return TextSpan.FromBounds(startPos, endPos); 486return TextSpan.FromBounds(typeDeclaration.Identifier.SpanStart, typeDeclaration.ParameterList.Span.End);
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (16)
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); 1806return TextSpan.FromBounds(switchStatement.SwitchKeyword.SpanStart, 1814return TextSpan.FromBounds(whileStatement.WhileKeyword.SpanStart, whileStatement.CloseParenToken.Span.End); 1821return TextSpan.FromBounds(forStatement.ForKeyword.SpanStart, forStatement.CloseParenToken.Span.End); 1826return TextSpan.FromBounds( 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; 2695return TextSpan.FromBounds(
EmbeddedLanguages\CSharpTestEmbeddedLanguageClassifier.cs (1)
87TextSpan.FromBounds(
ExtractMethod\CSharpSelectionValidator.cs (4)
307var blockSpan = TextSpan.FromBounds(block.OpenBraceToken.Span.End, block.CloseBraceToken.SpanStart); 318var expressionBodiedMemberBody = TextSpan.FromBounds(expressionBodiedMember.Expression.SpanStart, expressionBodiedMember.Expression.Span.End); 540return TextSpan.FromBounds(textSpan.Start, previousLine.EndIncludingLineBreak); 543return TextSpan.FromBounds(textSpan.Start, previousLine.End);
Highlighting\KeywordHighlighters\AsyncAwaitHighlighter.cs (1)
109spans[^1] = TextSpan.FromBounds(lastSpan.Start, mod.Span.End);
Highlighting\KeywordHighlighters\IfStatementHighlighter.cs (1)
55highlights.Add(TextSpan.FromBounds(
Highlighting\KeywordHighlighters\RegionHighlighter.cs (1)
37highlights.Add(TextSpan.FromBounds(
Highlighting\KeywordHighlighters\SwitchStatementHighlighter.cs (1)
79spans.Add(TextSpan.FromBounds(start, end));
Highlighting\KeywordHighlighters\YieldStatementHighlighter.cs (1)
54TextSpan.FromBounds(
ImplementInterface\AbstractChangeImplementationCodeRefactoringProvider.cs (1)
147: TextSpan.FromBounds(explicitName.FullSpan.Start, identifier.FullSpan.End);
NavigationBar\CSharpNavigationBarItemService.cs (1)
242return TextSpan.FromBounds(spanStart, spanEnd);
QuickInfo\CSharpSyntacticQuickInfoProvider.cs (1)
92var spans = ImmutableArray.Create(TextSpan.FromBounds(spanStart, spanEnd));
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)
92var node = root.FindNode(TextSpan.FromBounds(position, position));
Snippets\AbstractCSharpTypeSnippetProvider.cs (2)
79return new TextChange(TextSpan.FromBounds(targetPosition, targetPosition), SyntaxFacts.GetText(SyntaxKind.PublicKeyword) + " "); 92var node = root.FindNode(TextSpan.FromBounds(position, position));
Snippets\CSharpConstructorSnippetProvider.cs (1)
75return new TextChange(TextSpan.FromBounds(position, position), constructorDeclaration.NormalizeWhitespace().ToFullString());
Snippets\CSharpElseSnippetProvider.cs (1)
60return Task.FromResult(new TextChange(TextSpan.FromBounds(position, position), elseClause.ToFullString()));
SplitStringLiteral\InterpolatedStringSplitter.cs (1)
83var content = Document.Text.ToString(TextSpan.FromBounds(start, end));
SplitStringLiteral\SimpleStringSplitter.cs (1)
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 (1)
72TextSpan.FromBounds(start, root.Members.OfType<GlobalStatementSyntax>().Last().FullSpan.End));
src\Analyzers\CSharp\Analyzers\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessAnalyzer.cs (2)
182var fadeLocation = Location.Create(tree, TextSpan.FromBounds(firstStatement.SpanStart, previousToken.Span.End)); 203fadeLocation = 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 (2)
228var startReportSpan = TextSpan.FromBounds(anonymousFunction.SpanStart, invokedExpression.SpanStart); 229var endReportSpan = TextSpan.FromBounds(invokedExpression.Span.End, anonymousFunction.Span.End);
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 (1)
218syntaxTree.GetLocation(TextSpan.FromBounds(
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForCreateDiagnosticAnalyzer.cs (1)
61syntaxTree.GetLocation(TextSpan.FromBounds(
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForNewDiagnosticAnalyzer.cs (1)
86syntaxTree.GetLocation(TextSpan.FromBounds(
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForStackAllocDiagnosticAnalyzer.cs (2)
70syntaxTree.GetLocation(TextSpan.FromBounds( 110syntaxTree.GetLocation(TextSpan.FromBounds(
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\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\NewLines\ArrowExpressionClausePlacement\ArrowExpressionClausePlacementCodeFixProvider.cs (1)
93edits.Add(new TextChange(TextSpan.FromBounds(start, end), ""));
src\Analyzers\CSharp\CodeFixes\NewLines\ConditionalExpressionPlacement\ConditionalExpressionPlacementCodeFixProvider.cs (1)
95edits.Add(new TextChange(TextSpan.FromBounds(start, end), ""));
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (1)
846var lineBreakSpan = TextSpan.FromBounds(lineToConsider.End, lineToConsider.EndIncludingLineBreak);
StringIndentation\CSharpStringIndentationService.cs (1)
178indentSpan = TextSpan.FromBounds(firstLine.Start, lastLine.Start + offset);
Structure\CSharpStructureHelpers.cs (6)
153var span = TextSpan.FromBounds(startComment.SpanStart, endComment.Span.End); 356var span = TextSpan.FromBounds(GetCollapsibleStart(startToken), spanEndPos); 379return TextSpan.FromBounds(child.SpanStart, endPos); 383return TextSpan.FromBounds(node.SpanStart, endPos); 461textSpan: TextSpan.FromBounds(spanStart, spanEnd), 462hintSpan: TextSpan.FromBounds(hintSpanStart, hintSpanEnd),
Structure\Providers\AnonymousObjectCreationExpressionStructureProvider.cs (1)
38textSpan: TextSpan.FromBounds(node.NewKeyword.Span.End, node.Span.End),
Structure\Providers\ArrowExpressionClauseStructureProvider.cs (1)
27textSpan: TextSpan.FromBounds(previousToken.Span.End, node.Parent.Span.End),
Structure\Providers\BlockSyntaxStructureProvider.cs (1)
171return TextSpan.FromBounds(previousToken.Span.End, GetEnd(node));
Structure\Providers\CollectionExpressionStructureProvider.cs (2)
42var textSpan = TextSpan.FromBounds(node.SpanStart, end); 61var textSpan = TextSpan.FromBounds(previousToken.Span.End, node.Span.End);
Structure\Providers\DisabledTextTriviaStructureProvider.cs (1)
59var span = TextSpan.FromBounds(startPos, endPos);
Structure\Providers\DocumentationCommentStructureProvider.cs (1)
36var span = TextSpan.FromBounds(startPos, endPos);
Structure\Providers\IfDirectiveTriviaStructureProvider.cs (1)
53var span = TextSpan.FromBounds(startLine.Start, endLine.End);
Structure\Providers\InitializerExpressionStructureProvider.cs (3)
46textSpan: TextSpan.FromBounds(node.SpanStart, end), 47hintSpan: TextSpan.FromBounds(node.SpanStart, end), 64textSpan: TextSpan.FromBounds(previousToken.Span.End, node.Span.End),
Structure\Providers\SwitchStatementStructureProvider.cs (2)
24textSpan: TextSpan.FromBounds(node.CloseParenToken != default ? node.CloseParenToken.Span.End : node.Expression.Span.End, node.CloseBraceToken.Span.End), 37textSpan: TextSpan.FromBounds(start, 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 (1)
EditAndContinue\BreakpointSpansTests.cs (1)
85var expectedEnvelope = expectedSpans.IsEmpty ? default : TextSpan.FromBounds(expectedSpans[0].Start, expectedSpans[^1].End);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (22)
Semantics\GlobalUsingDirectiveTests.cs (3)
3256comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDiagnostics(TextSpan.FromBounds(20, comp2.SyntaxTrees[0].Length - 1)).Verify( 3264comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDiagnostics(TextSpan.FromBounds(20, comp2.SyntaxTrees[1].Length - 1)).Verify( 3272comp2.GetSemanticModel(comp2.SyntaxTrees[2]).GetDiagnostics(TextSpan.FromBounds(20, comp2.SyntaxTrees[2].Length - 1)).Verify(
SourceGeneration\GeneratorDriverTests.cs (19)
1219new[] { (gen001, TextSpan.FromBounds(2, 5)) }, 1226new[] { (gen001, TextSpan.FromBounds(27, 30)) }, 1240new[] { (gen001, TextSpan.FromBounds(34, 37)) }, 1249new[] { (gen001, TextSpan.FromBounds(34, 37)), (gen001, TextSpan.FromBounds(77, 80)) }, 3626location: Location.Create(syntaxTree, TextSpan.FromBounds(0, 2)))); 3659location: Location.Create(validSyntaxTree, TextSpan.FromBounds(0, 2)), 3660additionalLocations: new[] { Location.Create(invalidSyntaxTree, TextSpan.FromBounds(0, 2)) })); 3690location: Location.Create(syntaxTree, TextSpan.FromBounds(0, 2)))); 3720location: Location.Create(validSyntaxTree, TextSpan.FromBounds(0, 2)), 3721additionalLocations: new[] { Location.Create(invalidSyntaxTree, TextSpan.FromBounds(0, 2)) })); 3752location: Location.Create(syntaxTree, TextSpan.FromBounds(0, 100)))); 3784location: Location.Create(syntaxTree, TextSpan.FromBounds(0, 2)), 3785additionalLocations: new[] { Location.Create(syntaxTree, TextSpan.FromBounds(0, 100)) })); 3815location: Location.Create(syntaxTree, TextSpan.FromBounds(0, 100)))); 3844location: Location.Create(syntaxTree, TextSpan.FromBounds(0, 2)), 3845additionalLocations: new[] { Location.Create(syntaxTree, TextSpan.FromBounds(0, 100)) })); 3876location: Location.Create(syntaxTree, TextSpan.FromBounds(0, 2)))); 3906location: Location.Create(syntaxTree, TextSpan.FromBounds(0, 2))));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Symbols\AnonymousTypesSemanticsTests.cs (1)
2109intervals.Add(TextSpan.FromBounds(all[i - 1].offset, all[i].offset));
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (4)
Diagnostics\LineSpanDirectiveTests.cs (1)
493return TextSpan.FromBounds(getTextPosition(lines, span.Start), getTextPosition(lines, span.End));
Parsing\ParserRegressionTests.cs (1)
165var textSpan = Text.TextSpan.FromBounds(0, tree.Length);
Syntax\SyntaxFactoryTests.cs (2)
452var expectedLocation = Location.Create(expression.Token.SyntaxTree, TextSpan.FromBounds(0, 2)); 466var expectedLocation = Location.Create(expression.Token.SyntaxTree, TextSpan.FromBounds(0, 2));
Microsoft.CodeAnalysis.CSharp.Workspaces (29)
Classification\Worker.cs (2)
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);
Classification\Worker_DocumentationComments.cs (2)
109var span = TextSpan.FromBounds(spanStart.Value, spanStart.Value + index); 123var span = TextSpan.FromBounds(spanStart.Value, trivia.Span.End);
OrganizeImports\CSharpOrganizeImportsService.Rewriter.cs (1)
88=> TextSpan.FromBounds(list.First().FullSpan.Start, list.Last().FullSpan.End);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\EmbeddedLanguages\VirtualChars\CSharpVirtualCharService.cs (1)
519result.Add((character, TextSpan.FromBounds(startIndex + offset, endIndex + offset)));
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\Formatting\Engine\Trivia\TriviaRewriter.cs (3)
103return TextSpan.FromBounds(_node.FullSpan.Start, pair.Item2.SpanStart); 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)
53list.Add(FormattingOperations.CreateIndentBlockOperation(startToken, endToken, TextSpan.FromBounds(startPosition, endPosition), indentationDelta: -1, option: option));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\IndentBlockFormattingRule.cs (4)
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); 363AddIndentBlockOperation(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); 121_root, [TextSpan.FromBounds(adjustedStartPosition, adjustedEndPosition)], _options.FormattingOptions, smartTokenFormattingRules, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (2)
994=> TextSpan.FromBounds(body.OpenBraceToken.Span.End, body.CloseBraceToken.SpanStart); 1135return !branch.IsActive || !branch.BranchTaken ? TextSpan.FromBounds(branch.FullSpan.Start, position) : default;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\CompilationUnitSyntaxExtensions.cs (3)
57return TextSpan.FromBounds(start, end); 66return TextSpan.FromBounds(start, end); 74return TextSpan.FromBounds(start, end);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeDeclarationSyntaxExtensions.cs (3)
31indices.Add(!destination.OverlapsHiddenPosition(TextSpan.FromBounds(start, end), cancellationToken)); 37indices.Add(!destination.OverlapsHiddenPosition(TextSpan.FromBounds(start, end), cancellationToken)); 49indices.Add(!destination.OverlapsHiddenPosition(TextSpan.FromBounds(start, end), cancellationToken));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.cs (2)
78spans.Add(TextSpan.FromBounds(0, GetEndPosition(compilationUnit, compilationUnit.Members))); 90spans.Add(TextSpan.FromBounds(namespaceMember.SpanStart, GetEndPosition(namespaceMember, namespaceMember.Members)));
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (2)
Formatting\FormattingMultipleSpanTests.cs (2)
169var result = Formatter.Format(root, TextSpan.FromBounds(0, 0), workspace.Services.SolutionServices, CSharpSyntaxFormattingOptions.Default, CancellationToken.None); 199spans.Add(TextSpan.FromBounds(startPosition, endPosition));
Microsoft.CodeAnalysis.EditorFeatures (17)
CommentSelection\AbstractToggleBlockCommentBase.cs (11)
98var linesContainingSelection = TextSpan.FromBounds(firstLineAroundSelection, lastLineAroundSelection); 153var trackingSpan = TextSpan.FromBounds(intersectingBlockComments.First().Start, intersectingBlockComments.Last().End); 178spanToAdd = TextSpan.FromBounds(caretLocation, caretLocation); 205if (blockCommentSelection.IsSpanWhitespace(TextSpan.FromBounds(extent.Span.Start, extent.Span.End))) 293SelectedSpan = TextSpan.FromBounds(selectedSnapshotSpan.Start, selectedSnapshotSpan.End); 364var lineStartToCaretIsWhitespace = IsSpanWhitespace(TextSpan.FromBounds(selectedLine.Start, SelectedSpan.Start)); 365var caretToLineEndIsWhitespace = IsSpanWhitespace(TextSpan.FromBounds(SelectedSpan.Start, selectedLine.End)); 372if (IsSpanWhitespace(TextSpan.FromBounds(SelectedSpan.Start, blockComment.Start))) 382if (IsSpanWhitespace(TextSpan.FromBounds(blockComment.End, SelectedSpan.Start))) 415var possibleUncommentedSpan = TextSpan.FromBounds(spanStart, commentedSpan.Start); 429var uncommentedSpan = TextSpan.FromBounds(spanStart, SelectedSpan.End);
CommentSelection\CommentUncommentSelectionCommandHandler.cs (2)
166trackingSpans.Add(new CommentTrackingSpan(TextSpan.FromBounds(firstLine.Start.Position, lastLine.End.Position))); 173trackingSpans.Add(new CommentTrackingSpan(TextSpan.FromBounds(span.Start, span.End)));
IntelliSense\AsyncCompletion\CompletionSource.cs (1)
194buffer.ApplyChange(new TextChange(TextSpan.FromBounds(caretPoint - 2, caretPoint), string.Empty));
Interactive\SendToInteractiveSubmissionProvider.cs (1)
71var newSpans = GetExecutableSyntaxTreeNodeSelection(TextSpan.FromBounds(selectedSpansStart, selectedSpansEnd), root).
PasteTracking\PasteTrackingPasteCommandHandler.cs (1)
60var textSpan = TextSpan.FromBounds(snapshotSpan.Start, snapshotSpan.End);
Shared\Utilities\CommonFormattingHelpers.cs (1)
27return TextSpan.FromBounds(currentLine.Start, endPosition);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
CommentSelection\AbstractToggleCommentTestBase.cs (1)
76AssertEx.Equal(expectedSpans, textView.Selection.SelectedSpans.Select(snapshotSpan => TextSpan.FromBounds(snapshotSpan.Start, snapshotSpan.End)));
Microsoft.CodeAnalysis.EditorFeatures.Text (2)
Extensions.SnapshotSourceText.cs (1)
157return TextLine.FromSpan(_text, TextSpan.FromBounds(line.Start, line.End));
Shared\Extensions\ITextSnapshotExtensions.cs (1)
35return TextSpan.FromBounds(
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (32)
CodeFixes\CodeFixServiceTests.cs (13)
59document, TextSpan.FromBounds(0, 0), new DefaultCodeActionRequestPriorityProvider(), CancellationToken.None); 86_ = await tuple.codeFixService.GetFixesAsync(document, TextSpan.FromBounds(0, 0), CancellationToken.None); 112var fixCollections = await tuple.codeFixService.GetFixesAsync(document, TextSpan.FromBounds(0, 0), CancellationToken.None); 143_ = await tuple.codeFixService.GetFixesAsync(document, TextSpan.FromBounds(0, 0), 150_ = await tuple.codeFixService.GetFixesAsync(document, TextSpan.FromBounds(0, 0), 179_ = await tuple.codeFixService.GetFixesAsync(document, TextSpan.FromBounds(0, 0), 209var fixCollectionSet = await tuple.codeFixService.GetFixesAsync(document, TextSpan.FromBounds(0, 0), 296var fixes = await tuple.codeFixService.GetFixesAsync(document, TextSpan.FromBounds(0, 0), CancellationToken.None); 321document, TextSpan.FromBounds(0, 0), new DefaultCodeActionRequestPriorityProvider(), CancellationToken.None); 563c.ReportDiagnostic(Diagnostic.Create(descriptor, c.Tree.GetLocation(TextSpan.FromBounds(0, 0)))); 783return await fixService.GetFixesAsync(document, TextSpan.FromBounds(0, 0), CancellationToken.None); 884var txtDocumentCodeFixes = await tuple.codeFixService.GetFixesAsync(txtDocument, TextSpan.FromBounds(0, 1), CancellationToken.None); 901var logDocumentCodeFixes = await tuple.codeFixService.GetFixesAsync(logDocument, TextSpan.FromBounds(0, 1), CancellationToken.None);
CodeRefactorings\CodeRefactoringServiceTest.cs (7)
50var refactorings = await refactoringService.GetRefactoringsAsync(document, TextSpan.FromBounds(0, 0), CancellationToken.None); 88var refactorings = await refactoringService.GetRefactoringsAsync(document, TextSpan.FromBounds(0, 0), CancellationToken.None); 109var result = await refactoringService.GetRefactoringsAsync(document, TextSpan.FromBounds(0, 0), CancellationToken.None); 172var txtRefactorings = await refactoringService.GetRefactoringsAsync(txtAdditionalDocument, TextSpan.FromBounds(0, 0), CancellationToken.None); 187var logRefactorings = await refactoringService.GetRefactoringsAsync(logAdditionalDocument, TextSpan.FromBounds(0, 0), CancellationToken.None); 211var editorConfigRefactorings = await refactoringService.GetRefactoringsAsync(editorConfig, TextSpan.FromBounds(0, 0), CancellationToken.None); 226var globalConfigRefactorings = await refactoringService.GetRefactoringsAsync(globalConfig, TextSpan.FromBounds(0, 0), CancellationToken.None);
CommentSelection\CommentUncommentSelectionCommandHandlerTests.cs (3)
87CommentSelection(code, new[] { new TextChange(TextSpan.FromBounds(0, 0), "//") }, supportBlockComments: true); 127CommentSelection(code, new[] { new TextChange(TextSpan.FromBounds(0, 0), "//") }, supportBlockComments: false); 423CommentSelection(code, new[] { new TextChange(TextSpan.FromBounds(0, 0), "//") }, new[] { new Span(0, 15) }, supportBlockComments: true);
Diagnostics\DiagnosticAnalyzerServiceTests.cs (1)
952=> Task.FromResult(ImmutableArray.Create(Diagnostic.Create(s_syntaxRule, Location.Create(document.FilePath, TextSpan.FromBounds(0, 0), new LinePositionSpan(new LinePosition(0, 0), new LinePosition(0, 0))))));
EditAndContinue\EditAndContinueLanguageServiceTests.cs (3)
163var documentDiagnostic = CodeAnalysis.Diagnostic.Create(diagnosticDescriptor1, Location.Create(syntaxTree, TextSpan.FromBounds(1, 2)), ["doc", "error 1"]); 165var syntaxError = CodeAnalysis.Diagnostic.Create(diagnosticDescriptor1, Location.Create(syntaxTree, TextSpan.FromBounds(1, 2)), ["doc", "syntax error 3"]); 166var rudeEditDiagnostic = new RudeEditDiagnostic(RudeEditKind.Delete, TextSpan.FromBounds(2, 3), arguments: ["x"]).ToDiagnostic(syntaxTree);
Structure\BlockSpanTests.cs (5)
18var span = TextSpan.FromBounds(0, 1); 19var hintSpan = TextSpan.FromBounds(2, 3); 36var span = TextSpan.FromBounds(0, 1); 37var hintSpan = TextSpan.FromBounds(2, 3); 51var span = TextSpan.FromBounds(0, 1);
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (8)
CodeFixes\CodeFixServiceTests.vb (1)
297document, Text.TextSpan.FromBounds(0, 0), New DefaultCodeActionRequestPriorityProvider(), CancellationToken.None)
Diagnostics\DiagnosticServiceTests.vb (1)
917Dim documentDiagnostics = Await DiagnosticProviderTestUtilities.GetDocumentDiagnosticsAsync(workspace, document, TextSpan.FromBounds(0, 0))
IntelliSense\SignatureHelpControllerTests.vb (6)
90.Returns(Task.FromResult(New SignatureHelpItems(CreateItems(2), TextSpan.FromBounds(0, 0), selectedItem:=0, semanticParameterIndex:=0, syntacticArgumentCount:=0, argumentName:=Nothing))) 118Return Task.FromResult(New SignatureHelpItems(CreateItems(2), TextSpan.FromBounds(0, 0), selectedItem:=0, semanticParameterIndex:=0, syntacticArgumentCount:=0, argumentName:=Nothing)) 138Return Task.FromResult(New SignatureHelpItems(CreateItems(2), TextSpan.FromBounds(0, 0), selectedItem:=0, semanticParameterIndex:=0, syntacticArgumentCount:=0, argumentName:=Nothing)) 160.Returns(Task.FromResult(New SignatureHelpItems(CreateItems(2), TextSpan.FromBounds(0, 0), selectedItem:=0, semanticParameterIndex:=0, syntacticArgumentCount:=0, argumentName:=Nothing))) 171Return Task.FromResult(New SignatureHelpItems(CreateItems(2), TextSpan.FromBounds(0, 2), selectedItem:=0, semanticParameterIndex:=0, syntacticArgumentCount:=0, argumentName:=Nothing)) 358New SignatureHelpItems(_items, TextSpan.FromBounds(position, position), selectedItem:=0, semanticParameterIndex:=0, syntacticArgumentCount:=0, argumentName:=Nothing),
Microsoft.CodeAnalysis.Features (55)
ClassifiedSpansAndHighlightSpanFactory.cs (2)
83new ClassifiedSpan(ClassificationTypeNames.Text, TextSpan.FromBounds(widenedSpan.Start, narrowSpan.Start)), 85new ClassifiedSpan(ClassificationTypeNames.Text, TextSpan.FromBounds(narrowSpan.End, widenedSpan.End)),
Completion\CommonCompletionUtilities.cs (1)
57return TextSpan.FromBounds(start, end);
Completion\Providers\AbstractDocCommentCompletionProvider.cs (1)
281var replacementSpan = TextSpan.FromBounds(text[itemSpan.Start - 1] == '<' && beforeCaretText[0] == '<' ? itemSpan.Start - 1 : itemSpan.Start, itemSpan.End);
Completion\Providers\AbstractMemberInsertingCompletionProvider.cs (2)
143contextLocation: semanticModel.SyntaxTree.GetLocation(TextSpan.FromBounds(line.Start, line.Start)))); 190return TextSpan.FromBounds(firstToken.SpanStart, line.End);
Completion\Providers\Scripting\AbstractDirectivePathCompletionProvider.cs (1)
131return TextSpan.FromBounds(startIndex + quotedPathStart, endIndex + quotedPathStart);
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\ActiveStatementsMap.cs (1)
282span = TextSpan.FromBounds(start, end);
EditAndContinue\EditSession.cs (1)
229TextSpan.FromBounds(newText.Lines[newLineCount - 1].End, newText.Lines[newLineCount - 1].EndIncludingLineBreak);
EmbeddedLanguages\DateAndTime\EmbeddedCompletionContext.cs (1)
50_replacementSpan = TextSpan.FromBounds(startPosition, context.Position);
EmbeddedLanguages\Json\JsonLexer.cs (1)
38=> Text.GetSubSequence(TextSpan.FromBounds(start, end));
EmbeddedLanguages\RegularExpressions\RegexLexer.cs (1)
55=> Text.GetSubSequence(TextSpan.FromBounds(start, end));
EmbeddedLanguages\StackFrame\StackFrameLexer.cs (1)
66=> Text.GetSubSequence(TextSpan.FromBounds(start, end));
ExtractMethod\SelectionResult.cs (1)
172var span = TextSpan.FromBounds(firstToken.SpanStart, lastToken.Span.End);
NavigateTo\NavigateToUtilities.cs (1)
42return TextSpan.FromBounds(spanStart, spanEnd);
Navigation\IDefinitionLocationService.cs (1)
81return new DocumentSpan(document, TextSpan.FromBounds(startPosition, endPosition));
QuickInfo\IndentationHelper.cs (2)
61var spanBeforeDeletion = TextSpan.FromBounds(span.Start, Math.Min(span.End, deletion.Start)); 70span = TextSpan.FromBounds(Math.Min(deletion.End, span.End), span.End);
ReplaceDocCommentTextWithTag\AbstractReplaceDocCommentTextWithTagCodeRefactoringProvider.cs (1)
181return TextSpan.FromBounds(startInclusive, endExclusive);
SignatureHelp\CommonSignatureHelpUtilities.cs (2)
89return TextSpan.FromBounds(start, closeToken.SpanStart); 100return TextSpan.FromBounds(start, nextToken.SpanStart);
Snippets\RoslynLSPSnippetConverter.cs (1)
143return TextSpan.FromBounds(startPosition, endPosition);
Snippets\SnippetProviders\AbstractConsoleSnippetProvider.cs (2)
56var change = new TextChange(TextSpan.FromBounds(position, position), resultingNode.ToFullString()); 95var closestNode = root.FindNode(TextSpan.FromBounds(position, position));
Snippets\SnippetProviders\AbstractInlineStatementSnippetProvider.cs (1)
76var closestNode = root.FindNode(TextSpan.FromBounds(position, position), getInnermostNodeForTie: true);
Snippets\SnippetProviders\AbstractLockSnippetProvider.cs (1)
19return Task.FromResult(new TextChange(TextSpan.FromBounds(position, position), statement.NormalizeWhitespace().ToFullString()));
Snippets\SnippetProviders\AbstractMainMethodSnippetProvider.cs (1)
36return Task.FromResult(new TextChange(TextSpan.FromBounds(position, position), method.NormalizeWhitespace().ToFullString()));
Snippets\SnippetProviders\AbstractPropertySnippetProvider.cs (1)
24return new TextChange(TextSpan.FromBounds(position, position), propertyDeclaration.NormalizeWhitespace().ToFullString());
Snippets\SnippetProviders\AbstractSnippetProvider.cs (1)
220=> root.FindNode(TextSpan.FromBounds(position, position), getInnermostNodeForTie: true) as TSnippetSyntax;
Snippets\SnippetProviders\AbstractTypeSnippetProvider.cs (1)
25var mainChange = new TextChange(TextSpan.FromBounds(position, position), typeDeclaration.NormalizeWhitespace().ToFullString());
Snippets\SnippetUtilities.cs (1)
35wordSpan = TextSpan.FromBounds(startPosition, endPosition);
SplitOrMergeIfStatements\AbstractMergeIfStatementsCodeRefactoringProvider.cs (1)
60TextSpan.FromBounds(upperIfOrElseIfSpan.Start, lowerIfOrElseIfSpan.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 (3)
153textSpan = TextSpan.FromBounds(node.Span.Start, nodeEnd); 161textSpan = TextSpan.FromBounds(previous.Value.textSpan.Start, nodeEnd); 167textSpan = TextSpan.FromBounds(node.Span.Start, nodeEnd);
src\Analyzers\Core\Analyzers\RemoveUnnecessaryParentheses\AbstractRemoveUnnecessaryParenthesesDiagnosticAnalyzer.cs (1)
135return Location.Create(parenthesizedExpression.SyntaxTree, TextSpan.FromBounds(parenthesizedExpressionLocation.SourceSpan.Start, textSpanEndPosition));
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UseCollectionInitializerHelpers.cs (2)
48syntaxTree.GetLocation(TextSpan.FromBounds(match.SpanStart, expression.SpanStart)), 49syntaxTree.GetLocation(TextSpan.FromBounds(expression.FullSpan.End, match.Span.End)));
src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (8)
333edits.Add(new TextChange(TextSpan.FromBounds(startPos, startEnd), "")); 337edits.Add(new TextChange(TextSpan.FromBounds(firstMiddlePos, bottomEnd), "")); 346edits.Add(new TextChange(TextSpan.FromBounds(startPos, equalsEnd), "")); 350edits.Add(new TextChange(TextSpan.FromBounds(endPos, bottomEnd), "")); 359edits.Add(new TextChange(TextSpan.FromBounds(startPos, startEnd), "")); 365edits.Add(new TextChange(TextSpan.FromBounds(secondMiddlePos, equalsEnd), "")); 371edits.Add(new TextChange(TextSpan.FromBounds(firstMiddlePos, equalsEnd), "")); 376edits.Add(new TextChange(TextSpan.FromBounds(endPos, bottomEnd), ""));
StackTraceExplorer\StackTraceAnalyzer.cs (2)
79yield return callstack.GetSubSequence(TextSpan.FromBounds(position, i)); 88yield return callstack.GetSubSequence(TextSpan.FromBounds(position, callstack.Length));
StackTraceExplorer\VSDebugCallstackParser.cs (1)
38var textToParse = line.GetSubSequence(TextSpan.FromBounds(startPoint, line.Length));
TaskList\AbstractTaskListService.cs (1)
145var startMessage = text.ToString(TextSpan.FromBounds(fullSpan.Start, startLine.End));
Wrapping\AbstractCodeActionComputer.cs (2)
90new TextChange(TextSpan.FromBounds(nodeOrToken.Span.End, OriginalSourceText.Length), newLine)); 179var span = TextSpan.FromBounds(edit.Left.Span.End, edit.Right.Span.Start);
Microsoft.CodeAnalysis.Features.Test.Utilities (1)
EditAndContinue\SourceMarkers.cs (1)
81yield return (id, TextSpan.FromBounds(start, end));
Microsoft.CodeAnalysis.Features.UnitTests (17)
EditAndContinue\ActiveStatementsMapTests.cs (8)
48var span = TextSpan.FromBounds(8, 11); 51TextSpan.FromBounds(1, 6), // does not overlap 52TextSpan.FromBounds(3, 9), // overlaps 53TextSpan.FromBounds(4, 5), // does not overlap 54TextSpan.FromBounds(6, 7), // does not overlap 55TextSpan.FromBounds(7, 9), // overlaps 56TextSpan.FromBounds(10, 12), // overlaps 57TextSpan.FromBounds(13, 15)); // does not overlap
EditAndContinue\EmitSolutionUpdateResultsTests.cs (2)
131new RudeEditDiagnostic(RudeEditKind.Insert, TextSpan.FromBounds(1, 10), 123, ["a"]).ToDiagnostic(tree), 132new RudeEditDiagnostic(RudeEditKind.Delete, TextSpan.FromBounds(1, 10), 123, ["b"]).ToDiagnostic(tree)
EditAndContinue\RemoteEditAndContinueServiceTests.cs (3)
121var diagnostic = Diagnostic.Create(diagnosticDescriptor, Location.Create(syntaxTree, TextSpan.FromBounds(1, 1))); 199var documentDiagnostic = Diagnostic.Create(diagnosticDescriptor1, Location.Create(syntaxTree, TextSpan.FromBounds(1, 2)), new[] { "doc", "some error" }); 201var syntaxError = Diagnostic.Create(diagnosticDescriptor1, Location.Create(syntaxTree, TextSpan.FromBounds(1, 2)), new[] { "doc", "syntax error" });
EditAndContinue\RudeEditDiagnosticTests.cs (4)
85var re = new RudeEditDiagnostic(kind, TextSpan.FromBounds(1, 2)); 91var re = new RudeEditDiagnostic(kind, TextSpan.FromBounds(1, 2), syntaxNode, ["<1>", "<2>"]); 99var re = new RudeEditDiagnostic(kind, TextSpan.FromBounds(1, 2), syntaxNode, ["<1>", "<2>", "<3>"]); 108var re = new RudeEditDiagnostic(kind, TextSpan.FromBounds(1, 2), syntaxNode, ["<1>"]);
Microsoft.CodeAnalysis.LanguageServer.Protocol (4)
Features\UnifiedSuggestions\UnifiedSuggestedActionsSource.cs (1)
381var combinedSpan = minStart >= 0 ? TextSpan.FromBounds(minStart, maxEnd) : (TextSpan?)null;
Handler\InlineCompletions\InlineCompletionsHandler.cs (2)
185var spanToFormat = TextSpan.FromBounds(textChange.Span.Start, snippetEndPosition); 198var spanContainingFormattedSnippet = TextSpan.FromBounds(snippetShortcut.Start, snippetEndPosition);
Handler\SemanticTokens\SemanticTokensHelpers.cs (1)
199textSpan = TextSpan.FromBounds(Math.Min(absoluteStart, line.End), line.End);
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (2)
Diagnostics\AdditionalFileDiagnosticsTests.cs (1)
139location: Location.Create(context.AdditionalFile.Path, Text.TextSpan.FromBounds(0, 0), new Text.LinePositionSpan(new Text.LinePosition(0, 0), new Text.LinePosition(0, 0))), "args"));
InlayHint\AbstractInlayHintTests.cs (1)
28var span = TextSpan.FromBounds(0, text.Length);
Microsoft.CodeAnalysis.Test.Utilities (1)
MarkedSource\MarkupTestFile.cs (1)
198var span = TextSpan.FromBounds(matchIndex, finalIndex);
Microsoft.CodeAnalysis.UnitTests (5)
Text\SourceTextTests.cs (3)
428sourceText.Write(writer, TextSpan.FromBounds(1, sourceText.Length)); 456SourceText.From("ABC").Write(TextWriter.Null, TextSpan.FromBounds(4, 4))); 465SourceText.From("ABC").Write(TextWriter.Null, TextSpan.FromBounds(2, 4)));
Text\StringText_LineTest.cs (2)
31var span = TextSpan.FromBounds(0, text.Length); 42var span = TextSpan.FromBounds(0, text.Length);
Microsoft.CodeAnalysis.VisualBasic (11)
Binding\Binder_Query.vb (1)
2273operatorNameSpan = TextSpan.FromBounds(operatorNameSpan.Start, right.Span.End)
Compilation\VisualBasicCompilation.vb (1)
2179Dim location = tree.GetLocation(TextSpan.FromBounds(0, 0))
Lowering\Instrumentation\DebugInfoInjector.vb (1)
138sequencePointSpan = TextSpan.FromBounds(original.Syntax.SpanStart, original.Syntax.Span.End)
Scanner\Blender.vb (1)
101Return TextSpan.FromBounds(start.Start, [end].End)
Scanner\Scanner.vb (1)
326Return TextSpan.FromBounds(start, condLineStart)
Syntax\SyntaxNodeRemover.vb (6)
244Dim fullSpan = TextSpan.FromBounds(token.FullSpan.Start, node.FullSpan.End) 245Dim span = TextSpan.FromBounds(token.Span.Start, node.Span.End) 268Dim fullSpan = TextSpan.FromBounds(node.FullSpan.Start, token.FullSpan.End) 269Dim span = TextSpan.FromBounds(node.Span.Start, token.Span.End) 290removedSpan = TextSpan.FromBounds(span.Start, removedSpan.End) 293removedSpan = TextSpan.FromBounds(removedSpan.Start, span.End)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (11)
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\SyntaxNodeExtensions.vb (1)
885Dim blockSpan = TextSpan.FromBounds(block.BlockStatement.Span.End, block.EndBlockStatement.SpanStart)
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\SyntaxFacts\VisualBasicSyntaxFacts.vb (3)
843Return TextSpan.FromBounds(spanStart, method.EndBlockStatement.SpanStart) 893Return TextSpan.FromBounds(list.First.SpanStart, list.Last.Span.End) 898Return TextSpan.FromBounds(list.First.SpanStart, list.Last.Span.End)
src\Workspaces\VisualBasic\Portable\Formatting\Rules\BaseFormattingRule.vb (3)
52Return TextSpan.FromBounds(previousToken.Span.End, endToken.FullSpan.End) 64Return TextSpan.FromBounds(spanStart, trivia.FullSpan.Start) 68Return TextSpan.FromBounds(spanStart, nextToken.SpanStart)
src\Workspaces\VisualBasic\Portable\Formatting\Rules\NodeBasedFormattingRule.vb (1)
79AddIndentBlockOperation(operations, baseToken, startToken, endToken, TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End))
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (5)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationService.vb (2)
73indices.Add(Not destination.OverlapsHiddenPosition(TextSpan.FromBounds(0, destination.Members.First.SpanStart), cancellationToken)) 86TextSpan.FromBounds(destination.Members.Last.Span.End, destination.EndOfFileToken.SpanStart), cancellationToken))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\CompilationUnitSyntaxExtensions.vb (1)
40Return Not contextNode.SyntaxTree.OverlapsHiddenPosition(TextSpan.FromBounds(start, [end]), cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Indentation\SpecialFormattingOperation.vb (2)
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))
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (3)
EndConstructGeneration\EndConstructCommandHandler.vb (1)
161Return TextSpan.FromBounds(If(previousToken.Kind <> SyntaxKind.None, previousToken, firstToken).SpanStart,
EndConstructGeneration\VisualBasicEndConstructGenerationService.vb (1)
272Dim span = TextSpan.FromBounds(asSingleLine.IfKeyword.SpanStart, asSingleLine.ThenKeyword.Span.End)
LineCommit\ContainingStatementInfo.vb (1)
186Return New ContainingStatementInfo(node, TextSpan.FromBounds(attributes.Last.Span.End, node.Span.End))
Microsoft.CodeAnalysis.VisualBasic.Features (55)
CodeFixes\GenerateEndConstruct\GenerateEndConstructCodeFixProvider.vb (1)
252Dim updatedText = text.WithChanges(New TextChange(TextSpan.FromBounds(insertionPoint, insertionPoint), stringToAppend))
CodeFixes\MoveToTopOfFile\MoveToTopOfFileCodeFixProvider.MoveToLineCodeAction.vb (1)
39Dim textWithMovedLine = textWithoutLine.WithChanges(New TextChange(TextSpan.FromBounds(destinationLineSpan, destinationLineSpan), textLineToMove.ToString().TrimStart() + vbCrLf))
Debugging\DataTipInfoGetter.vb (1)
54span = TextSpan.FromBounds(conditionalAccess.SpanStart, span.End)
EditAndContinue\BreakpointSpans.vb (8)
92Return TextSpan.FromBounds(node.SpanStart, node.Span.End) 100Return TextSpan.FromBounds(list.First.SpanStart, list.Last.Span.End) 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 (10)
1257Return TextSpan.FromBounds(newWith.NewKeyword.Span.Start, 1289Return TextSpan.FromBounds(groupJoin.GroupKeyword.SpanStart, groupJoin.JoinKeyword.Span.End) 1304Return TextSpan.FromBounds(partition.SkipOrTakeKeyword.SpanStart, partition.WhileKeyword.Span.End) 1319Return TextSpan.FromBounds(ifKeyword.Span.Start, 1324Return TextSpan.FromBounds(node.NamespaceKeyword.SpanStart, node.Name.Span.End) 1334Return TextSpan.FromBounds(If(modifiers.Count <> 0, modifiers.First.SpanStart, start.SpanStart), 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 (2)
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\VisualBasicSelectionValidator.vb (2)
248.FinalSpan = GetAdjustedSpan(root, TextSpan.FromBounds(start, [end])) 656Return TextSpan.FromBounds(textSpan.Start, previousLine.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))
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)
Structure\Providers\CollectionInitializerStructureProvider.vb (2)
44textSpan:=TextSpan.FromBounds(node.SpanStart, endPos), 45hintSpan:=TextSpan.FromBounds(node.SpanStart, endPos),
Structure\Providers\CompilationUnitStructureProvider.vb (1)
27Dim span = TextSpan.FromBounds(startPos, endPos)
Structure\Providers\DisabledTextTriviaStructureProvider.vb (1)
25Dim span = TextSpan.FromBounds(startPos, endPos)
Structure\Providers\ObjectCreationInitializerStructureProvider.vb (1)
34textSpan:=TextSpan.FromBounds(previousToken.Span.End, node.Span.End),
Structure\VisualBasicStructureHelpers.vb (4)
29Dim span = TextSpan.FromBounds(startComment.SpanStart, endComment.Span.End) 115textSpan:=TextSpan.FromBounds(startPosition, endPosition), 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.Semantic.UnitTests (19)
SourceGeneration\GeneratorDriverTests.vb (19)
224gen001, TextSpan.FromBounds(1, 4), 229gen001, TextSpan.FromBounds(19, 22), 239gen001, TextSpan.FromBounds(26, 29), 246gen001, TextSpan.FromBounds(60, 63), 312location:=Location.Create(syntaxTree, TextSpan.FromBounds(2, 4)))) 343location:=Location.Create(validSyntaxTree, TextSpan.FromBounds(2, 4)), 344additionalLocations:={Location.Create(invalidSyntaxTree, TextSpan.FromBounds(2, 4))})) 374location:=Location.Create(syntaxTree, TextSpan.FromBounds(2, 4)))) 404location:=Location.Create(validSyntaxTree, TextSpan.FromBounds(2, 4)), 405additionalLocations:={Location.Create(invalidSyntaxTree, TextSpan.FromBounds(2, 4))})) 434location:=Location.Create(syntaxTree, TextSpan.FromBounds(2, 100)))) 464location:=Location.Create(syntaxTree, TextSpan.FromBounds(2, 4)), 465additionalLocations:={Location.Create(syntaxTree, TextSpan.FromBounds(2, 100))})) 495location:=Location.Create(syntaxTree, TextSpan.FromBounds(2, 100)))) 524location:=Location.Create(syntaxTree, TextSpan.FromBounds(2, 4)), 525additionalLocations:={Location.Create(syntaxTree, TextSpan.FromBounds(2, 100))})) 554location:=Location.Create(syntaxTree, TextSpan.FromBounds(2, 4)))) 584location:=Location.Create(syntaxTree, TextSpan.FromBounds(2, 4)))) 703Return x.Diagnostic.WithLocation(Location.Create(syntaxTree, TextSpan.FromBounds(start, endpoint)))
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (4)
IncrementalParser\IncrementalParser.vb (3)
1523New TextChange(TextSpan.FromBounds(8, 8), "System" + vbCrLf + "Imports "), 1524New TextChange(TextSpan.FromBounds(29, 45), "")) 1557Dim newText = oldText.Replace(TextSpan.FromBounds(startOfOld, endOfOld), newSource.Substring(startOfNew, endOfNew - startOfNew + 1))
TestSyntaxNodes.vb (1)
411VerifyListSpans(statements, TextSpan.FromBounds(statements(0).FullSpan.Start, statements(statements.Count - 1).FullSpan.End))
Microsoft.CodeAnalysis.VisualBasic.Workspaces (18)
Classification\Worker.DocumentationCommentClassifier.vb (2)
88Dim span = TextSpan.FromBounds(spanStart.Value, spanStart.Value + index) 98Dim span = TextSpan.FromBounds(spanStart.Value, trivia.Span.End)
Formatting\Rules\BaseFormattingRule.vb (3)
52Return TextSpan.FromBounds(previousToken.Span.End, endToken.FullSpan.End) 64Return TextSpan.FromBounds(spanStart, trivia.FullSpan.Start) 68Return TextSpan.FromBounds(spanStart, nextToken.SpanStart)
Formatting\Rules\NodeBasedFormattingRule.vb (1)
79AddIndentBlockOperation(operations, baseToken, startToken, endToken, TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End))
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])
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\Indentation\VisualBasicSmartTokenFormatter.vb (1)
40Dim spans = SpecializedCollections.SingletonEnumerable(TextSpan.FromBounds(previousToken.SpanStart, token.Span.End))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SyntaxFacts\VisualBasicSyntaxFacts.vb (3)
843Return TextSpan.FromBounds(spanStart, method.EndBlockStatement.SpanStart) 893Return TextSpan.FromBounds(list.First.SpanStart, list.Last.Span.End) 898Return TextSpan.FromBounds(list.First.SpanStart, list.Last.Span.End)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationService.vb (2)
73indices.Add(Not destination.OverlapsHiddenPosition(TextSpan.FromBounds(0, destination.Members.First.SpanStart), cancellationToken)) 86TextSpan.FromBounds(destination.Members.Last.Span.End, destination.EndOfFileToken.SpanStart), cancellationToken))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\CompilationUnitSyntaxExtensions.vb (1)
40Return Not contextNode.SyntaxTree.OverlapsHiddenPosition(TextSpan.FromBounds(start, [end]), cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Indentation\SpecialFormattingOperation.vb (2)
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))
Microsoft.CodeAnalysis.Workspaces (70)
Classification\ClassifierHelper.cs (3)
294finalParts.Add(createSpan(syntacticPart, TextSpan.FromBounds( 312finalParts.Add(createSpan(syntacticPart, TextSpan.FromBounds( 320finalParts.Add(createSpan(syntacticPart, TextSpan.FromBounds(
Classification\SyntaxClassification\SyntacticChangeRangeComputer.cs (1)
114TextSpan.FromBounds(start: commonLeftWidth.Value, end: oldRootWidth - commonRightWidth),
CodeCleanup\AbstractCodeCleanerService.cs (5)
219span = TextSpan.FromBounds(node.SpanStart, GetNextTokenEndPosition(nextTokenMarker.Type, nextToken)); 226span = TextSpan.FromBounds(GetPreviousTokenStartPosition(previousTokenMarker.Type, previousToken), node.Span.End); 347tokenSpans.Add(TextSpan.FromBounds(start, end)); 391return TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End); 608span = TextSpan.FromBounds(start, end);
LinkedFileDiffMerging\AbstractLinkedFileMergeConflictCommentAdditionService.cs (4)
79var oldText = oldDocumentText.GetSubText(TextSpan.FromBounds(startLineStartPosition, endLineEndPosition)); 80var adjustedChanges = changePartition.Select(c => new TextChange(TextSpan.FromBounds(c.Span.Start - startLineStartPosition, c.Span.End - startLineStartPosition), c.NewText)); 90commentChanges.Add(new TextChange(TextSpan.FromBounds(startLineStartPosition, startLineStartPosition), warningText)); 117? text.GetSubText(TextSpan.FromBounds(text.Lines[startLine].Start, text.Lines[endLine].End)).ToString()
LinkedFileDiffMerging\LinkedFileDiffMergingSession.cs (1)
284currentChange = new TextChange(TextSpan.FromBounds(currentChange.Span.Start, nextChange.Span.End), currentChange.NewText + nextChange.NewText);
PatternMatching\PatternMatcher.cs (1)
256var hump = TextSpan.FromBounds(candidateHumps[i].Start, candidateLength);
src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (1)
100return new TextChangeRange(TextSpan.FromBounds(currentStart, currentOldEnd), currentNewEnd - currentStart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\NormalizedTextSpanCollection.cs (7)
122spans.Add(TextSpan.FromBounds(start, end)); 296spans.Add(TextSpan.FromBounds(Math.Max(lastEnd, span1.Start), span1.End)); 307spans.Add(TextSpan.FromBounds(Math.Max(lastEnd, span1.Start), span2.Start)); 334spans.Add(TextSpan.FromBounds(Math.Max(lastEnd, span1.Start), span1.End)); 568spans.Add(TextSpan.FromBounds(start, end)); 611normalized.Add(TextSpan.FromBounds(oldStart, oldEnd)); 621normalized.Add(TextSpan.FromBounds(oldStart, oldEnd));
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)
63return TextSpan.FromBounds(start, end); 76return TextSpan.FromBounds(start.Value, end.Value);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (1)
242return sequence.GetSubSequence(TextSpan.FromBounds(startIndexInclusive, endIndexExclusive));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.cs (1)
211TextSpan.FromBounds(chars1._span.Start, chars2._span.End));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (2)
304fullSpan = TextSpan.FromBounds( 323var textSpan = TextSpan.FromBounds(start, end);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\TextSpanExtensions.cs (5)
48return TextSpan.FromBounds(start, end); 62var innerSpan = TextSpan.FromBounds(startNode.Span.Start, endNode.Span.End); 63var outerSpan = TextSpan.FromBounds(startNode.FullSpan.Start, endNode.FullSpan.End); 81yield return TextSpan.FromBounds(span.Start, startSegmentEnd); 85yield return TextSpan.FromBounds(endSegmentStart, 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\Engine\AbstractFormatEngine.cs (2)
341return TextSpan.FromBounds(startPosition, endPosition); 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\TreeData.NodeAndText.cs (3)
38return _text.ToString(TextSpan.FromBounds(token2.FullSpan.Start, token2.SpanStart)); 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 (2)
131=> TextSpan.FromBounds(Math.Max(_span.Start, textSpan.Start), Math.Min(_span.End, textSpan.End)); 217return TextSpan.FromBounds(start, end);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\FormattingOperations.cs (2)
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\TriviaEngine\AbstractTriviaFormatter.cs (4)
500var span = TextSpan.FromBounds(start, end); 836return TextSpan.FromBounds(this.StartPosition, trivia2.FullSpan.Start); 841return TextSpan.FromBounds(trivia1.FullSpan.End, this.EndPosition); 844return TextSpan.FromBounds(trivia1.FullSpan.End, trivia2.FullSpan.Start);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (2)
242return TextSpan.FromBounds(LineToBeIndented.Start, position); 245return TextSpan.FromBounds(position, LineToBeIndented.Start);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (1)
159var spanToCheck = TextSpan.FromBounds(0, name.Length - Suffix.Length);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.WordSpanEnumerator.cs (1)
72Current = TextSpan.FromBounds(Current.End, Math.Min(_nameSpan.End, nextWordSeparator));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\HeaderFacts\AbstractHeaderFacts.cs (1)
46var headerSpan = TextSpan.FromBounds(
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (2)
164var span = TextSpan.FromBounds(nodes.First().Span.Start, nodes.Last().Span.End); 461return TextSpan.FromBounds(startOfNodeWithoutAttributes, endOfNode);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (4)
158=> (token1.RawKind == 0) ? text.ToString(TextSpan.FromBounds(0, token2.SpanStart)) : text.ToString(TextSpan.FromBounds(token1.Span.End, token2.SpanStart)); 267return TextSpan.FromBounds(startPosition, endPosition); 368return TextSpan.FromBounds(startPosition, endPosition);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (1)
169return TextSpan.FromBounds(wordStart, current);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
51return TextSpan.FromBounds(start.SpanStart, end.Span.End);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeRefactorings\CodeRefactoringHelpers.cs (1)
121return TextSpan.FromBounds(start, end);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Indentation\IIndentationService.cs (1)
40return document.Text.ToString(TextSpan.FromBounds(tokenLine.Start, token.SpanStart));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
172var affectedSpan = TextSpan.FromBounds(previousToken.SpanStart, FirstStatementAffectedInInnermostBlock.Span.End);
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Formatting\FormattingTestBase.cs (1)
114outputBuilder.Add(TextSpan.FromBounds(0, outputText.Length));
Microsoft.CodeAnalysis.Workspaces.UnitTests (170)
CodeCleanup\Extensions.cs (1)
23return TextSpan.FromBounds(previousToken.SpanStart, endToken.Span.End);
EditorConfigParsing\EditorConfigFileParserTests.cs (71)
32(string.Empty, TextSpan.FromBounds(0, 9), true), 33("*.cs", TextSpan.FromBounds(10, 19), false), 34("*.vb", TextSpan.FromBounds(20, 29), false), 35("*.{cs,vb}", TextSpan.FromBounds(30, 39), false), 36("*.{cs,csx,vb,vbx}", TextSpan.FromBounds(40, 49), false)); 55(string.Empty, TextSpan.FromBounds(0, 9), true), 56("*.vb", TextSpan.FromBounds(20, 29), false), 57("*.{cs,vb}", TextSpan.FromBounds(30, 39), false), 58("*.{cs,csx,vb,vbx}", TextSpan.FromBounds(40, 49), false), 59("*s", TextSpan.FromBounds(50, 59), false), 60("*", TextSpan.FromBounds(60, 69), false), 61("*.{cs,csx}", TextSpan.FromBounds(70, 79), false)); 70(string.Empty, TextSpan.FromBounds(0, 9), true), 71("*.vb", TextSpan.FromBounds(20, 29), false), 72("*.{cs,vb}", TextSpan.FromBounds(30, 39), false), 73("*.{cs,csx,vb,vbx}", TextSpan.FromBounds(40, 49), false), 74("*s", TextSpan.FromBounds(50, 59), false), 75("*", TextSpan.FromBounds(60, 69), false), 76("*.{cs,csx}", TextSpan.FromBounds(70, 79), false)); 87(string.Empty, TextSpan.FromBounds(0, 9), true), 88("*.vb", TextSpan.FromBounds(20, 29), false), 89("*.{cs,csx,vb,vbx}", TextSpan.FromBounds(40, 49), false), 90("*s", TextSpan.FromBounds(50, 59), false), 91("*", TextSpan.FromBounds(60, 69), false), 92("*.{cs,csx}", TextSpan.FromBounds(70, 79), false)); 111(string.Empty, TextSpan.FromBounds(0, 9), true), 112("*.cs", TextSpan.FromBounds(10, 19), false), 113("*.vb", TextSpan.FromBounds(20, 29), false), 114("*.{cs,vb}", TextSpan.FromBounds(30, 39), false), 115("*.{cs,csx,vb,vbx}", TextSpan.FromBounds(40, 49), false), 116("*s", TextSpan.FromBounds(50, 59), false), 117("*", TextSpan.FromBounds(60, 69), false), 118("*.{cs,csx}", TextSpan.FromBounds(70, 79), false)); 133(string.Empty, TextSpan.FromBounds(0, 9), true), 134("sources/**/*.cs", TextSpan.FromBounds(10, 19), false), 135("sources/**/*.vb", TextSpan.FromBounds(20, 29), false), 136("*.{cs,vb}", TextSpan.FromBounds(30, 39), false), 137("*.{cs,csx,vb,vbx}", TextSpan.FromBounds(40, 49), false), 138("*s", TextSpan.FromBounds(50, 59), false), 139("*", TextSpan.FromBounds(60, 69), false), 140("*.{cs,csx}", TextSpan.FromBounds(70, 79), false)); 150(string.Empty, TextSpan.FromBounds(0, 9), true), 151("sources/**/*.cs", TextSpan.FromBounds(10, 19), false), 152("sources/**/*.vb", TextSpan.FromBounds(20, 29), false), 153("*.{cs,vb}", TextSpan.FromBounds(30, 39), false), 154("*.{cs,csx,vb,vbx}", TextSpan.FromBounds(40, 49), false), 155("*s", TextSpan.FromBounds(50, 59), false), 156("*", TextSpan.FromBounds(60, 69), false), 157("*.{cs,csx}", TextSpan.FromBounds(70, 79), false)); 172(string.Empty, TextSpan.FromBounds(0, 9), true), 173("*.{cs,csx,vbx}", TextSpan.FromBounds(30, 39), false), 174("*.{cs,csx,vb,vbx}", TextSpan.FromBounds(40, 49), false), 175("*s", TextSpan.FromBounds(50, 59), false), 176("*", TextSpan.FromBounds(60, 69), false)); 191(string.Empty, TextSpan.FromBounds(0, 9), true), 192("*.*b", TextSpan.FromBounds(30, 39), false), 193("*.*b", TextSpan.FromBounds(80, 89), false), 194("*.*b", TextSpan.FromBounds(130, 139), false), 195("*.*s", TextSpan.FromBounds(40, 49), false), 196("*.*s", TextSpan.FromBounds(90, 99), false), 197("*.*s", TextSpan.FromBounds(120, 129), false), 198("*s", TextSpan.FromBounds(50, 59), false), 199("*s", TextSpan.FromBounds(100, 109), false), 200("*", TextSpan.FromBounds(60, 69), false), 201("*b", TextSpan.FromBounds(70, 79), false), 202("*b", TextSpan.FromBounds(110, 119), false)); 217(string.Empty, TextSpan.FromBounds(0, 9), true), 218("*s", TextSpan.FromBounds(100, 109), false), 219("*", TextSpan.FromBounds(60, 69), false)); 234(string.Empty, TextSpan.FromBounds(0, 9), true), 235("*s", TextSpan.FromBounds(100, 109), false));
EditorConfigParsing\NamingStyleParserTests.cs (48)
59Assert.Equal(TextSpan.FromBounds(2155, 2260), rule0.NamingScheme.OptionName.Span); 67Assert.Equal(TextSpan.FromBounds(2562, 2641), rule0.NamingScheme.Capitalization.Span); 70Assert.Equal(TextSpan.FromBounds(2338, 2481), rule0.ApplicableSymbolInfo.Accessibilities.Span); 77Assert.Equal(TextSpan.FromBounds(2338, 2481), rule0.ApplicableSymbolInfo.Accessibilities.Span); 80Assert.Equal(TextSpan.FromBounds(2483, 2558), rule0.ApplicableSymbolInfo.Modifiers.Span); 83Assert.Equal(TextSpan.FromBounds(2338, 2481), rule0.ApplicableSymbolInfo.Accessibilities.Span); 86Assert.Equal(TextSpan.FromBounds(1961, 2049), rule0.Severity.Span); 94Assert.Equal(TextSpan.FromBounds(5078, 5149), rule1.NamingScheme.OptionName.Span); 102Assert.Equal(TextSpan.FromBounds(5236, 5300), rule1.NamingScheme.Capitalization.Span); 105Assert.Equal(TextSpan.FromBounds(4998, 5076), rule1.ApplicableSymbolInfo.OptionName.Span); 120Assert.Equal(TextSpan.FromBounds(5153, 5232), rule1.ApplicableSymbolInfo.SymbolKinds.Span); 123Assert.Equal(TextSpan.FromBounds(4928, 4996), rule1.Severity.Span); 132Assert.Equal(TextSpan.FromBounds(5925, 5999), rule2.NamingScheme.OptionName.Span); 140Assert.Equal(TextSpan.FromBounds(6061, 6127), rule2.NamingScheme.Capitalization.Span); 143Assert.Equal(TextSpan.FromBounds(5853, 5923), rule2.ApplicableSymbolInfo.OptionName.Span); 170Assert.Equal(TextSpan.FromBounds(6003, 6057), rule2.ApplicableSymbolInfo.SymbolKinds.Span); 173Assert.Equal(TextSpan.FromBounds(5781, 5851), rule2.Severity.Span); 181Assert.Equal(TextSpan.FromBounds(2891, 3000), rule3.NamingScheme.OptionName.Span); 189Assert.Equal(TextSpan.FromBounds(3310, 3391), rule3.NamingScheme.Capitalization.Span); 192Assert.Equal(TextSpan.FromBounds(2783, 2889), rule3.ApplicableSymbolInfo.OptionName.Span); 199Assert.Equal(TextSpan.FromBounds(3080, 3225), rule3.ApplicableSymbolInfo.Accessibilities.Span); 202Assert.Equal(TextSpan.FromBounds(3227, 3306), rule3.ApplicableSymbolInfo.Modifiers.Span); 205Assert.Equal(TextSpan.FromBounds(3004, 3078), rule3.ApplicableSymbolInfo.SymbolKinds.Span); 208Assert.Equal(TextSpan.FromBounds(2691, 2781), rule3.Severity.Span); 216Assert.Equal(TextSpan.FromBounds(5502, 5587), rule4.NamingScheme.OptionName.Span); 224Assert.Equal(TextSpan.FromBounds(5666, 5735), rule4.NamingScheme.Capitalization.Span); 227Assert.Equal(TextSpan.FromBounds(5418, 5500), rule4.ApplicableSymbolInfo.OptionName.Span); 241Assert.Equal(TextSpan.FromBounds(5591, 5662), rule4.ApplicableSymbolInfo.SymbolKinds.Span); 244Assert.Equal(TextSpan.FromBounds(5338, 5416), rule4.Severity.Span); 252Assert.Equal(TextSpan.FromBounds(3569, 3642), rule5.NamingScheme.OptionName.Span); 260Assert.Equal(TextSpan.FromBounds(3773, 3836), rule5.NamingScheme.Capitalization.Span); 263Assert.Equal(TextSpan.FromBounds(3497, 3567), rule5.ApplicableSymbolInfo.OptionName.Span); 275Assert.Equal(TextSpan.FromBounds(3711, 3769), rule5.ApplicableSymbolInfo.Modifiers.Span); 279Assert.Equal(TextSpan.FromBounds(3646, 3709), rule5.ApplicableSymbolInfo.SymbolKinds.Span); 282Assert.Equal(TextSpan.FromBounds(3423, 3495), rule5.Severity.Span); 290Assert.Equal(TextSpan.FromBounds(4601, 4685), rule6.NamingScheme.OptionName.Span); 292Assert.Equal(TextSpan.FromBounds(4825, 4885), rule6.NamingScheme.Prefix.Span); 298Assert.Equal(TextSpan.FromBounds(4755, 4823), rule6.NamingScheme.Capitalization.Span); 301Assert.Equal(TextSpan.FromBounds(4518, 4599), rule6.ApplicableSymbolInfo.OptionName.Span); 315Assert.Equal(TextSpan.FromBounds(4689, 4751), rule6.ApplicableSymbolInfo.SymbolKinds.Span); 318Assert.Equal(TextSpan.FromBounds(4439, 4516), rule6.Severity.Span); 326Assert.Equal(TextSpan.FromBounds(4045, 4125), rule7.NamingScheme.OptionName.Span); 328Assert.Equal(TextSpan.FromBounds(4326, 4385), rule7.NamingScheme.Prefix.Span); 334Assert.Equal(TextSpan.FromBounds(4258, 4324), rule7.NamingScheme.Capitalization.Span); 337Assert.Equal(TextSpan.FromBounds(3966, 4043), rule7.ApplicableSymbolInfo.OptionName.Span); 349Assert.Equal(TextSpan.FromBounds(4191, 4254), rule7.ApplicableSymbolInfo.Modifiers.Span); 352Assert.Equal(TextSpan.FromBounds(4129, 4189), rule7.ApplicableSymbolInfo.SymbolKinds.Span); 355Assert.Equal(TextSpan.FromBounds(3889, 3964), rule7.Severity.Span);
Shared\Extensions\TextSpanExtensions\SubtractTests.cs (50)
28private static TextSpan LongSpan { get; } = TextSpan.FromBounds(10, 20); 29private static TextSpan UnitSpan { get; } = TextSpan.FromBounds(10, 11); 30private static TextSpan EmptySpan { get; } = TextSpan.FromBounds(10, 10); 44LongSpan.Subtract(TextSpan.FromBounds(RightBeforeStart(LongSpan), RightBeforeStart(LongSpan)))); 52LongSpan.Subtract(TextSpan.FromBounds(RightBeforeStart(LongSpan), AtStart(LongSpan)))); 59[TextSpan.FromBounds(RightAfterStart(LongSpan), AtEnd(LongSpan))], 60LongSpan.Subtract(TextSpan.FromBounds(RightBeforeStart(LongSpan), RightAfterStart(LongSpan)))); 67[TextSpan.FromBounds(RightBeforeEnd(LongSpan), AtEnd(LongSpan))], 68LongSpan.Subtract(TextSpan.FromBounds(RightBeforeStart(LongSpan), RightBeforeEnd(LongSpan)))); 75LongSpan.Subtract(TextSpan.FromBounds(RightBeforeStart(LongSpan), AtEnd(LongSpan)))); 82LongSpan.Subtract(TextSpan.FromBounds(RightBeforeStart(LongSpan), RightAfterEnd(LongSpan)))); 90LongSpan.Subtract(TextSpan.FromBounds(AtStart(LongSpan), AtStart(LongSpan)))); 97[TextSpan.FromBounds(RightAfterStart(LongSpan), AtEnd(LongSpan))], 98LongSpan.Subtract(TextSpan.FromBounds(AtStart(LongSpan), RightAfterStart(LongSpan)))); 105[TextSpan.FromBounds(RightBeforeEnd(LongSpan), AtEnd(LongSpan))], 106LongSpan.Subtract(TextSpan.FromBounds(AtStart(LongSpan), RightBeforeEnd(LongSpan)))); 113LongSpan.Subtract(TextSpan.FromBounds(AtStart(LongSpan), AtEnd(LongSpan)))); 120LongSpan.Subtract(TextSpan.FromBounds(AtStart(LongSpan), RightAfterEnd(LongSpan)))); 128LongSpan.Subtract(TextSpan.FromBounds(RightAfterStart(LongSpan), RightAfterStart(LongSpan)))); 136TextSpan.FromBounds(AtStart(LongSpan), RightAfterStart(LongSpan)), 137TextSpan.FromBounds(RightBeforeEnd(LongSpan), AtEnd(LongSpan)) 139LongSpan.Subtract(TextSpan.FromBounds(RightAfterStart(LongSpan), RightBeforeEnd(LongSpan)))); 146[TextSpan.FromBounds(AtStart(LongSpan), RightAfterStart(LongSpan))], 147LongSpan.Subtract(TextSpan.FromBounds(RightAfterStart(LongSpan), AtEnd(LongSpan)))); 154[TextSpan.FromBounds(AtStart(LongSpan), RightAfterStart(LongSpan))], 155LongSpan.Subtract(TextSpan.FromBounds(RightAfterStart(LongSpan), RightAfterEnd(LongSpan)))); 163LongSpan.Subtract(TextSpan.FromBounds(RightBeforeEnd(LongSpan), RightBeforeEnd(LongSpan)))); 170[TextSpan.FromBounds(AtStart(LongSpan), RightBeforeEnd(LongSpan))], 171LongSpan.Subtract(TextSpan.FromBounds(RightBeforeEnd(LongSpan), AtEnd(LongSpan)))); 178[TextSpan.FromBounds(AtStart(LongSpan), RightBeforeEnd(LongSpan))], 179LongSpan.Subtract(TextSpan.FromBounds(RightBeforeEnd(LongSpan), RightAfterEnd(LongSpan)))); 187LongSpan.Subtract(TextSpan.FromBounds(AtEnd(LongSpan), AtEnd(LongSpan)))); 195LongSpan.Subtract(TextSpan.FromBounds(AtEnd(LongSpan), RightAfterEnd(LongSpan)))); 203LongSpan.Subtract(TextSpan.FromBounds(RightAfterEnd(LongSpan), RightAfterEnd(LongSpan)))); 211UnitSpan.Subtract(TextSpan.FromBounds(RightBeforeStart(UnitSpan), RightBeforeStart(UnitSpan)))); 219UnitSpan.Subtract(TextSpan.FromBounds(RightBeforeStart(UnitSpan), AtStart(UnitSpan)))); 226UnitSpan.Subtract(TextSpan.FromBounds(RightBeforeStart(UnitSpan), AtEnd(UnitSpan)))); 233UnitSpan.Subtract(TextSpan.FromBounds(RightBeforeStart(UnitSpan), RightAfterEnd(UnitSpan)))); 241UnitSpan.Subtract(TextSpan.FromBounds(AtStart(UnitSpan), AtStart(UnitSpan)))); 248UnitSpan.Subtract(TextSpan.FromBounds(AtStart(UnitSpan), AtEnd(UnitSpan)))); 255UnitSpan.Subtract(TextSpan.FromBounds(AtStart(UnitSpan), RightAfterEnd(UnitSpan)))); 263UnitSpan.Subtract(TextSpan.FromBounds(AtEnd(UnitSpan), AtEnd(UnitSpan)))); 271UnitSpan.Subtract(TextSpan.FromBounds(AtEnd(UnitSpan), RightAfterEnd(UnitSpan)))); 279UnitSpan.Subtract(TextSpan.FromBounds(RightAfterEnd(UnitSpan), RightAfterEnd(UnitSpan)))); 287EmptySpan.Subtract(TextSpan.FromBounds(RightBeforeStart(EmptySpan), RightBeforeStart(EmptySpan)))); 294EmptySpan.Subtract(TextSpan.FromBounds(RightBeforeStart(EmptySpan), EmptySpan.Start))); 301EmptySpan.Subtract(TextSpan.FromBounds(RightBeforeStart(EmptySpan), RightAfterEnd(EmptySpan)))); 308EmptySpan.Subtract(TextSpan.FromBounds(EmptySpan.Start, EmptySpan.Start))); 315EmptySpan.Subtract(TextSpan.FromBounds(EmptySpan.Start, RightAfterEnd(EmptySpan)))); 323EmptySpan.Subtract(TextSpan.FromBounds(RightAfterEnd(EmptySpan), RightAfterEnd(EmptySpan))));
Microsoft.VisualStudio.LanguageServices (18)
CallHierarchy\CallHierarchyDetail.cs (1)
46return location.SourceTree.GetText().GetSubText(TextSpan.FromBounds(start, end)).ToString();
Diagnostics\VisualStudioVenusSpanMappingService.cs (1)
60sourceSpan = TextSpan.FromBounds(startPos, Math.Max(startPos, endPos));
Extensions\DocumentExtensions.cs (1)
56codeBlocks.Add(Tuple.Create(TextSpan.FromBounds(start, end), cookie));
Implementation\AbstractEditorFactory.cs (2)
361var originalNewLine = originalText.ToString(CodeAnalysis.Text.TextSpan.FromBounds(originalLine.End, originalLine.EndIncludingLineBreak)); 367var currentSpan = CodeAnalysis.Text.TextSpan.FromBounds(currentLine.End, currentLine.EndIncludingLineBreak);
LanguageService\AbstractLanguageService`2.IVsLanguageContextProvider.cs (1)
37var span = Microsoft.CodeAnalysis.Text.TextSpan.FromBounds(start, end);
LanguageService\AbstractLanguageService`2.IVsLanguageTextOps.cs (2)
77var originalSpan = RoslynTextSpan.FromBounds(start, end); 106return RoslynTextSpan.FromBounds(start, end);
Venus\ContainedDocument.cs (10)
454groups.Add(TextSpan.FromBounds(0, 0)); 458groups.Add(TextSpan.FromBounds(start, i)); 462groups.Add(TextSpan.FromBounds(start, i)); 475groups.Add(TextSpan.FromBounds(start, text.Length)); 548TextSpan.FromBounds(visibleFirstLineInOriginalText.EndIncludingLineBreak, visibleLastLineInOriginalText.Start), 569TextSpan.FromBounds(visibleFirstLineInOriginalText.EndIncludingLineBreak, spanInOriginalText.End), 586TextSpan.FromBounds(spanInOriginalText.Start, visibleLastLineInOriginalText.Start), 841return new BaseIndentationFormattingRule(root, TextSpan.FromBounds(visibleSpan.Start, end), baseIndentation, _vbHelperFormattingRule); 851return new BaseIndentationFormattingRule(root, TextSpan.FromBounds(visibleSpan.Start, end), baseIndentation, _vbHelperFormattingRule); 946return (start <= end) ? TextSpan.FromBounds(start, end + 1) : default;
Microsoft.VisualStudio.LanguageServices.CSharp (5)
CodeModel\CSharpCodeModelService.cs (2)
2802text = text.Replace(TextSpan.FromBounds(deletionStart, deletionEnd), string.Empty); 2877text = text.Replace(TextSpan.FromBounds(deletionStart, deletionEnd), string.Empty);
CodeModel\CSharpCodeModelService.NodeLocator.cs (2)
140var textAfterBrace = text.ToString(TextSpan.FromBounds(openBrace.Span.End, openBraceLine.End)); 214var textBeforeBrace = text.ToString(TextSpan.FromBounds(closeBraceLine.Start, closeBrace.SpanStart));
LanguageService\CSharpHelpContextService.cs (1)
89return text.GetSubText(TextSpan.FromBounds(start, end)).ToString();
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
EditorConfigSettings\DataProvider\DataProviderTests.MockAnalyzerReference.cs (1)
111c.ReportDiagnostic(Diagnostic.Create(descriptor, c.Tree.GetLocation(TextSpan.FromBounds(0, 0))));
Microsoft.VisualStudio.LanguageServices.VisualBasic (4)
CodeModel\VisualBasicCodeModelService.vb (4)
1301text = text.Replace(TextSpan.FromBounds(deletionStart, deletionEnd), String.Empty) 1360text = text.Replace(TextSpan.FromBounds(spanStart, spanEnd), String.Empty) 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)
Roslyn.VisualStudio.Next.UnitTests (3)
Services\ServiceHubServicesTests.cs (1)
90var newText = oldText.WithChanges(new TextChange(TextSpan.FromBounds(0, 0), "/* test */"));
Services\VisualStudioDiagnosticAnalyzerExecutorTests.cs (2)
276c.ReportDiagnostic(Diagnostic.Create(_supportedDiagnostics[0], c.Tree.GetLocation(TextSpan.FromBounds(0, 1)))); 294c.ReportDiagnostic(Diagnostic.Create(_supportedDiagnostics[0], c.Tree.GetLocation(TextSpan.FromBounds(0, 1))));