Adds new recent changes annotations

This commit is contained in:
Eric Amodio
2017-06-10 04:19:07 -04:00
parent 23c7171d7f
commit 48a1ca704d
19 changed files with 299 additions and 136 deletions

View File

@@ -39,6 +39,7 @@ export type Commands = 'gitlens.closeUnchangedFiles' |
'gitlens.stashSave' |
'gitlens.toggleCodeLens' |
'gitlens.toggleFileBlame' |
'gitlens.toggleFileRecentChanges' |
'gitlens.toggleLineBlame';
export const Commands = {
CloseUnchangedFiles: 'gitlens.closeUnchangedFiles' as Commands,
@@ -76,6 +77,7 @@ export const Commands = {
StashSave: 'gitlens.stashSave' as Commands,
ToggleCodeLens: 'gitlens.toggleCodeLens' as Commands,
ToggleFileBlame: 'gitlens.toggleFileBlame' as Commands,
ToggleFileRecentChanges: 'gitlens.toggleFileRecentChanges' as Commands,
ToggleLineBlame: 'gitlens.toggleLineBlame' as Commands
};

View File

@@ -1,8 +1,8 @@
'use strict';
import { TextEditor, TextEditorEdit, Uri, window, workspace } from 'vscode';
import { AnnotationController } from '../annotations/annotationController';
import { AnnotationController, FileAnnotationType } from '../annotations/annotationController';
import { Commands, EditorCommand } from './common';
import { ExtensionKey, FileAnnotationType, IConfig } from '../configuration';
import { ExtensionKey, IConfig } from '../configuration';
import { Logger } from '../logger';
export interface ShowFileBlameCommandArgs {

View File

@@ -1,8 +1,8 @@
'use strict';
import { TextEditor, TextEditorEdit, Uri, window, workspace } from 'vscode';
import { CurrentLineController } from '../currentLineController';
import { CurrentLineController, LineAnnotationType } from '../currentLineController';
import { Commands, EditorCommand } from './common';
import { ExtensionKey, IConfig, LineAnnotationType } from '../configuration';
import { ExtensionKey, IConfig } from '../configuration';
import { Logger } from '../logger';
export interface ShowLineBlameCommandArgs {

View File

@@ -1,8 +1,8 @@
'use strict';
import { TextEditor, TextEditorEdit, Uri, window, workspace } from 'vscode';
import { AnnotationController } from '../annotations/annotationController';
import { AnnotationController, FileAnnotationType } from '../annotations/annotationController';
import { Commands, EditorCommand } from './common';
import { ExtensionKey, FileAnnotationType, IConfig } from '../configuration';
import { ExtensionKey, IConfig } from '../configuration';
import { Logger } from '../logger';
export interface ToggleFileBlameCommandArgs {

View File

@@ -0,0 +1,24 @@
'use strict';
import { TextEditor, TextEditorEdit, Uri, window } from 'vscode';
import { AnnotationController, FileAnnotationType } from '../annotations/annotationController';
import { Commands, EditorCommand } from './common';
import { Logger } from '../logger';
export class ToggleFileRecentChangesCommand extends EditorCommand {
constructor(private annotationController: AnnotationController) {
super(Commands.ToggleFileRecentChanges);
}
async execute(editor: TextEditor, edit: TextEditorEdit, uri?: Uri): Promise<any> {
if (editor !== undefined && editor.document !== undefined && editor.document.isDirty) return undefined;
try {
return this.annotationController.toggleAnnotations(editor, FileAnnotationType.RecentChanges);
}
catch (ex) {
Logger.error(ex, 'ToggleFileRecentChangesCommand');
return window.showErrorMessage(`Unable to toggle recent file changes annotations. See output channel for more details`);
}
}
}

View File

@@ -1,8 +1,8 @@
'use strict';
import { TextEditor, TextEditorEdit, Uri, window, workspace } from 'vscode';
import { CurrentLineController } from '../currentLineController';
import { CurrentLineController, LineAnnotationType } from '../currentLineController';
import { Commands, EditorCommand } from './common';
import { ExtensionKey, IConfig, LineAnnotationType } from '../configuration';
import { ExtensionKey, IConfig } from '../configuration';
import { Logger } from '../logger';
export interface ToggleLineBlameCommandArgs {