67 references to TextChangeRange
Microsoft.CodeAnalysis (19)
Syntax\SyntaxDiffer.cs (7)
535
RecordChange(new ChangeRecord(new
TextChangeRange
(oldSpan, 0), removedNodes, null));
549
RecordChange(new
TextChangeRange
(oldSpan, newSpan.Length), removedNode, insertedNode);
559
RecordChange(new ChangeRecord(new
TextChangeRange
(oldSpan, newSpan.Length), removedNodes, insertedNodes));
569
RecordChange(new ChangeRecord(new
TextChangeRange
(new TextSpan(start, 0), newSpan.Length), null, insertedNodes));
581
new
TextChangeRange
(new TextSpan(last.Range.Span.Start, last.Range.Span.Length + change.Range.Span.Length), last.Range.NewLength + change.Range.NewLength),
604
new
TextChangeRange
(new TextSpan(last.Range.Span.Start, last.Range.Span.Length + textChangeRange.Span.Length), last.Range.NewLength + textChangeRange.NewLength),
762
range = new
TextChangeRange
(
Text\ChangedText.cs (1)
206
return ImmutableArray.Create(new
TextChangeRange
(new TextSpan(0, oldText.Length), _newText.Length));
Text\SourceText.cs (2)
810
changeRanges.Add(new
TextChangeRange
(change.Span, newTextLength));
890
return ImmutableArray.Create(new
TextChangeRange
(new TextSpan(0, oldText.Length), this.Length));
Text\TextChange.cs (1)
91
return new
TextChangeRange
(change.Span, change.NewText.Length);
Text\TextChangeRange.cs (1)
129
return new
TextChangeRange
(combined, newLen);
Text\TextChangeRangeExtensions.cs (7)
100
return new
TextChangeRange
(TextSpan.FromBounds(currentStart, currentOldEnd), currentNewEnd - currentStart);
105
return new
TextChangeRange
(textChange.Span, textChange.NewText?.Length ?? 0);
225
addAndAdjustOldDelta(builder, ref oldDelta, new
TextChangeRange
(new TextSpan(oldChange.Span.Start, oldChangeLeadingDeletion), oldChangeLeadingInsertion));
226
oldChange = new
TextChangeRange
(new TextSpan(newChange.SpanStart - oldDelta, oldChange.Span.Length - oldChangeLeadingDeletion), oldChange.NewLength - oldChangeLeadingInsertion);
261
oldChange = new
TextChangeRange
(oldChange.Span, oldChange.NewLength - newChange.SpanLength);
380
add(builder, new
TextChangeRange
(new TextSpan(newChange.SpanStart - oldDelta, newChange.SpanLength), newChange.NewLength));
391
builder[^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)
100
return new
TextChangeRange
(TextSpan.FromBounds(currentStart, currentOldEnd), currentNewEnd - currentStart);
105
return new
TextChangeRange
(textChange.Span, textChange.NewText?.Length ?? 0);
225
addAndAdjustOldDelta(builder, ref oldDelta, new
TextChangeRange
(new TextSpan(oldChange.Span.Start, oldChangeLeadingDeletion), oldChangeLeadingInsertion));
226
oldChange = new
TextChangeRange
(new TextSpan(newChange.SpanStart - oldDelta, oldChange.Span.Length - oldChangeLeadingDeletion), oldChange.NewLength - oldChangeLeadingInsertion);
261
oldChange = new
TextChangeRange
(oldChange.Span, oldChange.NewLength - newChange.SpanLength);
380
add(builder, new
TextChangeRange
(new TextSpan(newChange.SpanStart - oldDelta, newChange.SpanLength), newChange.NewLength));
391
builder[^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)
550
return 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)
303
return [new
TextChangeRange
(new TextSpan(0, oldText.Length), this.Length)];
354
return ImmutableArray.Create(new
TextChangeRange
(new TextSpan(0, oldTextLength), this.Length));
Extensions.TextBufferContainer.cs (1)
113
var changes = ImmutableArray.CreateRange(args.Changes.Select(c => new
TextChangeRange
(new TextSpan(c.OldSpan.Start, c.OldSpan.Length), c.NewLength)));
ITextImageHelpers.cs (2)
109
return new
TextChangeRange
(new TextSpan(change.OldSpan.Start, change.OldSpan.Length), change.NewLength);
113
return 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); });
27
var range = new
TextChangeRange
(span, 42);
39
EqualityUnit.Create(new
TextChangeRange
(new TextSpan(42, 2), 13)).WithEqualValues(new
TextChangeRange
(new TextSpan(42, 2), 13)),
40
EqualityUnit.Create(new
TextChangeRange
(new TextSpan(42, 2), 13)).WithNotEqualValues(new
TextChangeRange
(new TextSpan(42, 2), 5)),
41
EqualityUnit.Create(new
TextChangeRange
(new TextSpan(42, 2), 13)).WithNotEqualValues(new
TextChangeRange
(new TextSpan(42, 4), 13)));
Text\TextChangeTests.cs (15)
926
new
TextChangeRange
(new TextSpan(919, 10), 466),
927
new
TextChangeRange
(new TextSpan(936, 33), 29),
928
new
TextChangeRange
(new TextSpan(1098, 0), 70),
929
new
TextChangeRange
(new TextSpan(1125, 4), 34),
930
new
TextChangeRange
(new TextSpan(1138, 0), 47));
932
new
TextChangeRange
(new TextSpan(997, 0), 2),
933
new
TextChangeRange
(new TextSpan(1414, 0), 2),
934
new
TextChangeRange
(new TextSpan(1419, 0), 2),
935
new
TextChangeRange
(new TextSpan(1671, 5), 5),
936
new
TextChangeRange
(new TextSpan(1681, 0), 4));
941
new
TextChangeRange
(new TextSpan(919, 10), 468),
942
new
TextChangeRange
(new TextSpan(936, 33), 33),
943
new
TextChangeRange
(new TextSpan(1098, 0), 70),
944
new
TextChangeRange
(new TextSpan(1125, 4), 38),
945
new
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)
108
Return Me.WithChanges(newText, {New
TextChangeRange
(New TextSpan(0, Me.Length), newText.Length)})
Microsoft.CodeAnalysis.Workspaces (8)
Classification\SyntaxClassification\SyntacticChangeRangeComputer.cs (1)
113
return new
TextChangeRange
(
src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (7)
100
return new
TextChangeRange
(TextSpan.FromBounds(currentStart, currentOldEnd), currentNewEnd - currentStart);
105
return new
TextChangeRange
(textChange.Span, textChange.NewText?.Length ?? 0);
225
addAndAdjustOldDelta(builder, ref oldDelta, new
TextChangeRange
(new TextSpan(oldChange.Span.Start, oldChangeLeadingDeletion), oldChangeLeadingInsertion));
226
oldChange = new
TextChangeRange
(new TextSpan(newChange.SpanStart - oldDelta, oldChange.Span.Length - oldChangeLeadingDeletion), oldChange.NewLength - oldChangeLeadingInsertion);
261
oldChange = new
TextChangeRange
(oldChange.Span, oldChange.NewLength - newChange.SpanLength);
380
add(builder, new
TextChangeRange
(new TextSpan(newChange.SpanStart - oldDelta, newChange.SpanLength), newChange.NewLength));
391
builder[^1] = new
TextChangeRange
(new TextSpan(last.Span.Start, last.Span.Length + change.Span.Length), last.NewLength + change.NewLength);