Skip to content

Commit

Permalink
Fix the issue with the missing diagnostic.data
Browse files Browse the repository at this point in the history
  • Loading branch information
w0rm authored and razzeee committed Feb 4, 2024
1 parent edd6813 commit 3ac9d6e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/common/providers/codeActionProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,12 @@ export class CodeActionProvider {
// and the fix all code action for that error if there are other diagnostics with
// the same error code
(<IDiagnostic[]>params.context.diagnostics).forEach((diagnostic) => {
// We have type casted diagnostic to `IDiagnostic`, however the original
// type is `Diagnostic`, the `.data` property may be missing in some cases
if (!diagnostic.data) {
return;
}

const registrations =
CodeActionProvider.errorCodeToRegistrationMap.getAll(
diagnostic.data.code,
Expand Down

0 comments on commit 3ac9d6e

Please sign in to comment.