11 overrides of GetText
Microsoft.CodeAnalysis.CSharp (3)
Syntax\CSharpSyntaxTree.Dummy.cs (1)
33public override SourceText GetText(CancellationToken cancellationToken)
Syntax\CSharpSyntaxTree.LazySyntaxTree.cs (1)
44public override SourceText GetText(CancellationToken cancellationToken)
Syntax\CSharpSyntaxTree.ParsedSyntaxTree.cs (1)
62public override SourceText GetText(CancellationToken cancellationToken)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
DeclarationTests.cs (1)
973public override SourceText GetText(CancellationToken cancellationToken)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Syntax\Mocks\MockCSharpSyntaxTree.cs (1)
34public override SourceText GetText(CancellationToken cancellationToken)
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
Workspace\LanguageServices\CSharpSyntaxTreeFactoryService.ParsedSyntaxTree.cs (1)
45public override SourceText GetText(CancellationToken cancellationToken)
Microsoft.CodeAnalysis.VisualBasic (3)
Syntax\VisualBasicSyntaxTree.DummySyntaxTree.vb (1)
28Public Overrides Function GetText(Optional cancellationToken As CancellationToken = Nothing) As SourceText
Syntax\VisualBasicSyntaxTree.LazySyntaxTree.vb (1)
51Public Overrides Function GetText(Optional cancellationToken As CancellationToken = Nothing) As SourceText
Syntax\VisualBasicSyntaxTree.ParsedSyntaxTree.vb (1)
75Public Overrides Function GetText(Optional cancellationToken As CancellationToken = Nothing) As SourceText
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (1)
ParserTestUtilities.vb (1)
519Public Overrides Function GetText(Optional cancellationToken As CancellationToken = Nothing) As SourceText
Microsoft.CodeAnalysis.VisualBasic.Workspaces (1)
Workspace\LanguageServices\VisualBasicSyntaxTreeFactoryService.ParsedSyntaxTree.vb (1)
42Public Overrides Function GetText(Optional cancellationToken As CancellationToken = Nothing) As SourceText
317 references to GetText
BuildValidator (1)
CompilationDiff.cs (1)
308tree.GetText().Write(writer);
IdeCoreBenchmarks (1)
IncrementalSourceGeneratorBenchmarks.cs (1)
159var sourceText = syntaxTree.GetText();
Microsoft.AspNetCore.App.Analyzers (1)
Infrastructure\VirtualChars\CSharpVirtualCharService.cs (1)
199var parentSourceText = parentExpression.SyntaxTree.GetText();
Microsoft.AspNetCore.App.Analyzers.Test (1)
RouteEmbeddedLanguage\RoutePatternParserTests.cs (1)
148var sourceText = token.SyntaxTree.GetText();
Microsoft.AspNetCore.Http.Extensions.Tests (2)
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
136var text = syntaxTree.GetText();
ValidationsGenerator\ValidationsGeneratorTestBase.cs (1)
129var text = syntaxTree.GetText();
Microsoft.AspNetCore.Http.Microbenchmarks (1)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
136var text = syntaxTree.GetText();
Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests (1)
SnapshotTestHelper.cs (1)
124var text = syntaxTree.GetText();
Microsoft.CodeAnalysis (15)
CommandLine\CommonCompiler.cs (2)
464text = EmbeddedText.FromSource(path, tree.GetText()); 1164var sourceText = tree.GetText(cancellationToken);
Compilation\Compilation.cs (1)
2500if (!string.IsNullOrEmpty(tree.FilePath) && tree.GetText().Encoding == null)
Compilation\DeterministicKey.cs (1)
44=> _tree.GetText(cancellationToken);
DiagnosticAnalyzer\AnalysisContextInfo.cs (1)
111var text = _file.Value.SourceTree.GetText();
Syntax\LineDirectiveMap.cs (1)
148var sourceText = tree.GetText();
Syntax\SyntaxDiffer.cs (2)
45return new[] { new TextChange(new TextSpan(0, 0), after.GetText().ToString()) }; 81return new[] { new TextSpan(0, after!.GetText().Length) };
Syntax\SyntaxTree.cs (3)
122return Task.FromResult(this.TryGetText(out SourceText? text) ? text : this.GetText(cancellationToken)); 375var text = this.GetText(); 417return this.GetText(CancellationToken.None).ToString();
Syntax\SyntaxTreeComparer.cs (3)
28SourceTextComparer.Instance.Equals(x.GetText(), y.GetText()); 33return Hash.Combine(obj.FilePath.GetHashCode(), SourceTextComparer.Instance.GetHashCode(obj.GetText()));
Syntax\SyntaxTreeExtensions.cs (1)
23var text = tree.GetText();
Microsoft.CodeAnalysis.CodeStyle (12)
src\Analyzers\Core\Analyzers\Formatting\AbstractFormattingAnalyzer.cs (1)
49var oldText = tree.GetText(cancellationToken);
src\Analyzers\Core\Analyzers\RemoveUnnecessaryParentheses\AbstractRemoveUnnecessaryParenthesesDiagnosticAnalyzer.cs (1)
131var lines = parenthesizedExpression.SyntaxTree.GetText(cancellationToken).Lines;
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
23var text = tree.GetText();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (2)
27var text = tree.GetText(cancellationToken); 105var text = tree.GetText(cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
166var textLine = baseToken.SyntaxTree.GetText(cancellationToken).Lines.GetLineFromPosition(baseToken.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.StructuredTrivia.cs (4)
50if (root.SyntaxTree != null && root.SyntaxTree.GetText() != null) 52return root.SyntaxTree.GetText(); 56if (parent != null && parent.SyntaxTree != null && parent.SyntaxTree.GetText() != null) 58return parent.SyntaxTree.GetText();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\AbstractDocumentationCommentService.cs (1)
86var line = syntaxTree.GetText(cancellationToken).Lines.GetLineFromPosition(spanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (1)
151var line = tree.GetText().Lines.GetLineFromPosition(startPosition);
Microsoft.CodeAnalysis.CodeStyle.Fixes (3)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\AddParameterEditor.cs (2)
25var sourceText = declaration.SyntaxTree.GetText(cancellationToken); 159var text = parameters[0].SyntaxTree.GetText(cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (1)
55var text = root.SyntaxTree.GetText(cancellationToken);
Microsoft.CodeAnalysis.CSharp (11)
Compilation\CSharpCompilation.cs (1)
1099var text = tree.GetText();
Compilation\CSharpSemanticModel.cs (1)
5225var text = tree.GetText(cancellationToken);
Symbols\Source\SourceMethodSymbolWithAttributes.cs (4)
1082var referencedLines = matchingTree.GetText().Lines; 1111DeclaringCompilation.AddInterception(matchingTree.GetText().GetContentHash(), position, attributeLocation, this); 1279var referencedLines = matchingTree.GetText().Lines; 1325DeclaringCompilation.AddInterception(matchingTree.GetText().GetContentHash(), referencedToken.Position, attributeLocation, this);
Syntax\CSharpSyntaxTree.cs (5)
666=> GetDirectiveMap().TranslateSpan(GetText(cancellationToken), this.FilePath, span); 670=> GetDirectiveMap().GetLineVisibility(GetText(cancellationToken), position); 677return (map.Entries.Length == 1) ? Array.Empty<LineMapping>() : map.GetLineMappings(GetText(cancellationToken).Lines); 688=> GetDirectiveMap().TranslateSpanAndVisibility(GetText(), FilePath, span, out isHiddenPosition); 753=> GetText(cancellationToken).Lines.GetLinePosition(position);
Microsoft.CodeAnalysis.CSharp.CodeStyle (6)
src\Analyzers\CSharp\Analyzers\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementDiagnosticAnalyzer.cs (1)
50var text = tree.GetText(cancellationToken);
src\Analyzers\CSharp\Analyzers\NewLines\ConstructorInitializerPlacement\ConstructorInitializerPlacementDiagnosticAnalyzer.cs (1)
68var sourceText = context.Tree.GetText(context.CancellationToken);
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs (1)
94var sourceText = semanticModel.SyntaxTree.GetText(cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\EmbeddedLanguages\VirtualChars\CSharpVirtualCharService.cs (1)
187var parentSourceText = parentExpression.SyntaxTree.GetText();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (1)
238var name = SyntaxFactory.ParseName(syntaxTree.GetText(cancellationToken).ToString(TextSpan.FromBounds(genericIdentifier.SpanStart, lastToken.Span.End)));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs (1)
351var sourceText = token.SyntaxTree!.GetText(cancellationToken);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.cs (1)
144var text = node.SyntaxTree.GetText();
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
Extensions\SyntaxTreeExtensionsTests.cs (2)
18var line = tree.GetText().Lines[lineNumber]; 27var line = tree.GetText().Lines[lineNumber];
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (1)
EmbeddedLanguages\RegularExpressions\CSharpRegexParserTests.cs (1)
117var sourceText = token.SyntaxTree.GetText();
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (3)
PDB\PDBEmbeddedSourceTests.cs (3)
47EmbeddedText.FromSource(tree1.FilePath, tree1.GetText()), 48EmbeddedText.FromSource(tree2.FilePath, tree2.GetText()) 109embeddedTexts: new[] { EmbeddedText.FromSource(tree.FilePath, tree.GetText()) });
Microsoft.CodeAnalysis.CSharp.Features (18)
Completion\CompletionProviders\PartialMethodCompletionProvider.cs (2)
92var text = tree.GetText(cancellationToken); 116while (IsOnSameLine(token, touchingToken, tree.GetText(cancellationToken)))
ConvertToRawString\ConvertInterpolatedStringToRawStringCodeRefactoringProvider.cs (1)
507text ??= stringExpression.SyntaxTree.GetText(cancellationToken);
Debugging\CSharpProximityExpressionsService.Worker.cs (2)
155var line = _syntaxTree.GetText(cancellationToken).Lines.IndexOf(_position); 160nextStatement != null && _syntaxTree.GetText(cancellationToken).Lines.IndexOf(nextStatement.SpanStart) == line;
DocumentationComments\CSharpDocumentationCommentSnippetService.cs (1)
223if (position >= syntaxTree.GetText(cancellationToken).Length)
EditAndContinue\BreakpointSpans.cs (1)
21var source = tree.GetText(cancellationToken);
EmbeddedLanguages\CSharpTestEmbeddedLanguageClassifier.cs (1)
68var text = semanticModel.SyntaxTree.GetText(cancellationToken);
LineSeparators\CSharpLineSeparatorService.cs (3)
331var line = syntaxTree.GetText(cancellationToken).Lines.IndexOf(textSpan.End); 332if (line == syntaxTree.GetText(cancellationToken).Lines.Count - 1) 337if (string.IsNullOrWhiteSpace(syntaxTree.GetText(cancellationToken).Lines[line + 1].ToString()))
src\Analyzers\CSharp\Analyzers\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementDiagnosticAnalyzer.cs (1)
50var text = tree.GetText(cancellationToken);
src\Analyzers\CSharp\Analyzers\NewLines\ConstructorInitializerPlacement\ConstructorInitializerPlacementDiagnosticAnalyzer.cs (1)
68var sourceText = context.Tree.GetText(context.CancellationToken);
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs (1)
94var sourceText = semanticModel.SyntaxTree.GetText(cancellationToken);
Structure\Providers\ArgumentListStructureProvider.cs (1)
36var text = node.SyntaxTree.GetText(cancellationToken);
Structure\Providers\DisabledTextTriviaStructureProvider.cs (1)
70var text = syntaxTree.GetText(cancellationToken);
Structure\Providers\IfDirectiveTriviaStructureProvider.cs (1)
40text ??= node.SyntaxTree.GetText(cancellationToken);
Structure\Providers\StringLiteralExpressionStructureProvider.cs (1)
49var sourceText = node.SyntaxTree.GetText(cancellationToken);
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (2)
ScriptTests.cs (2)
67Assert.Equal(state.Script.Code, compilation.SyntaxTrees.First().GetText().ToString()); 75Assert.Equal(state.Script.SourceText, compilation.SyntaxTrees.First().GetText());
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (16)
Semantics\BindingAwaitTests.cs (1)
27SourceText text = tree.GetText();
Semantics\InterceptorsTests.cs (2)
3584builder.WriteBytes(sourceTree.GetText().GetContentHash()); 3634builder.WriteBytes(sourceTree.GetText().GetContentHash());
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());
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (15)
Compilation\SemanticModelAPITests.cs (3)
3555var position = tree.GetText().ToString().IndexOf("class C {", StringComparison.Ordinal); 3576var position = tree.GetText().ToString().IndexOf("class C {", StringComparison.Ordinal); 4400var 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);
DeclarationTests.cs (1)
975return _underlyingTree.GetText(cancellationToken);
Symbols\Metadata\MetadataTypeTests.cs (2)
363var oldIText = oldTree.GetText(); 378oldIText = oldTree.GetText();
Symbols\Source\DeclaringSyntaxNodeTests.cs (2)
138string code = tree.GetText().ToString(); 153string code = tree.GetText().ToString();
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (58)
Diagnostics\DiagnosticTest.cs (1)
2412string s = syntaxTree.GetText().ToString();
Diagnostics\LocationsTests.cs (5)
68string s = syntaxTree.GetText().ToString(); 76var text = tree.GetText(); 400Assert.InRange(diag.Location.SourceSpan.End, diag.Location.SourceSpan.Start, syntaxTree.GetText().Length); 465Assert.InRange(diag.Location.SourceSpan.Start, 0, syntaxTree.GetText().Length); 466Assert.InRange(diag.Location.SourceSpan.End, 0, syntaxTree.GetText().Length);
IncrementalParsing\GrammarAmbiguities.cs (1)
104var parsedRoot = SyntaxFactory.ParseCompilationUnit(syntaxTree.GetText().ToString());
IncrementalParsing\IncrementalParsingTests.cs (37)
494var text = tree.GetText(); 526var text = tree.GetText(); 567var text = tree.GetText(); 618var initialText = initialTree.GetText(); 2170Assert.Equal(parsedTree.GetText().ToString(), incrementalTree.GetText().ToString()); 2225Assert.Equal(parsedTree.GetText().ToString(), incrementalTree.GetText().ToString()); 2312Assert.Equal(parsedTree.GetText().ToString(), incrementalTree.GetText().ToString()); 3329var oldIText = oldTree.GetText(); 3343oldIText = oldTree.GetText(); 3407var currIText = currTree.GetText(); 3447var currIText = currTree.GetText(); 3627var text = tree.GetText(); 3648var text = tree.GetText(); 3669var text = tree.GetText(); 3690var text = tree.GetText(); 3711var text = tree.GetText(); 3732var text = tree.GetText(); 3756var text = tree.GetText(); 3780var text = tree.GetText(); 3804var text = tree.GetText(); 3828var text = tree.GetText(); 3852var text = tree.GetText(); 3878var text = tree.GetText(); 3904var text = tree.GetText(); 3929var text = tree.GetText(); 3955var text = tree.GetText(); 3973var text = tree.GetText(); 3991var text = tree.GetText(); 4009var text = tree.GetText(); 4024var text = tree.GetText(); 4038var text = tree.GetText(); 4052var text = tree.GetText(); 4090var text = tree.GetText(); 4111var text = tree.GetText();
Parsing\ParserRegressionTests.cs (1)
163var lines1 = tree.GetText().Lines.Count; // 3
Syntax\SyntaxEquivalenceTests.cs (2)
21var tree3 = SyntaxFactory.ParseSyntaxTree(tree2.GetText().ToString()); 30var tree3 = SyntaxFactory.ParseSyntaxTree(tree2.GetText().ToString());
Syntax\SyntaxFactoryTests.cs (2)
45var text = SyntaxFactory.SyntaxTree(SyntaxFactory.CompilationUnit(), encoding: null).GetText(); 53var text = SyntaxFactory.CompilationUnit().SyntaxTree.GetText();
Syntax\SyntaxNodeTests.cs (3)
788var position = tree.GetText().Lines[2].End - 1; 910var tree2 = tree1.WithChangedText(tree1.GetText().WithChanges(new TextChange(default, " "))); 921var tree2 = tree1.WithChangedText(tree1.GetText().WithChanges(new TextChange(new TextSpan(22, 0), " return; ")));
Syntax\SyntaxTreeTests.cs (6)
122Assert.Equal(SourceHashAlgorithm.Sha1, tree.GetText().ChecksumAlgorithm); 134Assert.Equal(SourceHashAlgorithm.Sha1, tree.GetText().ChecksumAlgorithm); 247var newText = newTree.GetText(); 265var newText = newTree.GetText(); 289var newText = newTree.GetText(); 305var newText = newTree.GetText();
Microsoft.CodeAnalysis.CSharp.Test.Utilities (4)
SyntaxTreeExtensions.cs (4)
19var oldFullText = syntaxTree.GetText(); 26var oldFullText = syntaxTree.GetText().ToString(); 34var oldFullText = syntaxTree.GetText().ToString(); 47var oldFullText = syntaxTree.GetText().ToString();
Microsoft.CodeAnalysis.CSharp.Workspaces (4)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\EmbeddedLanguages\VirtualChars\CSharpVirtualCharService.cs (1)
187var parentSourceText = parentExpression.SyntaxTree.GetText();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (1)
238var name = SyntaxFactory.ParseName(syntaxTree.GetText(cancellationToken).ToString(TextSpan.FromBounds(genericIdentifier.SpanStart, lastToken.Span.End)));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs (1)
351var sourceText = token.SyntaxTree!.GetText(cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.cs (1)
144var text = node.SyntaxTree.GetText();
Microsoft.CodeAnalysis.EditorFeatures (1)
RenameTracking\RenameTrackingTaggerProvider.RenameTrackingCommitter.cs (1)
186var fullText = syntaxTree.GetText(cancellationToken);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (2)
KeywordHighlighting\AbstractKeywordHighlighterTests.cs (2)
75var actualText = tree.GetText().ToString(highlightSpans[j]); 81var expectedText = tree.GetText().ToString(expectedHighlightSpans[j]);
Microsoft.CodeAnalysis.Features (6)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.cs (1)
272var lines = syntaxTree.GetText(cancellationToken).Lines;
ReplaceDocCommentTextWithTag\AbstractReplaceDocCommentTextWithTagCodeRefactoringProvider.cs (1)
118var sourceText = semanticModel.SyntaxTree.GetText(cancellationToken);
Snippets\SnippetProviders\AbstractInlineStatementSnippetProvider.cs (2)
105var sourceText = parentNode.SyntaxTree.GetText(cancellationToken); 138var sourceText = parentNode.SyntaxTree.GetText(cancellationToken);
src\Analyzers\Core\Analyzers\Formatting\AbstractFormattingAnalyzer.cs (1)
49var oldText = tree.GetText(cancellationToken);
src\Analyzers\Core\Analyzers\RemoveUnnecessaryParentheses\AbstractRemoveUnnecessaryParenthesesDiagnosticAnalyzer.cs (1)
131var lines = parenthesizedExpression.SyntaxTree.GetText(cancellationToken).Lines;
Microsoft.CodeAnalysis.Features.Test.Utilities (4)
EditAndContinue\ActiveStatementsDescription.cs (1)
88var newText = newTree.GetText();
EditAndContinue\EditAndContinueTestVerifier.cs (1)
504var text = tree.GetText();
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (1)
418Generate(syntaxTree.GetText().ToString(), fileName);
EditAndContinue\RuntimeRudeEditDescription.cs (1)
14=> new RudeEditDiagnostic(kind, tree.GetText().Lines.GetTextSpan(new LinePositionSpan(position, position)), syntaxKind: 0, arguments).ToDiagnostic(tree).ToString();
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (1)
Diagnostics\PullDiagnosticTests.cs (1)
660var text = tree.GetText(CancellationToken.None).ToString();
Microsoft.CodeAnalysis.Rebuild (1)
CompilationFactory.cs (1)
85.Select(st => (path: st.FilePath, text: st.GetText()))
Microsoft.CodeAnalysis.Rebuild.UnitTests (3)
CompilationRebuildArtifactResolver.cs (1)
31.Select(x => x.GetText())
CSharpRebuildTests.cs (1)
38.Select(x => compilationFactory.CreateSyntaxTree(x.FilePath, x.GetText()))
DeterministicKeyBuilderTests.cs (1)
283var contentChecksum = GetChecksum(syntaxTree.GetText());
Microsoft.CodeAnalysis.ResxSourceGenerator.UnitTests (2)
Verifiers\CSharpSourceGeneratorVerifier`1+Test.cs (1)
141File.WriteAllText(filePath, tree.GetText().ToString(), tree.Encoding);
Verifiers\VisualBasicSourceGeneratorVerifier`1+Test.cs (1)
126File.WriteAllText(filePath, tree.GetText().ToString(), tree.Encoding);
Microsoft.CodeAnalysis.Test.Utilities (5)
Compilation\IRuntimeEnvironment.cs (1)
252.Select(t => (filePath: t.FilePath, text: t.GetText()))
CompilationVerifier.cs (1)
648ILValidation.GetSequencePointMarkers(xmlMethod, id => _compilation.SyntaxTrees.Single(tree => tree.FilePath == documentMap[id]).GetText()) :
Diagnostics\CommonDiagnosticAnalyzers.cs (1)
1826context.TryGetValue(treeContext.Tree.GetText(), _textValueProvider, out var length);
Diagnostics\DiagnosticDescription.cs (2)
161_squiggledText = _location.SourceTree.GetText().ToString(_location.SourceSpan); 543assertText.AppendLine(l.SourceTree.GetText().Lines.GetLineFromPosition(l.SourceSpan.Start).ToString());
Microsoft.CodeAnalysis.VisualBasic (6)
CommandLine\CommandLineDiagnosticFormatter.vb (1)
132text = diagnostic.Location.SourceTree.GetText()
Syntax\VisualBasicSyntaxTree.vb (5)
451Return GetDirectiveMap().TranslateSpan(GetText(cancellationToken), FilePath, span) 456Return GetDirectiveMap().GetLineVisibility(Me.GetText(cancellationToken), position) 460Return GetDirectiveMap().TranslateSpanAndVisibility(Me.GetText(), Me.FilePath, span, isHiddenPosition) 467Return If(map.Entries.Length = 1, Array.Empty(Of LineMapping)(), map.GetLineMappings(GetText(cancellationToken).Lines)) 487Return Me.GetText().Lines.GetLinePosition(position)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (3)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTokenExtensions.vb (1)
202Dim text = token.SyntaxTree.GetText()
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTreeExtensions.vb (2)
358Dim line = syntaxTree.GetText(cancellationToken).Lines(lineNumber) 363syntaxTree.GetText(cancellationToken).Lines.IndexOf(statement.SpanStart) = lineNumber Then
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Indentation\SpecialFormattingOperation.vb (1)
125Dim sourceText = node.SyntaxTree.GetText()
Microsoft.CodeAnalysis.VisualBasic.Features (6)
Debugging\ProximityExpressionsGetter.Worker.vb (2)
86Dim line = _syntaxTree.GetText(cancellationToken).Lines.IndexOf(_position) 89While nextStatement IsNot Nothing AndAlso _syntaxTree.GetText(cancellationToken).Lines.IndexOf(nextStatement.SpanStart) = line
DocumentationComments\VisualBasicDocumentationCommentSnippetService.vb (1)
230If position >= syntaxTree.GetText(cancellationToken).Length Then
EditAndContinue\BreakpointSpans.vb (1)
14Dim source = tree.GetText(cancellationToken)
Highlighting\KeywordHighlightingHelpers.vb (1)
88Dim text = node.SyntaxTree.GetText(cancellationToken)
Structure\Providers\XmlExpressionStructureProvider.vb (1)
27Dim line = syntaxTree.GetText(cancellationToken).Lines.GetLineFromPosition(span.Start)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (7)
Binding\BindingScopeTests.vb (1)
18Dim treeText As String = tree.GetText().ToString()
Compilation\MyTemplateTests.vb (3)
51Dim sourceText = MyTemplate.GetText() 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 (16)
DocumentationComments\DocCommentTests.vb (1)
12084Dim text As String = tree.GetText().ToString()
SymbolsTests\Source\SourceSymbolTests.vb (15)
341Assert.Equal("C", locs(0).SourceTree.GetText().ToString(locs(0).SourceSpan)) 343Assert.Equal("C", locs(1).SourceTree.GetText().ToString(locs(1).SourceSpan)) 350Assert.Equal("D", locs(0).SourceTree.GetText().ToString(locs(0).SourceSpan)) 352Assert.Equal("D", locs(1).SourceTree.GetText().ToString(locs(1).SourceSpan)) 359Assert.Equal("T", locs(0).SourceTree.GetText().ToString(locs(0).SourceSpan)) 361Assert.Equal("T", locs(1).SourceTree.GetText().ToString(locs(1).SourceSpan)) 367Assert.Equal("m1", locs(0).SourceTree.GetText().ToString(locs(0).SourceSpan)) 373Assert.Equal("x", locs(0).SourceTree.GetText().ToString(locs(0).SourceSpan)) 379Assert.Equal("v1$", locs(0).SourceTree.GetText().ToString(locs(0).SourceSpan)) 386Assert.Equal("N1", locs(0).SourceTree.GetText().ToString(locs(0).SourceSpan)) 388Assert.Equal("N1", locs(1).SourceTree.GetText().ToString(locs(1).SourceSpan)) 395Assert.Equal("N2", locs(0).SourceTree.GetText().ToString(locs(0).SourceSpan)) 397Assert.Equal("N2", locs(1).SourceTree.GetText().ToString(locs(1).SourceSpan)) 404Assert.Equal("N3", locs(0).SourceTree.GetText().ToString(locs(0).SourceSpan)) 406Assert.Equal("N3", locs(1).SourceTree.GetText().ToString(locs(1).SourceSpan))
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (19)
IncrementalParser\IncrementalParser.vb (5)
1121Dim oldIText = tree.GetText() 1143Dim fullText = fullTree.GetText() 1158Dim oldIText = tree.GetText() 1186Dim fullText = fullTree.GetText() 1204Dim oldText = tree.GetText()
LocationTests.vb (3)
56Dim s = tree.GetText().ToString() 63Dim text = tree.GetText() 255Dim text = tree.GetText()
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())
Syntax\SyntaxFactoryTests.vb (2)
14Dim text = SyntaxFactory.SyntaxTree(SyntaxFactory.CompilationUnit(), encoding:=Nothing).GetText() 21Dim text = SyntaxFactory.CompilationUnit().SyntaxTree.GetText()
Syntax\SyntaxTreeTests.vb (5)
18Assert.Equal(SourceHashAlgorithm.Sha1, tree.GetText().ChecksumAlgorithm) 114Dim newText = newTree.GetText() 131Dim newText = newTree.GetText() 154Dim newText = newTree.GetText() 168Dim newText = newTree.GetText()
TestSyntaxNodes.vb (1)
2349Dim position = tree.GetText().Lines(1).End
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (9)
CompilationTestUtils.vb (4)
659Dim text As String = tree.GetText().ToString() 667Dim text As String = tree.GetText().ToString() 1009Dim lineText As String = GetLineText(sourceLocation.SourceTree.GetText(), sourceLocation.SourceSpan.Start, offsetInLine) 1131Dim text As String = tree.GetText().ToString()
SemanticModelTestBase.vb (1)
23Dim text As String = tree.GetText().ToString()
SyntaxTreeExtensions.vb (4)
17Dim oldFullText = syntaxTree.GetText() 24Dim oldFullText = syntaxTree.GetText().ToString() 32Dim oldFullText = syntaxTree.GetText().ToString() 45Dim oldFullText = syntaxTree.GetText().ToString()
Microsoft.CodeAnalysis.VisualBasic.Workspaces (5)
Simplification\Reducers\VisualBasicEscapingReducer.vb (1)
153Dim text = parent.SyntaxTree.GetText(cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTokenExtensions.vb (1)
202Dim text = token.SyntaxTree.GetText()
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTreeExtensions.vb (2)
358Dim line = syntaxTree.GetText(cancellationToken).Lines(lineNumber) 363syntaxTree.GetText(cancellationToken).Lines.IndexOf(statement.SpanStart) = lineNumber Then
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Indentation\SpecialFormattingOperation.vb (1)
125Dim sourceText = node.SyntaxTree.GetText()
Microsoft.CodeAnalysis.Workspaces (14)
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
23var text = tree.GetText();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (2)
27var text = tree.GetText(cancellationToken); 105var text = tree.GetText(cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
166var textLine = baseToken.SyntaxTree.GetText(cancellationToken).Lines.GetLineFromPosition(baseToken.SpanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.StructuredTrivia.cs (4)
50if (root.SyntaxTree != null && root.SyntaxTree.GetText() != null) 52return root.SyntaxTree.GetText(); 56if (parent != null && parent.SyntaxTree != null && parent.SyntaxTree.GetText() != null) 58return parent.SyntaxTree.GetText();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\AbstractDocumentationCommentService.cs (1)
86var line = syntaxTree.GetText(cancellationToken).Lines.GetLineFromPosition(spanStart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (1)
151var line = tree.GetText().Lines.GetLineFromPosition(startPosition);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\AddParameterEditor.cs (2)
25var sourceText = declaration.SyntaxTree.GetText(cancellationToken); 159var text = parameters[0].SyntaxTree.GetText(cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (1)
55var text = root.SyntaxTree.GetText(cancellationToken);
Workspace\Solution\DocumentState.cs (1)
544static (tree, c) => tree.GetText(c),
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (2)
VisualStudioMSBuildWorkspaceTests.cs (2)
2895Assert.Null(doc2tree.GetText().Encoding); 2909Assert.Same(text.Encoding, doc3tree.GetText().Encoding);
Microsoft.CodeAnalysis.Workspaces.UnitTests (12)
FindReferencesTests.cs (3)
175.AddDocument(docId, "testFile", tree.GetText()); 214.AddDocument(docId, "testFile", tree.GetText()); 278.AddDocument(docId, "testFile", tree.GetText());
SolutionTests\SolutionTests.cs (6)
303Assert.Equal(SourceHashAlgorithm.Sha1, tree.GetText().ChecksumAlgorithm); 2482Assert.Equal(SourceHashAlgorithm.Sha1, root.SyntaxTree.GetText().ChecksumAlgorithm); 2511Assert.Equal(SourceHashAlgorithm.Sha1, root.SyntaxTree.GetText().ChecksumAlgorithm); 3202var text2 = tree2.GetText(); 4572var sourceText = strongTree.GetText(); 5480var treeText = newDocTree.GetText();
SymbolKeyTests.cs (1)
1416var text = syntaxTree.GetText();
SyntaxPathTests.cs (2)
429var oldFullText = syntaxTree.GetText(); 437offset: syntaxTree.GetText().ToString().IndexOf(oldText, startIndex, StringComparison.Ordinal),
Microsoft.VisualStudio.LanguageServices (6)
CallHierarchy\CallHierarchyDetail.cs (3)
44var start = location.SourceTree.GetText().Lines[lineSpan.StartLinePosition.Line].Start; 45var end = location.SourceTree.GetText().Lines[lineSpan.EndLinePosition.Line].End; 46return location.SourceTree.GetText().GetSubText(TextSpan.FromBounds(start, end)).ToString();
Diagnostics\VisualStudioVenusSpanMappingService.cs (1)
75return location.SourceTree.GetText().Lines;
Progression\GraphQueries\IsUsedByGraphQuery.cs (1)
56var lineText = location.SourceTree.GetText(cancellationToken).Lines[span.StartLinePosition.Line].ToString();
TaskList\ProjectExternalErrorReporter.cs (1)
320var text = tree.GetText();
Microsoft.VisualStudio.LanguageServices.CSharp (3)
CodeModel\CSharpCodeModelService.cs (3)
1274var text = memberDeclaration.SyntaxTree.GetText(CancellationToken.None); 1354var text = memberDeclaration.SyntaxTree.GetText(CancellationToken.None); 1412var text = memberDeclaration.SyntaxTree.GetText(CancellationToken.None);
Microsoft.VisualStudio.LanguageServices.VisualBasic (3)
CodeModel\VisualBasicCodeModelService.vb (3)
2251Dim text = member.SyntaxTree.GetText(CancellationToken.None) 2480Dim text = member.SyntaxTree.GetText(CancellationToken.None) 2506Dim text = member.SyntaxTree.GetText(CancellationToken.None)
Roslyn.Diagnostics.Analyzers (1)
src\RoslynAnalyzers\Utilities\Refactoring\Extensions\SyntaxTreeExtensions.cs (1)
21var text = tree.GetText(cancellationToken);