67 references to TextChangeRange
Microsoft.CodeAnalysis (19)
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)
206return ImmutableArray.Create(new TextChangeRange(new TextSpan(0, oldText.Length), _newText.Length));
Text\SourceText.cs (2)
810changeRanges.Add(new TextChangeRange(change.Span, newTextLength)); 890return 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);
Text\TextChangeRangeExtensions.cs (7)
100return new TextChangeRange(TextSpan.FromBounds(currentStart, currentOldEnd), currentNewEnd - currentStart); 105return new TextChangeRange(textChange.Span, textChange.NewText?.Length ?? 0); 225addAndAdjustOldDelta(builder, ref oldDelta, new TextChangeRange(new TextSpan(oldChange.Span.Start, oldChangeLeadingDeletion), oldChangeLeadingInsertion)); 226oldChange = new TextChangeRange(new TextSpan(newChange.SpanStart - oldDelta, oldChange.Span.Length - oldChangeLeadingDeletion), oldChange.NewLength - oldChangeLeadingInsertion); 261oldChange = new TextChangeRange(oldChange.Span, oldChange.NewLength - newChange.SpanLength); 380add(builder, new TextChangeRange(new TextSpan(newChange.SpanStart - oldDelta, newChange.SpanLength), newChange.NewLength)); 391builder[^1] = new TextChangeRange(new TextSpan(last.Span.Start, last.Span.Length + change.Span.Length), last.NewLength + change.NewLength);
Microsoft.CodeAnalysis.CodeStyle (7)
src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (7)
100return new TextChangeRange(TextSpan.FromBounds(currentStart, currentOldEnd), currentNewEnd - currentStart); 105return new TextChangeRange(textChange.Span, textChange.NewText?.Length ?? 0); 225addAndAdjustOldDelta(builder, ref oldDelta, new TextChangeRange(new TextSpan(oldChange.Span.Start, oldChangeLeadingDeletion), oldChangeLeadingInsertion)); 226oldChange = new TextChangeRange(new TextSpan(newChange.SpanStart - oldDelta, oldChange.Span.Length - oldChangeLeadingDeletion), oldChange.NewLength - oldChangeLeadingInsertion); 261oldChange = new TextChangeRange(oldChange.Span, oldChange.NewLength - newChange.SpanLength); 380add(builder, new TextChangeRange(new TextSpan(newChange.SpanStart - oldDelta, newChange.SpanLength), newChange.NewLength)); 391builder[^1] = new TextChangeRange(new TextSpan(last.Span.Start, last.Span.Length + change.Span.Length), last.NewLength + change.NewLength);
Microsoft.CodeAnalysis.CSharp (1)
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)
8791(CSharpSyntaxNode)oldTree.GetRoot(), new[] { new TextChangeRange(new TextSpan(282, 0), 1) });
Microsoft.CodeAnalysis.EditorFeatures (1)
Shared\Extensions\TextChangeExtensions.cs (1)
13=> new(textChange.OldSpan.ToTextSpan(), textChange.NewLength);
Microsoft.CodeAnalysis.EditorFeatures.Text (5)
Extensions.SnapshotSourceText.cs (2)
303return [new TextChangeRange(new TextSpan(0, oldText.Length), this.Length)]; 354return ImmutableArray.Create(new TextChangeRange(new TextSpan(0, oldTextLength), this.Length));
Extensions.TextBufferContainer.cs (1)
113var changes = ImmutableArray.CreateRange(args.Changes.Select(c => new TextChangeRange(new TextSpan(c.OldSpan.Start, c.OldSpan.Length), c.NewLength)));
ITextImageHelpers.cs (2)
109return new TextChangeRange(new TextSpan(change.OldSpan.Start, change.OldSpan.Length), change.NewLength); 113return new TextChangeRange(new TextSpan(change.NewSpan.Start, change.NewSpan.Length), change.OldLength);
Microsoft.CodeAnalysis.UnitTests (23)
Text\TextChangeRangeTest.cs (8)
20() => { var notUsed = new TextChangeRange(new TextSpan(), -1); }); 27var range = new TextChangeRange(span, 42); 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(
src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (7)
100return new TextChangeRange(TextSpan.FromBounds(currentStart, currentOldEnd), currentNewEnd - currentStart); 105return new TextChangeRange(textChange.Span, textChange.NewText?.Length ?? 0); 225addAndAdjustOldDelta(builder, ref oldDelta, new TextChangeRange(new TextSpan(oldChange.Span.Start, oldChangeLeadingDeletion), oldChangeLeadingInsertion)); 226oldChange = new TextChangeRange(new TextSpan(newChange.SpanStart - oldDelta, oldChange.Span.Length - oldChangeLeadingDeletion), oldChange.NewLength - oldChangeLeadingInsertion); 261oldChange = new TextChangeRange(oldChange.Span, oldChange.NewLength - newChange.SpanLength); 380add(builder, new TextChangeRange(new TextSpan(newChange.SpanStart - oldDelta, newChange.SpanLength), newChange.NewLength)); 391builder[^1] = new TextChangeRange(new TextSpan(last.Span.Start, last.Span.Length + change.Span.Length), last.NewLength + change.NewLength);