@@ -239,11 +239,6 @@ namespace ts.refactor.extractSymbol {
239
239
interface TargetRange {
240
240
readonly range : Expression | Statement [ ] ;
241
241
readonly facts : RangeFacts ;
242
- /**
243
- * A list of symbols that are declared in the selected range which are visible in the containing lexical scope
244
- * Used to ensure we don't turn something used outside the range free (or worse, resolve to a different entity).
245
- */
246
- readonly declarations : Symbol [ ] ;
247
242
/**
248
243
* If `this` is referring to a function instead of class, we need to retrieve its type.
249
244
*/
@@ -294,8 +289,6 @@ namespace ts.refactor.extractSymbol {
294
289
// Do the same for the ending position
295
290
const end = cursorRequest ? start : getParentNodeInSpan ( endToken , sourceFile , adjustedSpan ) ;
296
291
297
- const declarations : Symbol [ ] = [ ] ;
298
-
299
292
// We'll modify these flags as we walk the tree to collect data
300
293
// about what things need to be done as part of the extraction.
301
294
let rangeFacts = RangeFacts . None ;
@@ -344,7 +337,7 @@ namespace ts.refactor.extractSymbol {
344
337
return { errors : [ createFileDiagnostic ( sourceFile , span . start , length , Messages . cannotExtractRange ) ] } ;
345
338
}
346
339
347
- return { targetRange : { range : statements , facts : rangeFacts , declarations , thisNode } } ;
340
+ return { targetRange : { range : statements , facts : rangeFacts , thisNode } } ;
348
341
}
349
342
350
343
if ( isReturnStatement ( start ) && ! start . expression ) {
@@ -359,7 +352,7 @@ namespace ts.refactor.extractSymbol {
359
352
if ( errors ) {
360
353
return { errors } ;
361
354
}
362
- return { targetRange : { range : getStatementOrExpressionRange ( node ) ! , facts : rangeFacts , declarations , thisNode } } ; // TODO: GH#18217
355
+ return { targetRange : { range : getStatementOrExpressionRange ( node ) ! , facts : rangeFacts , thisNode } } ; // TODO: GH#18217
363
356
364
357
/**
365
358
* Attempt to refine the extraction node (generally, by shrinking it) to produce better results.
@@ -489,7 +482,6 @@ namespace ts.refactor.extractSymbol {
489
482
( errors ||= [ ] ) . push ( createDiagnosticForNode ( node , Messages . cannotExtractExportedEntity ) ) ;
490
483
return true ;
491
484
}
492
- declarations . push ( node . symbol ) ;
493
485
}
494
486
495
487
// Some things can't be extracted in certain situations
0 commit comments