Skip to content

Commit

Permalink
Update packages/language-server/src/plugins/typescript/features/Diagn…
Browse files Browse the repository at this point in the history
…osticsProvider.ts

Co-authored-by: Simon H <[email protected]>
  • Loading branch information
jasonlyu123 and dummdidumm authored Nov 24, 2023
1 parent 4d14f77 commit eea8096
Showing 1 changed file with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,13 @@ export class DiagnosticsProviderImpl implements DiagnosticsProvider {
const checkers = [lang.getSuggestionDiagnostics, lang.getSemanticDiagnostics];

for (const checker of checkers) {
if (!cancellationToken) {
diagnostics.push(...checker.call(lang, tsDoc.filePath));
continue;
}

// wait a bit so the event loop can check for cancellation
// or let completion go first
await new Promise((resolve) => setTimeout(resolve, 10));
if (cancellationToken.isCancellationRequested) {
return [];
if (cancellationToken) {
// wait a bit so the event loop can check for cancellation
// or let completion go first
await new Promise((resolve) => setTimeout(resolve, 10));
if (cancellationToken.isCancellationRequested) {
return [];
}
}
diagnostics.push(...checker.call(lang, tsDoc.filePath));
}
Expand Down

0 comments on commit eea8096

Please sign in to comment.