73 instantiations of TextChangeRange
Microsoft.CodeAnalysis (19)
InternalUtilities\TextChangeRangeExtensions.cs (7)
99return new TextChangeRange(TextSpan.FromBounds(currentStart, currentOldEnd), currentNewEnd - currentStart); 104return new TextChangeRange(textChange.Span, textChange.NewText?.Length ?? 0); 224addAndAdjustOldDelta(builder, ref oldDelta, new TextChangeRange(new TextSpan(oldChange.Span.Start, oldChangeLeadingDeletion), oldChangeLeadingInsertion)); 225oldChange = new TextChangeRange(new TextSpan(newChange.SpanStart - oldDelta, oldChange.Span.Length - oldChangeLeadingDeletion), oldChange.NewLength - oldChangeLeadingInsertion); 260oldChange = new TextChangeRange(oldChange.Span, oldChange.NewLength - newChange.SpanLength); 379add(builder, new TextChangeRange(new TextSpan(newChange.SpanStart - oldDelta, newChange.SpanLength), newChange.NewLength)); 390builder[^1] = new TextChangeRange(new TextSpan(last.Span.Start, last.Span.Length + change.Span.Length), last.NewLength + change.NewLength);
Syntax\SyntaxDiffer.cs (7)
535RecordChange(new ChangeRecord(new TextChangeRange(oldSpan, 0), removedNodes, null)); 549RecordChange(new TextChangeRange(oldSpan, newSpan.Length), removedNode, insertedNode); 559RecordChange(new ChangeRecord(new TextChangeRange(oldSpan, newSpan.Length), removedNodes, insertedNodes)); 569RecordChange(new ChangeRecord(new TextChangeRange(new TextSpan(start, 0), newSpan.Length), null, insertedNodes)); 581new TextChangeRange(new TextSpan(last.Range.Span.Start, last.Range.Span.Length + change.Range.Span.Length), last.Range.NewLength + change.Range.NewLength), 604new TextChangeRange(new TextSpan(last.Range.Span.Start, last.Range.Span.Length + textChangeRange.Span.Length), last.Range.NewLength + textChangeRange.NewLength), 762range = new TextChangeRange(
Text\ChangedText.cs (1)
207return ImmutableArray.Create(new TextChangeRange(new TextSpan(0, oldText.Length), _newText.Length));
Text\SourceText.cs (2)
700changeRanges.Add(new TextChangeRange(change.Span, newTextLength)); 780return ImmutableArray.Create(new TextChangeRange(new TextSpan(0, oldText.Length), this.Length));
Text\TextChange.cs (1)
91return new TextChangeRange(change.Span, change.NewText.Length);
Text\TextChangeRange.cs (1)
129return new TextChangeRange(combined, newLen);
Microsoft.CodeAnalysis.CodeStyle (7)
TextChangeRangeExtensions.cs (7)
99return new TextChangeRange(TextSpan.FromBounds(currentStart, currentOldEnd), currentNewEnd - currentStart); 104return new TextChangeRange(textChange.Span, textChange.NewText?.Length ?? 0); 224addAndAdjustOldDelta(builder, ref oldDelta, new TextChangeRange(new TextSpan(oldChange.Span.Start, oldChangeLeadingDeletion), oldChangeLeadingInsertion)); 225oldChange = new TextChangeRange(new TextSpan(newChange.SpanStart - oldDelta, oldChange.Span.Length - oldChangeLeadingDeletion), oldChange.NewLength - oldChangeLeadingInsertion); 260oldChange = new TextChangeRange(oldChange.Span, oldChange.NewLength - newChange.SpanLength); 379add(builder, new TextChangeRange(new TextSpan(newChange.SpanStart - oldDelta, newChange.SpanLength), newChange.NewLength)); 390builder[^1] = new TextChangeRange(new TextSpan(last.Span.Start, last.Span.Length + change.Span.Length), last.NewLength + change.NewLength);
Microsoft.CodeAnalysis.CSharp (2)
Parser\Blender.cs (1)
160return new TextChangeRange(finalSpan, finalLength);
Syntax\CSharpSyntaxTree.cs (1)
550return this.WithChanges(newText, new[] { new TextChangeRange(new TextSpan(0, this.Length), newText.Length) });
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1)
Semantics\TopLevelStatementsTests.cs (1)
8779(CSharpSyntaxNode)oldTree.GetRoot(), new[] { new TextChangeRange(new TextSpan(282, 0), 1) });
Microsoft.CodeAnalysis.EditorFeatures (3)
Shared\Extensions\TextChangeExtensions.cs (1)
13=> new(textChange.OldSpan.ToTextSpan(), textChange.NewLength);
Tagging\AbstractAsynchronousTaggerProvider.TagSource_ProduceTags.cs (2)
89var textChangeRange = new TextChangeRange(new TextSpan(c.OldSpan.Start, c.OldSpan.Length), c.NewLength); 101textChangeRanges.Add(new TextChangeRange(new TextSpan(c.OldSpan.Start, c.OldSpan.Length), c.NewLength));
Microsoft.CodeAnalysis.EditorFeatures.Text (5)
Extensions.SnapshotSourceText.cs (4)
304return new[] { new TextChangeRange(new TextSpan(0, oldText.Length), this.Length) }; 355return ImmutableArray.Create(new TextChangeRange(new TextSpan(0, oldTextLength), this.Length)); 441return new TextChangeRange(new TextSpan(change.OldSpan.Start, change.OldSpan.Length), change.NewLength); 445return new TextChangeRange(new TextSpan(change.NewSpan.Start, change.NewSpan.Length), change.OldLength);
Extensions.TextBufferContainer.cs (1)
113var changes = ImmutableArray.CreateRange(args.Changes.Select(c => new TextChangeRange(new TextSpan(c.OldSpan.Start, c.OldSpan.Length), c.NewLength)));
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (1)
Classification\SyntacticChangeRangeComputerTests.vb (1)
37Dim expectedChange = New TextChangeRange(
Microsoft.CodeAnalysis.UnitTests (25)
Text\TextChangeRangeTest.cs (10)
20() => { var notUsed = new TextChangeRange(new TextSpan(), -1); }); 27var range = new TextChangeRange(span, 42); 38EqualityUnit.Create(new TextChangeRange()).WithEqualValues(new TextChangeRange()), 39EqualityUnit.Create(new TextChangeRange(new TextSpan(42, 2), 13)).WithEqualValues(new TextChangeRange(new TextSpan(42, 2), 13)), 40EqualityUnit.Create(new TextChangeRange(new TextSpan(42, 2), 13)).WithNotEqualValues(new TextChangeRange(new TextSpan(42, 2), 5)), 41EqualityUnit.Create(new TextChangeRange(new TextSpan(42, 2), 13)).WithNotEqualValues(new TextChangeRange(new TextSpan(42, 4), 13)));
Text\TextChangeTests.cs (15)
926new TextChangeRange(new TextSpan(919, 10), 466), 927new TextChangeRange(new TextSpan(936, 33), 29), 928new TextChangeRange(new TextSpan(1098, 0), 70), 929new TextChangeRange(new TextSpan(1125, 4), 34), 930new TextChangeRange(new TextSpan(1138, 0), 47)); 932new TextChangeRange(new TextSpan(997, 0), 2), 933new TextChangeRange(new TextSpan(1414, 0), 2), 934new TextChangeRange(new TextSpan(1419, 0), 2), 935new TextChangeRange(new TextSpan(1671, 5), 5), 936new TextChangeRange(new TextSpan(1681, 0), 4)); 941new TextChangeRange(new TextSpan(919, 10), 468), 942new TextChangeRange(new TextSpan(936, 33), 33), 943new TextChangeRange(new TextSpan(1098, 0), 70), 944new TextChangeRange(new TextSpan(1125, 4), 38), 945new TextChangeRange(new TextSpan(1138, 0), 47));
Microsoft.CodeAnalysis.VisualBasic (2)
Scanner\Blender.vb (1)
222_affectedRange = New TextChangeRange(span, span.Length - _change.Span.Length + _change.NewLength)
Syntax\VisualBasicSyntaxTree.vb (1)
108Return Me.WithChanges(newText, {New TextChangeRange(New TextSpan(0, Me.Length), newText.Length)})
Microsoft.CodeAnalysis.Workspaces (8)
Classification\SyntaxClassification\SyntacticChangeRangeComputer.cs (1)
113return new TextChangeRange(
TextChangeRangeExtensions.cs (7)
99return new TextChangeRange(TextSpan.FromBounds(currentStart, currentOldEnd), currentNewEnd - currentStart); 104return new TextChangeRange(textChange.Span, textChange.NewText?.Length ?? 0); 224addAndAdjustOldDelta(builder, ref oldDelta, new TextChangeRange(new TextSpan(oldChange.Span.Start, oldChangeLeadingDeletion), oldChangeLeadingInsertion)); 225oldChange = new TextChangeRange(new TextSpan(newChange.SpanStart - oldDelta, oldChange.Span.Length - oldChangeLeadingDeletion), oldChange.NewLength - oldChangeLeadingInsertion); 260oldChange = new TextChangeRange(oldChange.Span, oldChange.NewLength - newChange.SpanLength); 379add(builder, new TextChangeRange(new TextSpan(newChange.SpanStart - oldDelta, newChange.SpanLength), newChange.NewLength)); 390builder[^1] = new TextChangeRange(new TextSpan(last.Span.Start, last.Span.Length + change.Span.Length), last.NewLength + change.NewLength);
190 references to TextChangeRange
Microsoft.CodeAnalysis (77)
InternalUtilities\TextChangeRangeExtensions.cs (21)
17public static TextChangeRange? Accumulate(this TextChangeRange? accumulatedTextChangeSoFar, IEnumerable<TextChangeRange> changesInNextVersion) 28var newChange = TextChangeRange.Collapse(changesInNextVersion); 102public static TextChangeRange ToTextChangeRange(this TextChange textChange) 116public static ImmutableArray<TextChangeRange> Merge(ImmutableArray<TextChangeRange> oldChanges, ImmutableArray<TextChangeRange> newChanges) 129var builder = ArrayBuilder<TextChangeRange>.GetInstance(); 131var oldChange = oldChanges[0]; 369static void addAndAdjustOldDelta(ArrayBuilder<TextChangeRange> builder, ref int oldDelta, TextChangeRange oldChange) 376static void adjustAndAddNewChange(ArrayBuilder<TextChangeRange> builder, int oldDelta, UnadjustedNewChange newChange) 382static void add(ArrayBuilder<TextChangeRange> builder, TextChangeRange change) 386var last = builder[^1]; 405/// Represents a new change being processed by <see cref="Merge(ImmutableArray&lt;TextChangeRange&gt;, ImmutableArray&lt;TextChangeRange&gt;)"/>. 428public UnadjustedNewChange(TextChangeRange range) 434private static int NewEnd(this TextChangeRange range) => range.Span.Start + range.NewLength;
Syntax\SyntaxDiffer.cs (6)
518public readonly TextChangeRange Range; 522internal ChangeRecord(TextChangeRange range, Queue<SyntaxNodeOrToken>? oldNodes, Queue<SyntaxNodeOrToken>? newNodes) 593private void RecordChange(TextChangeRange textChangeRange, in SyntaxNodeOrToken removedNode, SyntaxNodeOrToken insertedNode) 728public readonly TextChangeRange Range; 731public ChangeRangeWithText(TextChangeRange range, string? newText) 750var range = cr.Range;
Syntax\SyntaxTreeExtensions.cs (2)
20internal static void VerifySource(this SyntaxTree tree, IEnumerable<TextChangeRange>? changes = null) 31var change = TextChangeRange.Collapse(changes).Span;
Text\ChangedText.cs (17)
20public ChangedText(SourceText oldText, SourceText newText, ImmutableArray<TextChangeRange> changeRanges) 35SourceText oldText, SourceText newText, ImmutableArray<TextChangeRange> changeRanges) 38foreach (var change in changeRanges) 45foreach (var change in changeRanges) 62public ImmutableArray<TextChangeRange> ChangeRanges { get; } 70public ChangeInfo(ImmutableArray<TextChangeRange> changeRanges, WeakReference<SourceText> weakOldText, ChangeInfo? previous) 108public IEnumerable<TextChangeRange> Changes 170public override IReadOnlyList<TextChangeRange> GetChangeRanges(SourceText oldText) 179return TextChangeRange.NoChanges; 224private static IReadOnlyList<ImmutableArray<TextChangeRange>> GetChangesBetween(SourceText oldText, ChangedText newText) 226var list = new List<ImmutableArray<TextChangeRange>>(); 253private static ImmutableArray<TextChangeRange> Merge(IReadOnlyList<ImmutableArray<TextChangeRange>> changeSets) 293foreach (var change in _info.ChangeRanges) 369public static ImmutableArray<TextChangeRange> Merge(ImmutableArray<TextChangeRange> oldChanges, ImmutableArray<TextChangeRange> newChanges)
Text\SourceText.cs (5)
651var changeRanges = ArrayBuilder<TextChangeRange>.GetInstance(); 763/// Gets the set of <see cref="TextChangeRange"/> that describe how the text changed 767public virtual IReadOnlyList<TextChangeRange> GetChangeRanges(SourceText oldText) 776return TextChangeRange.NoChanges; 796foreach (var range in ranges)
Text\TextChange.cs (2)
85/// Converts a <see cref="TextChange"/> to a <see cref="TextChangeRange"/>. 88public static implicit operator TextChangeRange(TextChange change)
Text\TextChangeEventArgs.cs (4)
24public TextChangeEventArgs(SourceText oldText, SourceText newText, IEnumerable<TextChangeRange> changes) 42public TextChangeEventArgs(SourceText oldText, SourceText newText, params TextChangeRange[] changes) 43: this(oldText, newText, (IEnumerable<TextChangeRange>)changes) 60public IReadOnlyList<TextChangeRange> Changes { get; }
Text\TextChangeRange.cs (20)
16public readonly struct TextChangeRange : IEquatable<TextChangeRange> 31/// Initializes a new instance of <see cref="TextChangeRange"/>. 48/// Compares current instance of <see cref="TextChangeRange"/> to another. 50public bool Equals(TextChangeRange other) 58/// Compares current instance of <see cref="TextChangeRange"/> to another. 62return obj is TextChangeRange range && Equals(range); 66/// Provides hash code for current instance of <see cref="TextChangeRange"/>. 75/// Determines if two instances of <see cref="TextChangeRange"/> are same. 77public static bool operator ==(TextChangeRange left, TextChangeRange right) 83/// Determines if two instances of <see cref="TextChangeRange"/> are different. 85public static bool operator !=(TextChangeRange left, TextChangeRange right) 93public static IReadOnlyList<TextChangeRange> NoChanges => SpecializedCollections.EmptyReadOnlyList<TextChangeRange>(); 96/// Collapse a set of <see cref="TextChangeRange"/>s into a single encompassing range. If 99public static TextChangeRange Collapse(IEnumerable<TextChangeRange> changes) 105foreach (var change in changes) 123return default(TextChangeRange);
Microsoft.CodeAnalysis.CodeStyle (23)
J\s\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (2)
20internal static void VerifySource(this SyntaxTree tree, IEnumerable<TextChangeRange>? changes = null) 31var change = TextChangeRange.Collapse(changes).Span;
TextChangeRangeExtensions.cs (21)
17public static TextChangeRange? Accumulate(this TextChangeRange? accumulatedTextChangeSoFar, IEnumerable<TextChangeRange> changesInNextVersion) 28var newChange = TextChangeRange.Collapse(changesInNextVersion); 102public static TextChangeRange ToTextChangeRange(this TextChange textChange) 116public static ImmutableArray<TextChangeRange> Merge(ImmutableArray<TextChangeRange> oldChanges, ImmutableArray<TextChangeRange> newChanges) 129var builder = ArrayBuilder<TextChangeRange>.GetInstance(); 131var oldChange = oldChanges[0]; 369static void addAndAdjustOldDelta(ArrayBuilder<TextChangeRange> builder, ref int oldDelta, TextChangeRange oldChange) 376static void adjustAndAddNewChange(ArrayBuilder<TextChangeRange> builder, int oldDelta, UnadjustedNewChange newChange) 382static void add(ArrayBuilder<TextChangeRange> builder, TextChangeRange change) 386var last = builder[^1]; 405/// Represents a new change being processed by <see cref="Merge(ImmutableArray&lt;TextChangeRange&gt;, ImmutableArray&lt;TextChangeRange&gt;)"/>. 428public UnadjustedNewChange(TextChangeRange range) 434private static int NewEnd(this TextChangeRange range) => range.Span.Start + range.NewLength;
Microsoft.CodeAnalysis.CSharp (15)
Parser\Blender.cs (9)
22private readonly ImmutableStack<TextChangeRange> _changes; 38public Blender(Lexer lexer, CSharp.CSharpSyntaxNode oldTree, IEnumerable<TextChangeRange> changes) 42_changes = ImmutableStack.Create<TextChangeRange>(); 59var collapsed = TextChangeRange.Collapse(changes); 64var affectedRange = ExtendToAffectedRange(oldTree, collapsed); 89ImmutableStack<TextChangeRange> changes, 114private static TextChangeRange ExtendToAffectedRange( 116TextChangeRange changeRange)
Parser\Blender.Reader.cs (2)
22private ImmutableStack<TextChangeRange> _changes; 134var change = _changes.Peek();
Parser\LanguageParser.cs (1)
39IEnumerable<TextChangeRange>? changes,
Parser\SyntaxParser.cs (1)
47IEnumerable<TextChangeRange> changes,
Syntax\CSharpSyntaxTree.cs (2)
553private SyntaxTree WithChanges(SourceText newText, IReadOnlyList<TextChangeRange> changes) 560IReadOnlyList<TextChangeRange>? workingChanges = changes;
Microsoft.CodeAnalysis.CSharp.Features (1)
BraceCompletion\AbstractCurlyBraceOrBracketCompletionService.cs (1)
188foreach (var newRange in newRanges)
Microsoft.CodeAnalysis.EditorFeatures (10)
Classification\Syntactic\SyntacticClassificationTaggerProvider.TagComputer.cs (2)
324ValueTask<TextChangeRange?> ComputeChangedRangeAsync() 334return new ValueTask<TextChangeRange?>();
Shared\Extensions\TextChangeExtensions.cs (1)
12public static TextChangeRange ToTextChangeRange(this ITextChange textChange)
Tagging\AbstractAsynchronousTaggerProvider.TagSource.cs (2)
122private TextChangeRange? _accumulatedTextChanges_doNotAccessDirectly; 333private TextChangeRange? AccumulatedTextChanges
Tagging\AbstractAsynchronousTaggerProvider.TagSource_ProduceTags.cs (2)
89var textChangeRange = new TextChangeRange(new TextSpan(c.OldSpan.Start, c.OldSpan.Length), c.NewLength); 99using var _ = ArrayBuilder<TextChangeRange>.GetInstance(count, out var textChangeRanges);
Tagging\TaggerContext.cs (3)
36public TextChangeRange? TextChangeRange { get; } 52TextChangeRange? textChangeRange = null) 62TextChangeRange? textChangeRange,
Microsoft.CodeAnalysis.EditorFeatures.Text (14)
Extensions.SnapshotSourceText.cs (14)
289public override IReadOnlyList<TextChangeRange> GetChangeRanges(SourceText oldText) 299return TextChangeRange.NoChanges; 319public override IReadOnlyList<TextChangeRange> GetChangeRanges(SourceText oldText) 329return TextChangeRange.NoChanges; 347private IReadOnlyList<TextChangeRange> GetChangeRanges(ITextImage? oldImage, int oldTextLength, ITextImage? newImage) 360return TextChangeRange.NoChanges; 376private static readonly Func<ITextChange, TextChangeRange> s_forwardTextChangeRange = c => CreateTextChangeRange(c, forward: true); 377private static readonly Func<ITextChange, TextChangeRange> s_backwardTextChangeRange = c => CreateTextChangeRange(c, forward: false); 379private static IReadOnlyList<TextChangeRange> GetChangeRanges(ITextImage snapshot1, ITextImage snapshot2, bool forward) 407return ImmutableArray.Create<TextChangeRange>(); 415private static TextChangeRange GetChangeRanges(ITextImageVersion oldVersion, ITextImageVersion newVersion, bool forward) 417TextChangeRange? range = null; 428private static IEnumerable<IEnumerable<TextChangeRange>> GetMultipleVersionTextChanges( 437private static TextChangeRange CreateTextChangeRange(ITextChange change, bool forward)
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (3)
Classification\ClassificationTests.vb (3)
362Public Function ComputeSyntacticChangeRangeAsync(oldDocument As Document, newDocument As Document, timeout As TimeSpan, cancellationToken As CancellationToken) As ValueTask(Of TextChangeRange?) Implements IClassificationService.ComputeSyntacticChangeRangeAsync 363Return New ValueTask(Of TextChangeRange?) 366Public Function ComputeSyntacticChangeRange(services As SolutionServices, oldRoot As SyntaxNode, newRoot As SyntaxNode, timeout As TimeSpan, cancellationToken As CancellationToken) As TextChangeRange? Implements IClassificationService.ComputeSyntacticChangeRange
Microsoft.CodeAnalysis.ExternalAccess.FSharp (2)
Internal\Classification\FSharpClassificationService.cs (2)
64public TextChangeRange? ComputeSyntacticChangeRange(SolutionServices services, SyntaxNode oldRoot, SyntaxNode newRoot, TimeSpan timeout, CancellationToken cancellationToken) 70public ValueTask<TextChangeRange?> ComputeSyntacticChangeRangeAsync(Document oldDocument, Document newDocument, TimeSpan timeout, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.Features (4)
ExternalAccess\UnitTesting\SolutionCrawler\AbstractUnitTestingDocumentDifferenceService.cs (1)
45var range = newText.GetEncompassingTextChangeRange(oldText);
SolutionCrawler\AbstractDocumentDifferenceService.cs (3)
46var range = newText.GetEncompassingTextChangeRange(oldText); 104ISyntaxFactsService syntaxFactsService, SyntaxNode oldRoot, SyntaxNode newRoot, TextChangeRange range) 138ISyntaxFactsService syntaxFactsService, SyntaxNode oldRoot, SyntaxNode newRoot, TextChangeRange range)
Microsoft.CodeAnalysis.UnitTests (3)
Text\TextChangeRangeTest.cs (2)
20() => { var notUsed = new TextChangeRange(new TextSpan(), -1); }); 27var range = new TextChangeRange(span, 42);
Text\TextChangeTests.cs (1)
946Assert.Equal<TextChangeRange>(expected, merged);
Microsoft.CodeAnalysis.VisualBasic (5)
Scanner\Blender.vb (4)
27Private ReadOnly _change As TextChangeRange 32Private ReadOnly _affectedRange As TextChangeRange 185changes As TextChangeRange(), 206_change = TextChangeRange.Collapse(changes)
Syntax\VisualBasicSyntaxTree.vb (1)
114Private Function WithChanges(newText As SourceText, changes As TextChangeRange()) As SyntaxTree
Microsoft.CodeAnalysis.Workspaces (33)
Classification\AbstractClassificationService.cs (2)
216public ValueTask<TextChangeRange?> ComputeSyntacticChangeRangeAsync(Document oldDocument, Document newDocument, TimeSpan timeout, CancellationToken cancellationToken) 219public TextChangeRange? ComputeSyntacticChangeRange(SolutionServices services, SyntaxNode oldRoot, SyntaxNode newRoot, TimeSpan timeout, CancellationToken cancellationToken)
Classification\IClassificationService.cs (2)
88ValueTask<TextChangeRange?> ComputeSyntacticChangeRangeAsync( 96TextChangeRange? ComputeSyntacticChangeRange(
Classification\SyntaxClassification\AbstractSyntaxClassificationService.cs (1)
63public TextChangeRange? ComputeSyntacticChangeRange(SyntaxNode oldRoot, SyntaxNode newRoot, TimeSpan timeout, CancellationToken cancellationToken)
Classification\SyntaxClassification\ISyntaxClassificationService.cs (1)
59TextChangeRange? ComputeSyntacticChangeRange(
Classification\SyntaxClassification\SyntacticChangeRangeComputer.cs (1)
41public static TextChangeRange ComputeSyntacticChangeRange(SyntaxNode oldRoot, SyntaxNode newRoot, TimeSpan timeout, CancellationToken cancellationToken)
J\s\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (2)
20internal static void VerifySource(this SyntaxTree tree, IEnumerable<TextChangeRange>? changes = null) 31var change = TextChangeRange.Collapse(changes).Span;
Shared\Extensions\SourceTextExtensions.cs (2)
45public static TextChangeRange GetEncompassingTextChangeRange(this SourceText newText, SourceText oldText) 59return TextChangeRange.Collapse(ranges);
TextChangeRangeExtensions.cs (21)
17public static TextChangeRange? Accumulate(this TextChangeRange? accumulatedTextChangeSoFar, IEnumerable<TextChangeRange> changesInNextVersion) 28var newChange = TextChangeRange.Collapse(changesInNextVersion); 102public static TextChangeRange ToTextChangeRange(this TextChange textChange) 116public static ImmutableArray<TextChangeRange> Merge(ImmutableArray<TextChangeRange> oldChanges, ImmutableArray<TextChangeRange> newChanges) 129var builder = ArrayBuilder<TextChangeRange>.GetInstance(); 131var oldChange = oldChanges[0]; 369static void addAndAdjustOldDelta(ArrayBuilder<TextChangeRange> builder, ref int oldDelta, TextChangeRange oldChange) 376static void adjustAndAddNewChange(ArrayBuilder<TextChangeRange> builder, int oldDelta, UnadjustedNewChange newChange) 382static void add(ArrayBuilder<TextChangeRange> builder, TextChangeRange change) 386var last = builder[^1]; 405/// Represents a new change being processed by <see cref="Merge(ImmutableArray&lt;TextChangeRange&gt;, ImmutableArray&lt;TextChangeRange&gt;)"/>. 428public UnadjustedNewChange(TextChangeRange range) 434private static int NewEnd(this TextChangeRange range) => range.Span.Start + range.NewLength;
Workspace\Solution\DocumentState.cs (1)
249var change = newText.GetEncompassingTextChangeRange(oldText);