|
|
@ -2,11 +2,17 @@ |
|
|
|
import { Range } from 'vscode'; |
|
|
|
import { RemoteProvider } from './provider'; |
|
|
|
|
|
|
|
const issueEnricherRegEx = /(^|\s)(#([0-9]+))\b/gi; |
|
|
|
const issueEnricherRegex = /(^|\s)(#([0-9]+))\b/gi; |
|
|
|
const stripGitRegex = /\/_git\/?/i; |
|
|
|
|
|
|
|
const sshDomainRegex = /^ssh\./i; |
|
|
|
const sshPathRegex = /^\/?v\d\//i; |
|
|
|
|
|
|
|
export class AzureDevOpsRemote extends RemoteProvider { |
|
|
|
constructor(domain: string, path: string, protocol?: string, name?: string) { |
|
|
|
domain = domain.replace(sshDomainRegex, ''); |
|
|
|
path = path.replace(sshPathRegex, ''); |
|
|
|
|
|
|
|
super(domain, path, protocol, name); |
|
|
|
} |
|
|
|
|
|
|
@ -22,7 +28,7 @@ export class AzureDevOpsRemote extends RemoteProvider { |
|
|
|
// Strip off any `_git` part from the repo url
|
|
|
|
const baseUrl = this.baseUrl.replace(stripGitRegex, '/'); |
|
|
|
// Matches #123
|
|
|
|
return message.replace(issueEnricherRegEx, `$1[$2](${baseUrl}/_workitems/edit/$3 "Open Work Item $2")`); |
|
|
|
return message.replace(issueEnricherRegex, `$1[$2](${baseUrl}/_workitems/edit/$3 "Open Work Item $2")`); |
|
|
|
} |
|
|
|
|
|
|
|
protected getUrlForBranches(): string { |
|
|
|