mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-01-17 17:25:51 -05:00
Adds GitLab remote link support
Adds Bitbucket remote link support Adds Visual Studio Team Services remote link support
This commit is contained in:
27
src/git/remotes/visualStudio.ts
Normal file
27
src/git/remotes/visualStudio.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
'use strict';
|
||||
import { RemoteProvider } from './provider';
|
||||
|
||||
export class VisualStudioService extends RemoteProvider {
|
||||
|
||||
constructor(public domain: string, public path: string) {
|
||||
super(domain, path);
|
||||
}
|
||||
|
||||
get name() {
|
||||
return 'Visual Studio Team Services';
|
||||
}
|
||||
|
||||
protected getUrlForBranch(branch: string): string {
|
||||
return `${this.baseUrl}/?version=GB${branch}&_a=history`;
|
||||
}
|
||||
|
||||
protected getUrlForCommit(sha: string): string {
|
||||
return `${this.baseUrl}/commit/${sha}`;
|
||||
}
|
||||
|
||||
protected getUrlForFile(fileName: string, branch?: string, sha?: string): string {
|
||||
if (sha) return `${this.baseUrl}/commit/${sha}/?_a=contents&path=%2F${fileName}`;
|
||||
if (branch) return `${this.baseUrl}/?path=%2F${fileName}&version=GB${branch}&_a=contents`;
|
||||
return `${this.baseUrl}?path=%2F${fileName}`;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user