diff --git a/CHANGELOG.md b/CHANGELOG.md index 632499b..6de0e5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 0.10.28 (Preview) + +### Deprecated +- **This extension has moved to the official Microsoft extension** — `dotutils.binlog-analyzer` is now published as [`ms-dotnettools.msbuild-binlog-analyzer`](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.msbuild-binlog-analyzer) ("MSBuild Binlog Analyzer for VS Code"). This `dotutils` build is deprecated and will no longer be updated. It now nudges users to migrate with a one-time blocking dialog (offering to install the official extension and uninstall this one) plus a persistent status-bar warning that remains until you migrate or opt out; the notice stays silent once the official extension is installed. The README and Marketplace listing point to the replacement. + ## 0.10.27 (Preview) ### Added diff --git a/README.md b/README.md index b90816c..a3b1544 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,13 @@ # MSBuild Binlog Analyzer for VS Code -[![VS Marketplace](https://img.shields.io/visual-studio-marketplace/v/dotutils.binlog-analyzer?label=VS%20Marketplace&color=blue)](https://marketplace.visualstudio.com/items?itemName=dotutils.binlog-analyzer) -[![Installs](https://img.shields.io/visual-studio-marketplace/i/dotutils.binlog-analyzer)](https://marketplace.visualstudio.com/items?itemName=dotutils.binlog-analyzer) +> # ⚠️ This extension is deprecated +> +> **`dotutils.binlog-analyzer` has moved to the official Microsoft extension:** +> **[MSBuild Binlog Analyzer for VS Code (`ms-dotnettools.msbuild-binlog-analyzer`)](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.msbuild-binlog-analyzer)** +> +> This `dotutils` version is no longer maintained and will not receive updates. +> Please install the official extension and uninstall this one. VS Code will +> also prompt you to migrate automatically. Analyze MSBuild binary logs (`.binlog`) with **GitHub Copilot Chat** and **MCP tools** — right from VS Code. diff --git a/package.json b/package.json index 1052b77..260652d 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "binlog-analyzer", - "displayName": "MSBuild Binlog Analyzer", - "description": "Analyze MSBuild binary logs with Copilot Chat and MCP tools", - "version": "0.10.27", + "displayName": "MSBuild Binlog Analyzer (DEPRECATED \u2014 use ms-dotnettools.msbuild-binlog-analyzer)", + "description": "DEPRECATED: install the official \"MSBuild Binlog Analyzer for VS Code\" (ms-dotnettools.msbuild-binlog-analyzer) instead. Analyze MSBuild binary logs with Copilot Chat and MCP tools.", + "version": "0.10.28", "preview": true, "publisher": "dotutils", "license": "MIT", diff --git a/src/deprecationNotice.ts b/src/deprecationNotice.ts new file mode 100644 index 0000000..7fed2de --- /dev/null +++ b/src/deprecationNotice.ts @@ -0,0 +1,84 @@ +import * as vscode from 'vscode'; + +/** + * This "dotutils" extension is deprecated in favor of the official Microsoft + * extension. A single transient toast is too easy to dismiss, so we use two + * layers that are hard to miss but not obnoxious: + * 1. A blocking modal shown exactly once (Escape/Cancel only defers it to the + * next activation — it is never treated as a permanent dismissal). + * 2. A persistent status-bar warning that stays until the user migrates or + * explicitly opts out, and re-opens the migration prompt on click. + * Everything is best-effort and must never block or break activation. + */ +const NEW_EXTENSION_ID = 'ms-dotnettools.msbuild-binlog-analyzer'; +const OLD_EXTENSION_ID = 'dotutils.binlog-analyzer'; +const MIGRATE_COMMAND = 'binlog.showDeprecationMigration'; +const SUPPRESS_KEY = 'binlog.deprecationNoticeSuppressed'; +const MODAL_SHOWN_KEY = 'binlog.deprecationModalShown'; + +export function registerDeprecationNotice(context: vscode.ExtensionContext): void { + try { + // Already migrated — the official extension is installed, so stay quiet. + if (vscode.extensions.getExtension(NEW_EXTENSION_ID)) { + return; + } + if (context.globalState.get(SUPPRESS_KEY)) { + return; + } + + // Persistent, always-visible reminder that survives dismissing the dialog. + const status = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left, -100); + status.text = '$(warning) Binlog Analyzer deprecated'; + status.tooltip = 'This extension has moved to ms-dotnettools.msbuild-binlog-analyzer. Click to migrate.'; + status.backgroundColor = new vscode.ThemeColor('statusBarItem.warningBackground'); + status.command = MIGRATE_COMMAND; + status.show(); + context.subscriptions.push(status); + + const migrate = async (modal: boolean): Promise => { + try { + const install = 'Install new extension'; + const dismiss = "Don't show again"; + const choice = await vscode.window.showWarningMessage( + 'MSBuild Binlog Analyzer has moved to the official Microsoft extension ' + + '"MSBuild Binlog Analyzer for VS Code" (ms-dotnettools.msbuild-binlog-analyzer). ' + + 'This "dotutils" version is deprecated and will no longer be updated. ' + + 'Please install the official extension to keep getting updates.', + { modal }, + install, dismiss); + + if (choice === install) { + await vscode.commands.executeCommand('workbench.extensions.installExtension', NEW_EXTENSION_ID); + status.hide(); + const uninstall = 'Uninstall old & reload'; + const next = await vscode.window.showInformationMessage( + 'The official extension is installed. Uninstall this deprecated version and reload to finish migrating?', + uninstall, 'Later'); + if (next === uninstall) { + await vscode.commands.executeCommand('workbench.extensions.uninstallExtension', OLD_EXTENSION_ID); + await vscode.commands.executeCommand('workbench.action.reloadWindow'); + } + } else if (choice === dismiss) { + await context.globalState.update(SUPPRESS_KEY, true); + status.hide(); + } + // choice === undefined (Escape/Cancel) or "Later": leave the status + // bar in place and re-prompt on a future activation. + } catch { + // Non-fatal. + } + }; + + context.subscriptions.push( + vscode.commands.registerCommand(MIGRATE_COMMAND, () => migrate(false)) + ); + + // Show the unmissable modal exactly once; the status bar covers later sessions. + if (!context.globalState.get(MODAL_SHOWN_KEY)) { + void context.globalState.update(MODAL_SHOWN_KEY, true); + void migrate(true); + } + } catch { + // Non-fatal — never block activation on the migration notice. + } +} diff --git a/src/extension.ts b/src/extension.ts index 6644c1b..a02316c 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -12,6 +12,7 @@ import { } from './buildCheck'; import * as telemetry from './telemetry'; import { registerBinlogLanguageModelTools } from './languageModelTools'; +import { registerDeprecationNotice } from './deprecationNotice'; import { projectSourcesAccessible, formatOverviewText } from './parsers'; import * as path from 'path'; import * as fs from 'fs'; @@ -172,6 +173,11 @@ export async function activate(context: vscode.ExtensionContext) { telemetry.trackActivation(); setCiContext(context); + // This extension is deprecated in favor of the official ms-dotnettools + // extension. Register a persistent migration nudge (best-effort, never + // blocks activation): an unmissable modal once + a persistent status bar. + registerDeprecationNotice(context); + // Expose binlog analysis as VS Code language-model tools so any agent // (@workspace, custom modes, agent mode) can use them — not just @binlog. registerBinlogLanguageModelTools(context, {