@@ -132,7 +132,7 @@ function getInliningInfo(file: SourceFile, startPosition: number, tryWithReferen
132
132
133
133
// Find all references to the variable in the current file.
134
134
const references = getReferenceNodes ( parent , checker , file ) ;
135
- return references && { references, declaration : parent , replacement : getSynthesizedDeepClone ( parent . initializer ) } ;
135
+ return references && { references, declaration : parent , replacement : parent . initializer } ;
136
136
}
137
137
138
138
// Try finding the declaration and nodes to replace via the reference token.
@@ -148,7 +148,7 @@ function getInliningInfo(file: SourceFile, startPosition: number, tryWithReferen
148
148
}
149
149
150
150
const references = getReferenceNodes ( declaration , checker , file ) ;
151
- return references && { references, declaration, replacement : getSynthesizedDeepClone ( declaration . initializer ) } ;
151
+ return references && { references, declaration, replacement : declaration . initializer } ;
152
152
}
153
153
154
154
return { error : getLocaleSpecificMessage ( Diagnostics . Could_not_find_variable_to_inline ) } ;
@@ -189,8 +189,8 @@ function getReplacementExpression(reference: Node, replacement: Expression): Exp
189
189
// instead just check for special cases with needsParentheses.
190
190
const { parent } = reference ;
191
191
if ( isExpression ( parent ) && ( getExpressionPrecedence ( replacement ) < getExpressionPrecedence ( parent ) || needsParentheses ( parent ) ) ) {
192
- return factory . createParenthesizedExpression ( replacement ) ;
192
+ return getSynthesizedDeepClone ( factory . createParenthesizedExpression ( replacement ) ) ;
193
193
}
194
194
195
- return replacement ;
195
+ return getSynthesizedDeepClone ( replacement ) ;
196
196
}
0 commit comments