diff --git a/package.json b/package.json index 0165fd4..405fdac 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "name": "flexpilot-vscode-extension", "displayName": "Flexpilot", "description": "Open-Source, Native and a True GitHub Copilot Alternative for VS Code", - "version": "1.96.0", + "version": "1.96.1", "icon": "assets/logo.png", "license": "GPL-3.0-only", "pricing": "Free", diff --git a/src/startup.ts b/src/startup.ts index fd568e9..26191da 100644 --- a/src/startup.ts +++ b/src/startup.ts @@ -259,6 +259,15 @@ const isArgvJsonOutdated = async () => { export const updateRuntimeArguments = async () => { // Initialize the flag to require a restart let requireRestart = false; + let restartMessage = + "Flexpilot: Please restart VS Code to apply the latest updates"; + + // Hide the chat setup if it is visible + try { + await vscode.commands.executeCommand("workbench.action.chat.hideSetup"); + } catch (error) { + logger.warn(`Chat setup not found: ${String(error)}`); + } // Check if the argv.json file is outdated if (await isArgvJsonOutdated()) { @@ -278,15 +287,18 @@ export const updateRuntimeArguments = async () => { requireRestart = true; } + // Check if GitHub Copilot is active + if (isGitHubCopilotActive()) { + logger.warn("GitHub Copilot is active, restart required"); + restartMessage = + "Flexpilot: To ensure Flexpilot functions correctly, kindly disable `GitHub Copilot` and Restart"; + } + // Notify the user about the required restart if (requireRestart) { // Show a notification to restart VS Code vscode.window - .showInformationMessage( - "Flexpilot: Please restart VS Code to apply the latest updates", - "Restart", - "View Logs", - ) + .showInformationMessage(restartMessage, "Restart", "View Logs") .then((selection) => { if (selection === "Restart") { triggerVscodeRestart(); @@ -299,30 +311,6 @@ export const updateRuntimeArguments = async () => { throw new Error("Flexpilot: VS Code restart required"); } - // Check if GitHub Copilot is active - if (isGitHubCopilotActive()) { - logger.warn("GitHub Copilot is active"); - // Notify the user about GitHub Copilot compatibility - vscode.window - .showWarningMessage( - "To ensure Flexpilot functions correctly, kindly disable GitHub Copilot and reload the window", - "Reload Window", - "View Logs", - ) - .then((selection) => { - if (selection === "Reload Window") { - vscode.commands.executeCommand("workbench.action.reloadWindow"); - } else if (selection === "View Logs") { - logger.showOutputChannel(); - } - }); - - // Throw an error to stop the execution - throw new Error( - "Flexpilot: GitHub Copilot is active and needs to be disabled", - ); - } - // Log the successful activation logger.info("Successfully updated runtime arguments"); };