File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,12 @@ suite("Utils", () => {
1616 id : "jira-123" ,
1717 } ) ;
1818
19+ assert . deepStrictEqual ( utils . findJiraIssueId ( "jira-123 Hello" ) , {
20+ startIndex : 0 ,
21+ firstIndexAfter : 9 ,
22+ id : "jira-123" ,
23+ } ) ;
24+
1925 assert . deepStrictEqual ( utils . findJiraIssueId ( "Hello" ) , {
2026 startIndex : 0 ,
2127 firstIndexAfter : 0 ,
Original file line number Diff line number Diff line change 44
55import * as vscode from "vscode" ;
66
7+ /** JIRA-123 */
8+ const jiraPrefixUndecorated = / ^ ( ) ( [ a - z A - Z ] { 2 , } - [ 0 - 9 ] + ) + / ;
9+
710/** JIRA-123: */
811const jiraPrefixWithColon = / ^ ( ) ( [ a - z A - Z ] { 2 , } - [ 0 - 9 ] + ) : + / ;
912
@@ -56,7 +59,10 @@ export function createDiagnostic(
5659}
5760
5861export function findJiraIssueId ( firstLine : string ) : JiraIssueIdPrefix {
59- let match = firstLine . match ( jiraPrefixWithColon ) ;
62+ let match = firstLine . match ( jiraPrefixUndecorated ) ;
63+ if ( ! match ) {
64+ match = firstLine . match ( jiraPrefixWithColon ) ;
65+ }
6066 if ( ! match ) {
6167 match = firstLine . match ( jiraPrefixWithBrackets ) ;
6268 }
You can’t perform that action at this time.
0 commit comments