mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-01-20 01:35:36 -05:00
Renames hosting to remote
This commit is contained in:
@@ -4,7 +4,7 @@ import { BuiltInCommands } from '../constants';
|
||||
|
||||
export type Commands = 'gitlens.closeUnchangedFiles' | 'gitlens.copyMessageToClipboard' | 'gitlens.copyShaToClipboard' |
|
||||
'gitlens.diffDirectory' | 'gitlens.diffWithBranch' | 'gitlens.diffWithNext' | 'gitlens.diffWithPrevious' | 'gitlens.diffLineWithPrevious' | 'gitlens.diffWithWorking' | 'gitlens.diffLineWithWorking' |
|
||||
'gitlens.openChangedFiles' | 'gitlens.openCommitInHostingProvider' | 'gitlens.openFileInHostingProvider' | 'gitlens.openInHostingProvider' |
|
||||
'gitlens.openChangedFiles' | 'gitlens.openCommitInRemote' | 'gitlens.openFileInRemote' | 'gitlens.openInRemote' |
|
||||
'gitlens.showBlame' | 'gitlens.showBlameHistory' | 'gitlens.showFileHistory' |
|
||||
'gitlens.showLastQuickPick' | 'gitlens.showQuickBranchHistory' |
|
||||
'gitlens.showQuickCommitDetails' | 'gitlens.showQuickCommitFileDetails' |
|
||||
@@ -23,9 +23,9 @@ export const Commands = {
|
||||
DiffWithWorking: 'gitlens.diffWithWorking' as Commands,
|
||||
DiffLineWithWorking: 'gitlens.diffLineWithWorking' as Commands,
|
||||
OpenChangedFiles: 'gitlens.openChangedFiles' as Commands,
|
||||
OpenCommitInHostingProvider: 'gitlens.openCommitInHostingProvider' as Commands,
|
||||
OpenFileInHostingProvider: 'gitlens.openFileInHostingProvider' as Commands,
|
||||
OpenInHostingProvider: 'gitlens.openInHostingProvider' as Commands,
|
||||
OpenCommitInRemote: 'gitlens.openCommitInRemote' as Commands,
|
||||
OpenFileInRemote: 'gitlens.openFileInRemote' as Commands,
|
||||
OpenInRemote: 'gitlens.openInRemote' as Commands,
|
||||
ShowBlame: 'gitlens.showBlame' as Commands,
|
||||
ShowBlameHistory: 'gitlens.showBlameHistory' as Commands,
|
||||
ShowFileHistory: 'gitlens.showFileHistory' as Commands,
|
||||
|
||||
@@ -5,10 +5,10 @@ import { ActiveEditorCommand, Commands } from './commands';
|
||||
import { GitCommit, GitService, GitUri } from '../gitService';
|
||||
import { Logger } from '../logger';
|
||||
|
||||
export class OpenCommitInHostingProviderCommand extends ActiveEditorCommand {
|
||||
export class OpenCommitInRemoteCommand extends ActiveEditorCommand {
|
||||
|
||||
constructor(private git: GitService, private repoPath: string) {
|
||||
super(Commands.OpenCommitInHostingProvider);
|
||||
super(Commands.OpenCommitInRemote);
|
||||
}
|
||||
|
||||
async execute(editor: TextEditor, edit: TextEditorEdit, uri?: Uri) {
|
||||
@@ -27,7 +27,7 @@ export class OpenCommitInHostingProviderCommand extends ActiveEditorCommand {
|
||||
if (blameline < 0) return undefined;
|
||||
|
||||
const blame = await this.git.getBlameForLine(gitUri, blameline);
|
||||
if (!blame) return window.showWarningMessage(`Unable to open commit in hosting provider. File is probably not under source control`);
|
||||
if (!blame) return window.showWarningMessage(`Unable to open commit in remote provider. File is probably not under source control`);
|
||||
|
||||
let commit = blame.commit;
|
||||
// If the line is uncommitted, find the previous commit
|
||||
@@ -36,11 +36,11 @@ export class OpenCommitInHostingProviderCommand extends ActiveEditorCommand {
|
||||
}
|
||||
|
||||
const remotes = Arrays.uniqueBy(await this.git.getRemotes(this.repoPath), _ => _.url, _ => !!_.provider);
|
||||
return commands.executeCommand(Commands.OpenInHostingProvider, uri, remotes, 'commit', [commit.sha]);
|
||||
return commands.executeCommand(Commands.OpenInRemote, uri, remotes, 'commit', [commit.sha]);
|
||||
}
|
||||
catch (ex) {
|
||||
Logger.error('[GitLens.OpenCommitInHostingProviderCommand]', ex);
|
||||
return window.showErrorMessage(`Unable to open commit in hosting provider. See output channel for more details`);
|
||||
Logger.error('[GitLens.OpenCommitInRemoteCommand]', ex);
|
||||
return window.showErrorMessage(`Unable to open commit in remote provider. See output channel for more details`);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,10 +5,10 @@ import { ActiveEditorCommand, Commands } from './commands';
|
||||
import { GitService, GitUri } from '../gitService';
|
||||
import { Logger } from '../logger';
|
||||
|
||||
export class OpenFileInHostingProviderCommand extends ActiveEditorCommand {
|
||||
export class OpenFileInRemoteCommand extends ActiveEditorCommand {
|
||||
|
||||
constructor(private git: GitService, private repoPath: string) {
|
||||
super(Commands.OpenFileInHostingProvider);
|
||||
super(Commands.OpenFileInRemote);
|
||||
}
|
||||
|
||||
async execute(editor: TextEditor, edit: TextEditorEdit, uri?: Uri) {
|
||||
@@ -21,11 +21,11 @@ export class OpenFileInHostingProviderCommand extends ActiveEditorCommand {
|
||||
|
||||
try {
|
||||
const remotes = Arrays.uniqueBy(await this.git.getRemotes(this.repoPath), _ => _.url, _ => !!_.provider);
|
||||
return commands.executeCommand(Commands.OpenInHostingProvider, uri, remotes, 'file', [gitUri.getRelativePath(), gitUri.sha]);
|
||||
return commands.executeCommand(Commands.OpenInRemote, uri, remotes, 'file', [gitUri.getRelativePath(), gitUri.sha]);
|
||||
}
|
||||
catch (ex) {
|
||||
Logger.error('[GitLens.OpenFileInHostingProviderCommand]', ex);
|
||||
return window.showErrorMessage(`Unable to open file in hosting provider. See output channel for more details`);
|
||||
Logger.error('[GitLens.OpenFileInRemoteCommand]', ex);
|
||||
return window.showErrorMessage(`Unable to open file in remote provider. See output channel for more details`);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,17 @@
|
||||
'use strict';
|
||||
import { TextEditor, Uri, window } from 'vscode';
|
||||
import { ActiveEditorCommand, Commands } from './commands';
|
||||
import { GitRemote, HostingProviderOpenType } from '../gitService';
|
||||
import { GitRemote, RemoteProviderOpenType } from '../gitService';
|
||||
import { Logger } from '../logger';
|
||||
import { CommandQuickPickItem, OpenRemoteCommandQuickPickItem, RemotesQuickPick } from '../quickPicks';
|
||||
|
||||
export class OpenInHostingProviderCommand extends ActiveEditorCommand {
|
||||
export class OpenInRemoteCommand extends ActiveEditorCommand {
|
||||
|
||||
constructor() {
|
||||
super(Commands.OpenInHostingProvider);
|
||||
super(Commands.OpenInRemote);
|
||||
}
|
||||
|
||||
async execute(editor: TextEditor, uri?: Uri, remotes?: GitRemote[], type?: HostingProviderOpenType, args?: string[], name?: string, goBackCommand?: CommandQuickPickItem) {
|
||||
async execute(editor: TextEditor, uri?: Uri, remotes?: GitRemote[], type?: RemoteProviderOpenType, args?: string[], name?: string, goBackCommand?: CommandQuickPickItem) {
|
||||
if (!(uri instanceof Uri)) {
|
||||
uri = editor && editor.document && editor.document.uri;
|
||||
}
|
||||
@@ -46,8 +46,8 @@ export class OpenInHostingProviderCommand extends ActiveEditorCommand {
|
||||
|
||||
}
|
||||
catch (ex) {
|
||||
Logger.error('[GitLens.OpenInHostingProviderCommand]', ex);
|
||||
return window.showErrorMessage(`Unable to open in hosting provider. See output channel for more details`);
|
||||
Logger.error('[GitLens.OpenInRemoteCommand]', ex);
|
||||
return window.showErrorMessage(`Unable to open in remote provider. See output channel for more details`);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user