Base:
100 references to ToString
Microsoft.AspNetCore.App.Analyzers (1)
RouteEmbeddedLanguage\Infrastructure\RouteStringSyntaxDetector.cs (1)
209var text = trivia.ToString();
Microsoft.CodeAnalysis (3)
SourceGeneration\GeneratedCodeUtilities.cs (2)
101var text = trivia.ToString(); 132var text = trivia.ToString();
Syntax\SyntaxTrivia.cs (1)
43return GetType().Name + " " + (UnderlyingNode?.KindText ?? "None") + " " + ToString();
Microsoft.CodeAnalysis.CodeStyle (4)
src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (2)
101var text = trivia.ToString(); 132var text = trivia.ToString();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\AbstractDocumentationCommentService.cs (1)
58return exteriorTrivia != null ? exteriorTrivia.Value.ToString() : string.Empty;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (1)
145if (!IsOnSingleLine(trivia.ToString()))
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Analyzers\Core\CodeFixes\UseObjectInitializer\AbstractUseObjectInitializerCodeFixProvider.cs (1)
133var existingWhitespace = whitespaceTrivia.ToString();
Microsoft.CodeAnalysis.CSharp.CodeStyle (6)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaExtensions.cs (1)
65var commentText = trivia.ToString();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.Analyzer.cs (1)
162var text = trivia.ToString();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.CodeShapeAnalyzer.cs (4)
140Debug.Assert(trivia.ToString() == trivia.ToFullString()); 141var text = trivia.ToString(); 313var triviaString = trivia.ToString(); 344var xmlCommentText = xmlTrivia.ToString();
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (1)
376=> node.GetLeadingTrivia() is [.., (kind: SyntaxKind.WhitespaceTrivia) whitespace] ? whitespace.ToString() : "";
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (1)
97var text = t1.ToString();
Microsoft.CodeAnalysis.CSharp.Features (9)
BraceCompletion\AbstractCurlyBraceOrBracketCompletionService.cs (1)
129newLineEdit = new TextChange(new TextSpan(annotatedNewline.SpanStart, 0), annotatedNewline.ToString());
BraceMatching\BlockCommentBraceMatcher.cs (1)
48trivia.ToString() is ['/', '*', .., '*', '/'])
DocumentationComments\CSharpDocumentationCommentSnippetService.cs (2)
299&& firstTrivia.ToString() == ExteriorTriviaText; 352&& firstTextToken.LeadingTrivia.ElementAt(0).ToString() == ExteriorTriviaText
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (1)
376=> node.GetLeadingTrivia() is [.., (kind: SyntaxKind.WhitespaceTrivia) whitespace] ? whitespace.ToString() : "";
Structure\CSharpStructureHelpers.cs (3)
124return CreateCommentBannerTextWithPrefix(comment.ToString(), "//"); 128var lineBreakStart = comment.ToString().IndexOfAny(s_newLineCharacters); 130var text = comment.ToString();
TaskList\CSharpTaskListService.cs (1)
86SyntaxFacts.IsPreprocessorDirective(trivia.Kind()) && trivia.ToString().IndexOf(SingleLineCommentPrefix, StringComparison.Ordinal) > 0;
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (17)
LexicalAndXml\LexicalTests.cs (7)
174Assert.Equal(text, trivia.ToString()); 3620Assert.Equal(" \t\v\f\u00A0", leading[0].ToString()); 3626Assert.Equal("\u00A0\f\v\t ", trailing[0].ToString()); 3638Assert.Equal("\u001A", leading[0].ToString()); 3644Assert.Equal("\u001A", trailing[0].ToString()); 3659Assert.Equal("\uFEFF", leading[0].ToString()); 3665Assert.Equal(" \uFEFF", trailing[0].ToString());
Parsing\ScriptParsingTests.cs (1)
9742Assert.Equal(expectedSkippedText, skippedText.ToString());
Parsing\StatementParsingTests.cs (1)
1964Assert.Equal("for", fs.ForEachKeyword.TrailingTrivia[0].ToString());
Syntax\StructuredTriviaTests.cs (1)
83Assert.Equal(" ", trResult.ToString());
Syntax\SyntaxNodeTests.cs (4)
3535Assert.Equal(" ", node.GetLeadingTrivia().First().ToString()); 3546Assert.Equal(" ", node.GetLeadingTrivia().First().ToString()); 3569Assert.Equal(" ", trivia.ToString()); 3588Assert.Equal("// This is trivia", rootTrivia.ToString().Trim());
Syntax\SyntaxTriviaListTests.cs (3)
56Assert.Equal("/*A*/", list[0].ToString()); 57Assert.Equal("/*B*/", list[1].ToString()); 58Assert.Equal("/*C*/", list[2].ToString());
Microsoft.CodeAnalysis.CSharp.Workspaces (9)
Classification\Worker_DocumentationComments.cs (1)
99var text = trivia.ToString();
Rename\CSharpRenameRewriterLanguageService.cs (1)
665var originalString = trivia.ToString();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaExtensions.cs (1)
65var commentText = trivia.ToString();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.Analyzer.cs (1)
162var text = trivia.ToString();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.CodeShapeAnalyzer.cs (4)
140Debug.Assert(trivia.ToString() == trivia.ToFullString()); 141var text = trivia.ToString(); 313var triviaString = trivia.ToString(); 344var xmlCommentText = xmlTrivia.ToString();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (1)
97var text = t1.ToString();
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (2)
Diagnostics\DiagnosticAnalyzerServiceTests.cs (2)
676var pragma1 = root.FindTrivia(diagnostics[0].DataLocation.UnmappedFileSpan.GetClampedTextSpan(text).Start).ToString(); 678var pragma2 = root.FindTrivia(diagnostics[1].DataLocation.UnmappedFileSpan.GetClampedTextSpan(text).Start).ToString();
Microsoft.CodeAnalysis.Features (2)
EmbeddedLanguages\EmbeddedLanguageDetector.cs (1)
144var text = trivia.ToString();
src\Analyzers\Core\CodeFixes\UseObjectInitializer\AbstractUseObjectInitializerCodeFixProvider.cs (1)
133var existingWhitespace = whitespaceTrivia.ToString();
Microsoft.CodeAnalysis.UnitTests (2)
CommonSyntaxTests.cs (2)
90Assert.Equal("test", trivia.ToString()); 106Assert.Equal("test", trivia.ToString());
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (4)
src\Workspaces\VisualBasic\Portable\Formatting\Engine\Trivia\TriviaDataFactory.Analyzer.vb (1)
99Dim text = trivia.ToString()
src\Workspaces\VisualBasic\Portable\Formatting\Engine\Trivia\TriviaDataFactory.CodeShapeAnalyzer.vb (3)
111Debug.Assert(trivia.ToString() = trivia.ToFullString()) 112Dim text = trivia.ToString() 298Dim xmlCommentText = xmlTrivia.ToString()
Microsoft.CodeAnalysis.VisualBasic.Features (3)
DocumentationComments\VisualBasicDocumentationCommentSnippetService.vb (1)
178firstTextToken.LeadingTrivia.ElementAt(0).ToString() = "'''" AndAlso
Structure\Providers\DisabledTextTriviaStructureProvider.vb (1)
23Dim endPos = startPos + trivia.ToString().TrimEnd().Length
Structure\VisualBasicStructureHelpers.vb (1)
24Return "' " & comment.ToString().Substring(1).Trim() & SpaceEllipsis
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (20)
Scanner\ScannerTests.vb (4)
720Assert.Equal(" ", tk.LeadingTrivia(0).ToString()) 721Assert.Equal("' ", tk.TrailingTrivia(0).ToString()) 728Assert.Equal(" ", tk.LeadingTrivia(0).ToString()) 729Assert.Equal("' ", tk.LeadingTrivia(1).ToString())
Syntax\ManualTests.vb (2)
109Assert.Equal(" ", node.GetLeadingTrivia().First().ToString()) 119Assert.Equal(" ", node.GetLeadingTrivia().First().ToString())
TestSyntaxNodes.vb (14)
706Assert.Equal("AAA", follTrivia(0).ToString()) 712Assert.Equal("B", follTrivia(1).ToString()) 737Assert.Equal("CCCC", precTrivia(0).ToString()) 743Assert.Equal("DD", precTrivia(1).ToString()) 749Assert.Equal("AAA", precTrivia(2).ToString()) 758Assert.Equal("B", follTrivia(0).ToString()) 775Assert.Equal(" ", keyword.TrailingTrivia()(0).ToString) 786Assert.Equal(" ", keyword.LeadingTrivia()(0).ToString) 796Assert.Equal(" ", keyword.TrailingTrivia()(0).ToString) 807Assert.Equal(" ", keyword.TrailingTrivia()(0).ToString) 808Assert.Equal("'goo", keyword.LeadingTrivia()(1).ToString) 823Assert.Equal(" ", endTry.GetTrailingTrivia()(0).ToString) 1804Assert.Equal("<goo> </ >", ident.LeadingTrivia()(0).ToString()) 1815Assert.Equal(" ", trResult.ToString())
Microsoft.CodeAnalysis.VisualBasic.Workspaces (9)
CaseCorrection\VisualBasicCaseCorrectionService.Rewriter.vb (2)
305Dim remText = trivia.ToString().Substring(0, 3) 308Dim expectedText = remKeywordText & trivia.ToString().Substring(3)
Classification\Worker.DocumentationCommentClassifier.vb (1)
80Dim text = trivia.ToString()
CodeCleanup\Providers\FixIncorrectTokensCodeCleanupProvider.vb (1)
69Dim triviaText = newTrivia.ToString()
Formatting\Engine\Trivia\TriviaDataFactory.Analyzer.vb (1)
99Dim text = trivia.ToString()
Formatting\Engine\Trivia\TriviaDataFactory.CodeShapeAnalyzer.vb (3)
111Debug.Assert(trivia.ToString() = trivia.ToFullString()) 112Dim text = trivia.ToString() 298Dim xmlCommentText = xmlTrivia.ToString()
Rename\VisualBasicRenameRewriterLanguageService.vb (1)
603Dim originalString = trivia.ToString()
Microsoft.CodeAnalysis.Workspaces (5)
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (1)
390.Select(t => Tuple.Create(t.ToString(), t.Span.Start, t.Token.Span));
src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (2)
101var text = trivia.ToString(); 132var text = trivia.ToString();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\AbstractDocumentationCommentService.cs (1)
58return exteriorTrivia != null ? exteriorTrivia.Value.ToString() : string.Empty;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (1)
145if (!IsOnSingleLine(trivia.ToString()))
Microsoft.VisualStudio.LanguageServices.CSharp (1)
CodeModel\MethodXml\MethodXmlBuilder.cs (1)
52var trimmedComment = trivia.ToString()[2..];