The code to trigger a rebuild on missing extension.js added in https://github.com/continuedev/continue/pull/3276 turns out not to be entirely reliable because esbuild sometimes falls back to full-contents comparison rather than using the modtime. To fix this, include a buildTimestamp file in the input, and rewrite that when we want to trigger a rebuild.
58 lines
1.6 KiB
TypeScript
58 lines
1.6 KiB
TypeScript
/**
|
|
* This is the entry point for the extension.
|
|
*/
|
|
|
|
import { setupCa } from "core/util/ca";
|
|
import { extractMinimalStackTraceInfo } from "core/util/extractMinimalStackTraceInfo";
|
|
import { Telemetry } from "core/util/posthog";
|
|
import * as vscode from "vscode";
|
|
|
|
import { getExtensionVersion } from "./util/util";
|
|
export { default as buildTimestamp } from "./.buildTimestamp";
|
|
|
|
async function dynamicImportAndActivate(context: vscode.ExtensionContext) {
|
|
await setupCa();
|
|
const { activateExtension } = await import("./activation/activate");
|
|
return await activateExtension(context);
|
|
}
|
|
|
|
export function activate(context: vscode.ExtensionContext) {
|
|
return dynamicImportAndActivate(context).catch((e) => {
|
|
console.log("Error activating extension: ", e);
|
|
Telemetry.capture(
|
|
"vscode_extension_activation_error",
|
|
{
|
|
stack: extractMinimalStackTraceInfo(e.stack),
|
|
message: e.message,
|
|
},
|
|
false,
|
|
true,
|
|
);
|
|
vscode.window
|
|
.showWarningMessage(
|
|
"Error activating the Continue extension.",
|
|
"View Logs",
|
|
"Retry",
|
|
)
|
|
.then((selection) => {
|
|
if (selection === "View Logs") {
|
|
vscode.commands.executeCommand("continue.viewLogs");
|
|
} else if (selection === "Retry") {
|
|
// Reload VS Code window
|
|
vscode.commands.executeCommand("workbench.action.reloadWindow");
|
|
}
|
|
});
|
|
});
|
|
}
|
|
|
|
export function deactivate() {
|
|
Telemetry.capture(
|
|
"deactivate",
|
|
{
|
|
extensionVersion: getExtensionVersion(),
|
|
},
|
|
true,
|
|
);
|
|
|
|
Telemetry.shutdownPosthogClient();
|
|
}
|