mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-02-16 18:48:45 -05:00
Refactors command & quickpick imports
This commit is contained in:
@@ -1,71 +1,17 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
import { commands, Disposable, TextEditor, TextEditorEdit, window } from 'vscode';
|
export { ActiveEditorCommand, Command, Commands, EditorCommand } from './commands/commands';
|
||||||
|
export { CopyMessageToClipboardCommand } from './commands/copyMessageToClipboard';
|
||||||
export type Commands = 'gitlens.copyMessageToClipboard' | 'gitlens.copyShaToClipboard' | 'gitlens.diffWithPrevious' | 'gitlens.diffLineWithPrevious' | 'gitlens.diffWithWorking' | 'gitlens.diffLineWithWorking' | 'gitlens.showBlame' | 'gitlens.showBlameHistory' | 'gitlens.showFileHistory' | 'gitlens.showQuickCommitDetails' | 'gitlens.showQuickFileHistory' | 'gitlens.showQuickRepoHistory' | 'gitlens.showQuickRepoStatus' | 'gitlens.toggleBlame' | 'gitlens.toggleCodeLens';
|
export { CopyShaToClipboardCommand } from './commands/copyShaToClipboard';
|
||||||
export const Commands = {
|
export { DiffLineWithPreviousCommand } from './commands/diffLineWithPrevious';
|
||||||
CopyMessageToClipboard: 'gitlens.copyMessageToClipboard' as Commands,
|
export { DiffLineWithWorkingCommand } from './commands/diffLineWithWorking';
|
||||||
CopyShaToClipboard: 'gitlens.copyShaToClipboard' as Commands,
|
export { DiffWithPreviousCommand } from './commands/diffWithPrevious';
|
||||||
DiffWithPrevious: 'gitlens.diffWithPrevious' as Commands,
|
export { DiffWithWorkingCommand } from './commands/diffWithWorking';
|
||||||
DiffLineWithPrevious: 'gitlens.diffLineWithPrevious' as Commands,
|
export { ShowBlameCommand } from './commands/showBlame';
|
||||||
DiffWithWorking: 'gitlens.diffWithWorking' as Commands,
|
export { ShowBlameHistoryCommand } from './commands/showBlameHistory';
|
||||||
DiffLineWithWorking: 'gitlens.diffLineWithWorking' as Commands,
|
export { ShowFileHistoryCommand } from './commands/showFileHistory';
|
||||||
ShowBlame: 'gitlens.showBlame' as Commands,
|
export { ShowQuickCommitDetailsCommand } from './commands/showQuickCommitDetails';
|
||||||
ShowBlameHistory: 'gitlens.showBlameHistory' as Commands,
|
export { ShowQuickFileHistoryCommand } from './commands/showQuickFileHistory';
|
||||||
ShowFileHistory: 'gitlens.showFileHistory' as Commands,
|
export { ShowQuickRepoHistoryCommand } from './commands/showQuickRepoHistory';
|
||||||
ShowQuickCommitDetails: 'gitlens.showQuickCommitDetails' as Commands,
|
export { ShowQuickRepoStatusCommand } from './commands/showQuickRepoStatus';
|
||||||
ShowQuickFileHistory: 'gitlens.showQuickFileHistory' as Commands,
|
export { ToggleBlameCommand } from './commands/toggleBlame';
|
||||||
ShowQuickRepoHistory: 'gitlens.showQuickRepoHistory' as Commands,
|
export { ToggleCodeLensCommand } from './commands/toggleCodeLens';
|
||||||
ShowQuickRepoStatus: 'gitlens.showQuickRepoStatus' as Commands,
|
|
||||||
ToggleBlame: 'gitlens.toggleBlame' as Commands,
|
|
||||||
ToggleCodeLens: 'gitlens.toggleCodeLens' as Commands
|
|
||||||
};
|
|
||||||
|
|
||||||
export abstract class Command extends Disposable {
|
|
||||||
|
|
||||||
private _disposable: Disposable;
|
|
||||||
|
|
||||||
constructor(command: Commands) {
|
|
||||||
super(() => this.dispose());
|
|
||||||
this._disposable = commands.registerCommand(command, this.execute, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
dispose() {
|
|
||||||
this._disposable && this._disposable.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract execute(...args: any[]): any;
|
|
||||||
}
|
|
||||||
|
|
||||||
export abstract class EditorCommand extends Disposable {
|
|
||||||
private _disposable: Disposable;
|
|
||||||
|
|
||||||
constructor(command: Commands) {
|
|
||||||
super(() => this.dispose());
|
|
||||||
this._disposable = commands.registerTextEditorCommand(command, this.execute, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
dispose() {
|
|
||||||
this._disposable && this._disposable.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract execute(editor: TextEditor, edit: TextEditorEdit, ...args: any[]): any;
|
|
||||||
}
|
|
||||||
|
|
||||||
export abstract class ActiveEditorCommand extends Disposable {
|
|
||||||
private _disposable: Disposable;
|
|
||||||
|
|
||||||
constructor(command: Commands) {
|
|
||||||
super(() => this.dispose());
|
|
||||||
this._disposable = commands.registerCommand(command, this._execute, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
dispose() {
|
|
||||||
this._disposable && this._disposable.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
_execute(...args: any[]): any {
|
|
||||||
return this.execute(window.activeTextEditor, ...args);
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract execute(editor: TextEditor, ...args: any[]): any;
|
|
||||||
}
|
|
||||||
71
src/commands/commands.ts
Normal file
71
src/commands/commands.ts
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
'use strict';
|
||||||
|
import { commands, Disposable, TextEditor, TextEditorEdit, window } from 'vscode';
|
||||||
|
|
||||||
|
export type Commands = 'gitlens.copyMessageToClipboard' | 'gitlens.copyShaToClipboard' | 'gitlens.diffWithPrevious' | 'gitlens.diffLineWithPrevious' | 'gitlens.diffWithWorking' | 'gitlens.diffLineWithWorking' | 'gitlens.showBlame' | 'gitlens.showBlameHistory' | 'gitlens.showFileHistory' | 'gitlens.showQuickCommitDetails' | 'gitlens.showQuickFileHistory' | 'gitlens.showQuickRepoHistory' | 'gitlens.showQuickRepoStatus' | 'gitlens.toggleBlame' | 'gitlens.toggleCodeLens';
|
||||||
|
export const Commands = {
|
||||||
|
CopyMessageToClipboard: 'gitlens.copyMessageToClipboard' as Commands,
|
||||||
|
CopyShaToClipboard: 'gitlens.copyShaToClipboard' as Commands,
|
||||||
|
DiffWithPrevious: 'gitlens.diffWithPrevious' as Commands,
|
||||||
|
DiffLineWithPrevious: 'gitlens.diffLineWithPrevious' as Commands,
|
||||||
|
DiffWithWorking: 'gitlens.diffWithWorking' as Commands,
|
||||||
|
DiffLineWithWorking: 'gitlens.diffLineWithWorking' as Commands,
|
||||||
|
ShowBlame: 'gitlens.showBlame' as Commands,
|
||||||
|
ShowBlameHistory: 'gitlens.showBlameHistory' as Commands,
|
||||||
|
ShowFileHistory: 'gitlens.showFileHistory' as Commands,
|
||||||
|
ShowQuickCommitDetails: 'gitlens.showQuickCommitDetails' as Commands,
|
||||||
|
ShowQuickFileHistory: 'gitlens.showQuickFileHistory' as Commands,
|
||||||
|
ShowQuickRepoHistory: 'gitlens.showQuickRepoHistory' as Commands,
|
||||||
|
ShowQuickRepoStatus: 'gitlens.showQuickRepoStatus' as Commands,
|
||||||
|
ToggleBlame: 'gitlens.toggleBlame' as Commands,
|
||||||
|
ToggleCodeLens: 'gitlens.toggleCodeLens' as Commands
|
||||||
|
};
|
||||||
|
|
||||||
|
export abstract class Command extends Disposable {
|
||||||
|
|
||||||
|
private _disposable: Disposable;
|
||||||
|
|
||||||
|
constructor(command: Commands) {
|
||||||
|
super(() => this.dispose());
|
||||||
|
this._disposable = commands.registerCommand(command, this.execute, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
dispose() {
|
||||||
|
this._disposable && this._disposable.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract execute(...args: any[]): any;
|
||||||
|
}
|
||||||
|
|
||||||
|
export abstract class EditorCommand extends Disposable {
|
||||||
|
private _disposable: Disposable;
|
||||||
|
|
||||||
|
constructor(command: Commands) {
|
||||||
|
super(() => this.dispose());
|
||||||
|
this._disposable = commands.registerTextEditorCommand(command, this.execute, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
dispose() {
|
||||||
|
this._disposable && this._disposable.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract execute(editor: TextEditor, edit: TextEditorEdit, ...args: any[]): any;
|
||||||
|
}
|
||||||
|
|
||||||
|
export abstract class ActiveEditorCommand extends Disposable {
|
||||||
|
private _disposable: Disposable;
|
||||||
|
|
||||||
|
constructor(command: Commands) {
|
||||||
|
super(() => this.dispose());
|
||||||
|
this._disposable = commands.registerCommand(command, this._execute, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
dispose() {
|
||||||
|
this._disposable && this._disposable.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
_execute(...args: any[]): any {
|
||||||
|
return this.execute(window.activeTextEditor, ...args);
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract execute(editor: TextEditor, ...args: any[]): any;
|
||||||
|
}
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
import { Iterables } from '../system';
|
import { Iterables } from '../system';
|
||||||
import { TextEditor, Uri, window } from 'vscode';
|
import { TextEditor, Uri, window } from 'vscode';
|
||||||
import { ActiveEditorCommand, Commands } from '../commands';
|
import { ActiveEditorCommand, Commands } from './commands';
|
||||||
import GitProvider, { GitUri } from '../gitProvider';
|
import GitProvider, { GitUri } from '../gitProvider';
|
||||||
import { Logger } from '../logger';
|
import { Logger } from '../logger';
|
||||||
import { copy } from 'copy-paste';
|
import { copy } from 'copy-paste';
|
||||||
|
|
||||||
export default class CopyMessageToClipboardCommand extends ActiveEditorCommand {
|
export class CopyMessageToClipboardCommand extends ActiveEditorCommand {
|
||||||
|
|
||||||
constructor(private git: GitProvider, public repoPath: string) {
|
constructor(private git: GitProvider, public repoPath: string) {
|
||||||
super(Commands.CopyMessageToClipboard);
|
super(Commands.CopyMessageToClipboard);
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
import { Iterables } from '../system';
|
import { Iterables } from '../system';
|
||||||
import { TextEditor, Uri, window } from 'vscode';
|
import { TextEditor, Uri, window } from 'vscode';
|
||||||
import { ActiveEditorCommand, Commands } from '../commands';
|
import { ActiveEditorCommand, Commands } from './commands';
|
||||||
import GitProvider, { GitUri } from '../gitProvider';
|
import GitProvider, { GitUri } from '../gitProvider';
|
||||||
import { Logger } from '../logger';
|
import { Logger } from '../logger';
|
||||||
import { copy } from 'copy-paste';
|
import { copy } from 'copy-paste';
|
||||||
|
|
||||||
export default class CopyShaToClipboardCommand extends ActiveEditorCommand {
|
export class CopyShaToClipboardCommand extends ActiveEditorCommand {
|
||||||
|
|
||||||
constructor(private git: GitProvider, public repoPath: string) {
|
constructor(private git: GitProvider, public repoPath: string) {
|
||||||
super(Commands.CopyShaToClipboard);
|
super(Commands.CopyShaToClipboard);
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
import { commands, TextEditor, TextEditorEdit, Uri, window } from 'vscode';
|
import { commands, TextEditor, TextEditorEdit, Uri, window } from 'vscode';
|
||||||
import { Commands, EditorCommand } from '../commands';
|
import { Commands, EditorCommand } from './commands';
|
||||||
import { BuiltInCommands } from '../constants';
|
import { BuiltInCommands } from '../constants';
|
||||||
import GitProvider, { GitCommit, GitUri } from '../gitProvider';
|
import GitProvider, { GitCommit, GitUri } from '../gitProvider';
|
||||||
import { Logger } from '../logger';
|
import { Logger } from '../logger';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
|
|
||||||
export default class DiffLineWithPreviousCommand extends EditorCommand {
|
export class DiffLineWithPreviousCommand extends EditorCommand {
|
||||||
|
|
||||||
constructor(private git: GitProvider) {
|
constructor(private git: GitProvider) {
|
||||||
super(Commands.DiffLineWithPrevious);
|
super(Commands.DiffLineWithPrevious);
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
import { commands, TextEditor, TextEditorEdit, Uri, window } from 'vscode';
|
import { commands, TextEditor, TextEditorEdit, Uri, window } from 'vscode';
|
||||||
import { Commands, EditorCommand } from '../commands';
|
import { Commands, EditorCommand } from './commands';
|
||||||
import GitProvider, { GitCommit, GitUri } from '../gitProvider';
|
import GitProvider, { GitCommit, GitUri } from '../gitProvider';
|
||||||
import { Logger } from '../logger';
|
import { Logger } from '../logger';
|
||||||
|
|
||||||
export default class DiffLineWithWorkingCommand extends EditorCommand {
|
export class DiffLineWithWorkingCommand extends EditorCommand {
|
||||||
|
|
||||||
constructor(private git: GitProvider) {
|
constructor(private git: GitProvider) {
|
||||||
super(Commands.DiffLineWithWorking);
|
super(Commands.DiffLineWithWorking);
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
import { Iterables } from '../system';
|
import { Iterables } from '../system';
|
||||||
import { commands, Range, TextEditor, TextEditorEdit, Uri, window } from 'vscode';
|
import { commands, Range, TextEditor, TextEditorEdit, Uri, window } from 'vscode';
|
||||||
import { Commands, EditorCommand } from '../commands';
|
import { Commands, EditorCommand } from './commands';
|
||||||
import { BuiltInCommands } from '../constants';
|
import { BuiltInCommands } from '../constants';
|
||||||
import GitProvider, { GitCommit, GitUri } from '../gitProvider';
|
import GitProvider, { GitCommit, GitUri } from '../gitProvider';
|
||||||
import { Logger } from '../logger';
|
import { Logger } from '../logger';
|
||||||
import * as moment from 'moment';
|
import * as moment from 'moment';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
|
|
||||||
export default class DiffWithPreviousCommand extends EditorCommand {
|
export class DiffWithPreviousCommand extends EditorCommand {
|
||||||
|
|
||||||
constructor(private git: GitProvider) {
|
constructor(private git: GitProvider) {
|
||||||
super(Commands.DiffWithPrevious);
|
super(Commands.DiffWithPrevious);
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
import { Iterables } from '../system';
|
import { Iterables } from '../system';
|
||||||
import { commands, TextEditor, TextEditorEdit, Uri, window } from 'vscode';
|
import { commands, TextEditor, TextEditorEdit, Uri, window } from 'vscode';
|
||||||
import { Commands, EditorCommand } from '../commands';
|
import { Commands, EditorCommand } from './commands';
|
||||||
import { BuiltInCommands } from '../constants';
|
import { BuiltInCommands } from '../constants';
|
||||||
import GitProvider, { GitCommit, GitUri } from '../gitProvider';
|
import GitProvider, { GitCommit, GitUri } from '../gitProvider';
|
||||||
import { Logger } from '../logger';
|
import { Logger } from '../logger';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
|
|
||||||
export default class DiffWithWorkingCommand extends EditorCommand {
|
export class DiffWithWorkingCommand extends EditorCommand {
|
||||||
|
|
||||||
constructor(private git: GitProvider) {
|
constructor(private git: GitProvider) {
|
||||||
super(Commands.DiffWithWorking);
|
super(Commands.DiffWithWorking);
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
import { TextEditor, TextEditorEdit, Uri, window } from 'vscode';
|
import { TextEditor, TextEditorEdit, Uri, window } from 'vscode';
|
||||||
import BlameAnnotationController from '../blameAnnotationController';
|
import BlameAnnotationController from '../blameAnnotationController';
|
||||||
import { Commands, EditorCommand } from '../commands';
|
import { Commands, EditorCommand } from './commands';
|
||||||
import { Logger } from '../logger';
|
import { Logger } from '../logger';
|
||||||
|
|
||||||
export default class ShowBlameCommand extends EditorCommand {
|
export class ShowBlameCommand extends EditorCommand {
|
||||||
|
|
||||||
constructor(private annotationController: BlameAnnotationController) {
|
constructor(private annotationController: BlameAnnotationController) {
|
||||||
super(Commands.ShowBlame);
|
super(Commands.ShowBlame);
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
import { commands, Position, Range, TextEditor, TextEditorEdit, Uri, window } from 'vscode';
|
import { commands, Position, Range, TextEditor, TextEditorEdit, Uri, window } from 'vscode';
|
||||||
import { Commands, EditorCommand } from '../commands';
|
import { Commands, EditorCommand } from './commands';
|
||||||
import { BuiltInCommands } from '../constants';
|
import { BuiltInCommands } from '../constants';
|
||||||
import GitProvider, { GitUri } from '../gitProvider';
|
import GitProvider, { GitUri } from '../gitProvider';
|
||||||
import { Logger } from '../logger';
|
import { Logger } from '../logger';
|
||||||
|
|
||||||
export default class ShowBlameHistoryCommand extends EditorCommand {
|
export class ShowBlameHistoryCommand extends EditorCommand {
|
||||||
|
|
||||||
constructor(private git: GitProvider) {
|
constructor(private git: GitProvider) {
|
||||||
super(Commands.ShowBlameHistory);
|
super(Commands.ShowBlameHistory);
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
import { commands, Position, Range, TextEditor, TextEditorEdit, Uri, window } from 'vscode';
|
import { commands, Position, Range, TextEditor, TextEditorEdit, Uri, window } from 'vscode';
|
||||||
import { Commands, EditorCommand } from '../commands';
|
import { Commands, EditorCommand } from './commands';
|
||||||
import { BuiltInCommands } from '../constants';
|
import { BuiltInCommands } from '../constants';
|
||||||
import GitProvider, { GitUri } from '../gitProvider';
|
import GitProvider, { GitUri } from '../gitProvider';
|
||||||
import { Logger } from '../logger';
|
import { Logger } from '../logger';
|
||||||
|
|
||||||
export default class ShowFileHistoryCommand extends EditorCommand {
|
export class ShowFileHistoryCommand extends EditorCommand {
|
||||||
|
|
||||||
constructor(private git: GitProvider) {
|
constructor(private git: GitProvider) {
|
||||||
super(Commands.ShowFileHistory);
|
super(Commands.ShowFileHistory);
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
import { Iterables } from '../system';
|
import { Iterables } from '../system';
|
||||||
import { commands, TextEditor, Uri, window } from 'vscode';
|
import { commands, TextEditor, Uri, window } from 'vscode';
|
||||||
import { ActiveEditorCommand, Commands } from '../commands';
|
import { ActiveEditorCommand, Commands } from './commands';
|
||||||
import GitProvider, { GitCommit, GitLogCommit, GitUri } from '../gitProvider';
|
import GitProvider, { GitCommit, GitLogCommit, GitUri } from '../gitProvider';
|
||||||
import { Logger } from '../logger';
|
import { Logger } from '../logger';
|
||||||
import { CommandQuickPickItem, CommitFileDetailsQuickPick, CommitDetailsQuickPick, CommitWithFileStatusQuickPickItem } from '../quickPicks/commitDetails';
|
import { CommandQuickPickItem, CommitFileDetailsQuickPick, CommitDetailsQuickPick, CommitWithFileStatusQuickPickItem } from '../quickPicks';
|
||||||
|
|
||||||
export default class ShowQuickCommitDetailsCommand extends ActiveEditorCommand {
|
export class ShowQuickCommitDetailsCommand extends ActiveEditorCommand {
|
||||||
|
|
||||||
constructor(private git: GitProvider) {
|
constructor(private git: GitProvider) {
|
||||||
super(Commands.ShowQuickCommitDetails);
|
super(Commands.ShowQuickCommitDetails);
|
||||||
@@ -56,7 +56,7 @@ export default class ShowQuickCommitDetailsCommand extends ActiveEditorCommand {
|
|||||||
pick = await CommitDetailsQuickPick.show(commit as GitLogCommit, uri, goBackCommand);
|
pick = await CommitDetailsQuickPick.show(commit as GitLogCommit, uri, goBackCommand);
|
||||||
if (!pick) return undefined;
|
if (!pick) return undefined;
|
||||||
|
|
||||||
if (pick instanceof CommandQuickPickItem) {
|
if (!(pick instanceof CommitWithFileStatusQuickPickItem)) {
|
||||||
return pick.execute();
|
return pick.execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
import { commands, TextEditor, Uri, window } from 'vscode';
|
import { commands, TextEditor, Uri, window } from 'vscode';
|
||||||
import { ActiveEditorCommand, Commands } from '../commands';
|
import { ActiveEditorCommand, Commands } from './commands';
|
||||||
import GitProvider, { GitCommit, GitUri } from '../gitProvider';
|
import GitProvider, { GitCommit, GitUri } from '../gitProvider';
|
||||||
import { Logger } from '../logger';
|
import { Logger } from '../logger';
|
||||||
import { CommandQuickPickItem, FileHistoryQuickPick } from '../quickPicks/fileHistory';
|
import { CommandQuickPickItem, FileHistoryQuickPick } from '../quickPicks';
|
||||||
|
|
||||||
export default class ShowQuickFileHistoryCommand extends ActiveEditorCommand {
|
export class ShowQuickFileHistoryCommand extends ActiveEditorCommand {
|
||||||
|
|
||||||
constructor(private git: GitProvider) {
|
constructor(private git: GitProvider) {
|
||||||
super(Commands.ShowQuickFileHistory);
|
super(Commands.ShowQuickFileHistory);
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
import { commands, TextEditor, Uri, window } from 'vscode';
|
import { commands, TextEditor, Uri, window } from 'vscode';
|
||||||
import { ActiveEditorCommand, Commands } from '../commands';
|
import { ActiveEditorCommand, Commands } from './commands';
|
||||||
import GitProvider, { GitCommit, GitUri } from '../gitProvider';
|
import GitProvider, { GitCommit, GitUri } from '../gitProvider';
|
||||||
import { Logger } from '../logger';
|
import { Logger } from '../logger';
|
||||||
import { CommandQuickPickItem, RepoHistoryQuickPick } from '../quickPicks/repoHistory';
|
import { CommandQuickPickItem, RepoHistoryQuickPick } from '../quickPicks';
|
||||||
|
|
||||||
export default class ShowQuickRepoHistoryCommand extends ActiveEditorCommand {
|
export class ShowQuickRepoHistoryCommand extends ActiveEditorCommand {
|
||||||
|
|
||||||
constructor(private git: GitProvider, public repoPath: string) {
|
constructor(private git: GitProvider, public repoPath: string) {
|
||||||
super(Commands.ShowQuickRepoHistory);
|
super(Commands.ShowQuickRepoHistory);
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
import { TextEditor, Uri, window } from 'vscode';
|
import { TextEditor, Uri, window } from 'vscode';
|
||||||
import { ActiveEditorCommand, Commands } from '../commands';
|
import { ActiveEditorCommand, Commands } from './commands';
|
||||||
import GitProvider, { GitUri } from '../gitProvider';
|
import GitProvider, { GitUri } from '../gitProvider';
|
||||||
import { Logger } from '../logger';
|
import { Logger } from '../logger';
|
||||||
import { CommandQuickPickItem, RepoStatusQuickPick } from '../quickPicks/repoStatus';
|
import { CommandQuickPickItem, RepoStatusQuickPick } from '../quickPicks';
|
||||||
|
|
||||||
export default class ShowQuickRepoStatusCommand extends ActiveEditorCommand {
|
export class ShowQuickRepoStatusCommand extends ActiveEditorCommand {
|
||||||
|
|
||||||
constructor(private git: GitProvider, public repoPath: string) {
|
constructor(private git: GitProvider, public repoPath: string) {
|
||||||
super(Commands.ShowQuickRepoStatus);
|
super(Commands.ShowQuickRepoStatus);
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
import { TextEditor, TextEditorEdit, Uri, window } from 'vscode';
|
import { TextEditor, TextEditorEdit, Uri, window } from 'vscode';
|
||||||
import BlameAnnotationController from '../blameAnnotationController';
|
import BlameAnnotationController from '../blameAnnotationController';
|
||||||
import { Commands, EditorCommand } from '../commands';
|
import { Commands, EditorCommand } from './commands';
|
||||||
import { Logger } from '../logger';
|
import { Logger } from '../logger';
|
||||||
|
|
||||||
export default class ToggleBlameCommand extends EditorCommand {
|
export class ToggleBlameCommand extends EditorCommand {
|
||||||
|
|
||||||
constructor(private annotationController: BlameAnnotationController) {
|
constructor(private annotationController: BlameAnnotationController) {
|
||||||
super(Commands.ToggleBlame);
|
super(Commands.ToggleBlame);
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
import { TextEditor, TextEditorEdit } from 'vscode';
|
import { TextEditor, TextEditorEdit } from 'vscode';
|
||||||
import { Commands, EditorCommand } from '../commands';
|
import { Commands, EditorCommand } from './commands';
|
||||||
import GitProvider from '../gitProvider';
|
import GitProvider from '../gitProvider';
|
||||||
|
|
||||||
export default class ToggleCodeLensCommand extends EditorCommand {
|
export class ToggleCodeLensCommand extends EditorCommand {
|
||||||
|
|
||||||
constructor(private git: GitProvider) {
|
constructor(private git: GitProvider) {
|
||||||
super(Commands.ToggleCodeLens);
|
super(Commands.ToggleCodeLens);
|
||||||
|
|||||||
@@ -3,21 +3,12 @@ import { commands, ExtensionContext, languages, window, workspace } from 'vscode
|
|||||||
import BlameActiveLineController from './blameActiveLineController';
|
import BlameActiveLineController from './blameActiveLineController';
|
||||||
import BlameAnnotationController from './blameAnnotationController';
|
import BlameAnnotationController from './blameAnnotationController';
|
||||||
import { configureCssCharacters } from './blameAnnotationFormatter';
|
import { configureCssCharacters } from './blameAnnotationFormatter';
|
||||||
import CopyMessageToClipboardCommand from './commands/copyMessageToClipboard';
|
import { CopyMessageToClipboardCommand, CopyShaToClipboardCommand } from './commands';
|
||||||
import CopyShaToClipboardCommand from './commands/copyShaToClipboard';
|
import { DiffLineWithPreviousCommand, DiffLineWithWorkingCommand, DiffWithPreviousCommand, DiffWithWorkingCommand} from './commands';
|
||||||
import DiffLineWithPreviousCommand from './commands/diffLineWithPrevious';
|
import { ShowBlameCommand, ToggleBlameCommand } from './commands';
|
||||||
import DiffLineWithWorkingCommand from './commands/diffLineWithWorking';
|
import { ShowBlameHistoryCommand, ShowFileHistoryCommand } from './commands';
|
||||||
import DiffWithPreviousCommand from './commands/diffWithPrevious';
|
import { ShowQuickCommitDetailsCommand, ShowQuickFileHistoryCommand, ShowQuickRepoHistoryCommand, ShowQuickRepoStatusCommand} from './commands';
|
||||||
import DiffWithWorkingCommand from './commands/diffWithWorking';
|
import { ToggleCodeLensCommand } from './commands';
|
||||||
import ShowBlameCommand from './commands/showBlame';
|
|
||||||
import ShowBlameHistoryCommand from './commands/showBlameHistory';
|
|
||||||
import ShowFileHistoryCommand from './commands/showFileHistory';
|
|
||||||
import ShowQuickCommitDetailsCommand from './commands/showQuickCommitDetails';
|
|
||||||
import ShowQuickFileHistoryCommand from './commands/showQuickFileHistory';
|
|
||||||
import ShowQuickRepoHistoryCommand from './commands/showQuickRepoHistory';
|
|
||||||
import ShowQuickRepoStatusCommand from './commands/showQuickRepoStatus';
|
|
||||||
import ToggleBlameCommand from './commands/toggleBlame';
|
|
||||||
import ToggleCodeLensCommand from './commands/toggleCodeLens';
|
|
||||||
import { IAdvancedConfig, IBlameConfig } from './configuration';
|
import { IAdvancedConfig, IBlameConfig } from './configuration';
|
||||||
import { BuiltInCommands, WorkspaceState } from './constants';
|
import { BuiltInCommands, WorkspaceState } from './constants';
|
||||||
import GitContentProvider from './gitContentProvider';
|
import GitContentProvider from './gitContentProvider';
|
||||||
|
|||||||
7
src/quickPicks.ts
Normal file
7
src/quickPicks.ts
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
'use strict';
|
||||||
|
export { CommandQuickPickItem, OpenFileCommandQuickPickItem, OpenFilesCommandQuickPickItem } from './quickPicks/quickPicks';
|
||||||
|
export { CommitQuickPickItem, CommitWithFileStatusQuickPickItem } from './quickPicks/gitQuickPicks';
|
||||||
|
export { OpenCommitFileCommandQuickPickItem, OpenCommitFilesCommandQuickPickItem, CommitDetailsQuickPick, CommitFileDetailsQuickPick } from './quickPicks/commitDetails';
|
||||||
|
export { FileHistoryQuickPick } from './quickPicks/fileHistory';
|
||||||
|
export { RepoHistoryQuickPick } from './quickPicks/repoHistory';
|
||||||
|
export { OpenStatusFileCommandQuickPickItem, OpenStatusFilesCommandQuickPickItem, RepoStatusQuickPick } from './quickPicks/repoStatus';
|
||||||
Reference in New Issue
Block a user