Merge pull request #5073 from fbricon/harden-registerCopyBufferSpy
Mitigate registerCopyBufferSpy failures
This commit is contained in:
commit
cd34cc5e8b
1 changed files with 20 additions and 4 deletions
|
|
@ -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,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue