4 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)
131 references to ToString
dotnet-format (1)
Formatters\EndOfLineFormatter.cs (1)
48var lineEnding = newSourceText.ToString(lineEndingSpan);
GenerateDocumentationAndConfigFiles (7)
src\roslyn\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
60var fromText = text.ToString(textSpanOpt.Value);
src\roslyn\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\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Indentation\IIndentationService.cs (1)
39return document.Text.ToString(TextSpan.FromBounds(tokenLine.Start, token.SpanStart));
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)
732return ToString(new TextSpan(0, this.Length)); 952newt = 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\roslyn\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
60var fromText = text.ToString(textSpanOpt.Value);
src\roslyn\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\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Indentation\IIndentationService.cs (1)
39return document.Text.ToString(TextSpan.FromBounds(tokenLine.Start, token.SpanStart));
Microsoft.CodeAnalysis.AnalyzerUtilities (6)
src\roslyn\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
60var fromText = text.ToString(textSpanOpt.Value);
src\roslyn\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\roslyn\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 (6)
src\roslyn\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
60var fromText = text.ToString(textSpanOpt.Value);
src\roslyn\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\roslyn\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\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (1)
247var name = SyntaxFactory.ParseName(syntaxTree.GetText(cancellationToken).ToString(TextSpan.FromBounds(genericIdentifier.SpanStart, lastToken.Span.End)));
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (1)
915: EndOfLine(text.ToString(lineBreakSpan));
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\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (1)
915: EndOfLine(text.ToString(lineBreakSpan));
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (1)
Microsoft.NetCore.Analyzers\Runtime\CSharpPreferReadOnlySpanPropertiesOverReadOnlyArrayFields.Fixer.cs (1)
580return sourceText.ToString(TextSpan.FromBounds(firstLine.End, firstLine.EndIncludingLineBreak));
Microsoft.CodeAnalysis.CSharp.Workspaces (3)
Classification\ClassificationHelpers.cs (2)
520var text2 = text.ToString(textSpan); 545var text = rawText.ToString(span);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (1)
247var name = SyntaxFactory.ParseName(syntaxTree.GetText(cancellationToken).ToString(TextSpan.FromBounds(genericIdentifier.SpanStart, lastToken.Span.End)));
Microsoft.CodeAnalysis.Features (14)
Completion\Utilities.cs (1)
42return new TextChange(totalOldSpan, newText.ToString(totalNewSpan));
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (1)
724lineText = 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)
141var startMessage = text.ToString(TextSpan.FromBounds(fullSpan.Start, startLine.End)); 156var endMessage = text.ToString(new TextSpan(endLine.Start, length));
Wrapping\AbstractCodeActionComputer.cs (1)
181var text = OriginalSourceText.ToString(span);
Microsoft.CodeAnalysis.Razor.Compiler (8)
Language\DefaultTagHelperResolutionPhase.cs (2)
918var exprText = sourceDocument.Text.ToString( 967var innerText = sourceDocument.Text.ToString(
Language\DefaultTagHelperResolutionPhase.LegacyTagHelperResolver.cs (4)
592var sourceText = sourceDocument.Text.ToString( 728var rawText = sourceDocument.Text.ToString( 1332var text = sourceDocument.Text.ToString( 1415var text = sourceDocument.Text.ToString(new Microsoft.CodeAnalysis.Text.TextSpan(vss.AbsoluteIndex, vss.Length));
Language\Legacy\CSharpCodeParser.cs (2)
2053var content = source.ToString(TextSpan.FromBounds(start, end)); 2172var name = source.ToString(TextSpan.FromBounds(nameStart, nameEnd));
Microsoft.CodeAnalysis.Razor.DotNetFormat (30)
src\roslyn\src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.Formatting\FormattingUtilities.cs (9)
101var extractedText = text.ToString(extractionSpan); 307replacementBuilder.Append(formattedText.ToString(TextSpan.FromBounds( 321replacementText = formattedText.ToString(TextSpan.FromBounds(formattedStart, formattedEnd)); 452return lineText.ToString(TextSpan.FromBounds(formattedLine.Start, end)); 460return indentationString + lineText.ToString(TextSpan.FromBounds(formattedLine.Start + firstNonWhitespace, end)); 464? indentationString + lineText.ToString(TextSpan.FromBounds(formattedLine.End, end)) 504formattedText.ToString(TextSpan.FromBounds(formattedStart, formattedLine.End)))); 643formattingChanges.Add(new TextChange(new(originalLine.End, 0), formattedText.ToString(formattedLine.Span))); 660formattedText.ToString(TextSpan.FromBounds(formattedStart, formattedLine.End)));
src\roslyn\src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.Formatting\Passes\CSharpFormattingPass.CSharpDocumentGenerator.cs (19)
323additionalLinesBuilder.AppendLine(_sourceText.ToString(new TextSpan(originalSpan.AbsoluteIndex, originalSpan.Length))); 330additionalLinesBuilder.AppendLine(_sourceText.ToString(new TextSpan(originalSpan.AbsoluteIndex, originalSpan.Length))); 398var skippedPreviousLineText = _sourceText.ToString(TextSpan.FromBounds(node.SpanStart, previousLine.End)); 457_builder.Append(_sourceText.ToString(TextSpan.FromBounds(_currentLine.Start, _currentFirstNonWhitespacePosition))); 493_builder.Append(_sourceText.ToString(span)); 582_builder.Append(_sourceText.ToString(TextSpan.FromBounds(_currentLine.Start, _currentFirstNonWhitespacePosition))); 585_builder.Append(_sourceText.ToString(span)); 1023_builder.Append(_sourceText.ToString(TextSpan.FromBounds(_currentLine.Start, _currentFirstNonWhitespacePosition))); 1113_builder.Append(_sourceText.ToString(TextSpan.FromBounds(_currentLine.Start, _currentFirstNonWhitespacePosition))); 1115_builder.Append(_sourceText.ToString(span)); 1158_builder.Append(_sourceText.ToString(TextSpan.FromBounds(_currentLine.Start, _currentFirstNonWhitespacePosition))); 1159_builder.AppendLine(_sourceText.ToString(TextSpan.FromBounds(_currentToken.Position + 1, _currentLine.End))); 1173_builder.Append(_sourceText.ToString(TextSpan.FromBounds(_currentLine.Start, _currentFirstNonWhitespacePosition))); 1174_builder.AppendLine(_sourceText.ToString(TextSpan.FromBounds(_currentToken.Position + 1, _currentLine.End))); 1256_builder.AppendLine(_sourceText.ToString(TextSpan.FromBounds(_currentToken.Position + 1, _currentLine.End))); 1303_builder.Append(_sourceText.ToString(TextSpan.FromBounds(_currentLine.Start, _currentFirstNonWhitespacePosition))); 1307_builder.Append(_sourceText.ToString(TextSpan.FromBounds(contentStart, contentEnd))); 1353_builder.AppendLine(_sourceText.ToString(span)); 1428_builder.Append(_sourceText.ToString(TextSpan.FromBounds(closeAngleEnd, _currentLine.End)));
src\roslyn\src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.Formatting\Passes\FormattingContentValidationPass.cs (1)
60builder.AppendLine(SR.FormatEdit_at_deletes(text.GetLinePositionSpan(change.Span), text.ToString(change.Span)));
src\roslyn\src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.Workspaces.Shared\Extensions\TextLineExtensions.cs (1)
27? line.Text.AssumeNotNull().ToString(TextSpan.FromBounds(line.Start, line.Start + offset))
Microsoft.CodeAnalysis.ResxSourceGenerator (6)
src\roslyn\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
60var fromText = text.ToString(textSpanOpt.Value);
src\roslyn\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\roslyn\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.Workspaces (8)
Classification\Classifier.cs (1)
139parts.Add(new SymbolDisplayPart(kind.Value, null, sourceText.ToString(span.TextSpan)));
src\roslyn\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
60var fromText = text.ToString(textSpanOpt.Value);
src\roslyn\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\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Indentation\IIndentationService.cs (1)
39return document.Text.ToString(TextSpan.FromBounds(tokenLine.Start, token.SpanStart));
Roslyn.Diagnostics.Analyzers (7)
src\roslyn\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
60var fromText = text.ToString(textSpanOpt.Value);
src\roslyn\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\roslyn\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\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (1)
247var name = SyntaxFactory.ParseName(syntaxTree.GetText(cancellationToken).ToString(TextSpan.FromBounds(genericIdentifier.SpanStart, lastToken.Span.End)));
SuperFileCheck (1)
Program.cs (1)
347var lineStr = text.ToString(line.Span);