Skip to content

Commit 5174de3

Browse files
Copilotalexr00
andauthored
Open created issues in editor instead of browser (#7046)
* Initial plan for issue * Replace browser open with editor open for issue creation notification Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com> * Complete implementation and validation of editor-based issue opening Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com> * Capture folder manager as const * Revert unrelated formatting changes to participantsPrompt.tsx Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
1 parent 57b2e89 commit 5174de3

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

src/issues/issueFeatureRegistrar.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import { OctokitCommon } from '../github/common';
2727
import { FolderRepositoryManager, PullRequestDefaults } from '../github/folderRepositoryManager';
2828
import { IProject } from '../github/interface';
2929
import { IssueModel } from '../github/issueModel';
30+
import { IssueOverviewPanel } from '../github/issueOverview';
3031
import { RepositoriesManager } from '../github/repositoriesManager';
3132
import { ISSUE_OR_URL_EXPRESSION, parseIssueExpressionOutput } from '../github/utils';
3233
import { chatCommand } from '../lm/utils';
@@ -1272,10 +1273,11 @@ ${options?.body ?? ''}\n
12721273
if (!folderManager) {
12731274
return false;
12741275
}
1276+
const constFolderManager: FolderRepositoryManager = folderManager;
12751277
progress.report({ message: vscode.l10n.t('Verifying that issue data is valid...') });
12761278
try {
12771279
if (!origin) {
1278-
origin = await folderManager.getPullRequestDefaults();
1280+
origin = await constFolderManager.getPullRequestDefaults();
12791281
}
12801282
} catch (e) {
12811283
// There is no remote
@@ -1296,11 +1298,11 @@ ${options?.body ?? ''}\n
12961298
milestone
12971299
};
12981300

1299-
if (!(await this.verifyLabels(folderManager, createParams))) {
1301+
if (!(await this.verifyLabels(constFolderManager, createParams))) {
13001302
return false;
13011303
}
13021304
progress.report({ message: vscode.l10n.t('Creating issue in {0}...', `${createParams.owner}/${createParams.repo}`) });
1303-
const issue = await folderManager.createIssue(createParams);
1305+
const issue = await constFolderManager.createIssue(createParams);
13041306
if (issue) {
13051307
if (copilotAssignee) {
13061308
const copilotUser = (await folderManager.getAssignableUsers())[issue.remote.remoteName].find(user => COPILOT_ACCOUNTS[user.login]);
@@ -1322,14 +1324,14 @@ ${options?.body ?? ''}\n
13221324
await vscode.workspace.applyEdit(edit);
13231325
} else {
13241326
const copyIssueUrl = vscode.l10n.t('Copy Issue Link');
1325-
const openIssue = vscode.l10n.t({ message: 'Open Issue', comment: 'Open the issue description in the browser to see it\'s full contents.' });
1327+
const openIssue = vscode.l10n.t({ message: 'Open Issue', comment: 'Open the issue description in the editor to see it\'s full contents.' });
13261328
vscode.window.showInformationMessage(vscode.l10n.t('Issue created'), copyIssueUrl, openIssue).then(async result => {
13271329
switch (result) {
13281330
case copyIssueUrl:
13291331
await vscode.env.clipboard.writeText(issue.html_url);
13301332
break;
13311333
case openIssue:
1332-
await vscode.env.openExternal(vscode.Uri.parse(issue.html_url));
1334+
await IssueOverviewPanel.createOrShow(this.telemetry, this.context.extensionUri, constFolderManager, issue);
13331335
break;
13341336
}
13351337
});

0 commit comments

Comments
 (0)