diff --git a/extensions/vscode/src/activation/JumpManager.ts b/extensions/vscode/src/activation/JumpManager.ts index 7d3adb73c..65bffaa0a 100644 --- a/extensions/vscode/src/activation/JumpManager.ts +++ b/extensions/vscode/src/activation/JumpManager.ts @@ -45,7 +45,9 @@ export class JumpManager { public dispose() { // Dispose current decoration. - this._disposables.forEach((d) => d.dispose()); + this._disposables.forEach((d) => { + if (d) d.dispose(); + }); this._disposables = []; } @@ -75,14 +77,6 @@ export class JumpManager { document.lineCount - 1, ); - console.log( - "editor lines:", - document - .getText() - .split("\n") - .slice(startLine, endLine + 1), - ); - // First check if we have enough lines in the document if (endLine - startLine + 1 < completionLines.length) { // Not enough lines in document, so content can't be identical. @@ -225,8 +219,7 @@ export class JumpManager { } // Dispose any active listeners. - this._disposables.forEach((d) => d.dispose()); - this._disposables = []; + this.dispose(); // Reset the context. await vscode.commands.executeCommand(