mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-01-16 17:25:40 -05:00
Enables typescript strict mode
Fixes all the compile/lint issues
This commit is contained in:
@@ -19,9 +19,11 @@ const UrlRegex = /^(?:git:\/\/(.*?)\/|https:\/\/(.*?)\/|http:\/\/(.*?)\/|git@(.*
|
||||
|
||||
export class RemoteProviderFactory {
|
||||
|
||||
static getRemoteProvider(url: string): RemoteProvider {
|
||||
static getRemoteProvider(url: string): RemoteProvider | undefined {
|
||||
try {
|
||||
const match = UrlRegex.exec(url);
|
||||
if (match == null) return undefined;
|
||||
|
||||
const domain = match[1] || match[2] || match[3] || match[4] || match[5];
|
||||
const path = match[6].replace(/\.git/, '');
|
||||
|
||||
|
||||
@@ -26,10 +26,12 @@ export abstract class RemoteProvider {
|
||||
|
||||
protected abstract getUrlForBranch(branch: string): string;
|
||||
protected abstract getUrlForCommit(sha: string): string;
|
||||
protected abstract getUrlForFile(fileName: string, branch: string, sha?: string, range?: Range): string;
|
||||
protected abstract getUrlForFile(fileName: string, branch?: string, sha?: string, range?: Range): string;
|
||||
|
||||
private async _openUrl(url: string): Promise<{}> {
|
||||
return url && commands.executeCommand(BuiltInCommands.Open, Uri.parse(url));
|
||||
private async _openUrl(url: string): Promise<{} | undefined> {
|
||||
if (url === undefined) return undefined;
|
||||
|
||||
return commands.executeCommand(BuiltInCommands.Open, Uri.parse(url));
|
||||
}
|
||||
|
||||
open(type: 'branch', branch: string): Promise<{}>;
|
||||
|
||||
Reference in New Issue
Block a user