Focus cline when on update

This commit is contained in:
Cline Evaluation
2025-05-20 06:34:25 +04:00
parent 8d540d0dfa
commit 705877384d
2 changed files with 19 additions and 14 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
"name": "claude-dev",
"displayName": "Cline",
"description": "Autonomous coding agent right in your IDE, capable of creating/editing files, running commands, using the browser, and more with your permission every step of the way.",
"version": "3.16.1",
"version": "3.16.2",
"icon": "assets/icons/icon.png",
"engines": {
"vscode": "^1.84.0"
+18 -13
View File
@@ -53,21 +53,26 @@ export async function activate(context: vscode.ExtensionContext) {
)
// Perform post-update actions if necessary
if (!previousVersion || currentVersion !== previousVersion) {
Logger.log(`Cline version changed: ${previousVersion} -> ${currentVersion}. First run or update detected.`)
const lastShownPopupNotificationVersion = context.globalState.get<string>("clineLastPopupNotificationVersion")
try {
if (!previousVersion || currentVersion !== previousVersion) {
Logger.log(`Cline version changed: ${previousVersion} -> ${currentVersion}. First run or update detected.`)
const lastShownPopupNotificationVersion = context.globalState.get<string>("clineLastPopupNotificationVersion")
if (currentVersion !== lastShownPopupNotificationVersion && previousVersion) {
// Show VS Code popup notification as this version hasn't been notified yet without doing it for fresh installs
const message = `Cline has been updated to v${currentVersion}`
await vscode.commands.executeCommand("claude-dev.SidebarProvider.focus")
await new Promise((resolve) => setTimeout(resolve, 200))
vscode.window.showInformationMessage(message)
// Record that we've shown the popup for this version.
await context.globalState.update("clineLastPopupNotificationVersion", currentVersion)
if (currentVersion !== lastShownPopupNotificationVersion && previousVersion) {
// Show VS Code popup notification as this version hasn't been notified yet without doing it for fresh installs
const message = `Cline has been updated to v${currentVersion}`
await vscode.commands.executeCommand("claude-dev.SidebarProvider.focus")
await new Promise((resolve) => setTimeout(resolve, 200))
vscode.window.showInformationMessage(message)
// Record that we've shown the popup for this version.
await context.globalState.update("clineLastPopupNotificationVersion", currentVersion)
}
// Always update the main version tracker for the next launch.
await context.globalState.update("clineVersion", currentVersion)
}
// Always update the main version tracker for the next launch.
await context.globalState.update("clineVersion", currentVersion)
} catch (error) {
const errorMessage = error instanceof Error ? error.message : String(error)
console.error(`Error during post-update actions: ${errorMessage}, Stack trace: ${error.stack}`)
}
context.subscriptions.push(