Skip to content

Commit 9a83077

Browse files
committed
Add explanatory comment
1 parent 5de6ac1 commit 9a83077

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/services/codefixes/fixUnusedIdentifier.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ namespace ts.codefix {
135135
oldFunction.equalsGreaterThanToken,
136136
oldFunction.body);
137137

138+
// Drop leading and trailing trivia of the new function because we're only going
139+
// to replace the span (vs the full span) of the old function - the old leading
140+
// and trailing trivia will remain.
138141
suppressLeadingAndTrailingTrivia(newFunction);
139142

140143
changes.replaceRange(sourceFile, { pos: oldFunction.getStart(), end: oldFunction.end }, newFunction);

0 commit comments

Comments
 (0)