5 overrides of ToString
Microsoft.CodeAnalysis (4)
Text\ChangedText.cs (1)
137public override string ToString(TextSpan span)
Text\StringBuilderText.cs (1)
78public override string ToString(TextSpan span)
Text\StringText.cs (1)
71public override string ToString(TextSpan span)
Text\SubText.cs (1)
71public override string ToString(TextSpan span)
Microsoft.CodeAnalysis.EditorFeatures.Text (1)
Extensions.SnapshotSourceText.cs (1)
177public override string ToString(TextSpan textSpan)
235 references to ToString
GenerateDocumentationAndConfigFiles (7)
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
60var fromText = text.ToString(textSpanOpt.Value);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.NodeAndText.cs (3)
37return _text.ToString(TextSpan.FromBounds(token2.FullSpan.Start, token2.SpanStart)); 43return _text.ToString(TextSpan.FromBounds(token1.Span.End, token1.FullSpan.End)); 46return _text.ToString(TextSpan.FromBounds(token1.Span.End, token2.SpanStart));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (2)
157=> (token1.RawKind == 0) ? text.ToString(TextSpan.FromBounds(0, token2.SpanStart)) : text.ToString(TextSpan.FromBounds(token1.Span.End, token2.SpanStart));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Indentation\IIndentationService.cs (1)
39return document.Text.ToString(TextSpan.FromBounds(tokenLine.Start, token.SpanStart));
Metrics (6)
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
60var fromText = text.ToString(textSpanOpt.Value);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.NodeAndText.cs (3)
37return _text.ToString(TextSpan.FromBounds(token2.FullSpan.Start, token2.SpanStart)); 43return _text.ToString(TextSpan.FromBounds(token1.Span.End, token1.FullSpan.End)); 46return _text.ToString(TextSpan.FromBounds(token1.Span.End, token2.SpanStart));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (2)
157=> (token1.RawKind == 0) ? text.ToString(TextSpan.FromBounds(0, token2.SpanStart)) : text.ToString(TextSpan.FromBounds(token1.Span.End, token2.SpanStart));
Metrics.Legacy (6)
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
60var fromText = text.ToString(textSpanOpt.Value);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.NodeAndText.cs (3)
37return _text.ToString(TextSpan.FromBounds(token2.FullSpan.Start, token2.SpanStart)); 43return _text.ToString(TextSpan.FromBounds(token1.Span.End, token1.FullSpan.End)); 46return _text.ToString(TextSpan.FromBounds(token1.Span.End, token2.SpanStart));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (2)
157=> (token1.RawKind == 0) ? text.ToString(TextSpan.FromBounds(0, token2.SpanStart)) : text.ToString(TextSpan.FromBounds(token1.Span.End, token2.SpanStart));
Microsoft.AspNetCore.App.Analyzers.Test (1)
RouteEmbeddedLanguage\RoutePatternParserTests.cs (1)
291=> new("Text", text.ToString(span));
Microsoft.AspNetCore.Razor.Test.Common (2)
Language\IntegrationTests\IntegrationTestBase.cs (1)
532var actualSpan = csharpDocument.Text.ToString(mapping.GeneratedSpan.AsTextSpan());
Language\IntegrationTests\SourceMappingsSerializer.cs (1)
48return content.ToString(location.AsTextSpan());
Microsoft.CodeAnalysis (6)
Syntax\SyntaxTreeExtensions.cs (1)
60var fromText = text.ToString(textSpanOpt.Value);
Text\ChangedText.cs (1)
139return _newText.ToString(span);
Text\SourceText.cs (2)
712return ToString(new TextSpan(0, this.Length)); 938newt = this.ToString(span);
Text\SubText.cs (1)
75return UnderlyingText.ToString(GetCompositeSpan(span.Start, span.Length));
Text\TextLine.cs (1)
181return _text.ToString(this.Span);
Microsoft.CodeAnalysis.Analyzers (7)
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
60var fromText = text.ToString(textSpanOpt.Value);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.NodeAndText.cs (3)
37return _text.ToString(TextSpan.FromBounds(token2.FullSpan.Start, token2.SpanStart)); 43return _text.ToString(TextSpan.FromBounds(token1.Span.End, token1.FullSpan.End)); 46return _text.ToString(TextSpan.FromBounds(token1.Span.End, token2.SpanStart));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (2)
157=> (token1.RawKind == 0) ? text.ToString(TextSpan.FromBounds(0, token2.SpanStart)) : text.ToString(TextSpan.FromBounds(token1.Span.End, token2.SpanStart));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Indentation\IIndentationService.cs (1)
39return document.Text.ToString(TextSpan.FromBounds(tokenLine.Start, token.SpanStart));
Microsoft.CodeAnalysis.AnalyzerUtilities (6)
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
60var fromText = text.ToString(textSpanOpt.Value);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.NodeAndText.cs (3)
37return _text.ToString(TextSpan.FromBounds(token2.FullSpan.Start, token2.SpanStart)); 43return _text.ToString(TextSpan.FromBounds(token1.Span.End, token1.FullSpan.End)); 46return _text.ToString(TextSpan.FromBounds(token1.Span.End, token2.SpanStart));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (2)
157=> (token1.RawKind == 0) ? text.ToString(TextSpan.FromBounds(0, token2.SpanStart)) : text.ToString(TextSpan.FromBounds(token1.Span.End, token2.SpanStart));
Microsoft.CodeAnalysis.BannedApiAnalyzers (7)
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
60var fromText = text.ToString(textSpanOpt.Value);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.NodeAndText.cs (3)
37return _text.ToString(TextSpan.FromBounds(token2.FullSpan.Start, token2.SpanStart)); 43return _text.ToString(TextSpan.FromBounds(token1.Span.End, token1.FullSpan.End)); 46return _text.ToString(TextSpan.FromBounds(token1.Span.End, token2.SpanStart));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (2)
157=> (token1.RawKind == 0) ? text.ToString(TextSpan.FromBounds(0, token2.SpanStart)) : text.ToString(TextSpan.FromBounds(token1.Span.End, token2.SpanStart));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Indentation\IIndentationService.cs (1)
39return document.Text.ToString(TextSpan.FromBounds(tokenLine.Start, token.SpanStart));
Microsoft.CodeAnalysis.CodeStyle (6)
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
60var fromText = text.ToString(textSpanOpt.Value);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.NodeAndText.cs (3)
37return _text.ToString(TextSpan.FromBounds(token2.FullSpan.Start, token2.SpanStart)); 43return _text.ToString(TextSpan.FromBounds(token1.Span.End, token1.FullSpan.End)); 46return _text.ToString(TextSpan.FromBounds(token1.Span.End, token2.SpanStart));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (2)
157=> (token1.RawKind == 0) ? text.ToString(TextSpan.FromBounds(0, token2.SpanStart)) : text.ToString(TextSpan.FromBounds(token1.Span.End, token2.SpanStart));
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Indentation\IIndentationService.cs (1)
39return document.Text.ToString(TextSpan.FromBounds(tokenLine.Start, token.SpanStart));
Microsoft.CodeAnalysis.CSharp (2)
Parser\Lexer.cs (1)
720info.Text = TextWindow.Text.ToString(TextSpan.FromBounds(startingPosition, end));
Parser\SlidingTextWindow.cs (1)
418return this.Text.ToString(span);
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (1)
238var name = SyntaxFactory.ParseName(syntaxTree.GetText(cancellationToken).ToString(TextSpan.FromBounds(genericIdentifier.SpanStart, lastToken.Span.End)));
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (1)
915: EndOfLine(text.ToString(lineBreakSpan));
Microsoft.CodeAnalysis.CSharp.EditorFeatures (8)
AutomaticCompletion\AutomaticLineEnderCommandHandler.cs (1)
203var endingString = text.ToString(TextSpan.FromBounds(lastToken.Span.End, line.End));
StringCopyPaste\KnownSourcePasteProcessor.cs (2)
296builder.Append(sourceText.ToString(sourceText.Lines[i].SpanIncludingLineBreak)); 341builder.Append(TextBeforePaste.ToString(new TextSpan(TextBeforePaste.Lines[line].Start, offset)));
StringCopyPaste\StringCopyPasteCommandHandler.cs (1)
247return textBeforePaste.ToString(TextSpan.FromBounds(lastLine.Span.Start, quotePosition));
StringCopyPaste\StringCopyPasteHelpers.cs (1)
546return text.ToString(lineWhitespaceSpan);
StringCopyPaste\UnknownSourcePasteProcessor.cs (3)
192var fullChangeLineText = textOfCurrentChange.ToString(currentChangeLine.SpanIncludingLineBreak); 261var fullChangeLineText = textOfCurrentChange.ToString(currentChangeLine.SpanIncludingLineBreak); 332buffer.Append(TextBeforePaste.ToString(new TextSpan(TextBeforePaste.Lines[line].Start, offset)));
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (1)
EmbeddedLanguages\RegularExpressions\CSharpRegexParserTests.cs (1)
215=> new("Text", text.ToString(span));
Microsoft.CodeAnalysis.CSharp.Features (14)
BraceMatching\BlockCommentBraceMatcher.cs (2)
56if (text.ToString(startBrace) == "/**" && text.ToString(endBrace) == "*/")
Completion\CompletionProviders\DeclarationName\DeclarationNameInfo.cs (1)
192var type = SyntaxFactory.ParseTypeName(sourceText.ToString(subSpan));
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider_Operators.cs (1)
143var replacement = item.DisplayText + text.ToString(TextSpan.FromBounds(expressionStart, dotLikeToken.SpanStart));
ConvertToRawString\ConvertInterpolatedStringToRawStringCodeRefactoringProvider.cs (8)
314builder.Append(text.ToString(TextSpan.FromBounds(line.End, line.EndIncludingLineBreak))); 334builder.Append(text.ToString(TextSpan.FromBounds(firstNonWhitespacePos, line.EndIncludingLineBreak))); 480=> builder.Append(line.Text!.ToString(line.SpanIncludingLineBreak)); 579builder.Append(text.ToString(TextSpan.FromBounds(line.End, line.EndIncludingLineBreak))); 591var currentLineLeadingWhitespace = line.Text!.ToString(TextSpan.FromBounds(line.Start, pos)); 594builder.Append(text.ToString(TextSpan.FromBounds(line.Start + commonWhitespacePrefix.Length, line.EndIncludingLineBreak))); 612builder.Append(text.ToString(TextSpan.FromBounds(line.Start + commonWhitespacePrefix.Length, line.EndIncludingLineBreak))); 666var currentLineLeadingWhitespace = line.Text!.ToString(TextSpan.FromBounds(line.Start, pos));
SplitStringLiteral\InterpolatedStringSplitter.cs (1)
83var content = Document.Text.ToString(TextSpan.FromBounds(start, end));
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (1)
915: EndOfLine(text.ToString(lineBreakSpan));
Microsoft.CodeAnalysis.CSharp.Workspaces (3)
Classification\ClassificationHelpers.cs (2)
509var text2 = text.ToString(textSpan); 534var text = rawText.ToString(span);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (1)
238var name = SyntaxFactory.ParseName(syntaxTree.GetText(cancellationToken).ToString(TextSpan.FromBounds(genericIdentifier.SpanStart, lastToken.Span.End)));
Microsoft.CodeAnalysis.EditorFeatures (2)
AutomaticCompletion\AbstractAutomaticLineEnderCommandHandler.cs (1)
177if (string.IsNullOrWhiteSpace(text.ToString(TextSpan.FromBounds(token.Span.End, line.End))))
InlineRename\InlineRenameSession.OpenTextBufferManager.cs (1)
215return sourceText.ToString(span);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (4)
Completion\AbstractCompletionProviderTests.cs (2)
1282var assertText = "'" + text.ToString(new TextSpan(position, 1)) + "' expected to be textual trigger character"; 1287var assertText = "'" + text.ToString(new TextSpan(position, 1)) + "' expected to NOT be textual trigger character";
KeywordHighlighting\AbstractKeywordHighlighterTests.cs (2)
75var actualText = tree.GetText().ToString(highlightSpans[j]); 81var expectedText = tree.GetText().ToString(expectedHighlightSpans[j]);
Microsoft.CodeAnalysis.Features (17)
Completion\Utilities.cs (1)
42return new TextChange(totalOldSpan, newText.ToString(totalNewSpan));
Copilot\IProposalAdjusterService.cs (3)
311var protectedText = originalText.ToString(protectedSpan); 331var overlapText = originalText.ToString(TextSpan.FromBounds(protectedSpan.Start, change.Span.End)); 341var overlapText = originalText.ToString(TextSpan.FromBounds(change.Span.Start, protectedSpan.End));
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (1)
719lineText = text.ToString(TextSpan.FromBounds(diagnostic.Span.Start, Math.Min(diagnostic.Span.Start + 120, line.End)));
InvertIf\AbstractInvertIfCodeRefactoringProvider.cs (2)
184new TextChange(trueSpan, text.ToString(falseSpan)), 185new TextChange(falseSpan, text.ToString(trueSpan)));
QuickInfo\Presentation\QuickInfoContentBuilder.cs (1)
159text.ToString(span.TextSpan),
Rename\SymbolicRenameInfo.cs (1)
255var triggerText = sourceText.ToString(triggerToken.Span);
ReplaceDocCommentTextWithTag\AbstractReplaceDocCommentTextWithTagCodeRefactoringProvider.cs (3)
48var singleWordText = sourceText.ToString(singleWordSpan); 72var fullyQualifiedText = sourceText.ToString(fullyQualifiedSpan); 119var text = sourceText.ToString(replacementSpan);
SemanticSearch\SemanticSearchDefinitionItemFactory.cs (1)
67var displayText = new TaggedText(TextTags.Text, text.ToString(displaySpan));
Snippets\RoslynLSPSnippetConverter.cs (1)
112var newString = documentText.ToString(extendedSpan);
TaskList\AbstractTaskListService.cs (2)
143var startMessage = text.ToString(TextSpan.FromBounds(fullSpan.Start, startLine.End)); 158var endMessage = text.ToString(new TextSpan(endLine.Start, length));
Wrapping\AbstractCodeActionComputer.cs (1)
181var text = OriginalSourceText.ToString(span);
Microsoft.CodeAnalysis.Features.Test.Utilities (1)
EditAndContinue\Extensions.cs (1)
32d.Span == default ? null : newSource.ToString(d.Span),
Microsoft.CodeAnalysis.LanguageServer.Protocol (1)
Handler\References\FindUsagesLSPContext.cs (1)
369span.ClassificationType, docText.ToString(span.TextSpan), ClassifiedTextRunStyle.Plain, markerTagType));
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (7)
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
60var fromText = text.ToString(textSpanOpt.Value);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.NodeAndText.cs (3)
37return _text.ToString(TextSpan.FromBounds(token2.FullSpan.Start, token2.SpanStart)); 43return _text.ToString(TextSpan.FromBounds(token1.Span.End, token1.FullSpan.End)); 46return _text.ToString(TextSpan.FromBounds(token1.Span.End, token2.SpanStart));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (2)
157=> (token1.RawKind == 0) ? text.ToString(TextSpan.FromBounds(0, token2.SpanStart)) : text.ToString(TextSpan.FromBounds(token1.Span.End, token2.SpanStart));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Indentation\IIndentationService.cs (1)
39return document.Text.ToString(TextSpan.FromBounds(tokenLine.Start, token.SpanStart));
Microsoft.CodeAnalysis.PublicApiAnalyzers (6)
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
60var fromText = text.ToString(textSpanOpt.Value);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.NodeAndText.cs (3)
37return _text.ToString(TextSpan.FromBounds(token2.FullSpan.Start, token2.SpanStart)); 43return _text.ToString(TextSpan.FromBounds(token1.Span.End, token1.FullSpan.End)); 46return _text.ToString(TextSpan.FromBounds(token1.Span.End, token2.SpanStart));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (2)
157=> (token1.RawKind == 0) ? text.ToString(TextSpan.FromBounds(0, token2.SpanStart)) : text.ToString(TextSpan.FromBounds(token1.Span.End, token2.SpanStart));
Microsoft.CodeAnalysis.PublicApiAnalyzers.CodeFixes (1)
PublicApiFixHelpers.cs (1)
90return sourceText.ToString(new TextSpan(firstLine.End, firstLine.EndIncludingLineBreak - firstLine.End));
Microsoft.CodeAnalysis.Razor.Compiler (6)
Language\DefaultTagHelperResolutionPhase.cs (2)
844var exprText = sourceDocument.Text.ToString( 893var innerText = sourceDocument.Text.ToString(
Language\DefaultTagHelperResolutionPhase.LegacyTagHelperResolver.cs (4)
592var sourceText = sourceDocument.Text.ToString( 728var rawText = sourceDocument.Text.ToString( 1312var text = sourceDocument.Text.ToString( 1395var text = sourceDocument.Text.ToString(new Microsoft.CodeAnalysis.Text.TextSpan(vss.AbsoluteIndex, vss.Length));
Microsoft.CodeAnalysis.Razor.Workspaces (37)
CodeActions\CSharp\TypeAccessibilityCodeActionProvider.cs (1)
114var associatedValue = context.SourceText.ToString(diagnosticSpan);
CodeActions\Razor\ExtractToCodeBehindCodeActionResolver.cs (1)
49var codeBlockContent = text.ToString(new TextSpan(actionParams.ExtractStart, actionParams.ExtractEnd - actionParams.ExtractStart)).Trim();
CodeActions\Razor\ExtractToCssCodeActionResolver.cs (1)
45var cssContent = text.ToString(new TextSpan(actionParams.ExtractStart, actionParams.ExtractEnd - actionParams.ExtractStart)).Trim();
CodeActions\Razor\PromoteUsingCodeActionResolver.cs (1)
46var textToInsert = sourceText.ToString(TextSpan.FromBounds(actionParams.UsingStart, actionParams.UsingEnd));
DocumentMapping\RazorEditService_Members.cs (1)
184builder.Append(sourceText.ToString(TextSpan.FromBounds(line.Start + offset, line.End)));
Extensions\TextLineExtensions.cs (1)
26? line.Text.AssumeNotNull().ToString(TextSpan.FromBounds(line.Start, line.Start + offset))
FindAllReferences\FindAllReferencesHelper.cs (1)
48return codeDoc.Source.Text.ToString(TextSpan.FromBounds(start, line.End));
Formatting\FormattingUtilities.cs (9)
102var extractedText = text.ToString(extractionSpan); 337replacementBuilder.Append(formattedText.ToString(TextSpan.FromBounds( 351replacementText = formattedText.ToString(TextSpan.FromBounds(formattedStart, formattedEnd)); 466return lineText.ToString(TextSpan.FromBounds(formattedLine.Start, end)); 474return indentationString + lineText.ToString(TextSpan.FromBounds(formattedLine.Start + firstNonWhitespace, end)); 478? indentationString + lineText.ToString(TextSpan.FromBounds(formattedLine.End, end)) 518formattedText.ToString(TextSpan.FromBounds(formattedStart, formattedLine.End)))); 657formattingChanges.Add(new TextChange(new(originalLine.End, 0), formattedText.ToString(formattedLine.Span))); 674formattedText.ToString(TextSpan.FromBounds(formattedStart, formattedLine.End)));
Formatting\Passes\CSharpFormattingPass.CSharpDocumentGenerator.cs (16)
285additionalLinesBuilder.AppendLine(_sourceText.ToString(originalSpan.ToTextSpan())); 292additionalLinesBuilder.AppendLine(_sourceText.ToString(originalSpan.ToTextSpan())); 353var skippedPreviousLineText = _sourceText.ToString(TextSpan.FromBounds(node.SpanStart, previousLine.End)); 365_builder.Append(_sourceText.ToString(TextSpan.FromBounds(_currentLine.Start, _currentFirstNonWhitespacePosition))); 394_builder.Append(_sourceText.ToString(span)); 496_builder.Append(_sourceText.ToString(TextSpan.FromBounds(_currentLine.Start, _currentFirstNonWhitespacePosition))); 499_builder.Append(_sourceText.ToString(span)); 843_builder.Append(_sourceText.ToString(TextSpan.FromBounds(_currentLine.Start, _currentFirstNonWhitespacePosition))); 933_builder.Append(_sourceText.ToString(TextSpan.FromBounds(_currentLine.Start, _currentFirstNonWhitespacePosition))); 935_builder.Append(_sourceText.ToString(span)); 978_builder.Append(_sourceText.ToString(TextSpan.FromBounds(_currentLine.Start, _currentFirstNonWhitespacePosition))); 979_builder.AppendLine(_sourceText.ToString(TextSpan.FromBounds(_currentToken.Position + 1, _currentLine.End))); 993_builder.Append(_sourceText.ToString(TextSpan.FromBounds(_currentLine.Start, _currentFirstNonWhitespacePosition))); 994_builder.AppendLine(_sourceText.ToString(TextSpan.FromBounds(_currentToken.Position + 1, _currentLine.End))); 1076_builder.AppendLine(_sourceText.ToString(TextSpan.FromBounds(_currentToken.Position + 1, _currentLine.End))); 1180_builder.Append(_sourceText.ToString(TextSpan.FromBounds(closeAngleEnd, _currentLine.End)));
Formatting\Passes\CSharpOnTypeFormattingPass.cs (1)
573var spanText = context.SourceText.ToString(mappingSpan);
Formatting\Passes\FormattingContentValidationPass.cs (1)
59builder.AppendLine(SR.FormatEdit_at_deletes(text.GetLinePositionSpan(change.Span), text.ToString(change.Span)));
Formatting\RazorFormattingService.cs (1)
351var newText = changedText.ToString(spanAfterChange);
Formatting\UsingDirectiveHelper.cs (2)
109return sourceText.ToString(TextSpan.FromBounds(start, end)); 281builder.AppendLine(sourceText.ToString(directive.Span));
Microsoft.CodeAnalysis.ResxSourceGenerator (6)
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
60var fromText = text.ToString(textSpanOpt.Value);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.NodeAndText.cs (3)
37return _text.ToString(TextSpan.FromBounds(token2.FullSpan.Start, token2.SpanStart)); 43return _text.ToString(TextSpan.FromBounds(token1.Span.End, token1.FullSpan.End)); 46return _text.ToString(TextSpan.FromBounds(token1.Span.End, token2.SpanStart));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (2)
157=> (token1.RawKind == 0) ? text.ToString(TextSpan.FromBounds(0, token2.SpanStart)) : text.ToString(TextSpan.FromBounds(token1.Span.End, token2.SpanStart));
Microsoft.CodeAnalysis.Test.Utilities (1)
Diagnostics\DiagnosticDescription.cs (1)
161_squiggledText = _location.SourceTree.GetText().ToString(_location.SourceSpan);
Microsoft.CodeAnalysis.UnitTests (7)
Text\CompositeTextTests.cs (1)
50return textLines.Select(l => l.Text!.ToString(l.SpanIncludingLineBreak));
Text\SourceTextTests.cs (1)
206var change = new TextChange(span, text.ToString(span));
Text\StringTextTests_Default.cs (5)
73Assert.Equal("goo", data.ToString(data.Lines[0].Span)); 74Assert.Equal("bar", data.ToString(data.Lines[1].Span)); 75Assert.Equal("baz", data.ToString(data.Lines[2].Span)); 83Assert.Equal("goo", data.ToString(data.Lines[0].Span)); 84Assert.Equal("bar", data.ToString(data.Lines[1].Span));
Microsoft.CodeAnalysis.Workspaces (8)
Classification\Classifier.cs (1)
139parts.Add(new SymbolDisplayPart(kind.Value, null, sourceText.ToString(span.TextSpan)));
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
60var fromText = text.ToString(textSpanOpt.Value);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.NodeAndText.cs (3)
37return _text.ToString(TextSpan.FromBounds(token2.FullSpan.Start, token2.SpanStart)); 43return _text.ToString(TextSpan.FromBounds(token1.Span.End, token1.FullSpan.End)); 46return _text.ToString(TextSpan.FromBounds(token1.Span.End, token2.SpanStart));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (2)
157=> (token1.RawKind == 0) ? text.ToString(TextSpan.FromBounds(0, token2.SpanStart)) : text.ToString(TextSpan.FromBounds(token1.Span.End, token2.SpanStart));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Indentation\IIndentationService.cs (1)
39return document.Text.ToString(TextSpan.FromBounds(tokenLine.Start, token.SpanStart));
Microsoft.NET.Sdk.Razor.SourceGenerators.UnitTests (4)
RazorSourceGeneratorComponentTests.cs (4)
847Assert.Equal(snippet, generatedText.ToString(generatedSpan)); 856Assert.Equal(snippet, originalText.ToString(mappedSpan)); 905Assert.Equal(snippet, generatedText.ToString(generatedSpan)); 913Assert.Equal(snippet, originalText.ToString(mappedSpan));
Microsoft.VisualStudio.LanguageServices (4)
Implementation\AbstractEditorFactory.cs (1)
367var originalNewLine = originalText.ToString(CodeAnalysis.Text.TextSpan.FromBounds(originalLine.End, originalLine.EndIncludingLineBreak));
ValueTracking\TreeItemViewModel.cs (2)
42public override string AutomationName => _sourceText.ToString(TextSpan); 112return new ClassifiedText(cs.ClassificationType, _sourceText.ToString(cs.TextSpan));
Venus\ContainedDocument.cs (1)
352var leftText = originalText.ToString(changeInOriginalText.Span);
Microsoft.VisualStudio.LanguageServices.CSharp (2)
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));
Microsoft.VisualStudio.LanguageServices.Razor.UnitTests (8)
Cohost\RemoteDebugInfoServiceTest.cs (1)
482var expected = input.Spans.Select(inputText.ToString).Concat(extraExpressions).OrderAsArray();
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Diagnostics\RazorDiagnosticHelperTest.cs (4)
71Assert.Equal("lo W", sourceText.ToString(sourceText.GetTextSpan(range))); 87Assert.Equal("", sourceText.ToString(sourceText.GetTextSpan(range))); 103Assert.Equal("", sourceText.ToString(sourceText.GetTextSpan(range))); 119Assert.Equal("World", sourceText.ToString(sourceText.GetTextSpan(range)));
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\DocumentExcerpt\DocumentExcerptServiceTestBase.cs (2)
55(await primary.GetTextAsync(cancellationToken)).ToString(primarySpan), 56(await secondary.GetTextAsync(cancellationToken)).ToString(secondarySpan));
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Endpoints\CohostSemanticTokensRangeEndpointTest.cs (1)
497var text = sourceText.ToString(new TextSpan(sourceText.Lines[lineIndex].Start + lineOffset, length));
Microsoft.VisualStudioCode.RazorExtension.UnitTests (7)
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Diagnostics\RazorDiagnosticHelperTest.cs (4)
71Assert.Equal("lo W", sourceText.ToString(sourceText.GetTextSpan(range))); 87Assert.Equal("", sourceText.ToString(sourceText.GetTextSpan(range))); 103Assert.Equal("", sourceText.ToString(sourceText.GetTextSpan(range))); 119Assert.Equal("World", sourceText.ToString(sourceText.GetTextSpan(range)));
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\DocumentExcerpt\DocumentExcerptServiceTestBase.cs (2)
55(await primary.GetTextAsync(cancellationToken)).ToString(primarySpan), 56(await secondary.GetTextAsync(cancellationToken)).ToString(secondarySpan));
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Endpoints\CohostSemanticTokensRangeEndpointTest.cs (1)
497var text = sourceText.ToString(new TextSpan(sourceText.Lines[lineIndex].Start + lineOffset, length));
Roslyn.Diagnostics.Analyzers (7)
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
60var fromText = text.ToString(textSpanOpt.Value);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.NodeAndText.cs (3)
37return _text.ToString(TextSpan.FromBounds(token2.FullSpan.Start, token2.SpanStart)); 43return _text.ToString(TextSpan.FromBounds(token1.Span.End, token1.FullSpan.End)); 46return _text.ToString(TextSpan.FromBounds(token1.Span.End, token2.SpanStart));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (2)
157=> (token1.RawKind == 0) ? text.ToString(TextSpan.FromBounds(0, token2.SpanStart)) : text.ToString(TextSpan.FromBounds(token1.Span.End, token2.SpanStart));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Indentation\IIndentationService.cs (1)
39return document.Text.ToString(TextSpan.FromBounds(tokenLine.Start, token.SpanStart));
Roslyn.Diagnostics.CSharp.Analyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (1)
238var name = SyntaxFactory.ParseName(syntaxTree.GetText(cancellationToken).ToString(TextSpan.FromBounds(genericIdentifier.SpanStart, lastToken.Span.End)));
Test.Utilities (6)
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
60var fromText = text.ToString(textSpanOpt.Value);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.NodeAndText.cs (3)
37return _text.ToString(TextSpan.FromBounds(token2.FullSpan.Start, token2.SpanStart)); 43return _text.ToString(TextSpan.FromBounds(token1.Span.End, token1.FullSpan.End)); 46return _text.ToString(TextSpan.FromBounds(token1.Span.End, token2.SpanStart));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (2)
157=> (token1.RawKind == 0) ? text.ToString(TextSpan.FromBounds(0, token2.SpanStart)) : text.ToString(TextSpan.FromBounds(token1.Span.End, token2.SpanStart));
Text.Analyzers (7)
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
60var fromText = text.ToString(textSpanOpt.Value);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.NodeAndText.cs (3)
37return _text.ToString(TextSpan.FromBounds(token2.FullSpan.Start, token2.SpanStart)); 43return _text.ToString(TextSpan.FromBounds(token1.Span.End, token1.FullSpan.End)); 46return _text.ToString(TextSpan.FromBounds(token1.Span.End, token2.SpanStart));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (2)
157=> (token1.RawKind == 0) ? text.ToString(TextSpan.FromBounds(0, token2.SpanStart)) : text.ToString(TextSpan.FromBounds(token1.Span.End, token2.SpanStart));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Indentation\IIndentationService.cs (1)
39return document.Text.ToString(TextSpan.FromBounds(tokenLine.Start, token.SpanStart));