@@ -739,6 +739,8 @@ export class IssueFeatureRegistrar extends Disposable {
739739 ...options ,
740740 title : template . title ,
741741 body : template . body ,
742+ labels : template . labels ,
743+ assignees : template . assignees ,
742744 } ;
743745 }
744746 this . makeNewIssueFile ( uri , options ) ;
@@ -1059,7 +1061,7 @@ export class IssueFeatureRegistrar extends Disposable {
10591061 await vscode . workspace . fs . delete ( bodyPath ) ;
10601062 const assigneeLine = `${ ASSIGNEES } ${ options ?. assignees && options . assignees . length > 0 ? options . assignees . map ( value => '@' + value ) . join ( ', ' ) + ' ' : ''
10611063 } `;
1062- const labelLine = `${ LABELS } ` ;
1064+ const labelLine = `${ LABELS } ${ options ?. labels && options . labels . length > 0 ? options . labels . join ( ', ' ) + ' ' : '' } ` ;
10631065 const milestoneLine = `${ MILESTONE } ` ;
10641066 const projectsLine = `${ PROJECTS } ` ;
10651067 const cached = this . _newIssueCache . get ( ) ;
@@ -1206,14 +1208,14 @@ ${options?.body ?? ''}\n
12061208 return choice ?. repo ;
12071209 }
12081210
1209- private async chooseTemplate ( folderManager : FolderRepositoryManager ) : Promise < { title : string | undefined , body : string | undefined } | undefined > {
1211+ private async chooseTemplate ( folderManager : FolderRepositoryManager ) : Promise < IssueTemplate | undefined > {
12101212 const templateUris = await folderManager . getIssueTemplates ( ) ;
12111213 if ( templateUris . length === 0 ) {
1212- return { title : undefined , body : undefined } ;
1214+ return { title : undefined , body : undefined , labels : undefined , assignees : undefined , name : undefined , about : undefined } ;
12131215 }
12141216
12151217 interface IssueChoice extends vscode . QuickPickItem {
1216- template : { title : string | undefined , body : string | undefined } | undefined ;
1218+ template : IssueTemplate | undefined ;
12171219 }
12181220 const templates = await Promise . all (
12191221 templateUris
@@ -1239,7 +1241,7 @@ ${options?.body ?? ''}\n
12391241 } ) ;
12401242 choices . push ( {
12411243 label : vscode . l10n . t ( 'Blank issue' ) ,
1242- template : { title : undefined , body : undefined }
1244+ template : { title : undefined , body : undefined , labels : undefined , assignees : undefined , name : undefined , about : undefined }
12431245 } ) ;
12441246
12451247 const selectedTemplate = await vscode . window . showQuickPick ( choices , {
@@ -1253,8 +1255,12 @@ ${options?.body ?? ''}\n
12531255 const title = template . match ( / t i t l e : \s * ( .* ) / ) ?. [ 1 ] ?. replace ( / ^ [ " ' ] | [ " ' ] $ / g, '' ) ;
12541256 const name = template . match ( / n a m e : \s * ( .* ) / ) ?. [ 1 ] ?. replace ( / ^ [ " ' ] | [ " ' ] $ / g, '' ) ;
12551257 const about = template . match ( / a b o u t : \s * ( .* ) / ) ?. [ 1 ] ?. replace ( / ^ [ " ' ] | [ " ' ] $ / g, '' ) ;
1258+ const labelsMatch = template . match ( / l a b e l s : \s * ( .* ) / ) ?. [ 1 ] ;
1259+ const labels = labelsMatch ? labelsMatch . split ( ',' ) . map ( label => label . trim ( ) ) . filter ( label => label ) : undefined ;
1260+ const assigneesMatch = template . match ( / a s s i g n e e s : \s * ( .* ) / ) ?. [ 1 ] ;
1261+ const assignees = assigneesMatch ? assigneesMatch . split ( ',' ) . map ( assignee => assignee . trim ( ) ) . filter ( assignee => assignee ) : undefined ;
12561262 const body = template . match ( / - - - ( [ \s \S ] * ) - - - ( [ \s \S ] * ) / ) ?. [ 2 ] ;
1257- return { title, name, about, body } ;
1263+ return { title, name, about, labels , assignees , body } ;
12581264 }
12591265
12601266 private async doCreateIssue (
0 commit comments