|
1 | 1 | import * as fs from "node:fs/promises"; |
2 | 2 | import * as path from "node:path"; |
3 | 3 | import * as vscode from "vscode"; |
4 | | -import { patchloomNeedsUpgrade, resolvePatchloomStatus } from "../binary/patchloom.js"; |
| 4 | +import { ensurePatchloomReadyOrNotify } from "../binary/patchloom.js"; |
5 | 5 | import { configureMcpTargets, inspectMcpTargets } from "../mcp/config.js"; |
6 | 6 | import { activeWorkspaceFolder, describeWorkspaceEnvironment } from "../workspace/readiness.js"; |
7 | 7 | import { refreshStatusBar } from "../status/statusBar.js"; |
8 | 8 |
|
9 | 9 | export async function configureMcp(): Promise<void> { |
10 | | - const status = await resolvePatchloomStatus(); |
11 | | - if (!status.ready) { |
12 | | - const choice = await vscode.window.showWarningMessage( |
13 | | - `${status.message}\n\nPatchloom needs a working binary before MCP setup can continue.`, |
14 | | - "Open Settings" |
15 | | - ); |
16 | | - if (choice === "Open Settings") { |
17 | | - await vscode.commands.executeCommand("patchloom.openPatchloomSettings"); |
18 | | - } |
19 | | - return; |
20 | | - } |
21 | | - |
22 | | - if (patchloomNeedsUpgrade(status)) { |
23 | | - const choice = await vscode.window.showWarningMessage( |
24 | | - `${status.compatibilityMessage}\n\nUpgrade Patchloom before MCP setup can continue.`, |
25 | | - "Open Releases" |
26 | | - ); |
27 | | - if (choice === "Open Releases") { |
28 | | - await vscode.commands.executeCommand("patchloom.openPatchloomReleases"); |
29 | | - } |
| 10 | + const binaryPath = await ensurePatchloomReadyOrNotify("Patchloom needs a working binary before MCP setup can continue."); |
| 11 | + if (!binaryPath) { |
30 | 12 | return; |
31 | 13 | } |
32 | 14 |
|
@@ -66,7 +48,7 @@ export async function configureMcp(): Promise<void> { |
66 | 48 | workspaceFolderPath, |
67 | 49 | includeKinds: selectedKinds, |
68 | 50 | includeUserTarget: environment.supportsUserMcpConfig, |
69 | | - patchloomPathSetting: status.binaryPath, |
| 51 | + patchloomPathSetting: binaryPath, |
70 | 52 | readFile: async (filePath) => { |
71 | 53 | try { |
72 | 54 | return await fs.readFile(filePath, "utf8"); |
|
0 commit comments