diff --git a/vscode/src/rubyLsp.ts b/vscode/src/rubyLsp.ts index 83e5870ee..6bc84d00e 100644 --- a/vscode/src/rubyLsp.ts +++ b/vscode/src/rubyLsp.ts @@ -263,14 +263,7 @@ export class RubyLsp { } const options: vscode.QuickPickItem[] = client.addons - .sort((addon) => { - // Display errored addons last - if (addon.errored) { - return 1; - } - - return -1; - }) + .sort((addon) => (addon.errored ? 1 : -1)) .map((addon) => { const icon = addon.errored ? "$(error)" : "$(pass)"; return { @@ -278,9 +271,24 @@ export class RubyLsp { }; }); - await vscode.window.showQuickPick(options, { - placeHolder: "Addons (readonly)", + const quickPick = vscode.window.createQuickPick(); + quickPick.items = options; + quickPick.placeholder = "Addons (click to view output)"; + + quickPick.onDidAccept(() => { + const selected = quickPick.selectedItems[0]; + // Ideally, we should display information that's specific to the selected addon + if (selected) { + this.currentActiveWorkspace()?.outputChannel.show(); + } + quickPick.hide(); }); + + quickPick.onDidHide(() => { + quickPick.dispose(); + }); + + quickPick.show(); }), vscode.commands.registerCommand(Command.ToggleFeatures, async () => { // Extract feature descriptions from our package.json