mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-02-03 01:35:39 -05:00
Adds new recent changes annotations
This commit is contained in:
@@ -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
|
||||
};
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
24
src/commands/toggleFileRecentChanges.ts
Normal file
24
src/commands/toggleFileRecentChanges.ts
Normal 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`);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user