Skip to content

Commit

Permalink
🤖 Pick PR #58755 (Check cancellation token in isolate...) into releas…
Browse files Browse the repository at this point in the history
…e-5.5 (#58759)

Co-authored-by: Jake Bailey <[email protected]>
  • Loading branch information
TypeScript Bot and jakebailey authored Jun 3, 2024
1 parent 35d2952 commit 93585d0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/services/codefixes/fixMissingTypeAnnotationOnExports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ function withContext<T>(
};

function addTypeAnnotation(span: TextSpan) {
context.cancellationToken.throwIfCancellationRequested();

const nodeWithDiag = getTokenAtPosition(sourceFile, span.start);

const expandoFunction = findExpandoFunction(nodeWithDiag);
Expand Down Expand Up @@ -331,6 +333,8 @@ function withContext<T>(
}

function addInlineAssertion(span: TextSpan): DiagnosticOrDiagnosticAndArguments | undefined {
context.cancellationToken.throwIfCancellationRequested();

const nodeWithDiag = getTokenAtPosition(sourceFile, span.start);
const expandoFunction = findExpandoFunction(nodeWithDiag);
// No inline assertions for expando members
Expand Down Expand Up @@ -406,6 +410,8 @@ function withContext<T>(
}

function extractAsVariable(span: TextSpan): DiagnosticOrDiagnosticAndArguments | undefined {
context.cancellationToken.throwIfCancellationRequested();

const nodeWithDiag = getTokenAtPosition(sourceFile, span.start);
const targetNode = findBestFittingNode(nodeWithDiag, span) as Expression;
if (!targetNode || isValueSignatureDeclaration(targetNode) || isValueSignatureDeclaration(targetNode.parent)) return;
Expand Down

0 comments on commit 93585d0

Please sign in to comment.