Skip to content

Commit 93585d0

Browse files
TypeScript Botjakebailey
andauthored
🤖 Pick PR #58755 (Check cancellation token in isolate...) into release-5.5 (#58759)
Co-authored-by: Jake Bailey <[email protected]>
1 parent 35d2952 commit 93585d0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

‎src/services/codefixes/fixMissingTypeAnnotationOnExports.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,8 @@ function withContext<T>(
254254
};
255255

256256
function addTypeAnnotation(span: TextSpan) {
257+
context.cancellationToken.throwIfCancellationRequested();
258+
257259
const nodeWithDiag = getTokenAtPosition(sourceFile, span.start);
258260

259261
const expandoFunction = findExpandoFunction(nodeWithDiag);
@@ -331,6 +333,8 @@ function withContext<T>(
331333
}
332334

333335
function addInlineAssertion(span: TextSpan): DiagnosticOrDiagnosticAndArguments | undefined {
336+
context.cancellationToken.throwIfCancellationRequested();
337+
334338
const nodeWithDiag = getTokenAtPosition(sourceFile, span.start);
335339
const expandoFunction = findExpandoFunction(nodeWithDiag);
336340
// No inline assertions for expando members
@@ -406,6 +410,8 @@ function withContext<T>(
406410
}
407411

408412
function extractAsVariable(span: TextSpan): DiagnosticOrDiagnosticAndArguments | undefined {
413+
context.cancellationToken.throwIfCancellationRequested();
414+
409415
const nodeWithDiag = getTokenAtPosition(sourceFile, span.start);
410416
const targetNode = findBestFittingNode(nodeWithDiag, span) as Expression;
411417
if (!targetNode || isValueSignatureDeclaration(targetNode) || isValueSignatureDeclaration(targetNode.parent)) return;

0 commit comments

Comments
 (0)