1 write to NewLength
Microsoft.CodeAnalysis (1)
Text\TextChangeRange.cs (1)
44
this.
NewLength
= newLength;
78 references to NewLength
Microsoft.CodeAnalysis (35)
Syntax\SyntaxDiffer.cs (10)
109
if (change.Range.
NewLength
> 0) // delete-only ranges cannot be expressed as part of new text
112
newSpans.Add(new TextSpan(start, change.Range.
NewLength
));
115
delta += change.Range.
NewLength
- change.Range.Span.Length;
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
),
748
if (cr.Range.Span.Length > 0 && cr.Range.
NewLength
> 0)
764
range.
NewLength
- (commonLeadingCount + commonTrailingCount));
778
if (range.Span.Length > 0 || range.
NewLength
> 0)
Text\ChangedText.cs (1)
38
deltaLength += change.
NewLength
- change.Span.Length;
Text\SourceText.cs (3)
912
if (range.
NewLength
> 0)
914
var span = new TextSpan(newPos, range.
NewLength
);
924
newPosDelta += range.
NewLength
- range.Span.Length;
Text\TextChangeRange.cs (7)
28
internal int NewEnd => Span.Start +
NewLength
;
54
other.
NewLength
== this.
NewLength
;
71
return Hash.Combine(this.
NewLength
, this.Span.GetHashCode());
107
diff += change.
NewLength
- change.Span.Length;
134
return $"new TextChangeRange(new TextSpan({Span.Start}, {Span.Length}), {
NewLength
})";
139
return $"TextChangeRange(Span={Span}, NewLength={
NewLength
})";
Text\TextChangeRangeExtensions.cs (14)
40
var currentNewEnd = accumulatedTextChangeSoFar.Value.Span.Start + accumulatedTextChangeSoFar.Value.
NewLength
;
86
currentNewEnd = currentNewEnd + newChange.
NewLength
- newChange.Span.Length;
97
currentNewEnd = newChange.Span.Start + newChange.
NewLength
;
150
if (oldChange.Span.Length == 0 && oldChange.
NewLength
== 0)
226
oldChange = new TextChangeRange(new TextSpan(newChange.SpanStart - oldDelta, oldChange.Span.Length - oldChangeLeadingDeletion), oldChange.
NewLength
- oldChangeLeadingInsertion);
234
if (newChange.SpanLength <= oldChange.
NewLength
)
261
oldChange = new TextChangeRange(oldChange.Span, oldChange.
NewLength
- newChange.SpanLength);
308
oldDelta = oldDelta - oldChange.Span.Length + oldChange.
NewLength
;
310
var newDeletion = newChange.SpanLength + oldChange.Span.Length - oldChange.
NewLength
;
373
oldDelta = oldDelta - oldChange.Span.Length + oldChange.
NewLength
;
391
builder[^1] = new TextChangeRange(new TextSpan(last.Span.Start, last.Span.Length + change.Span.Length), last.
NewLength
+ change.
NewLength
);
430
: this(range.Span.Start, range.Span.Length, range.
NewLength
)
435
private static int NewEnd(this TextChangeRange range) => range.Span.Start + range.
NewLength
;
Microsoft.CodeAnalysis.CodeStyle (14)
src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (14)
40
var currentNewEnd = accumulatedTextChangeSoFar.Value.Span.Start + accumulatedTextChangeSoFar.Value.
NewLength
;
86
currentNewEnd = currentNewEnd + newChange.
NewLength
- newChange.Span.Length;
97
currentNewEnd = newChange.Span.Start + newChange.
NewLength
;
150
if (oldChange.Span.Length == 0 && oldChange.
NewLength
== 0)
226
oldChange = new TextChangeRange(new TextSpan(newChange.SpanStart - oldDelta, oldChange.Span.Length - oldChangeLeadingDeletion), oldChange.
NewLength
- oldChangeLeadingInsertion);
234
if (newChange.SpanLength <= oldChange.
NewLength
)
261
oldChange = new TextChangeRange(oldChange.Span, oldChange.
NewLength
- newChange.SpanLength);
308
oldDelta = oldDelta - oldChange.Span.Length + oldChange.
NewLength
;
310
var newDeletion = newChange.SpanLength + oldChange.Span.Length - oldChange.
NewLength
;
373
oldDelta = oldDelta - oldChange.Span.Length + oldChange.
NewLength
;
391
builder[^1] = new TextChangeRange(new TextSpan(last.Span.Start, last.Span.Length + change.Span.Length), last.
NewLength
+ change.
NewLength
);
430
: this(range.Span.Start, range.Span.Length, range.
NewLength
)
435
private static int NewEnd(this TextChangeRange range) => range.Span.Start + range.
NewLength
;
Microsoft.CodeAnalysis.CSharp (3)
Parser\Blender.cs (1)
156
var finalLength = changeRange.
NewLength
+ (changeRange.Span.Start - start);
Parser\Blender.Reader.cs (1)
134
_changeDelta += change.
NewLength
- change.Span.Length;
Syntax\CSharpSyntaxTree.cs (1)
564
if (workingChanges.Count == 1 && workingChanges[0].Span == new TextSpan(0, this.Length) && workingChanges[0].
NewLength
== newText.Length)
Microsoft.CodeAnalysis.EditorFeatures (2)
Classification\Semantic\AbstractSemanticOrEmbeddedClassificationViewTaggerProvider.cs (1)
174
var changedSpan = new TextSpan(collapsedRange.Span.Start, collapsedRange.
NewLength
);
Classification\Syntactic\SyntacticClassificationTaggerProvider.TagComputer.cs (1)
341
? currentSnapshot.GetSpan(changeRange.Value.Span.Start, changeRange.Value.
NewLength
)
Microsoft.CodeAnalysis.Features (1)
SolutionCrawler\AbstractDocumentDifferenceService.cs (1)
175
var lengthDelta = range.
NewLength
- range.Span.Length;
Microsoft.CodeAnalysis.UnitTests (2)
Text\TextChangeRangeTest.cs (1)
29
Assert.Equal(42, range.
NewLength
);
Text\TextChangeTests.cs (1)
80
Assert.Equal(10, changes[0].
NewLength
);
Microsoft.CodeAnalysis.VisualBasic (5)
Scanner\Blender.vb (4)
222
_affectedRange = New TextChangeRange(span, span.Length - _change.Span.Length + _change.
NewLength
)
230
If position >= _change.Span.Start + _change.
NewLength
Then
231
Return position - _change.
NewLength
+ _change.Span.Length
389
Dim range = New TextSpan(_affectedRange.Span.Start, _affectedRange.
NewLength
)
Syntax\VisualBasicSyntaxTree.vb (1)
120
If changes.Length = 1 AndAlso changes(0).Span = New TextSpan(0, Me.Length) AndAlso changes(0).
NewLength
= newText.Length Then
Microsoft.CodeAnalysis.Workspaces (16)
src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (14)
40
var currentNewEnd = accumulatedTextChangeSoFar.Value.Span.Start + accumulatedTextChangeSoFar.Value.
NewLength
;
86
currentNewEnd = currentNewEnd + newChange.
NewLength
- newChange.Span.Length;
97
currentNewEnd = newChange.Span.Start + newChange.
NewLength
;
150
if (oldChange.Span.Length == 0 && oldChange.
NewLength
== 0)
226
oldChange = new TextChangeRange(new TextSpan(newChange.SpanStart - oldDelta, oldChange.Span.Length - oldChangeLeadingDeletion), oldChange.
NewLength
- oldChangeLeadingInsertion);
234
if (newChange.SpanLength <= oldChange.
NewLength
)
261
oldChange = new TextChangeRange(oldChange.Span, oldChange.
NewLength
- newChange.SpanLength);
308
oldDelta = oldDelta - oldChange.Span.Length + oldChange.
NewLength
;
310
var newDeletion = newChange.SpanLength + oldChange.Span.Length - oldChange.
NewLength
;
373
oldDelta = oldDelta - oldChange.Span.Length + oldChange.
NewLength
;
391
builder[^1] = new TextChangeRange(new TextSpan(last.Span.Start, last.Span.Length + change.Span.Length), last.
NewLength
+ change.
NewLength
);
430
: this(range.Span.Start, range.Span.Length, range.
NewLength
)
435
private static int NewEnd(this TextChangeRange range) => range.Span.Start + range.
NewLength
;
Workspace\Solution\DocumentState.cs (2)
279
if (change.
NewLength
== newText.Length)
285
if (change.Span.Length < MaxTextChangeRangeLength && change.
NewLength
< MaxTextChangeRangeLength)