From e270705b4b38c95ca4a09d58c72a365b60305151 Mon Sep 17 00:00:00 2001 From: Anthony Kim Date: Thu, 23 May 2024 16:05:56 -0700 Subject: [PATCH] properly add to disposables --- src/client/extensionActivation.ts | 2 +- src/client/repl/replCommands.ts | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/client/extensionActivation.ts b/src/client/extensionActivation.ts index c8712281673d..37d97b8ccbab 100644 --- a/src/client/extensionActivation.ts +++ b/src/client/extensionActivation.ts @@ -109,7 +109,7 @@ export function activateFeatures(ext: ExtensionState, _components: Components): registerReplCommands(ext.disposables, interpreterService); registerReplExecuteOnEnter(ext.disposables, interpreterService); - registerReplExecuteOnShiftEnter(); + registerReplExecuteOnShiftEnter(ext.disposables); } /// ////////////////////////// diff --git a/src/client/repl/replCommands.ts b/src/client/repl/replCommands.ts index 2c0217873b8b..d9d0858a6637 100644 --- a/src/client/repl/replCommands.ts +++ b/src/client/repl/replCommands.ts @@ -193,10 +193,12 @@ export async function registerReplExecuteOnEnter( ); } -export async function registerReplExecuteOnShiftEnter(): Promise { - commands.registerCommand(Commands.Exec_In_REPL_Shift_Enter, async () => { - await commands.executeCommand(Commands.Exec_In_REPL_Enter); - }); +export async function registerReplExecuteOnShiftEnter(disposables: Disposable[]): Promise { + disposables.push( + commands.registerCommand(Commands.Exec_In_REPL_Shift_Enter, async () => { + await commands.executeCommand(Commands.Exec_In_REPL_Enter); + }), + ); } function isMultiLineText(textEditor: TextEditor | undefined): boolean {