Base:
1 override of ToString
Microsoft.CodeAnalysis.EditorFeatures.Text (1)
Extensions.SnapshotSourceText.cs (1)
175public override string ToString()
559 references to ToString
IdeCoreBenchmarks (1)
ClassificationBenchmarks.cs (1)
99var text = document.GetTextAsync().Result.ToString();
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.Analyzer.Testing (1)
CodeFixRunner.cs (1)
41return sourceText.ToString();
Microsoft.AspNetCore.Components.Analyzers.Tests (1)
Helpers\CodeFixVerifier.Helper.cs (1)
83return root.GetText().ToString();
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (1)
Helpers\CodeFixVerifier.Helper.cs (1)
83return root.GetText().ToString();
Microsoft.AspNetCore.Http.Extensions.Tests (2)
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (2)
138var buffer = encoding.GetBytes(text.ToString()); 365var newSource = generatedCode.ToString()
Microsoft.AspNetCore.Http.Microbenchmarks (2)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (2)
138var buffer = encoding.GetBytes(text.ToString()); 365var newSource = generatedCode.ToString()
Microsoft.CodeAnalysis (3)
Syntax\SyntaxDiffer.cs (1)
45return new[] { new TextChange(new TextSpan(0, 0), after.GetText().ToString()) };
Syntax\SyntaxTree.cs (1)
416return this.GetText(CancellationToken.None).ToString();
Syntax\SyntaxTreeExtensions.cs (1)
73var allText = text.ToString(); // Entire document as string to allow inspecting the text in the debugger.
Microsoft.CodeAnalysis.CodeStyle (2)
src\Analyzers\Core\Analyzers\SimplifyLinqExpression\AbstractSimplifyLinqExpressionDiagnosticAnalyzer.cs (1)
179return SyntaxFacts.GetNameOfMemberAccessExpression(memberAccess).GetText().ToString();
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
73var allText = text.ToString(); // Entire document as string to allow inspecting the text in the debugger.
Microsoft.CodeAnalysis.CodeStyle.UnitTestUtilities (1)
src\Features\DiagnosticsTestUtilities\CodeActions\CodeFixVerifierHelper.cs (1)
96return text?.ToString();
Microsoft.CodeAnalysis.CSharp (3)
Lowering\ClosureConversion\ClosureConversion.Analysis.Tree.cs (1)
110public override string ToString() => BoundNode.Syntax.GetText().ToString();
Parser\LanguageParser.cs (1)
230builder.Add(SyntaxFactory.BadToken(null, lexer.TextWindow.Text.ToString(), null));
Parser\Lexer.cs (1)
2015var token = SyntaxFactory.BadToken(null, text.ToString(), null).WithDiagnosticsGreen([error]);
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (1)
CommandLineTests.cs (1)
2500Assert.Equal(expectedEmbeddedMap[docPath], embeddedSource.ToString());
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
InlineRename\CSharpEditorInlineRenameService.cs (1)
164resultBuilder.Add((filePath, documentText.GetSubText(surroundingSpanOfInterest.Value).ToString()));
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (28)
CodeActions\PreviewTests.cs (1)
120var text = diffView.Viewer.RightView.TextBuffer.AsTextContainer().CurrentText.ToString();
CodeActions\SyncNamespace\CSharpSyncNamespaceTestsBase.cs (4)
189var actualText = (await modifiedOriginalDocument.GetTextAsync()).ToString(); 197var oldRefText = (await oldSolution.GetDocument(refDocumentId).GetTextAsync()).ToString(); 198var newRefText = (await newSolution.GetDocument(refDocumentId).GetTextAsync()).ToString(); 205var actualRefText = (await newSolution.GetDocument(refDocumentId).GetTextAsync()).ToString();
Completion\CompletionProviders\OverrideCompletionProviderTests.cs (4)
2481var actualCodeAfterCommit = textView.TextBuffer.CurrentSnapshot.AsText().ToString(); 2734var actualCodeAfterCommit = textView.TextBuffer.CurrentSnapshot.AsText().ToString(); 2789var actualCodeAfterCommit = textView.TextBuffer.CurrentSnapshot.AsText().ToString(); 3266var actualCodeAfterCommit = textBuffer.CurrentSnapshot.AsText().ToString();
EditorConfigSettings\Updater\SettingsUpdaterTests.cs (2)
69Assert.Equal(updatedEditorConfig, result?.ToString()); 78Assert.Equal(updatedEditorConfig, result?.ToString());
Formatting\RazorLineFormattingOptionsTests.cs (1)
81", formattedText.ToString());
PdbSourceDocument\AbstractPdbSourceDocumentTests.cs (2)
116AssertEx.EqualOrDiff(expected, actual.ToString()); 285File.WriteAllText(sourceCodePaths[i], sources[i].ToString(), sources[i].Encoding);
SplitStringLiteral\SplitStringLiteralCommandHandlerTests.cs (1)
99Assert.Equal(expectedOutput, textBuffer.CurrentSnapshot.AsText().ToString());
StringIndentation\StringIndentationTests.cs (1)
62return changedText.ToString();
Workspaces\WorkspaceTests_EditorFeatures.cs (12)
515Assert.Equal("public class X { }", docZText.ToString()); 574var hasX = (await doc1Z.GetTextAsync()).ToString().Contains("X"); 645var hasX = (await doc1Z.GetTextAsync()).ToString().Contains("X"); 667var hasX = (await doc1Z.GetTextAsync()).ToString().Contains("X"); 729Assert.Equal(startText, (await workspace.CurrentSolution.GetDocument(document.Id).GetTextAsync()).ToString()); 736Assert.Equal(startText, (await workspace.CurrentSolution.GetDocument(document.Id).GetTextAsync()).ToString()); 1064Assert.Equal("some text", (await additionalDocument.GetTextAsync()).ToString()); 1088Assert.Equal("root = true", (await analyzerConfigDocument.GetTextAsync()).ToString()); 1430Assert.Equal(originalText, (await eventArgs[0].OldSolution.GetDocument(originalDocumentId).GetTextAsync().ConfigureAwait(false)).ToString()); 1431Assert.Equal(originalText, (await eventArgs[1].OldSolution.GetDocument(originalDocumentId).GetTextAsync().ConfigureAwait(false)).ToString()); 1433Assert.Equal(updatedText, (await eventArgs[0].NewSolution.GetDocument(originalDocumentId).GetTextAsync().ConfigureAwait(false)).ToString()); 1434Assert.Equal(updatedText, (await eventArgs[1].NewSolution.GetDocument(originalDocumentId).GetTextAsync().ConfigureAwait(false)).ToString());
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (1)
CodeGen\CodeGenTupleTest.cs (1)
22620Assert.Equal(newText.ToString(), finalText);
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (1)
ScriptTests.cs (1)
67Assert.Equal(state.Script.Code, compilation.SyntaxTrees.First().GetText().ToString());
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (20)
Semantics\LocalFunctionTests.cs (12)
7344var localFuncPosition = tree.GetText().ToString().IndexOf("void local<TParameter>()", StringComparison.Ordinal) - 1; 7345var methodPosition = tree.GetText().ToString().IndexOf("void M2<TParameter>()", StringComparison.Ordinal) - 1; 7497var localFuncPosition = tree.GetText().ToString().IndexOf("[My(a)]", StringComparison.Ordinal); 7498var methodPosition = tree.GetText().ToString().IndexOf("[My(b)]", StringComparison.Ordinal); 7571var localFuncPosition = tree.GetText().ToString().IndexOf("positionA", StringComparison.Ordinal); 7572var methodPosition = tree.GetText().ToString().IndexOf("positionB", StringComparison.Ordinal); 8927var localFuncPosition = tree.GetText().ToString().IndexOf("positionA", StringComparison.Ordinal); 8928var methodPosition = tree.GetText().ToString().IndexOf("positionB", StringComparison.Ordinal); 9431var localFuncPosition = tree.GetText().ToString().IndexOf("positionA", StringComparison.Ordinal); 9432var methodPosition = tree.GetText().ToString().IndexOf("positionB", StringComparison.Ordinal); 9749var localFuncPosition = tree.GetText().ToString().IndexOf("positionA", StringComparison.Ordinal); 9750var methodPosition = tree.GetText().ToString().IndexOf("positionB", StringComparison.Ordinal);
Semantics\TopLevelStatementsTests.cs (1)
8795Assert.Equal(text2, tree.GetText().ToString());
SourceGeneration\GeneratorDriverFuzzTests.cs (4)
87var provider1 = provider.Select((additionalText, _) => (AdditionalText)new InMemoryAdditionalText(additionalText.Path, additionalText.GetText()!.ToString() switch 164var provider1 = provider.Where(additionalText => additionalText.GetText()!.ToString() is var textString 355context.AddSource(((InMemoryAdditionalText)text).Path, ((InMemoryAdditionalText)text).GetText()!.ToString()); 553}.Select(logic => (AdditionalText)new InMemoryAdditionalText(hintNameProvider.GetNextHintName(), additionalText.GetText()!.ToString() switch
SourceGeneration\GeneratorDriverTests.cs (2)
1512Assert.Equal("// generated", runResults.Results.Single().GeneratedSources.Single().SourceText.ToString()); 2894var contents = texts.Select((t, ct) => t?.GetText(ct)?.ToString()).WithTrackingName("Content");
SourceGeneration\GeneratorDriverTests_Attributes_FullyQualifiedName.cs (1)
1294Assert.Equal(expectedGeneratedSources, driver.GetRunResult().Results.Single().GeneratedSources.Select(s => (s.HintName, s.SourceText.ToString())));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (12)
Compilation\SemanticModelAPITests.cs (3)
3524var position = tree.GetText().ToString().IndexOf("class C {", StringComparison.Ordinal); 3545var position = tree.GetText().ToString().IndexOf("class C {", StringComparison.Ordinal); 4369var text = tree.GetText().ToString();
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (7)
4088var position1 = tree.GetText().ToString().IndexOf("WriteLine", StringComparison.Ordinal); 4169var position = tree.GetText().ToString().IndexOf("class C {", StringComparison.Ordinal); 4212var position2 = tree.GetText().ToString().IndexOf("C goo<O>", StringComparison.Ordinal); 4221var position3 = tree.GetText().ToString().IndexOf("Serializable", StringComparison.Ordinal); 4247var position = tree.GetText().ToString().IndexOf("class C {", StringComparison.Ordinal); 4324var position2 = tree.GetText().ToString().IndexOf("C goo<O>", StringComparison.Ordinal); 4347var position3 = tree.GetText().ToString().IndexOf("Serializable", StringComparison.Ordinal);
Symbols\Source\DeclaringSyntaxNodeTests.cs (2)
138string code = tree.GetText().ToString(); 153string code = tree.GetText().ToString();
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (77)
Diagnostics\DiagnosticTest.cs (1)
2406string s = syntaxTree.GetText().ToString();
Diagnostics\LocationsTests.cs (1)
68string s = syntaxTree.GetText().ToString();
IncrementalParsing\GrammarAmbiguities.cs (1)
104var parsedRoot = SyntaxFactory.ParseCompilationUnit(syntaxTree.GetText().ToString());
IncrementalParsing\IncrementalParsingTests.cs (67)
500var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 532var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 579var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 843var fullTree = SyntaxFactory.ParseSyntaxTree(withCloseBraceDeletedText.ToString()); 968Assert.Equal(newText.ToString(), finalText); 982Assert.Equal(newText.ToString(), output); 1428int locationOfInsert = oldText.ToString().IndexOf('0') + 1; 1532int locationOfChange = oldText.ToString().IndexOf("ON", StringComparison.Ordinal), widthOfChange = 2; 1552int locationOfChange = oldText.ToString().IndexOf("const", StringComparison.Ordinal), widthOfChange = 5; 1572int locationOfChange = oldText.ToString().IndexOf("class", StringComparison.Ordinal), widthOfChange = 5; 1595int locationOfChange = oldText.ToString().IndexOf('}'), widthOfChange = 5; 1615int locationOfChange = oldText.ToString().IndexOf('}'), widthOfChange = 5; 1635int locationOfChange = oldText.ToString().IndexOf("fixed", StringComparison.Ordinal), widthOfChange = 5; 1656int locationOfChange = oldText.ToString().IndexOf("@global", StringComparison.Ordinal), widthOfChange = 7; 1688int locationOfChange = oldText.ToString().IndexOf(txtToCmnt, StringComparison.Ordinal), widthOfChange = txtToCmnt.Length; 1713int locationOfChange = oldText.ToString().IndexOf(txtToCmnt, StringComparison.Ordinal), widthOfChange = txtToCmnt.Length; 1740Assert.Equal(parsedTree.GetText().ToString(), incrementalTree.GetText().ToString()); 1795Assert.Equal(parsedTree.GetText().ToString(), incrementalTree.GetText().ToString()); 1882Assert.Equal(parsedTree.GetText().ToString(), incrementalTree.GetText().ToString()); 2367int locationOfChange = oldText.ToString().IndexOf(textToRemove, StringComparison.Ordinal); 2395int locationOfChange = oldText.ToString().IndexOf(textToRemove, StringComparison.Ordinal); 2417int locationOfChange = oldText.ToString().IndexOf(textToRemove, StringComparison.Ordinal); 2468int locationOfChange = oldText.ToString().IndexOf(textToRemove, StringComparison.Ordinal); 2501int locationOfChange = oldText.ToString().IndexOf(textToRemove, StringComparison.Ordinal); 2527int locationOfChange = oldText.ToString().IndexOf(textToRemove, StringComparison.Ordinal); 2552int locationOfChange = oldText.ToString().IndexOf(textToRemove, StringComparison.Ordinal); 2581int locationOfChange = oldText.ToString().IndexOf(textToRemove, StringComparison.Ordinal); 2608int locationOfChange = oldText.ToString().IndexOf(textToRemove, StringComparison.Ordinal); 2632int locationOfChange = oldText.ToString().IndexOf(textToRemove, StringComparison.Ordinal); 2663int locationOfChange = oldText.ToString().IndexOf(txtToCmnt, StringComparison.Ordinal), widthOfChange = txtToCmnt.Length; 2691int locationOfChange = oldText.ToString().IndexOf(txtToCmnt, StringComparison.Ordinal), widthOfChange = txtToCmnt.Length; 2714int locationOfChange = oldText.ToString().IndexOf(txtToCmnt, StringComparison.Ordinal), widthOfChange = txtToCmnt.Length; 2769Assert.Equal(oldText.ToString(), startTree.GetCompilationUnitRoot().ToFullString()); 2792newText.ToString()); 2822", newText.ToString()); 2850", newText.ToString()); 2906var fullTree = SyntaxFactory.ParseSyntaxTree(newIText.ToString(), options: newTree.Options); 2920fullTree = SyntaxFactory.ParseSyntaxTree(newIText.ToString(), options: newTree.Options); 2990var fullTree = SyntaxFactory.ParseSyntaxTree(currIText.ToString()); 3026var fullTree = SyntaxFactory.ParseSyntaxTree(currIText.ToString()); 3202var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3223var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3244var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3265var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3286var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3308var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3332var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3356var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3380var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3404var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3428var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3454var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3479var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3505var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3531var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3549var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3567var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3585var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3599var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3613var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3628var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3665var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3726Assert.Equal(oldText.ToString(), startTree.GetCompilationUnitRoot().ToFullString()); 3735SourceText newText = SourceText.From(token + oldText.ToString());
Syntax\SyntaxEquivalenceTests.cs (3)
21var tree3 = SyntaxFactory.ParseSyntaxTree(tree2.GetText().ToString()); 30var tree3 = SyntaxFactory.ParseSyntaxTree(tree2.GetText().ToString()); 39var tree3 = SyntaxFactory.ParseSyntaxTree(node2.GetText().ToString());
TextExtensions.cs (4)
24var oldFullText = text.ToString(); 32var oldFullText = text.ToString(); 42var oldFullText = text.ToString(); 57var oldFullText = text.ToString();
Microsoft.CodeAnalysis.CSharp.Test.Utilities (3)
SyntaxTreeExtensions.cs (3)
26var oldFullText = syntaxTree.GetText().ToString(); 34var oldFullText = syntaxTree.GetText().ToString(); 47var oldFullText = syntaxTree.GetText().ToString();
Microsoft.CodeAnalysis.EditorFeatures (5)
InlineRename\InlineRenameSession.OpenTextBufferManager.cs (1)
606preMergeDocumentTextString = preMergeDocument.GetTextSynchronously(cancellationToken).ToString();
RenameTracking\RenameTrackingTaggerProvider.RenameTrackingCommitter.cs (2)
194Debug.Assert(newFullText.ToString() == documentWithOriginalName.GetTextSynchronously(cancellationToken).ToString());
TextDiffing\TextDifferencingServiceExtensions.cs (2)
21: diffService.DiffStrings(oldText.ToString(), newText.ToString(), options);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (12)
BraceHighlighting\MultiCharacterBraceHighlightingTests.cs (1)
34var text = (await document.GetTextAsync(cancellationToken)).ToString();
Completion\AbstractCompletionProviderTests.cs (4)
177var code = (await document.GetTextAsync()).ToString(); 663var actualCodeAfterCommit = textBuffer.CurrentSnapshot.AsText().ToString(); 700var actualCodeAfterCommit = textBuffer.CurrentSnapshot.AsText().ToString(); 767Assert.Equal(expectedCodeAfterCommit, text.ToString());
ExtractInterface\AbstractExtractInterfaceTests.cs (1)
163var updatedCode = (await updatedDocument.GetTextAsync()).ToString();
Formatting\CoreFormatterTestsBase.cs (1)
291var actual = result.GetText().ToString();
LanguageServer\AbstractLanguageServerProtocolTests.cs (2)
186return text.ToString(); 702text = sourceText.ToString();
Rename\RenamerTests.cs (1)
101AssertEx.EqualOrDiff(endDocument.Text, (await updatedDocument.GetTextAsync()).ToString());
SignatureHelp\AbstractSignatureHelpProviderTests.cs (2)
354var code = (await document.GetTextAsync()).ToString(); 470var code = (await document.GetTextAsync()).ToString();
Microsoft.CodeAnalysis.EditorFeatures.Text (1)
Implementation\TextBufferFactoryService\TextBufferCloneServiceFactory.cs (1)
52return _textBufferFactoryService.CreateTextBuffer(sourceText.ToString(), contentType);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (15)
CodeFixes\CodeFixServiceTests.cs (2)
894Assert.Equal("Additional Document", txtDocument.GetTextSynchronously(CancellationToken.None).ToString()); 949var newText = SourceText.From(text.ToString() + Title);
CodeRefactorings\CodeRefactoringServiceTest.cs (3)
182Assert.Empty(txtAdditionalDocument.GetTextSynchronously(CancellationToken.None).ToString()); 221Assert.Empty(editorConfig.GetTextSynchronously(CancellationToken.None).ToString()); 246var newText = SourceText.From(text.ToString() + Title);
Diagnostics\DiagnosticAnalyzerServiceTests.cs (2)
781var expectedText = additionalDocument.GetTextSynchronously(CancellationToken.None).ToString(); 782var actualText = analyzer.CallbackFilterFile.GetText().ToString();
EditorAdapter\TextSnapshotImplementationTest.cs (1)
34Assert.Equal(tuple.Item1.GetText(), text.ToString());
LinkedFiles\LinkedFileDiffMergingEditorTests.cs (1)
105var textString = sourceText.ToString();
Preview\PreviewWorkspaceTests.cs (1)
82Assert.Equal(previewWorkspace.CurrentSolution.Projects.First().Documents.First().GetTextAsync().Result.ToString(), text);
TextEditor\OpenDocumentTests.cs (2)
65Assert.Equal("Hello, World!", newDocumentWithChanges.GetTextSynchronously(CancellationToken.None).ToString()); 71Assert.Equal("Hello", originalDocumentWithChanges.GetTextSynchronously(CancellationToken.None).ToString());
TextEditor\TryGetDocumentTests.cs (1)
43Assert.Equal(expected, newSourceText.ToString());
Workspaces\TextFactoryTests.cs (2)
94Assert.Equal(text.ToString(), text2.ToString()); 114Assert.Equal(text.ToString(), text2.ToString());
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (6)
Diagnostics\AbstractCrossLanguageUserDiagnosticTest.vb (1)
116Dim actual = (Await updatedDocument.GetTextAsync()).ToString().Trim()
Diagnostics\AdditionalFileDiagnosticsTests.vb (1)
58Dim actual = updatedDocument.GetTextAsync().Result.ToString().Trim()
InlineHints\AbstractInlineHintsTests.vb (2)
70Dim newText = value.WithChanges(textChanges).ToString() 73AssertEx.Equal(expectedText.ToString(), newText)
Simplification\AbstractSimplificationTests.vb (1)
129Dim actualText = (Await simplifiedDocument.GetTextAsync()).ToString()
Simplification\ParameterSimplificationTests.vb (1)
31Assert.Equal(expected, (Await simplifiedDocument.GetTextAsync()).ToString())
Microsoft.CodeAnalysis.Features (1)
ValueTracking\ValueTrackedItem.cs (1)
42return subText.ToString();
Microsoft.CodeAnalysis.Features.Test.Utilities (4)
EditAndContinue\EditAndContinueTestVerifier.cs (1)
484var code = text.GetSubText(text.Lines.GetTextSpan(span.Span)).ToString().Replace("\r\n", " ");
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (2)
418Generate(syntaxTree.GetText().ToString(), fileName); 428Generate(additionalFile.GetText()!.ToString(), PathUtilities.GetFileName(additionalFile.Path));
Snippets\AbstractSnippetProviderTests.cs (1)
67Assert.Equal(markupAfterCommit, documentTextAfterSnippet.ToString());
Microsoft.CodeAnalysis.Features.UnitTests (1)
EditAndContinue\CompileTimeSolutionProviderTests.cs (1)
96return "// " + additionalText.GetText(ct)!.ToString();
Microsoft.CodeAnalysis.LanguageServer.Protocol (2)
Handler\Completion\CompletionHandler.cs (1)
196var filterText = sourceText.GetSubText(completionList.Span).ToString();
Handler\InlineCompletions\InlineCompletionsHandler.cs (1)
225return formattedLspSnippetText.ToString();
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (10)
DocumentChanges\DocumentChangesTests.cs (8)
52Assert.Equal(documentText, document.ToString()); 57Assert.Equal(expected, document.ToString()); 85Assert.Equal(documentText, document.ToString()); 206Assert.Equal(expected, document.ToString()); 284Assert.Equal(expected, document.ToString()); 323Assert.Equal(expected, document.ToString()); 363Assert.Equal(expected, document.ToString()); 447Assert.Equal(expected, document.ToString());
Workspaces\LspWorkspaceManagerTests.cs (2)
749Assert.Equal(generatorText, (await sourceGeneratedDocument.GetTextAsync(CancellationToken.None)).ToString()); 760Assert.Equal(openText, (await lspDocument.GetTextAsync(CancellationToken.None)).ToString());
Microsoft.CodeAnalysis.Scripting (2)
Hosting\CommandLine\CommandLineRunner.cs (1)
143RunInteractiveLoop(scriptOptions, code?.ToString(), cancellationToken);
Script.cs (1)
75public string Code => SourceText.ToString();
Microsoft.CodeAnalysis.Test.Utilities (1)
Metadata\ILValidation.cs (1)
427return subtext.ToString();
Microsoft.CodeAnalysis.TestAnalyzerReference (1)
NonSourceFileRefactoring.cs (1)
28var newText = SourceText.From(text.ToString() + Environment.NewLine + "# Refactored");
Microsoft.CodeAnalysis.UnitTests (116)
Text\LargeTextTests.cs (2)
47Assert.Equal(HelloWorld, text.ToString()); 168Assert.Equal(text.ToString().Substring(start, length), textLine.ToString());
Text\SourceTextTests.cs (1)
46Assert.Same(string.Empty, text.ToString());
Text\StringTextDecodingTests.cs (6)
62Assert.Equal(sjis.GetString(TestResources.General.ShiftJisSource), data.ToString()); 72Assert.Equal(sjis.GetString(TestResources.General.ShiftJisSource), data.ToString()); 171Assert.Equal(text, sourceText.ToString()); 196Assert.Equal(text, sourceText.ToString()); 226Assert.Equal(expectedText, sourceText.ToString()); 312Assert.Equal(expectedText, encodedText.ToString());
Text\StringTextTest.cs (5)
121Assert.Equal(text.ToString().Substring(start, length), textLine.ToString()); 235Assert.Equal("abc", source.ToString()); 250Assert.Equal("ab?", source.ToString()); 262Assert.Equal("\u1234", source.ToString()); 277Assert.Equal("abc", source.ToString());
Text\StringTextTests_Default.cs (1)
148Assert.Equal(originalText, encodedText.ToString());
Text\TextChangeTests.cs (101)
34Assert.Equal("World", subText.ToString()); 42Assert.Equal("Hello", subText.ToString()); 50Assert.Equal("World", subText.ToString()); 58Assert.Equal("o W", subText.ToString()); 66Assert.Equal("Hello Beautiful World", newText.ToString()); 91Assert.Equal("Halo Universe", newText.ToString()); 118Assert.Equal("Halo Universe", newText.ToString()); 145Assert.Equal("Hello Super Spectacular World", newText.ToString()); 157Assert.Equal("Hello Super Vurld", newText.ToString()); 171Assert.Equal("Hello Super Vurld", newText.ToString()); 183Assert.Equal("HellWorld", newText.ToString()); 195Assert.Equal("l Un", subText.ToString()); 271Assert.Equal(SourceText.From(changedText.ToString()).Lines, changedText.Lines, new TextLineEqualityComparer()); 361Assert.Equal(expected, text.ToString()); 381Assert.Equal(expected, text.ToString()); 394Assert.Equal("fghijklmno", subtext.ToString()); 432Assert.Equal("abcdefghij", newText.Segments[0].ToString()); 433Assert.Equal("lmnopqrstuvwxyz", newText.Segments[1].ToString()); 445Assert.Equal("abcdefghij*klmnopqrstuvwxyz", textWithSegments.ToString()); 448Assert.Equal("abcdefghij", textWithSegments.Segments[0].ToString()); 449Assert.Equal("*", textWithSegments.Segments[1].ToString()); 450Assert.Equal("klmnopqrstuvwxyz", textWithSegments.Segments[2].ToString()); 464Assert.Equal("abcdefghilmnopqrstuvwxyz", textWithFewerSegments.ToString()); 469Assert.Equal("abcdefghi", textWithFewerSegments.Segments[0].ToString()); 470Assert.Equal("lmnopqrstuvwxyz", textWithFewerSegments.Segments[1].ToString()); 495Assert.Equal(a, t.Segments[0].ToString()); 496Assert.Equal(b, t.Segments[1].ToString()); 508Assert.Equal(a, t.Segments[0].ToString()); 509Assert.Equal(b, t.Segments[1].ToString()); 510Assert.Equal(new string('c', t.Segments[2].Length), t.Segments[2].ToString()); 525Assert.Equal(a, t.Segments[0].ToString()); 526Assert.Equal(b, t.Segments[1].ToString()); 659Assert.Equal("Hello Cool World", change2.ToString()); 676Assert.Equal("0aa4", change1.ToString()); 677Assert.Equal("0abba4", change2.ToString()); 690Assert.Equal("0aaa2", change1.ToString()); 691Assert.Equal("0aabba2", change2.ToString()); 704Assert.Equal("0aa4", change1.ToString()); 705Assert.Equal("0abb4", change2.ToString()); 715Assert.Equal("Heard", change2.ToString()); 729Assert.Equal("Hell Bell World", change2.ToString()); 743Assert.Equal("Hello Cwazy Vorld", change2.ToString()); 759Assert.Equal("0aa1234", change1.ToString()); 760Assert.Equal("0bbaa1234", change2.ToString()); 772Assert.Equal("0aa4", change1.ToString()); 773Assert.Equal("0bbaa4", change2.ToString()); 785Assert.Equal("0aa1234", change1.ToString()); 786Assert.Equal("0bba1234", change2.ToString()); 798Assert.Equal("0aa1234", change1.ToString()); 799Assert.Equal("0bb1234", change2.ToString()); 811Assert.Equal("0aa1234", change1.ToString()); 812Assert.Equal("0bb234", change2.ToString()); 825Assert.Equal("0aa4", change1.ToString()); 826Assert.Equal("0bba4", change2.ToString()); 839Assert.Equal("0aa4", change1.ToString()); 840Assert.Equal("0bb", change2.ToString()); 849Assert.Equal("Hello World", change2.ToString()); 863Assert.Equal("Hello World", change2.ToString()); 879Assert.Equal("Hello World", change2.ToString()); 894Assert.Equal("Hell World", change1.ToString()); 896Assert.Equal("Hello World", change2.ToString()); 914Assert.Equal("Hello World", final.ToString()); 1012Assert.Equal(originalText.WithChanges(textChanges).ToString(), change2.ToString()); 1049Assert.Equal("a234", change1.ToString()); 1050Assert.Equal("bb34", change2.ToString()); 1053Assert.Equal("bb34", originalText.WithChanges(changes).ToString()); 1065Assert.Equal("aa0aa234", change1.ToString()); 1066Assert.Equal("baa234", change2.ToString()); 1067Assert.Equal(change2.ToString(), original.WithChanges(changes).ToString()); 1077Assert.Equal("a01234", change1.ToString()); 1078Assert.Equal("bb1234", change2.ToString()); 1081Assert.Equal("bb1234", originalText.WithChanges(changes).ToString()); 1091Assert.Equal("aa12aa4", change1.ToString()); 1092Assert.Equal("bbbaa12aa4", change2.ToString()); 1094Assert.Equal("bbbaa12aa4", originalText.WithChanges(changes).ToString()); 1104Assert.Equal("a34aaa5", change1.ToString()); 1105Assert.Equal("4bbaa5", change2.ToString()); 1108Assert.Equal("4bbaa5", originalText.WithChanges(changes).ToString()); 1118Assert.Equal("aaaaa12aaaa45aaaaa7", change1.ToString()); 1119Assert.Equal("baababbbbbaabbbbba7", change2.ToString()); 1122Assert.Equal("baababbbbbaabbbbba7", originalText.WithChanges(changes).ToString()); 1132Assert.Equal("a1234", change1.ToString()); 1133Assert.Equal("b1b4", change2.ToString()); 1136Assert.Equal("b1b4", originalText.WithChanges(changes).ToString()); 1146Assert.Equal("aa1234", change1.ToString()); 1147Assert.Equal("bab234", change2.ToString()); 1150Assert.Equal("bab234", originalText.WithChanges(changes).ToString()); 1160Assert.Equal("a2a5", change1.ToString()); 1161Assert.Equal("bbb5", change2.ToString()); 1164Assert.Equal("bbb5", originalText.WithChanges(changes).ToString()); 1174Assert.Equal("46", change1.ToString()); 1175Assert.Equal("6", change2.ToString()); 1178Assert.Equal("6", originalText.WithChanges(changes).ToString()); 1188Assert.Equal("245", change1.ToString()); 1189Assert.Equal("5", change2.ToString()); 1192Assert.Equal("5", originalText.WithChanges(changes).ToString()); 1202Assert.Equal("134", change1.ToString()); 1203Assert.Equal("14", change2.ToString()); 1206Assert.Equal("14", originalText.WithChanges(changes).ToString());
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (7)
Binding\BindingScopeTests.vb (1)
18Dim treeText As String = tree.GetText().ToString()
Compilation\MyTemplateTests.vb (3)
52Assert.Contains("Private ReadOnly m_Context As New Global.Microsoft.VisualBasic.MyServices.Internal.ContextValue(Of T)", sourceText.ToString(), StringComparison.Ordinal) 75Dim text = MyTemplate.GetText.ToString 98Dim text = MyTemplate.GetText.ToString
DeclaringSyntaxNodeTests.vb (3)
104Dim code As String = tree.GetText().ToString() 118Dim code As String = tree.GetText().ToString() 129Dim code As String = tree.GetText().ToString()
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (1)
DocumentationComments\DocCommentTests.vb (1)
12084Dim text As String = tree.GetText().ToString()
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (50)
IncrementalParser\IncrementalParser.vb (45)
136Dim newString = newText.ToString() 887Dim position = oldText.ToString().IndexOf(str, StringComparison.Ordinal) 908Dim position = oldText.ToString().LastIndexOf("Module", StringComparison.Ordinal) 937Dim position = oldText.ToString().IndexOf("False", StringComparison.Ordinal) 966Dim position = oldText.ToString().LastIndexOf("Module", StringComparison.Ordinal) 990Dim position = oldText.ToString().IndexOf(str, StringComparison.Ordinal) + str.Length 1011Dim position = oldText.ToString().IndexOf("'Else", StringComparison.Ordinal) 1031Dim position = oldText.ToString().IndexOf("X"c) 1055Dim position = oldText.ToString().Length 1081Dim position = oldText.ToString().IndexOf(str, StringComparison.Ordinal) 1107Dim position = oldText.ToString().LastIndexOf(str, StringComparison.Ordinal) 1127Dim fulltree = VisualBasicSyntaxTree.ParseText(newIText.ToString()) 1172Dim fulltree = VisualBasicSyntaxTree.ParseText(newIText.ToString()) 1268Dim position = oldText.ToString().IndexOf(str, StringComparison.Ordinal) 1292Dim position = oldText.ToString().IndexOf(str, StringComparison.Ordinal) 1316Dim position = oldText.ToString().IndexOf(str, StringComparison.Ordinal) 1340Dim position = oldText.ToString().IndexOf(str, StringComparison.Ordinal) 1363Dim position = oldText.ToString().IndexOf(str, StringComparison.Ordinal) 1386Dim position = oldText.ToString().IndexOf(str, StringComparison.Ordinal) 1406Dim position = oldText.ToString().IndexOf(str, StringComparison.Ordinal) 1426Dim position = oldText.ToString().IndexOf(str, StringComparison.Ordinal) 1446Dim position = oldText.ToString().IndexOf(str, StringComparison.Ordinal) 1466Dim position = oldText.ToString().IndexOf(str, StringComparison.Ordinal) 1490Dim position = oldText.ToString().IndexOf("#"c) 1585Dim position = oldText.ToString().IndexOf("&HFFFFFFFFFF:", StringComparison.Ordinal) 1770Dim position = oldText.ToString.IndexOf(TextToRemove, StringComparison.Ordinal) 1797Dim position = oldText.ToString.IndexOf(TextToRemove, StringComparison.Ordinal) 1826Dim position = oldText.ToString.IndexOf(TextToRemove, StringComparison.Ordinal) 1890Dim position = oldText.ToString.IndexOf(TextToRemove, StringComparison.Ordinal) 1923Dim position = oldText.ToString.IndexOf(TextToRemove, StringComparison.Ordinal) 1957Dim position = oldText.ToString.IndexOf(TextToRemove, StringComparison.Ordinal) 1987Dim position = oldText.ToString.IndexOf(TextToRemove, StringComparison.Ordinal) 2018Dim position = oldText.ToString.IndexOf(TextToRemove, StringComparison.Ordinal) 2050Dim position = oldText.ToString.IndexOf(TextToRemove, StringComparison.Ordinal) 2080Dim position = oldText.ToString.IndexOf(TextToRemove, StringComparison.Ordinal) 2112Dim position = oldText.ToString.IndexOf(TextToRemove, StringComparison.Ordinal) 2214Dim position = oldText.ToString.IndexOf(TextToRemove, StringComparison.Ordinal) 2246Dim position = oldText.ToString.IndexOf(TextToRemove, StringComparison.Ordinal) 2280Dim position = oldText.ToString.IndexOf(TextToRemove, StringComparison.Ordinal) 2306Dim position = oldText.ToString.IndexOf(TextToRemove, StringComparison.Ordinal) 2337Dim position = oldText.ToString.IndexOf(TextToRemove, StringComparison.Ordinal) 2370Dim position = oldText.ToString.IndexOf(TextToRemove, StringComparison.Ordinal) 2407Dim position = oldText.ToString.IndexOf(TextToRemove, StringComparison.Ordinal) 2435Dim position = oldText.ToString.IndexOf(TextToRemove, StringComparison.Ordinal) 2469Dim position = oldText.ToString.IndexOf(TextToRemove, StringComparison.Ordinal)
LocationTests.vb (1)
56Dim s = tree.GetText().ToString()
Parser\ParseDirectives.vb (1)
3387Dim index = tree.GetText.ToString.IndexOf(text, 0, StringComparison.Ordinal)
Syntax\SyntaxEquivalenceTests.vb (2)
18Dim tree3 = VisualBasicSyntaxTree.ParseText(tree2.GetText().ToString()) 25Dim tree3 = VisualBasicSyntaxTree.ParseText(tree2.GetText().ToString())
TestSyntaxNodes.vb (1)
3343Assert.Equal("#if True then", x(0).GetText.ToString.TrimEnd)
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (9)
CompilationTestUtils.vb (3)
659Dim text As String = tree.GetText().ToString() 667Dim text As String = tree.GetText().ToString() 1131Dim text As String = tree.GetText().ToString()
ParserTestUtilities.vb (2)
221Dim newText = newIText.ToString 222Dim oldText = oldIText.ToString
SemanticModelTestBase.vb (1)
23Dim text As String = tree.GetText().ToString()
SyntaxTreeExtensions.vb (3)
24Dim oldFullText = syntaxTree.GetText().ToString() 32Dim oldFullText = syntaxTree.GetText().ToString() 45Dim oldFullText = syntaxTree.GetText().ToString()
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (4)
CaseCorrection\VisualBasicCaseCorrectionTestBase.vb (1)
22AssertEx.EqualOrDiff(expected, actual.ToString())
CodeGeneration\AddImportsTests.vb (2)
102Dim actualText = (Await formatted.GetTextAsync()).ToString() 109Dim actualText = (Await formatted.GetTextAsync()).ToString()
Formatting\FormattingTests.vb (1)
4211Dim actual = (Await document.GetTextAsync()).ToString()
Microsoft.CodeAnalysis.Workspaces (5)
LinkedFileDiffMerging\AbstractLinkedFileMergeConflictCommentAdditionService.cs (1)
117? text.GetSubText(TextSpan.FromBounds(text.Lines[startLine].Start, text.Lines[endLine].End)).ToString()
Shared\Extensions\SourceTextExtensions.cs (1)
185writer.WriteString(sourceText.ToString());
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
73var allText = text.ToString(); // Entire document as string to allow inspecting the text in the debugger.
Workspace\Solution\DocumentState.cs (2)
696var newTextContent = newText.ToString(); 699var oldTextContent = oldText?.ToString();
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (32)
VisualStudioMSBuildWorkspaceTests.cs (32)
966Assert.NotEmpty(text.ToString()); 991Assert.Empty(text.ToString()); 2024Assert.Equal(newText.ToString(), text2.ToString()); 2029Assert.Equal(newText.ToString(), textOnDisk); 2067Assert.Equal(newText.ToString(), text2.ToString()); 2071Assert.Equal(newText.ToString(), textOnDisk); 2076Assert.Equal(originalText.ToString(), text.ToString()); 2103Assert.Equal(originalText.ToString(), text.ToString()); 2117var newText = SourceText.From("using System.Diagnostics;\r\n" + text.ToString()); 2126Assert.Equal(newText.ToString(), text2.ToString()); 2130Assert.Equal(newText.ToString(), textOnDisk); 2144var newText = SourceText.From("New Text In Additional File.\r\n" + text.ToString()); 2153Assert.Equal(newText.ToString(), text2.ToString()); 2157Assert.Equal(newText.ToString(), textOnDisk); 2179Assert.Equal(newText.ToString(), text2.ToString()); 2183Assert.Equal(newText.ToString(), textOnDisk); 2240var newText = "/* new text */\r\n" + text.ToString(); 2270var newText = "/* new text */\r\n" + text.ToString(); 2354Assert.Contains("Window", text.ToString(), StringComparison.Ordinal); 2372Assert.Contains("public class CSharpClass", documentText.ToString(), StringComparison.Ordinal); 2376Assert.Contains("Window", additionalDocumentText.ToString(), StringComparison.Ordinal); 2834Assert.Equal("//\u201C", text.ToString()); 2894Assert.Equal(fileContent, text.ToString()); 2907var noEncodingDoc = document.WithText(SourceText.From(text.ToString(), encoding: null)); 3247Assert.Equal("root = true", text.ToString());
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (5)
Formatting\FormattingTestBase.cs (1)
129var actual = sourceText.WithChanges(result).ToString();
GenerateFileForEachAdditionalFileWithContentsCommented.cs (1)
35return SourceText.From(generatedText.ToString(), encoding: Encoding.UTF8);
Workspaces\TestWorkspace`1.cs (3)
397text.ToString(), info.Name, info.SourceCodeKind, 422var hostDocument = CreateDocument(text.ToString(), info.Name, id: info.Id, exportProvider: ExportProvider); 446var hostDocument = CreateDocument(text.ToString(), info.Name, id: info.Id, filePath: info.FilePath, folders: info.Folders, exportProvider: ExportProvider);
Microsoft.CodeAnalysis.Workspaces.UnitTests (35)
CommandLineProject\CommandLineProjectWorkspaceTests.cs (1)
42var text = (await gooDoc.GetTextAsync()).ToString();
Formatter\FormatterTests.cs (1)
59AssertEx.Equal(@"Formatted with options: LineFormattingOptions { UseTabs = False, TabSize = 4, IndentationSize = 4, NewLine = \r\n }", formattedText.ToString());
LinkedFileDiffMerging\LinkedFileDiffMergingTests.cs (1)
53AssertEx.EqualOrDiff(expectedMergedText, mergedSolution.GetDocument(documentIds[i]).GetTextAsync().Result.ToString());
SolutionTests\ProjectSemanticVersionTests.cs (12)
44var position = text.ToString().LastIndexOf('{') + 1; 58var position = text.ToString().LastIndexOf('{') + 1; 72var position = text.ToString().LastIndexOf('(') + 1; 86var position = text.ToString().IndexOf('{') + 1; 100var position = text.ToString().IndexOf('{') + 1; 114var span = new TextSpan(text.ToString().IndexOf("20"), length: 2); 128var position = text.ToString().IndexOf('{') + 1; 142var span = new TextSpan(text.ToString().IndexOf("20"), length: 2); 184var position = text.ToString().IndexOf('(') + 1; 226var span = new TextSpan(text.ToString().IndexOf("20"), length: 2); 240var position = text.ToString().IndexOf('{') + 1; 254var span = new TextSpan(text.ToString().IndexOf("20"), length: 2);
SolutionTests\SolutionTests.cs (12)
1015Assert.Equal("new text", newSolution1.GetDocument(documentId)!.GetTextSynchronously(CancellationToken.None).ToString()); 1037Assert.Equal("new text", newSolution1.GetAdditionalDocument(documentId)!.GetTextSynchronously(CancellationToken.None).ToString()); 1059Assert.Equal("new text", newSolution1.GetAnalyzerConfigDocument(documentId)!.GetTextSynchronously(CancellationToken.None).ToString()); 3169var newText = solution2.GetDocument(documentId).GetTextAsync().Result.ToString(); 3315Assert.Equal(text1, observedText2.ToString()); 3335Assert.Equal(text, docText.ToString()); 3357Assert.Equal(text, docText.ToString()); 3382Assert.Equal(text, docText.ToString()); 3531Assert.Equal(expectedText, observedText.ToString()); 3562Assert.Equal(expectedText, observedText.ToString()); 3921Assert.Equal("", text.ToString()); 5748Assert.Equal("// source1", generatedDocuments.Single().GetTextSynchronously(CancellationToken.None).ToString());
SolutionTests\SolutionWithSourceGeneratorTests.cs (1)
889Assert.Equal("// Frozen Document", (await frozenWithSingleDocument.GetTextAsync()).ToString());
SymbolKeyTests.cs (1)
1419var newTree = syntaxTree.WithChangedText(text.WithChanges(new TextChange(new TextSpan(0, text.Length), text.ToString().Replace(" ", " "))));
SyntaxPathTests.cs (2)
411var oldFullText = text.ToString(); 437offset: syntaxTree.GetText().ToString().IndexOf(oldText, startIndex, StringComparison.Ordinal),
UtilityTest\SourceTextSerializationTests.cs (2)
46Assert.Equal(originalText.ToString(), recovered.ToString());
WorkspaceServiceTests\TemporaryStorageServiceTests.cs (1)
83Assert.Equal(text.ToString(), text2.ToString());
WorkspaceTests\AdhocWorkspaceTests.cs (1)
76Assert.Equal(source, (await doc.GetTextAsync()).ToString());
Microsoft.DotNet.GenFacades (1)
NotSupportedAssemblyGenerator.cs (1)
89string text = root.GetText().ToString();
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 (5)
ParserTests.cs (1)
683return Verifier.Verify(generatedSources[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.Metrics.Unit.Tests (6)
EmitterTests.cs (2)
49var result = r.First(x => x.HintName == "Factory.g.cs").SourceText.ToString(); 52result = 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.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)
Microsoft.VisualStudio.LanguageServices (7)
CallHierarchy\CallHierarchyDetail.cs (1)
46return location.SourceTree.GetText().GetSubText(TextSpan.FromBounds(start, end)).ToString();
Preview\FileChange.cs (3)
108var leftText = oldText.GetSubText(leftSpan.ToTextSpan()).ToString(); 109var rightText = newText.GetSubText(rightSpan.ToTextSpan()).ToString(); 128var text = document.GetTextSynchronously(CancellationToken.None).ToString();
Preview\PreviewUpdater.cs (1)
87var documentText = document.GetTextSynchronously(CancellationToken.None).ToString();
Preview\TopLevelChange.cs (1)
152var oldText = oldDocument.GetTextSynchronously(CancellationToken.None).ToString();
Workspace\SourceGeneratedFileManager.cs (1)
398edit.Replace(startPosition: 0, _textBuffer.CurrentSnapshot.Length, generatedSource.ToString());
Microsoft.VisualStudio.LanguageServices.CSharp (1)
SemanticSearch\SemanticSearchToolWindowImpl.cs (1)
373queryString = query.ToString();
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (2)
CodeModel\FileCodeFunctionTests.cs (2)
497var position = text.ToString().IndexOf("DynamicMethod", StringComparison.Ordinal); 510var position = text.ToString().IndexOf("protected virtual string MethodB", StringComparison.Ordinal) - 1;
Microsoft.VisualStudio.LanguageServices.UnitTests (4)
Preview\PreviewChangesTests.vb (3)
160Assert.Equal(document.GetTextAsync().Result.ToString(), finalText) 236Assert.Equal(forkedDocument.GetTextAsync().Result.ToString(), changedDocText) 238Dim finalAddedDocText = finalSolution.GetDocument(addedDocumentId1).GetTextAsync().Result.ToString()
Venus\DocumentService_IntegrationTests.vb (1)
189Assert.Equal(String.Empty, (Await newDocument.GetTextAsync()).ToString())
Roslyn.VisualStudio.Next.UnitTests (7)
Remote\SnapshotSerializationTests.cs (4)
621Assert.Equal(sourceText.ToString(), newText.GetText(CancellationToken.None).ToString()); 639Assert.Equal(sourceText.ToString(), newText.GetText(CancellationToken.None).ToString());
Services\ServiceHubServicesTests.cs (3)
103Assert.Equal(newText.ToString(), (await serializableRemoteText.GetTextAsync(CancellationToken.None)).ToString()); 489Assert.Equal(localText.ToString(), remoteText.ToString());
System.Windows.Forms.Analyzers (1)
System\Windows\Forms\Analyzers\AppManifestAnalyzer.cs (1)
48doc.LoadXml(appManifestXml.ToString());