Skip to content

Commit

Permalink
fix: GitHub button functionality in QuickPick UI (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcanouil authored Feb 2, 2025
1 parent 43559ea commit 7c6e987
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Changelog

## 0.8.0 (unreleased)
## 0.7.1 (unreleased)

- feat: add "activationEvents" to `package.json` to avoid unnecessary activation.
- fix: GitHub button in QuickPick UI opens again the repository in the default browser.

## 0.7.0 (2025-01-30)

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "quarto-wizard",
"displayName": "Quarto Wizard",
"description": "A Visual Studio Code extension that helps you manage Quarto projects.",
"version": "0.8.0",
"version": "0.7.1",
"publisher": "mcanouil",
"author": {
"name": "Mickaël CANOUIL"
Expand Down
8 changes: 7 additions & 1 deletion src/ui/extensionsQuickPick.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export interface ExtensionQuickPickItem extends vscode.QuickPickItem {
export function createExtensionItems(extensions: string[]): ExtensionQuickPickItem[] {
return extensions.map((ext) => ({
label: formatExtensionLabel(ext),
description: ext,
description: getGitHubLink(ext),
buttons: [
{
iconPath: new vscode.ThemeIcon("github"),
Expand Down Expand Up @@ -43,6 +43,12 @@ export async function showExtensionQuickPick(
quickPick.placeholder = "Select Quarto extensions to install";
quickPick.canSelectMany = true;
quickPick.matchOnDescription = true;
quickPick.onDidTriggerItemButton((e) => {
const url = e.item.url;
if (url) {
vscode.env.openExternal(vscode.Uri.parse(url));
}
});

return new Promise((resolve) => {
quickPick.onDidAccept(() => {
Expand Down

0 comments on commit 7c6e987

Please sign in to comment.