diff --git a/extensions/vscode/src/commands.ts b/extensions/vscode/src/commands.ts index 8a5a4ae99..1e39374c1 100644 --- a/extensions/vscode/src/commands.ts +++ b/extensions/vscode/src/commands.ts @@ -15,6 +15,7 @@ import { Core } from "core/core"; import { LOCAL_DEV_DATA_VERSION } from "core/data/log"; import { walkDirAsync } from "core/indexing/walkDir"; import { isModelInstaller } from "core/llm"; +import { extractMinimalStackTraceInfo } from "core/util/extractMinimalStackTraceInfo"; import { startLocalOllama } from "core/util/ollamaHelper"; import { getDevDataFilePath } from "core/util/paths"; import { Telemetry } from "core/util/posthog"; @@ -381,6 +382,7 @@ const getCommandsMap: ( rules: config.rules, }); } + return { "continue.acceptDiff": async (newFileUri?: string, streamId?: string) => processDiff( @@ -949,7 +951,7 @@ const getCommandsMap: ( if (core.configHandler.currentProfile?.profileDescription.id) { core.invoke("config/updateSelectedModel", { profileId: - core.configHandler.currentProfile?.profileDescription.id, + core.configHandler.currentProfile?.profileDescription.id, role: "autocomplete", title: selectedOption, }); @@ -1014,7 +1016,7 @@ const getCommandsMap: ( }; }; -const registerCopyBufferSpy = ( +const registerCopyBufferService = ( context: vscode.ExtensionContext, core: Core, ) => { @@ -1105,8 +1107,6 @@ export function registerAllCommands( core: Core, editDecorationManager: EditDecorationManager, ) { - registerCopyBufferSpy(context, core); - for (const [command, callback] of Object.entries( getCommandsMap( ide, @@ -1126,4 +1126,20 @@ export function registerAllCommands( vscode.commands.registerCommand(command, callback), ); } + + try { + registerCopyBufferService(context, core); + } catch (e: any) { + //Non-critical error, it needs to be intercepted and not prevent the extension from starting + console.log("Error registering CopyBufferService: ", e); + Telemetry.capture( + "vscode_extension_copy_buffer_failure", + { + stack: extractMinimalStackTraceInfo(e.stack), + message: e.message, + }, + false, + true, + ); + } }