Skip to content

Commit

Permalink
add comment to clarify undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
michelleangela committed Jun 15, 2023
1 parent b1598e0 commit 42bbea7
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ export class FindAllReferencesProvider implements vscode.ReferenceProvider {
if (cancelSource.token.isCancellationRequested || response.referenceInfos === null || response.isCanceled) {
// Return undefined instead of vscode.CancellationError to avoid the following error message from VS Code:
// "Cannot destructure property 'range' of 'e.location' as it is undefined."
// TODO: per issue https://github.com/microsoft/vscode/issues/169698
// vscode.CancellationError is expected, so when VS Code fixes the error use vscode.CancellationError again.
return undefined;
} else if (response.referenceInfos.length !== 0) {
response.referenceInfos.forEach((referenceInfo: ReferenceInfo) => {
Expand Down

0 comments on commit 42bbea7

Please sign in to comment.