Skip to content

Commit 683f3fa

Browse files
Merge pull request #13 from mohankumarelec/main
Bump version to 1.96.1 and improve restart notifications for updates
2 parents 0623878 + bced0d6 commit 683f3fa

File tree

2 files changed

+18
-30
lines changed

2 files changed

+18
-30
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "flexpilot-vscode-extension",
44
"displayName": "Flexpilot",
55
"description": "Open-Source, Native and a True GitHub Copilot Alternative for VS Code",
6-
"version": "1.96.0",
6+
"version": "1.96.1",
77
"icon": "assets/logo.png",
88
"license": "GPL-3.0-only",
99
"pricing": "Free",

src/startup.ts

Lines changed: 17 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,15 @@ const isArgvJsonOutdated = async () => {
259259
export const updateRuntimeArguments = async () => {
260260
// Initialize the flag to require a restart
261261
let requireRestart = false;
262+
let restartMessage =
263+
"Flexpilot: Please restart VS Code to apply the latest updates";
264+
265+
// Hide the chat setup if it is visible
266+
try {
267+
await vscode.commands.executeCommand("workbench.action.chat.hideSetup");
268+
} catch (error) {
269+
logger.warn(`Chat setup not found: ${String(error)}`);
270+
}
262271

263272
// Check if the argv.json file is outdated
264273
if (await isArgvJsonOutdated()) {
@@ -278,15 +287,18 @@ export const updateRuntimeArguments = async () => {
278287
requireRestart = true;
279288
}
280289

290+
// Check if GitHub Copilot is active
291+
if (isGitHubCopilotActive()) {
292+
logger.warn("GitHub Copilot is active, restart required");
293+
restartMessage =
294+
"Flexpilot: To ensure Flexpilot functions correctly, kindly disable `GitHub Copilot` and Restart";
295+
}
296+
281297
// Notify the user about the required restart
282298
if (requireRestart) {
283299
// Show a notification to restart VS Code
284300
vscode.window
285-
.showInformationMessage(
286-
"Flexpilot: Please restart VS Code to apply the latest updates",
287-
"Restart",
288-
"View Logs",
289-
)
301+
.showInformationMessage(restartMessage, "Restart", "View Logs")
290302
.then((selection) => {
291303
if (selection === "Restart") {
292304
triggerVscodeRestart();
@@ -299,30 +311,6 @@ export const updateRuntimeArguments = async () => {
299311
throw new Error("Flexpilot: VS Code restart required");
300312
}
301313

302-
// Check if GitHub Copilot is active
303-
if (isGitHubCopilotActive()) {
304-
logger.warn("GitHub Copilot is active");
305-
// Notify the user about GitHub Copilot compatibility
306-
vscode.window
307-
.showWarningMessage(
308-
"To ensure Flexpilot functions correctly, kindly disable GitHub Copilot and reload the window",
309-
"Reload Window",
310-
"View Logs",
311-
)
312-
.then((selection) => {
313-
if (selection === "Reload Window") {
314-
vscode.commands.executeCommand("workbench.action.reloadWindow");
315-
} else if (selection === "View Logs") {
316-
logger.showOutputChannel();
317-
}
318-
});
319-
320-
// Throw an error to stop the execution
321-
throw new Error(
322-
"Flexpilot: GitHub Copilot is active and needs to be disabled",
323-
);
324-
}
325-
326314
// Log the successful activation
327315
logger.info("Successfully updated runtime arguments");
328316
};

0 commit comments

Comments
 (0)