From 31adac58c70452f888bf20417cbc7e369f7b0d46 Mon Sep 17 00:00:00 2001 From: Jordan Ribbink Date: Tue, 19 Mar 2024 09:13:04 -0700 Subject: [PATCH] add custom picker --- extension/src/flow-cli/cli-selection-provider.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/extension/src/flow-cli/cli-selection-provider.ts b/extension/src/flow-cli/cli-selection-provider.ts index beff9022..02b3de2d 100644 --- a/extension/src/flow-cli/cli-selection-provider.ts +++ b/extension/src/flow-cli/cli-selection-provider.ts @@ -56,16 +56,18 @@ export class CliSelectionProvider implements vscode.Disposable { const selected = versionSelector.selectedItems[0] if (selected instanceof CustomBinaryItem) { - void vscode.window.showInputBox({ - placeHolder: 'Enter the path to the Flow CLI binary', - prompt: 'Enter the path to the Flow CLI binary' - }).then((path) => { - if (path != null) { - this.#cliProvider.setCurrentBinary(path) + void vscode.window.showOpenDialog({ + canSelectFiles: true, + canSelectFolders: false, + canSelectMany: false, + openLabel: 'Choose a Flow CLI binary' + }).then((uri) => { + if (uri != null) { + void this.#cliProvider.setCurrentBinary(uri[0].fsPath) } }) } else if (selected instanceof AvailableBinaryItem) { - this.#cliProvider.setCurrentBinary(selected.path) + void this.#cliProvider.setCurrentBinary(selected.path) } }))