mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-01-23 09:45:38 -05:00
Adds ability to esc out of file annotations
This commit is contained in:
@@ -9,8 +9,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
|
||||
- Adds all-new recent changes annotations of the whole-file - annotates and highlights all of lines changed in the most recent commit
|
||||
- Can customize the [layout](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens#file-recent-changes-annotation-settings), as well as the [theme](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens#theme-settings)
|
||||
- Adds `Toggle Recent File Changes Annotations` command (`gitlens.toggleFileRecentChanges`) - toggles the recent changes annotations on and off
|
||||
- Adds ability to press `Escape` to quickly toggle any whole-file annotations off
|
||||
- Improves performance
|
||||
- Optimized git output parsing to increase speed and reduce memory usage
|
||||
- Optimized git output parsing to increase speed and dramatically reduce memory usage
|
||||
- Defers diff chunk parsing until it is actually required
|
||||
- Adds `gitlens.defaultDateFormat` setting to specify how all absolute dates will be formatted by default
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ GitLens provides an unobtrusive blame annotation at the end of the current line,
|
||||
- Adds a `details` hover annotation to the line's annotation, which provides more commit details ([optional](#file-blame-annotation-settings), on by default)
|
||||
- Adds a `heatmap` (age) indicator to the gutter annotations (on right edge by [default](#file-blame-annotation-settings)), which provides an easy, at-a-glance way to tell the age of a line ([optional](#file-blame-annotation-settings), on by default)
|
||||
- Indicator ranges from bright yellow (newer) to dark brown (older)
|
||||
- Press `Escape` to quickly toggle the annotations off
|
||||
|
||||
- Adds [customizable](#status-bar-settings) **blame information** about the current line to the **status bar** ([optional](#status-bar-settings), on by default)
|
||||
|
||||
@@ -61,6 +62,7 @@ GitLens provides an unobtrusive blame annotation at the end of the current line,
|
||||
- Highlights all of lines changed in the most recent commit
|
||||
- Adds a `details` hover annotation to each line, which provides more commit details ([optional](#file-blame-annotation-settings), on by default)
|
||||
- Adds a `changes` (diff) hover annotation to each line, which provides **instant** access to the line's previous version ([optional](#file-recent-changes-annotation-settings), on by default)
|
||||
- Press `Escape` to quickly toggle the annotations off
|
||||
|
||||
- Adds `Toggle Recent File Changes Annotations` command (`gitlens.toggleFileRecentChanges`) to toggle the recent changes annotations on and off
|
||||
|
||||
|
||||
2686
package.json
2686
package.json
File diff suppressed because it is too large
Load Diff
@@ -2,6 +2,7 @@
|
||||
import { Functions, Objects } from '../system';
|
||||
import { DecorationRenderOptions, Disposable, Event, EventEmitter, ExtensionContext, OverviewRulerLane, TextDocument, TextDocumentChangeEvent, TextEditor, TextEditorDecorationType, TextEditorViewColumnChangeEvent, window, workspace } from 'vscode';
|
||||
import { AnnotationProviderBase } from './annotationProvider';
|
||||
import { Keyboard, KeyboardScope, KeyCommand, Keys } from '../keyboard';
|
||||
import { TextDocumentComparer, TextEditorComparer } from '../comparers';
|
||||
import { ExtensionKey, IConfig, LineHighlightLocations, themeDefaults } from '../configuration';
|
||||
import { BlameabilityChangeEvent, GitContextTracker, GitService, GitUri } from '../gitService';
|
||||
@@ -193,13 +194,17 @@ export class AnnotationController extends Disposable {
|
||||
|
||||
async clear(column: number) {
|
||||
const provider = this._annotationProviders.get(column);
|
||||
if (!provider) return;
|
||||
if (provider === undefined) return;
|
||||
|
||||
this._annotationProviders.delete(column);
|
||||
await provider.dispose();
|
||||
|
||||
if (this._annotationProviders.size === 0) {
|
||||
Logger.log(`Remove listener registrations for annotations`);
|
||||
|
||||
this._keyboardScope && this._keyboardScope.dispose();
|
||||
this._keyboardScope = undefined;
|
||||
|
||||
this._annotationsDisposable && this._annotationsDisposable.dispose();
|
||||
this._annotationsDisposable = undefined;
|
||||
}
|
||||
@@ -207,17 +212,19 @@ export class AnnotationController extends Disposable {
|
||||
this._onDidToggleAnnotations.fire();
|
||||
}
|
||||
|
||||
getAnnotationType(editor: TextEditor): FileAnnotationType | undefined {
|
||||
getAnnotationType(editor: TextEditor | undefined): FileAnnotationType | undefined {
|
||||
const provider = this.getProvider(editor);
|
||||
return provider === undefined ? undefined : provider.annotationType;
|
||||
}
|
||||
|
||||
getProvider(editor: TextEditor): AnnotationProviderBase | undefined {
|
||||
getProvider(editor: TextEditor | undefined): AnnotationProviderBase | undefined {
|
||||
if (!editor || !editor.document || !this.git.isEditorBlameable(editor)) return undefined;
|
||||
|
||||
return this._annotationProviders.get(editor.viewColumn || -1);
|
||||
}
|
||||
|
||||
private _keyboardScope: KeyboardScope | undefined = undefined;
|
||||
|
||||
async showAnnotations(editor: TextEditor, type: FileAnnotationType, shaOrLine?: string | number): Promise<boolean> {
|
||||
if (!editor || !editor.document || !this.git.isEditorBlameable(editor)) return false;
|
||||
|
||||
@@ -227,6 +234,21 @@ export class AnnotationController extends Disposable {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Allows pressing escape to exit the annotations
|
||||
if (this._keyboardScope === undefined) {
|
||||
this._keyboardScope = await Keyboard.instance.beginScope({
|
||||
escape: {
|
||||
onDidPressKey: (key: Keys) => {
|
||||
const editor = window.activeTextEditor;
|
||||
if (editor === undefined) return Promise.resolve(undefined);
|
||||
|
||||
this.clear(editor.viewColumn || -1);
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
} as KeyCommand
|
||||
});
|
||||
}
|
||||
|
||||
const gitUri = await GitUri.fromUri(editor.document.uri, this.git);
|
||||
|
||||
let provider: AnnotationProviderBase | undefined = undefined;
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
'use strict';
|
||||
export * from './commands/common';
|
||||
|
||||
export * from './commands/keyboard';
|
||||
|
||||
export * from './commands/closeUnchangedFiles';
|
||||
export * from './commands/copyMessageToClipboard';
|
||||
export * from './commands/copyShaToClipboard';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
'use strict';
|
||||
import { commands, Disposable, TextDocumentShowOptions, TextEditor, TextEditorEdit, Uri, window, workspace } from 'vscode';
|
||||
import { BuiltInCommands } from '../constants';
|
||||
import { Logger } from '../logger';
|
||||
import { Telemetry } from '../telemetry';
|
||||
|
||||
@@ -87,27 +86,6 @@ export function getCommandUri(uri?: Uri, editor?: TextEditor): Uri | undefined {
|
||||
return editor.document.uri;
|
||||
}
|
||||
|
||||
export type CommandContext = 'gitlens:canToggleCodeLens' |
|
||||
'gitlens:enabled' |
|
||||
'gitlens:hasRemotes' |
|
||||
'gitlens:isBlameable' |
|
||||
'gitlens:isRepository' |
|
||||
'gitlens:isTracked' |
|
||||
'gitlens:key';
|
||||
export const CommandContext = {
|
||||
CanToggleCodeLens: 'gitlens:canToggleCodeLens' as CommandContext,
|
||||
Enabled: 'gitlens:enabled' as CommandContext,
|
||||
HasRemotes: 'gitlens:hasRemotes' as CommandContext,
|
||||
IsBlameable: 'gitlens:isBlameable' as CommandContext,
|
||||
IsRepository: 'gitlens:isRepository' as CommandContext,
|
||||
IsTracked: 'gitlens:isTracked' as CommandContext,
|
||||
Key: 'gitlens:key' as CommandContext
|
||||
};
|
||||
|
||||
export function setCommandContext(key: CommandContext | string, value: any) {
|
||||
return commands.executeCommand(BuiltInCommands.SetContext, key, value);
|
||||
}
|
||||
|
||||
export abstract class Command extends Disposable {
|
||||
|
||||
private _disposable: Disposable;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
'use strict';
|
||||
import { commands } from 'vscode';
|
||||
|
||||
export const ExtensionId = 'gitlens';
|
||||
export const ExtensionKey = ExtensionId;
|
||||
@@ -38,6 +39,27 @@ export const BuiltInCommands = {
|
||||
ToggleRenderWhitespace: 'editor.action.toggleRenderWhitespace' as BuiltInCommands
|
||||
};
|
||||
|
||||
export type CommandContext = 'gitlens:canToggleCodeLens' |
|
||||
'gitlens:enabled' |
|
||||
'gitlens:hasRemotes' |
|
||||
'gitlens:isBlameable' |
|
||||
'gitlens:isRepository' |
|
||||
'gitlens:isTracked' |
|
||||
'gitlens:key';
|
||||
export const CommandContext = {
|
||||
CanToggleCodeLens: 'gitlens:canToggleCodeLens' as CommandContext,
|
||||
Enabled: 'gitlens:enabled' as CommandContext,
|
||||
HasRemotes: 'gitlens:hasRemotes' as CommandContext,
|
||||
IsBlameable: 'gitlens:isBlameable' as CommandContext,
|
||||
IsRepository: 'gitlens:isRepository' as CommandContext,
|
||||
IsTracked: 'gitlens:isTracked' as CommandContext,
|
||||
Key: 'gitlens:key' as CommandContext
|
||||
};
|
||||
|
||||
export function setCommandContext(key: CommandContext | string, value: any) {
|
||||
return commands.executeCommand(BuiltInCommands.SetContext, key, value);
|
||||
}
|
||||
|
||||
export type DocumentSchemes = 'file' | 'git' | 'gitlens-git';
|
||||
export const DocumentSchemes = {
|
||||
File: 'file' as DocumentSchemes,
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// import { Objects } from './system';
|
||||
import { ExtensionContext, extensions, languages, window, workspace } from 'vscode';
|
||||
import { AnnotationController } from './annotations/annotationController';
|
||||
import { CommandContext, setCommandContext } from './commands';
|
||||
import { CloseUnchangedFilesCommand, OpenChangedFilesCommand } from './commands';
|
||||
import { OpenBranchInRemoteCommand, OpenCommitInRemoteCommand, OpenFileInRemoteCommand, OpenInRemoteCommand, OpenRepoInRemoteCommand } from './commands';
|
||||
import { CopyMessageToClipboardCommand, CopyShaToClipboardCommand } from './commands';
|
||||
@@ -16,13 +15,13 @@ import { ShowCommitSearchCommand, ShowQuickCommitDetailsCommand, ShowQuickCommit
|
||||
import { ShowQuickRepoStatusCommand, ShowQuickStashListCommand } from './commands';
|
||||
import { StashApplyCommand, StashDeleteCommand, StashSaveCommand } from './commands';
|
||||
import { ToggleCodeLensCommand } from './commands';
|
||||
import { Keyboard } from './commands';
|
||||
import { CodeLensLocations, IConfig, LineHighlightLocations } from './configuration';
|
||||
import { ApplicationInsightsKey, ExtensionKey, QualifiedExtensionId, WorkspaceState } from './constants';
|
||||
import { ApplicationInsightsKey, CommandContext, ExtensionKey, QualifiedExtensionId, setCommandContext, WorkspaceState } from './constants';
|
||||
import { CurrentLineController, LineAnnotationType } from './currentLineController';
|
||||
import { GitContentProvider } from './gitContentProvider';
|
||||
import { GitRevisionCodeLensProvider } from './gitRevisionCodeLensProvider';
|
||||
import { GitContextTracker, GitService } from './gitService';
|
||||
import { Keyboard } from './keyboard';
|
||||
import { Logger } from './logger';
|
||||
import { Messages, SuppressedKeys } from './messages';
|
||||
import { Telemetry } from './telemetry';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
import { Disposable, Event, EventEmitter, TextDocument, TextDocumentChangeEvent, TextEditor, window, workspace } from 'vscode';
|
||||
import { CommandContext, setCommandContext } from '../commands';
|
||||
import { TextDocumentComparer } from '../comparers';
|
||||
import { CommandContext, setCommandContext } from '../constants';
|
||||
import { GitService, GitUri } from '../gitService';
|
||||
import { Logger } from '../logger';
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
'use strict';
|
||||
import { Iterables, Objects } from './system';
|
||||
import { Disposable, Event, EventEmitter, ExtensionContext, FileSystemWatcher, languages, Location, Position, Range, TextDocument, TextDocumentChangeEvent, TextEditor, Uri, workspace } from 'vscode';
|
||||
import { CommandContext, setCommandContext } from './commands';
|
||||
import { IConfig } from './configuration';
|
||||
import { DocumentSchemes, ExtensionKey } from './constants';
|
||||
import { CommandContext, DocumentSchemes, ExtensionKey, setCommandContext } from './constants';
|
||||
import { Git, GitAuthor, GitBlame, GitBlameCommit, GitBlameLine, GitBlameLines, GitBlameParser, GitBranch, GitCommit, GitDiff, GitDiffLine, GitDiffParser, GitLog, GitLogCommit, GitLogParser, GitRemote, GitStash, GitStashParser, GitStatus, GitStatusFile, GitStatusParser, IGit, setDefaultEncoding } from './git/git';
|
||||
import { GitUri, IGitCommitInfo, IGitUriData } from './git/gitUri';
|
||||
import { GitCodeLensProvider } from './gitCodeLensProvider';
|
||||
|
||||
@@ -1,140 +1,143 @@
|
||||
'use strict';
|
||||
import { commands, Disposable } from 'vscode';
|
||||
import { CommandContext, setCommandContext } from './common';
|
||||
import { ExtensionKey } from '../constants';
|
||||
import { QuickPickItem } from '../quickPicks';
|
||||
import { Logger } from '../logger';
|
||||
|
||||
const keyNoopCommand = Object.create(null) as QuickPickItem;
|
||||
export { keyNoopCommand as KeyNoopCommand };
|
||||
|
||||
export declare type Keys = 'left' | 'right' | ',' | '.';
|
||||
export const keys: Keys[] = [
|
||||
'left',
|
||||
'right',
|
||||
',',
|
||||
'.'
|
||||
];
|
||||
|
||||
export declare interface KeyMapping {
|
||||
[id: string]: (QuickPickItem | (() => Promise<QuickPickItem>) | undefined);
|
||||
}
|
||||
|
||||
const mappings: KeyMapping[] = [];
|
||||
|
||||
let _instance: Keyboard;
|
||||
|
||||
export class KeyboardScope extends Disposable {
|
||||
|
||||
constructor(private mapping: KeyMapping) {
|
||||
super(() => this.dispose());
|
||||
|
||||
for (const key in mapping) {
|
||||
mapping[key] = mapping[key] || keyNoopCommand;
|
||||
}
|
||||
}
|
||||
|
||||
async dispose() {
|
||||
const index = mappings.indexOf(this.mapping);
|
||||
Logger.log('KeyboardScope.dispose', mappings.length, index);
|
||||
if (index === (mappings.length - 1)) {
|
||||
mappings.pop();
|
||||
await this.updateKeyCommandsContext(mappings[mappings.length - 1]);
|
||||
}
|
||||
else {
|
||||
mappings.splice(index, 1);
|
||||
}
|
||||
}
|
||||
|
||||
async begin() {
|
||||
mappings.push(this.mapping);
|
||||
await this.updateKeyCommandsContext(this.mapping);
|
||||
return this;
|
||||
}
|
||||
|
||||
async clearKeyCommand(key: Keys) {
|
||||
const mapping = mappings[mappings.length - 1];
|
||||
if (mapping !== this.mapping || !mapping[key]) return;
|
||||
|
||||
Logger.log('KeyboardScope.clearKeyCommand', mappings.length, key);
|
||||
mapping[key] = undefined;
|
||||
await setCommandContext(`${CommandContext.Key}:${key}`, false);
|
||||
}
|
||||
|
||||
async setKeyCommand(key: Keys, command: QuickPickItem | (() => Promise<QuickPickItem>)) {
|
||||
const mapping = mappings[mappings.length - 1];
|
||||
if (mapping !== this.mapping) return;
|
||||
|
||||
Logger.log('KeyboardScope.setKeyCommand', mappings.length, key, !!mapping[key]);
|
||||
|
||||
if (!mapping[key]) {
|
||||
mapping[key] = command;
|
||||
await setCommandContext(`${CommandContext.Key}:${key}`, true);
|
||||
}
|
||||
else {
|
||||
mapping[key] = command;
|
||||
}
|
||||
}
|
||||
|
||||
private async updateKeyCommandsContext(mapping: KeyMapping) {
|
||||
const promises = [];
|
||||
for (const key of keys) {
|
||||
promises.push(setCommandContext(`${CommandContext.Key}:${key}`, !!(mapping && mapping[key])));
|
||||
}
|
||||
await Promise.all(promises);
|
||||
}
|
||||
}
|
||||
|
||||
export class Keyboard extends Disposable {
|
||||
|
||||
static get instance(): Keyboard {
|
||||
return _instance;
|
||||
}
|
||||
|
||||
private _disposable: Disposable;
|
||||
|
||||
constructor() {
|
||||
super(() => this.dispose());
|
||||
|
||||
const subscriptions: Disposable[] = [];
|
||||
|
||||
for (const key of keys) {
|
||||
subscriptions.push(commands.registerCommand(`${ExtensionKey}.key.${key}`, () => this.execute(key), this));
|
||||
}
|
||||
|
||||
this._disposable = Disposable.from(...subscriptions);
|
||||
|
||||
_instance = this;
|
||||
}
|
||||
|
||||
dispose() {
|
||||
this._disposable && this._disposable.dispose();
|
||||
}
|
||||
|
||||
async beginScope(mapping?: KeyMapping): Promise<KeyboardScope> {
|
||||
Logger.log('Keyboard.beginScope', mappings.length);
|
||||
return await new KeyboardScope(mapping ? Object.assign(Object.create(null), mapping) : Object.create(null)).begin();
|
||||
}
|
||||
|
||||
async execute(key: Keys): Promise<{} | undefined> {
|
||||
if (!mappings.length) return undefined;
|
||||
|
||||
try {
|
||||
const mapping = mappings[mappings.length - 1];
|
||||
|
||||
let command = mapping[key] as QuickPickItem | (() => Promise<QuickPickItem>);
|
||||
if (typeof command === 'function') {
|
||||
command = await command();
|
||||
}
|
||||
if (!command || typeof command.onDidPressKey !== 'function') return undefined;
|
||||
|
||||
Logger.log('Keyboard.execute', key);
|
||||
|
||||
return await command.onDidPressKey(key);
|
||||
}
|
||||
catch (ex) {
|
||||
Logger.error(ex, 'Keyboard.execute');
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
'use strict';
|
||||
import { commands, Disposable } from 'vscode';
|
||||
import { CommandContext, ExtensionKey, setCommandContext } from './constants';
|
||||
import { Logger } from './logger';
|
||||
|
||||
export declare interface KeyCommand {
|
||||
onDidPressKey?(key: Keys): Promise<{} | undefined>;
|
||||
}
|
||||
|
||||
const keyNoopCommand = Object.create(null) as KeyCommand;
|
||||
export { keyNoopCommand as KeyNoopCommand };
|
||||
|
||||
export declare type Keys = 'left' | 'right' | ',' | '.' | 'escape';
|
||||
export const keys: Keys[] = [
|
||||
'left',
|
||||
'right',
|
||||
',',
|
||||
'.',
|
||||
'escape'
|
||||
];
|
||||
|
||||
export declare interface KeyMapping {
|
||||
[id: string]: (KeyCommand | (() => Promise<KeyCommand>) | undefined);
|
||||
}
|
||||
|
||||
const mappings: KeyMapping[] = [];
|
||||
|
||||
let _instance: Keyboard;
|
||||
|
||||
export class KeyboardScope extends Disposable {
|
||||
|
||||
constructor(private mapping: KeyMapping) {
|
||||
super(() => this.dispose());
|
||||
|
||||
for (const key in mapping) {
|
||||
mapping[key] = mapping[key] || keyNoopCommand;
|
||||
}
|
||||
}
|
||||
|
||||
async dispose() {
|
||||
const index = mappings.indexOf(this.mapping);
|
||||
Logger.log('KeyboardScope.dispose', mappings.length, index);
|
||||
if (index === (mappings.length - 1)) {
|
||||
mappings.pop();
|
||||
await this.updateKeyCommandsContext(mappings[mappings.length - 1]);
|
||||
}
|
||||
else {
|
||||
mappings.splice(index, 1);
|
||||
}
|
||||
}
|
||||
|
||||
async begin() {
|
||||
mappings.push(this.mapping);
|
||||
await this.updateKeyCommandsContext(this.mapping);
|
||||
return this;
|
||||
}
|
||||
|
||||
async clearKeyCommand(key: Keys) {
|
||||
const mapping = mappings[mappings.length - 1];
|
||||
if (mapping !== this.mapping || !mapping[key]) return;
|
||||
|
||||
Logger.log('KeyboardScope.clearKeyCommand', mappings.length, key);
|
||||
mapping[key] = undefined;
|
||||
await setCommandContext(`${CommandContext.Key}:${key}`, false);
|
||||
}
|
||||
|
||||
async setKeyCommand(key: Keys, command: KeyCommand | (() => Promise<KeyCommand>)) {
|
||||
const mapping = mappings[mappings.length - 1];
|
||||
if (mapping !== this.mapping) return;
|
||||
|
||||
Logger.log('KeyboardScope.setKeyCommand', mappings.length, key, !!mapping[key]);
|
||||
|
||||
if (!mapping[key]) {
|
||||
mapping[key] = command;
|
||||
await setCommandContext(`${CommandContext.Key}:${key}`, true);
|
||||
}
|
||||
else {
|
||||
mapping[key] = command;
|
||||
}
|
||||
}
|
||||
|
||||
private async updateKeyCommandsContext(mapping: KeyMapping) {
|
||||
const promises = [];
|
||||
for (const key of keys) {
|
||||
promises.push(setCommandContext(`${CommandContext.Key}:${key}`, !!(mapping && mapping[key])));
|
||||
}
|
||||
await Promise.all(promises);
|
||||
}
|
||||
}
|
||||
|
||||
export class Keyboard extends Disposable {
|
||||
|
||||
static get instance(): Keyboard {
|
||||
return _instance;
|
||||
}
|
||||
|
||||
private _disposable: Disposable;
|
||||
|
||||
constructor() {
|
||||
super(() => this.dispose());
|
||||
|
||||
const subscriptions: Disposable[] = [];
|
||||
|
||||
for (const key of keys) {
|
||||
subscriptions.push(commands.registerCommand(`${ExtensionKey}.key.${key}`, () => this.execute(key), this));
|
||||
}
|
||||
|
||||
this._disposable = Disposable.from(...subscriptions);
|
||||
|
||||
_instance = this;
|
||||
}
|
||||
|
||||
dispose() {
|
||||
this._disposable && this._disposable.dispose();
|
||||
}
|
||||
|
||||
async beginScope(mapping?: KeyMapping): Promise<KeyboardScope> {
|
||||
Logger.log('Keyboard.beginScope', mappings.length);
|
||||
return await new KeyboardScope(mapping ? Object.assign(Object.create(null), mapping) : Object.create(null)).begin();
|
||||
}
|
||||
|
||||
async execute(key: Keys): Promise<{} | undefined> {
|
||||
if (!mappings.length) return undefined;
|
||||
|
||||
try {
|
||||
const mapping = mappings[mappings.length - 1];
|
||||
|
||||
let command = mapping[key] as KeyCommand | (() => Promise<KeyCommand>);
|
||||
if (typeof command === 'function') {
|
||||
command = await command();
|
||||
}
|
||||
if (!command || typeof command.onDidPressKey !== 'function') return undefined;
|
||||
|
||||
Logger.log('Keyboard.execute', key);
|
||||
|
||||
return await command.onDidPressKey(key);
|
||||
}
|
||||
catch (ex) {
|
||||
Logger.error(ex, 'Keyboard.execute');
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,10 @@
|
||||
'use strict';
|
||||
import { Arrays, Iterables } from '../system';
|
||||
import { CancellationTokenSource, QuickPickOptions, Uri, window } from 'vscode';
|
||||
import { Commands, Keyboard, KeyNoopCommand, ShowCommitSearchCommandArgs, ShowQuickBranchHistoryCommandArgs } from '../commands';
|
||||
import { Commands, ShowCommitSearchCommandArgs, ShowQuickBranchHistoryCommandArgs } from '../commands';
|
||||
import { CommandQuickPickItem, CommitQuickPickItem, getQuickPickIgnoreFocusOut, showQuickPickProgress } from './common';
|
||||
import { GitLog, GitService, GitUri, RemoteResource } from '../gitService';
|
||||
import { Keyboard, KeyNoopCommand } from '../keyboard';
|
||||
import { OpenRemotesCommandQuickPickItem } from './remotes';
|
||||
|
||||
export class BranchHistoryQuickPick {
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
'use strict';
|
||||
import { Arrays, Iterables } from '../system';
|
||||
import { commands, QuickPickOptions, TextDocumentShowOptions, Uri, window } from 'vscode';
|
||||
import { Commands, CopyMessageToClipboardCommandArgs, CopyShaToClipboardCommandArgs, DiffDirectoryCommandCommandArgs, DiffWithPreviousCommandArgs, Keyboard, KeyNoopCommand, Keys, ShowQuickCommitDetailsCommandArgs, StashApplyCommandArgs, StashDeleteCommandArgs } from '../commands';
|
||||
import { Commands, CopyMessageToClipboardCommandArgs, CopyShaToClipboardCommandArgs, DiffDirectoryCommandCommandArgs, DiffWithPreviousCommandArgs, ShowQuickCommitDetailsCommandArgs, StashApplyCommandArgs, StashDeleteCommandArgs } from '../commands';
|
||||
import { CommandQuickPickItem, getQuickPickIgnoreFocusOut, KeyCommandQuickPickItem, OpenFileCommandQuickPickItem, OpenFilesCommandQuickPickItem, QuickPickItem } from './common';
|
||||
import { getGitStatusIcon, GitCommit, GitLog, GitLogCommit, GitService, GitStashCommit, GitStatusFile, GitStatusFileStatus, GitUri, IGitCommitInfo, IGitStatusFile, RemoteResource } from '../gitService';
|
||||
import { Keyboard, KeyNoopCommand, Keys } from '../keyboard';
|
||||
import { OpenRemotesCommandQuickPickItem } from './remotes';
|
||||
import * as moment from 'moment';
|
||||
import * as path from 'path';
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
'use strict';
|
||||
import { Arrays, Iterables } from '../system';
|
||||
import { QuickPickItem, QuickPickOptions, Uri, window } from 'vscode';
|
||||
import { Commands, CopyMessageToClipboardCommandArgs, CopyShaToClipboardCommandArgs, DiffWithPreviousCommandArgs, DiffWithWorkingCommandArgs, Keyboard, KeyNoopCommand, ShowQuickCommitDetailsCommandArgs, ShowQuickCommitFileDetailsCommandArgs, ShowQuickFileHistoryCommandArgs } from '../commands';
|
||||
import { Commands, CopyMessageToClipboardCommandArgs, CopyShaToClipboardCommandArgs, DiffWithPreviousCommandArgs, DiffWithWorkingCommandArgs, ShowQuickCommitDetailsCommandArgs, ShowQuickCommitFileDetailsCommandArgs, ShowQuickFileHistoryCommandArgs } from '../commands';
|
||||
import { CommandQuickPickItem, getQuickPickIgnoreFocusOut, KeyCommandQuickPickItem, OpenFileCommandQuickPickItem } from './common';
|
||||
import { GitBranch, GitLog, GitLogCommit, GitService, GitUri, RemoteResource } from '../gitService';
|
||||
import { Keyboard, KeyNoopCommand } from '../keyboard';
|
||||
import { OpenRemotesCommandQuickPickItem } from './remotes';
|
||||
import * as moment from 'moment';
|
||||
import * as path from 'path';
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
'use strict';
|
||||
import { Iterables } from '../system';
|
||||
import { QuickPickOptions, window } from 'vscode';
|
||||
import { Keyboard } from '../commands';
|
||||
import { GitLog, GitService } from '../gitService';
|
||||
import { Keyboard } from '../keyboard';
|
||||
import { CommandQuickPickItem, CommitQuickPickItem, getQuickPickIgnoreFocusOut } from '../quickPicks';
|
||||
|
||||
export class CommitsQuickPick {
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
'use strict';
|
||||
import { CancellationTokenSource, commands, Disposable, QuickPickItem, QuickPickOptions, TextDocumentShowOptions, TextEditor, Uri, window, workspace } from 'vscode';
|
||||
import { Commands, Keyboard, KeyboardScope, KeyMapping, Keys, openEditor } from '../commands';
|
||||
import { Commands, openEditor } from '../commands';
|
||||
import { ExtensionKey, IAdvancedConfig } from '../configuration';
|
||||
import { GitCommit, GitLogCommit, GitStashCommit } from '../gitService';
|
||||
import { Keyboard, KeyboardScope, KeyMapping, Keys } from '../keyboard';
|
||||
// import { Logger } from '../logger';
|
||||
import * as moment from 'moment';
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
'use strict';
|
||||
import { Arrays, Iterables } from '../system';
|
||||
import { CancellationTokenSource, QuickPickOptions, Uri, window } from 'vscode';
|
||||
import { Commands, Keyboard, KeyNoopCommand, ShowQuickCurrentBranchHistoryCommandArgs, ShowQuickFileHistoryCommandArgs } from '../commands';
|
||||
import { Commands, ShowQuickCurrentBranchHistoryCommandArgs, ShowQuickFileHistoryCommandArgs } from '../commands';
|
||||
import { CommandQuickPickItem, CommitQuickPickItem, getQuickPickIgnoreFocusOut, showQuickPickProgress } from './common';
|
||||
import { GitLog, GitService, GitUri, RemoteResource } from '../gitService';
|
||||
import { Keyboard, KeyNoopCommand } from '../keyboard';
|
||||
import { OpenRemotesCommandQuickPickItem } from './remotes';
|
||||
import * as path from 'path';
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
'use strict';
|
||||
import { Iterables } from '../system';
|
||||
import { commands, QuickPickOptions, TextDocumentShowOptions, Uri, window } from 'vscode';
|
||||
import { Commands, DiffWithWorkingCommandArgs, Keyboard, Keys, OpenChangedFilesCommandArgs, ShowQuickBranchHistoryCommandArgs, ShowQuickRepoStatusCommandArgs, ShowQuickStashListCommandArgs } from '../commands';
|
||||
import { Commands, DiffWithWorkingCommandArgs, OpenChangedFilesCommandArgs, ShowQuickBranchHistoryCommandArgs, ShowQuickRepoStatusCommandArgs, ShowQuickStashListCommandArgs } from '../commands';
|
||||
import { CommandQuickPickItem, getQuickPickIgnoreFocusOut, OpenFileCommandQuickPickItem, QuickPickItem } from './common';
|
||||
import { GitStatus, GitStatusFile, GitUri } from '../gitService';
|
||||
import { Keyboard, Keys } from '../keyboard';
|
||||
import * as path from 'path';
|
||||
|
||||
export class OpenStatusFileCommandQuickPickItem extends OpenFileCommandQuickPickItem {
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
'use strict';
|
||||
import { Iterables } from '../system';
|
||||
import { QuickPickOptions, window } from 'vscode';
|
||||
import { Commands, Keyboard, StashSaveCommandArgs } from '../commands';
|
||||
import { Commands, StashSaveCommandArgs } from '../commands';
|
||||
import { GitService, GitStash } from '../gitService';
|
||||
import { Keyboard } from '../keyboard';
|
||||
import { CommandQuickPickItem, CommitQuickPickItem, getQuickPickIgnoreFocusOut } from '../quickPicks';
|
||||
|
||||
export class StashListQuickPick {
|
||||
|
||||
Reference in New Issue
Block a user