Skip to content

Commit 66a91c3

Browse files
committed
use textSpanEnd instead of handrolled version
1 parent d3a2dc0 commit 66a91c3

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
@@ -1836,11 +1836,10 @@ module ts {
18361836
? sourceFile.text.substr(0, textChangeRange.span.start)
18371837
: "";
18381838

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

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

0 commit comments

Comments
 (0)