Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit b59cab6

Browse files
committed
feat(vscode-github): allow to open pull request
After successful creation of pull request allow to open it on github Closes #69
1 parent 4b63d2b commit b59cab6

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/extension.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class Extension {
106106
const pullRequest = await this.githubManager.createPullRequest();
107107
if (pullRequest) {
108108
this.statusBarManager.updateStatus();
109-
vscode.window.showInformationMessage(`Successfully created #${pullRequest.number}`);
109+
this.showPullRequestNotification(pullRequest);
110110
}
111111
}
112112

@@ -142,7 +142,15 @@ class Extension {
142142
}
143143
if (pullRequest) {
144144
this.statusBarManager.updateStatus();
145-
vscode.window.showInformationMessage(`Successfully created #${pullRequest.number}`);
145+
this.showPullRequestNotification(pullRequest);
146+
}
147+
}
148+
149+
private async showPullRequestNotification(pullRequest: PullRequest): Promise<void> {
150+
const result = await vscode.window.showInformationMessage(
151+
`Successfully created #${pullRequest.number}`, 'Open on Github');
152+
if (result) {
153+
vscode.commands.executeCommand('vscode.open', vscode.Uri.parse(pullRequest.html_url));
146154
}
147155
}
148156

0 commit comments

Comments
 (0)