(targetRange, context, requestedChangesIndex)
| 160572 | return extractFunctionInScope(target, scopes[requestedChangesIndex], usagesPerScope[requestedChangesIndex], exposedVariableDeclarations, targetRange, context); |
| 160573 | } |
| 160574 | function getConstantExtractionAtIndex(targetRange, context, requestedChangesIndex) { |
| 160575 | var _a = getPossibleExtractionsWorker(targetRange, context), scopes = _a.scopes, _b = _a.readsAndWrites, target = _b.target, usagesPerScope = _b.usagesPerScope, constantErrorsPerScope = _b.constantErrorsPerScope, exposedVariableDeclarations = _b.exposedVariableDeclarations; |
| 160576 | ts.Debug.assert(!constantErrorsPerScope[requestedChangesIndex].length, "The extraction went missing? How?"); |
| 160577 | ts.Debug.assert(exposedVariableDeclarations.length === 0, "Extract constant accepted a range containing a variable declaration?"); |
| 160578 | context.cancellationToken.throwIfCancellationRequested(); |
| 160579 | var expression = ts.isExpression(target) |
| 160580 | ? target |
| 160581 | : target.statements[0].expression; |
| 160582 | return extractConstantInScope(expression, scopes[requestedChangesIndex], usagesPerScope[requestedChangesIndex], targetRange.facts, context); |
| 160583 | } |
| 160584 | /** |
| 160585 | * Given a piece of text to extract ('targetRange'), computes a list of possible extractions. |
| 160586 | * Each returned ExtractResultForScope corresponds to a possible target scope and is either a set of changes |
no test coverage detected
searching dependent graphs…