3 overrides of GetSubText
Microsoft.CodeAnalysis (3)
Text\ChangedText.cs (1)
142public override SourceText GetSubText(TextSpan span)
Text\CompositeText.cs (1)
83public override SourceText GetSubText(TextSpan span)
Text\SubText.cs (1)
78public override SourceText GetSubText(TextSpan span)
53 references to GetSubText
Microsoft.CodeAnalysis (7)
Text\ChangedText.cs (1)
144return _newText.GetSubText(span);
Text\CompositeText.cs (3)
102AddSegments(newSegments, segment.GetSubText(new TextSpan(segOffset, copyLength))); 222segments[i - 1] = prevSegment.GetSubText(new TextSpan(0, prevSegment.Length - 1)); 224segments[i + 1] = curSegment.GetSubText(new TextSpan(1, curSegment.Length - 1));
Text\SourceText.cs (3)
534return this.GetSubText(new TextSpan(start, this.Length - start)); 798var subText = this.GetSubText(new TextSpan(position, change.Span.Start - position)); 821var subText = this.GetSubText(new TextSpan(position, this.Length - position));
Microsoft.CodeAnalysis.CodeStyle (2)
src\Analyzers\Core\Analyzers\Formatting\AbstractFormattingAnalyzer.cs (2)
72if (oldText.GetSubText(new TextSpan(change.Span.Start + offset, change.NewText.Length)).ContentEquals(SourceText.From(change.NewText))) 81if (oldText.GetSubText(new TextSpan(change.Span.Start, change.NewText.Length)).ContentEquals(SourceText.From(change.NewText)))
Microsoft.CodeAnalysis.CSharp (1)
Parser\Lexer.cs (1)
2010var text = TextWindow.Text.GetSubText(TextSpan.FromBounds(savePosition, TextWindow.Position));
Microsoft.CodeAnalysis.CSharp.EditorFeatures (3)
InlineRename\CSharpEditorInlineRenameService.cs (1)
165resultBuilder.Add((filePath, documentText.GetSubText(surroundingSpanOfInterest.Value).ToString()));
StringCopyPaste\StringCopyPasteCommandHandler.cs (2)
300var originalStringContentsAfterPaste = snapshotAfterPaste.AsText().GetSubText(spanAfterPaste); 301var newStringContentsAfterEdit = newTextAfterChanges.GetSubText(spanAfterPaste);
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.Syntax.UnitTests (2)
Diagnostics\LineSpanDirectiveTests.cs (1)
488return $"[|{mappedText.GetSubText(span)}|]";
Diagnostics\LocationsTests.cs (1)
77return tree.GetLineMappings().Select(mapping => $"[|{text.GetSubText(text.Lines.GetTextSpan(mapping.Span))}|] -> {(mapping.IsHidden ? "<hidden>" : mapping.MappedSpan)}");
Microsoft.CodeAnalysis.EditorFeatures (1)
TextDiffing\EditorTextDifferencingService.cs (1)
45newText.GetSubText(diffResult.RightDecomposition.GetSpanInOriginal(d.Right).ToTextSpan()).ToString()))];
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (2)
FindReferences\FindReferencesTests.vb (2)
409builder.Append(text.GetSubText(New TextSpan(position, span.Start - position))) 416builder.Append(text.GetSubText(New TextSpan(position, text.Length - position)))
Microsoft.CodeAnalysis.Features (6)
Completion\Providers\Snippets\AbstractSnippetCompletionProvider.cs (1)
56var snippetText = allChangesText.GetSubText(textSpan).ToString();
EditAndContinue\EditSession.cs (2)
218if (oldLineSpan != newLineSpan || !oldText.GetSubText(oldLineSpan).ContentEquals(newText.GetSubText(newLineSpan)))
src\Analyzers\Core\Analyzers\Formatting\AbstractFormattingAnalyzer.cs (2)
72if (oldText.GetSubText(new TextSpan(change.Span.Start + offset, change.NewText.Length)).ContentEquals(SourceText.From(change.NewText))) 81if (oldText.GetSubText(new TextSpan(change.Span.Start, change.NewText.Length)).ContentEquals(SourceText.From(change.NewText)))
ValueTracking\ValueTrackedItem.cs (1)
40var subText = SourceText.GetSubText(Span);
Microsoft.CodeAnalysis.Features.Test.Utilities (2)
EditAndContinue\EditAndContinueTestVerifier.cs (2)
426throw new Exception($"Unable to find node with span {span} `{root.GetText().GetSubText(span)}` in:{Environment.NewLine}{root}"); 508var code = text.GetSubText(text.Lines.GetTextSpan(span.Span)).ToString().Replace("\r\n", " ");
Microsoft.CodeAnalysis.LanguageServer.Protocol (4)
Handler\Completion\CompletionHandler.cs (1)
194var filterText = sourceText.GetSubText(completionList.Span).ToString();
Handler\Completion\CompletionResultFactory.cs (1)
75var typedText = documentText.GetSubText(defaultSpan).ToString();
Handler\InlineCompletions\InlineCompletionsHandler.cs (2)
138var wordText = sourceText.GetSubText(wordOnLeft.Value).ToString(); 230var formattedLspSnippetText = formattedText.GetSubText(spanContainingFormattedSnippet).WithChanges(lspTextChanges);
Microsoft.CodeAnalysis.Test.Utilities (1)
Metadata\ILValidation.cs (1)
473var subtext = text.GetSubText(span);
Microsoft.CodeAnalysis.UnitTests (7)
Text\TextChangeTests.cs (7)
41var subText = text.GetSubText(new TextSpan(0, 5)); 49var subText = text.GetSubText(new TextSpan(6, 5)); 57var subText = text.GetSubText(new TextSpan(4, 3)); 65var subText = text.GetSubText(new TextSpan(0, 5)); 66var subSubText = subText.GetSubText(new TextSpan(0, 0)); 217var subText = newText.GetSubText(new TextSpan(3, 4)); 415var subtext = text.GetSubText(new TextSpan(5, 10));
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (1)
LocationTests.vb (1)
64Return tree.GetLineMappings().Select(Function(mapping) $"[|{text.GetSubText(text.Lines.GetTextSpan(mapping.Span))}|] -> {If(mapping.IsHidden, "<hidden>", mapping.MappedSpan.ToString())}")
Microsoft.CodeAnalysis.Workspaces (2)
LinkedFileDiffMerging\AbstractLinkedFileMergeConflictCommentAdditionService.cs (2)
74var oldText = oldDocumentText.GetSubText(TextSpan.FromBounds(startLineStartPosition, endLineEndPosition)); 144? text.GetSubText(TextSpan.FromBounds(text.Lines[startLine].Start, text.Lines[endLine].End)).ToString()
Microsoft.VisualStudio.LanguageServices (6)
CallHierarchy\CallHierarchyDetail.cs (1)
46return location.SourceTree.GetText().GetSubText(TextSpan.FromBounds(start, end)).ToString();
FindReferences\Entries\AbstractDocumentSpanEntry.cs (1)
106return text.GetSubText(line.Span);
Preview\FileChange.cs (2)
107var leftText = oldText.GetSubText(leftSpan.ToTextSpan()).ToString(); 108var rightText = newText.GetSubText(rightSpan.ToTextSpan()).ToString();
Venus\ContainedDocument.DocumentServiceProvider.cs (2)
282return (line.Snapshot.AsText().GetSubText(contentSpan.Span.ToTextSpan()), GetSpanOnContent(primarySpan.Span.ToTextSpan(), contentSpan.Span.ToTextSpan())); 287return (line.Snapshot.AsText().GetSubText(contentSpan.Span.ToTextSpan()), GetSpanOnContent(primarySpan.Span.ToTextSpan(), contentSpan.Span.ToTextSpan()));
Microsoft.VisualStudio.LanguageServices.CSharp (1)
LanguageService\CSharpHelpContextService.cs (1)
85return text.GetSubText(TextSpan.FromBounds(start, end)).ToString();
Microsoft.VisualStudio.LanguageServices.UnitTests (1)
Venus\DocumentService_IntegrationTests.vb (1)
327Return New ExcerptResult(mappedSource.GetSubText(line.Span), New TextSpan(mappedSpan.Start - line.Start, mappedSpan.Length), ImmutableArray.Create(New ClassifiedSpan(New TextSpan(0, line.Span.Length), ClassificationTypeNames.Text)), document, span)