@@ -9,7 +9,6 @@ import * as vscode from 'vscode';
9
9
import { Repository } from './api/api' ;
10
10
import { GitErrorCodes } from './api/api1' ;
11
11
import { CommentReply , findActiveHandler , resolveCommentHandler } from './commentHandlerResolver' ;
12
- import { IComment } from './common/comment' ;
13
12
import { commands } from './common/executeCommands' ;
14
13
import Logger from './common/logger' ;
15
14
import { FILE_LIST_LAYOUT , PR_SETTINGS_NAMESPACE } from './common/settingKeys' ;
@@ -20,7 +19,7 @@ import { formatError } from './common/utils';
20
19
import { EXTENSION_ID } from './constants' ;
21
20
import { FolderRepositoryManager } from './github/folderRepositoryManager' ;
22
21
import { GitHubRepository } from './github/githubRepository' ;
23
- import { Issue , PullRequest } from './github/interface' ;
22
+ import { Issue } from './github/interface' ;
24
23
import { IssueModel } from './github/issueModel' ;
25
24
import { IssueOverviewPanel } from './github/issueOverview' ;
26
25
import { NotificationProvider } from './github/notifications' ;
@@ -46,9 +45,6 @@ import {
46
45
import { PRNode } from './view/treeNodes/pullRequestNode' ;
47
46
import { RepositoryChangesNode } from './view/treeNodes/repositoryChangesNode' ;
48
47
49
- const _onDidUpdatePR = new vscode . EventEmitter < PullRequest | void > ( ) ;
50
- export const onDidUpdatePR : vscode . Event < PullRequest | void > = _onDidUpdatePR . event ;
51
-
52
48
function ensurePR ( folderRepoManager : FolderRepositoryManager , pr ?: PRNode ) : PullRequestModel ;
53
49
function ensurePR < TIssue extends Issue , TIssueModel extends IssueModel < TIssue > > ( folderRepoManager : FolderRepositoryManager , pr ?: TIssueModel ) : TIssueModel ;
54
50
function ensurePR < TIssue extends Issue , TIssueModel extends IssueModel < TIssue > > ( folderRepoManager : FolderRepositoryManager , pr ?: PRNode | TIssueModel ) : TIssueModel {
@@ -749,56 +745,6 @@ export function registerCommands(
749
745
} ) ,
750
746
) ;
751
747
752
- context . subscriptions . push (
753
- vscode . commands . registerCommand ( 'pr.close' , async ( pr ?: PRNode | PullRequestModel , message ?: string ) => {
754
- let pullRequestModel : PullRequestModel | undefined ;
755
- if ( pr ) {
756
- pullRequestModel = pr instanceof PullRequestModel ? pr : pr . pullRequestModel ;
757
- } else {
758
- const activePullRequests : PullRequestModel [ ] = reposManager . folderManagers
759
- . map ( folderManager => folderManager . activePullRequest ! )
760
- . filter ( activePR => ! ! activePR ) ;
761
- pullRequestModel = await chooseItem < PullRequestModel > (
762
- activePullRequests ,
763
- itemValue => `${ itemValue . number } : ${ itemValue . title } ` ,
764
- { placeHolder : vscode . l10n . t ( 'Pull request to close' ) } ,
765
- ) ;
766
- }
767
- if ( ! pullRequestModel ) {
768
- return ;
769
- }
770
- const pullRequest : PullRequestModel = pullRequestModel ;
771
- const yes = vscode . l10n . t ( 'Yes' ) ;
772
- return vscode . window
773
- . showWarningMessage (
774
- vscode . l10n . t ( 'Are you sure you want to close this pull request on GitHub? This will close the pull request without merging.' ) ,
775
- { modal : true } ,
776
- yes ,
777
- vscode . l10n . t ( 'No' ) ,
778
- )
779
- . then ( async value => {
780
- if ( value === yes ) {
781
- try {
782
- let newComment : IComment | undefined = undefined ;
783
- if ( message ) {
784
- newComment = await pullRequest . createIssueComment ( message ) ;
785
- }
786
-
787
- const newPR = await pullRequest . close ( ) ;
788
- vscode . commands . executeCommand ( 'pr.refreshList' ) ;
789
- _onDidUpdatePR . fire ( newPR ) ;
790
- return newComment ;
791
- } catch ( e ) {
792
- vscode . window . showErrorMessage ( `Unable to close pull request. ${ formatError ( e ) } ` ) ;
793
- _onDidUpdatePR . fire ( ) ;
794
- }
795
- }
796
-
797
- _onDidUpdatePR . fire ( ) ;
798
- } ) ;
799
- } ) ,
800
- ) ;
801
-
802
748
context . subscriptions . push (
803
749
vscode . commands . registerCommand ( 'pr.dismissNotification' , node => {
804
750
if ( node instanceof PRNode ) {
0 commit comments