Base:
101 references to ToString
dotnet-format (2)
Formatters\CharsetFormatter.cs (2)
40return SourceText.From(sourceText.ToString(), encoding, sourceText.ChecksumAlgorithm); 51var text = sourceText.ToString();
GenerateDocumentationAndConfigFiles (1)
src\roslyn\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
78var allText = text.ToString(); // Entire document as string to allow inspecting the text in the debugger.
Microsoft.Analyzers.Extra.Tests (8)
Resources\RoslynTestUtils.cs (7)
380results.Add(s.ToString().Replace("\r\n", "\n", StringComparison.Ordinal)); 388results.Add(s.ToString().Replace("\r\n", "\n", StringComparison.Ordinal)); 395results.Add(s.ToString().Replace("\r\n", "\n", StringComparison.Ordinal)); 471results.Add(s.ToString().Replace("\r\n", "\n", StringComparison.Ordinal)); 479results.Add(s.ToString().Replace("\r\n", "\n", StringComparison.Ordinal)); 486results.Add(s.ToString().Replace("\r\n", "\n", StringComparison.Ordinal)); 507return document.WithText(SourceText.From(newText.ToString(), newText.Encoding, newText.ChecksumAlgorithm));
UsingToStringInLoggersTests.cs (1)
68new[] { Source, generated.generatedSources[0].SourceText.ToString() });
Microsoft.Analyzers.Local (1)
ApiLifecycle\ModelLoader.cs (1)
49publicInterface = assemblyBaselineFile.GetText()?.ToString();
Microsoft.Analyzers.Local.Tests (7)
Resources\RoslynTestUtils.cs (7)
381results.Add(s.ToString().Replace("\r\n", "\n", StringComparison.Ordinal)); 389results.Add(s.ToString().Replace("\r\n", "\n", StringComparison.Ordinal)); 396results.Add(s.ToString().Replace("\r\n", "\n", StringComparison.Ordinal)); 472results.Add(s.ToString().Replace("\r\n", "\n", StringComparison.Ordinal)); 480results.Add(s.ToString().Replace("\r\n", "\n", StringComparison.Ordinal)); 487results.Add(s.ToString().Replace("\r\n", "\n", StringComparison.Ordinal)); 508return document.WithText(SourceText.From(newText.ToString(), newText.Encoding, newText.ChecksumAlgorithm));
Microsoft.AspNetCore.OpenApi.SourceGenerators (1)
XmlCommentGenerator.Parser.cs (1)
54xml = XElement.Parse(text.ToString());
Microsoft.CodeAnalysis (3)
Syntax\SyntaxDiffer.cs (1)
46return new[] { new TextChange(new TextSpan(0, 0), after.GetText().ToString()) };
Syntax\SyntaxTree.cs (1)
417return this.GetText(CancellationToken.None).ToString();
Syntax\SyntaxTreeExtensions.cs (1)
78var allText = text.ToString(); // Entire document as string to allow inspecting the text in the debugger.
Microsoft.CodeAnalysis.Analyzers (2)
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer_ResourceStringsFormat.cs (1)
74var sourceTextStr = sourceText.ToString();
src\roslyn\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
78var allText = text.ToString(); // Entire document as string to allow inspecting the text in the debugger.
Microsoft.CodeAnalysis.AnalyzerUtilities (1)
src\roslyn\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
78var allText = text.ToString(); // Entire document as string to allow inspecting the text in the debugger.
Microsoft.CodeAnalysis.CodeStyle (1)
src\roslyn\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
78var allText = text.ToString(); // Entire document as string to allow inspecting the text in the debugger.
Microsoft.CodeAnalysis.CSharp (3)
Lowering\ClosureConversion\ClosureConversion.Analysis.Tree.cs (1)
110public override string ToString() => BoundNode.Syntax.GetText().ToString();
Parser\LanguageParser.cs (1)
229builder.Add(SyntaxFactory.BadToken(null, lexer.TextWindow.Text.ToString(), null));
Parser\Lexer.cs (1)
1995var token = SyntaxFactory.BadToken(null, text.ToString(), null).WithDiagnosticsGreen([error]);
Microsoft.CodeAnalysis.CSharp.Features (4)
BraceCompletion\AbstractCurlyBraceOrBracketCompletionService.cs (1)
210var newTextChangeText = formattedText.GetSubText(new TextSpan(newRange.Span.Start + amountToShift, newRange.NewLength)).ToString();
SplitStringLiteral\SimpleStringSplitter.cs (3)
41var prefix = Document.Text.GetSubText(TextSpan.FromBounds(_token.SpanStart, CursorPosition)).ToString(); 42var suffix = Document.Text.GetSubText(TextSpan.FromBounds(CursorPosition, _token.Span.End)).ToString(); 47? Document.Text.GetSubText(TextSpan.FromBounds(_token.Span.End - "u8".Length, _token.Span.End)).ToString()
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (1)
Microsoft.NetCore.Analyzers\Runtime\CSharpUseOrdinalStringComparison.Fixer.cs (1)
33bool isIgnoreCase = memberAccess.Name.GetText().ToString().EndsWith(UseOrdinalStringComparisonAnalyzer.IgnoreCaseText, StringComparison.Ordinal);
Microsoft.CodeAnalysis.Features (5)
AddFileBanner\AbstractAddFileBannerCodeRefactoringProvider.cs (1)
144var token = syntaxFacts.ParseToken(text.ToString());
CodeLens\CodeLensReferencesService.cs (1)
291return (reference.Value.Content.ToString().TrimEnd(),
Completion\Providers\Snippets\AbstractSnippetCompletionProvider.cs (1)
56var snippetText = allChangesText.GetSubText(textSpan).ToString();
EditAndContinue\PdbMatchingSourceTextProvider.cs (1)
160return text.ToString();
ValueTracking\ValueTrackedItem.cs (1)
41return subText.ToString();
Microsoft.CodeAnalysis.ResxSourceGenerator (1)
src\roslyn\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
78var allText = text.ToString(); // Entire document as string to allow inspecting the text in the debugger.
Microsoft.CodeAnalysis.Scripting (2)
Hosting\CommandLine\CommandLineRunner.cs (1)
141RunInteractiveLoop(scriptOptions, code?.ToString(), cancellationToken);
Script.cs (1)
74public string Code => SourceText.ToString();
Microsoft.CodeAnalysis.TestAnalyzerReference (1)
NonSourceFileRefactoring.cs (1)
28var newText = SourceText.From(text.ToString() + Environment.NewLine + "# Refactored");
Microsoft.CodeAnalysis.VisualBasic.NetAnalyzers (1)
Microsoft.NetCore.Analyzers\Runtime\BasicUseOrdinalStringComparison.Fixer.vb (1)
28Dim isIgnoreCase = memberAccess.Name.GetText().ToString().EndsWith(UseOrdinalStringComparisonAnalyzer.IgnoreCaseText, StringComparison.Ordinal)
Microsoft.CodeAnalysis.Workspaces (5)
LinkedFileDiffMerging\AbstractLinkedFileMergeConflictCommentAdditionService.cs (1)
144? text.GetSubText(TextSpan.FromBounds(text.Lines[startLine].Start, text.Lines[endLine].End)).ToString()
Shared\Extensions\SourceTextExtensions.cs (1)
186writer.WriteString(sourceText.ToString());
src\roslyn\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
78var allText = text.ToString(); // Entire document as string to allow inspecting the text in the debugger.
Workspace\Solution\DocumentState.cs (2)
683var newTextContent = newText.ToString(); 686var oldTextContent = oldText?.ToString();
Microsoft.DotNet.GenFacades (1)
NotSupportedAssemblyGenerator.cs (1)
89string text = root.GetText().ToString();
Microsoft.Gen.BuildMetadata.Unit.Tests (5)
GeneratorTests.cs (1)
60await Verifier.Verify(sources.Select(s => s.SourceText.ToString()), settings);
test\Generators\Shared\RoslynTestUtils.cs (4)
513results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 521results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 528results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 549return document.WithText(SourceText.From(newText.ToString(), newText.Encoding, newText.ChecksumAlgorithm));
Microsoft.Gen.ComplianceReports.Unit.Tests (4)
test\Generators\Shared\RoslynTestUtils.cs (4)
513results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 521results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 528results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 549return document.WithText(SourceText.From(newText.ToString(), newText.Encoding, newText.ChecksumAlgorithm));
Microsoft.Gen.ContextualOptions.Unit.Tests (5)
EmitterTests.cs (1)
150var result = r[0].SourceText.ToString();
test\Generators\Shared\RoslynTestUtils.cs (4)
513results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 521results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 528results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 549return document.WithText(SourceText.From(newText.ToString(), newText.Encoding, newText.ChecksumAlgorithm));
Microsoft.Gen.Logging.Unit.Tests (6)
ParserTests.cs (1)
682return Verifier.Verify(generatedSources[0].SourceText.ToString())
ParserTests.LogProperties.cs (1)
488await Verifier.Verify(r[0].SourceText.ToString())
test\Generators\Shared\RoslynTestUtils.cs (4)
513results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 521results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 528results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 549return document.WithText(SourceText.From(newText.ToString(), newText.Encoding, newText.ChecksumAlgorithm));
Microsoft.Gen.MetadataExtractor.Unit.Tests (4)
test\Generators\Shared\RoslynTestUtils.cs (4)
513results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 521results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 528results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 549return document.WithText(SourceText.From(newText.ToString(), newText.Encoding, newText.ChecksumAlgorithm));
Microsoft.Gen.Metrics.Unit.Tests (6)
EmitterTests.cs (2)
51var result = r.First(x => x.HintName == "Factory.g.cs").SourceText.ToString(); 54result = r.First(x => x.HintName == "Metrics.g.cs").SourceText.ToString();
test\Generators\Shared\RoslynTestUtils.cs (4)
513results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 521results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 528results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 549return document.WithText(SourceText.From(newText.ToString(), newText.Encoding, newText.ChecksumAlgorithm));
Microsoft.Gen.MetricsReports.Unit.Tests (4)
test\Generators\Shared\RoslynTestUtils.cs (4)
513results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 521results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 528results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 549return document.WithText(SourceText.From(newText.ToString(), newText.Encoding, newText.ChecksumAlgorithm));
Microsoft.Maui.Controls.SourceGen (1)
CodeBehindGenerator.cs (1)
136 xmlDoc.LoadXml(text.ToString());
Microsoft.ML.AutoML.SourceGenerator (10)
EstimatorTypeGenerator.cs (3)
27var json = text.GetText().ToString(); 36.SelectMany(file => Utils.GetEstimatorsFromJson(file.GetText().ToString()).Estimators, (text, estimator) => (estimator.FunctionName, estimator.EstimatorTypes)) 41.SelectMany(file => Utils.GetEstimatorsFromJson(file.GetText().ToString()).Estimators, (text, estimator) => (estimator.FunctionName, estimator.EstimatorTypes))
SearchSpaceGenerator.cs (2)
24var json = text.GetText().ToString(); 33.Select(f => f.GetText().ToString())
SweepableEstimatorFactoryGenerator.cs (3)
24var json = text.GetText().ToString(); 33.SelectMany(file => Utils.GetEstimatorsFromJson(file.GetText().ToString()).Estimators, (text, estimator) => (estimator.FunctionName, estimator.EstimatorTypes, estimator.SearchOption)) 38.SelectMany(file => Utils.GetEstimatorsFromJson(file.GetText().ToString()).Estimators, (text, estimator) => (estimator.FunctionName, estimator.EstimatorTypes, estimator.SearchOption))
SweepableEstimatorGenerator.cs (2)
23var json = text.GetText().ToString(); 32.SelectMany(file => Utils.GetEstimatorsFromJson(file.GetText().ToString()).Estimators)
Roslyn.Diagnostics.Analyzers (1)
src\roslyn\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
78var allText = text.ToString(); // Entire document as string to allow inspecting the text in the debugger.
rzc (1)
GenerateCommand.cs (1)
262var generatedCode = result.CSharpDocument.Text.ToString();
System.Private.CoreLib.Generators (2)
NativeRuntimeEventSourceGenerator.cs (2)
30string manifestText = manifestFile.GetText(spc.CancellationToken)?.ToString(); 38string inclusionText = inclusionFiles.FirstOrDefault()?.GetText(spc.CancellationToken)?.ToString();
System.Windows.Forms.Analyzers (1)
System\Windows\Forms\Analyzers\AppManifestAnalyzer.cs (1)
48doc.LoadXml(appManifestXml.ToString());