@@ -9,7 +9,6 @@ import * as vscode from 'vscode';
99import { Repository } from './api/api' ;
1010import { GitErrorCodes } from './api/api1' ;
1111import { CommentReply , findActiveHandler , resolveCommentHandler } from './commentHandlerResolver' ;
12- import { IComment } from './common/comment' ;
1312import { commands } from './common/executeCommands' ;
1413import Logger from './common/logger' ;
1514import { FILE_LIST_LAYOUT , PR_SETTINGS_NAMESPACE } from './common/settingKeys' ;
@@ -20,7 +19,7 @@ import { formatError } from './common/utils';
2019import { EXTENSION_ID } from './constants' ;
2120import { FolderRepositoryManager } from './github/folderRepositoryManager' ;
2221import { GitHubRepository } from './github/githubRepository' ;
23- import { Issue , PullRequest } from './github/interface' ;
22+ import { Issue } from './github/interface' ;
2423import { IssueModel } from './github/issueModel' ;
2524import { IssueOverviewPanel } from './github/issueOverview' ;
2625import { NotificationProvider } from './github/notifications' ;
@@ -46,9 +45,6 @@ import {
4645import { PRNode } from './view/treeNodes/pullRequestNode' ;
4746import { RepositoryChangesNode } from './view/treeNodes/repositoryChangesNode' ;
4847
49- const _onDidUpdatePR = new vscode . EventEmitter < PullRequest | void > ( ) ;
50- export const onDidUpdatePR : vscode . Event < PullRequest | void > = _onDidUpdatePR . event ;
51-
5248function ensurePR ( folderRepoManager : FolderRepositoryManager , pr ?: PRNode ) : PullRequestModel ;
5349function ensurePR < TIssue extends Issue , TIssueModel extends IssueModel < TIssue > > ( folderRepoManager : FolderRepositoryManager , pr ?: TIssueModel ) : TIssueModel ;
5450function ensurePR < TIssue extends Issue , TIssueModel extends IssueModel < TIssue > > ( folderRepoManager : FolderRepositoryManager , pr ?: PRNode | TIssueModel ) : TIssueModel {
@@ -749,56 +745,6 @@ export function registerCommands(
749745 } ) ,
750746 ) ;
751747
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-
802748 context . subscriptions . push (
803749 vscode . commands . registerCommand ( 'pr.dismissNotification' , node => {
804750 if ( node instanceof PRNode ) {
0 commit comments