Skip to content

Commit 1f35f19

Browse files
committed
use textSpanEnd instead of handrolled version
1 parent 845820d commit 1f35f19

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/services/services.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1835,11 +1835,10 @@ module ts {
18351835
? sourceFile.text.substr(0, textChangeRange.span.start)
18361836
: "";
18371837

1838-
let textChangeRangeEnd = textChangeRange.span.start + textChangeRange.span.length;
18391838
// grab the fragment from the end of the span till the end of the original text
1840-
let suffix = textChangeRangeEnd !== sourceFile.text.length
1841-
? sourceFile.text.substr(textChangeRangeEnd)
1842-
: "";
1839+
let suffix = textSpanEnd(textChangeRange.span) !== sourceFile.text.length
1840+
? sourceFile.text.substr(textSpanEnd(textChangeRange.span))
1841+
: "";
18431842

18441843
if (textChangeRange.newLength === 0) {
18451844
// edit was a deletion - just combine prefix and suffix

0 commit comments

Comments
 (0)