From 30bb4398a341f46d267c361cddeb2703f8b38045 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Fri, 9 Jun 2017 14:53:52 -0400 Subject: [PATCH] Changes formatting & ordering --- src/commands/common.ts | 61 +++++++++++++++++++++++++++++++----------- src/configuration.ts | 20 ++++++++++++-- src/constants.ts | 15 ++++++++++- 3 files changed, 78 insertions(+), 18 deletions(-) diff --git a/src/commands/common.ts b/src/commands/common.ts index ae6c56b..af95eb6 100644 --- a/src/commands/common.ts +++ b/src/commands/common.ts @@ -4,16 +4,41 @@ import { BuiltInCommands } from '../constants'; import { Logger } from '../logger'; import { Telemetry } from '../telemetry'; -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.openBranchInRemote' | 'gitlens.openCommitInRemote' | 'gitlens.openFileInRemote' | 'gitlens.openInRemote' | 'gitlens.openRepoInRemote' | - 'gitlens.showBlameHistory' | 'gitlens.showCommitSearch' | 'gitlens.showFileBlame' | 'gitlens.showFileHistory' | - 'gitlens.showLastQuickPick' | 'gitlens.showLineBlame' | 'gitlens.showQuickBranchHistory' | - 'gitlens.showQuickCommitDetails' | 'gitlens.showQuickCommitFileDetails' | - 'gitlens.showQuickFileHistory' | 'gitlens.showQuickRepoHistory' | - 'gitlens.showQuickRepoStatus' | 'gitlens.showQuickStashList' | - 'gitlens.stashApply' | 'gitlens.stashDelete' | 'gitlens.stashSave' | - 'gitlens.toggleCodeLens' | 'gitlens.toggleFileBlame' | 'gitlens.toggleLineBlame'; +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.openBranchInRemote' | + 'gitlens.openCommitInRemote' | + 'gitlens.openFileInRemote' | + 'gitlens.openInRemote' | + 'gitlens.openRepoInRemote' | + 'gitlens.showBlameHistory' | + 'gitlens.showCommitSearch' | + 'gitlens.showFileBlame' | + 'gitlens.showFileHistory' | + 'gitlens.showLastQuickPick' | + 'gitlens.showLineBlame' | + 'gitlens.showQuickBranchHistory' | + 'gitlens.showQuickCommitDetails' | + 'gitlens.showQuickCommitFileDetails' | + 'gitlens.showQuickFileHistory' | + 'gitlens.showQuickRepoHistory' | + 'gitlens.showQuickRepoStatus' | + 'gitlens.showQuickStashList' | + 'gitlens.stashApply' | + 'gitlens.stashDelete' | + 'gitlens.stashSave' | + 'gitlens.toggleCodeLens' | + 'gitlens.toggleFileBlame' | + 'gitlens.toggleLineBlame'; export const Commands = { CloseUnchangedFiles: 'gitlens.closeUnchangedFiles' as Commands, CopyMessageToClipboard: 'gitlens.copyMessageToClipboard' as Commands, @@ -31,12 +56,12 @@ export const Commands = { OpenFileInRemote: 'gitlens.openFileInRemote' as Commands, OpenInRemote: 'gitlens.openInRemote' as Commands, OpenRepoInRemote: 'gitlens.openRepoInRemote' as Commands, - ShowFileBlame: 'gitlens.showFileBlame' as Commands, - ShowLineBlame: 'gitlens.showLineBlame' as Commands, ShowBlameHistory: 'gitlens.showBlameHistory' as Commands, ShowCommitSearch: 'gitlens.showCommitSearch' as Commands, + ShowFileBlame: 'gitlens.showFileBlame' as Commands, ShowFileHistory: 'gitlens.showFileHistory' as Commands, ShowLastQuickPick: 'gitlens.showLastQuickPick' as Commands, + ShowLineBlame: 'gitlens.showLineBlame' as Commands, ShowQuickCommitDetails: 'gitlens.showQuickCommitDetails' as Commands, ShowQuickCommitFileDetails: 'gitlens.showQuickCommitFileDetails' as Commands, ShowQuickFileHistory: 'gitlens.showQuickFileHistory' as Commands, @@ -47,9 +72,9 @@ export const Commands = { StashApply: 'gitlens.stashApply' as Commands, StashDelete: 'gitlens.stashDelete' as Commands, StashSave: 'gitlens.stashSave' as Commands, + ToggleCodeLens: 'gitlens.toggleCodeLens' as Commands, ToggleFileBlame: 'gitlens.toggleFileBlame' as Commands, - ToggleLineBlame: 'gitlens.toggleLineBlame' as Commands, - ToggleCodeLens: 'gitlens.toggleCodeLens' as Commands + ToggleLineBlame: 'gitlens.toggleLineBlame' as Commands }; export function getCommandUri(uri?: Uri, editor?: TextEditor): Uri | undefined { @@ -58,7 +83,13 @@ 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 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, diff --git a/src/configuration.ts b/src/configuration.ts index 9306e45..f9b137e 100644 --- a/src/configuration.ts +++ b/src/configuration.ts @@ -11,7 +11,14 @@ export const BlameLineHighlightLocations = { OverviewRuler: 'overviewRuler' as BlameLineHighlightLocations }; -export type CodeLensCommand = 'gitlens.toggleFileBlame' | 'gitlens.showBlameHistory' | 'gitlens.showFileHistory' | 'gitlens.diffWithPrevious' | 'gitlens.showQuickCommitDetails' | 'gitlens.showQuickCommitFileDetails' | 'gitlens.showQuickFileHistory' | 'gitlens.showQuickRepoHistory'; +export type CodeLensCommand = 'gitlens.toggleFileBlame' | + 'gitlens.showBlameHistory' | + 'gitlens.showFileHistory' | + 'gitlens.diffWithPrevious' | + 'gitlens.showQuickCommitDetails' | + 'gitlens.showQuickCommitFileDetails' | + 'gitlens.showQuickFileHistory' | + 'gitlens.showQuickRepoHistory'; export const CodeLensCommand = { BlameAnnotate: Commands.ToggleFileBlame as CodeLensCommand, ShowBlameHistory: Commands.ShowBlameHistory as CodeLensCommand, @@ -43,7 +50,16 @@ export const LineAnnotationType = { Hover: 'hover' as LineAnnotationType }; -export type StatusBarCommand = 'gitlens.toggleFileBlame' | 'gitlens.showBlameHistory' | 'gitlens.showFileHistory' | 'gitlens.toggleCodeLens' | 'gitlens.diffWithPrevious' | 'gitlens.diffWithWorking' | 'gitlens.showQuickCommitDetails' | 'gitlens.showQuickCommitFileDetails' | 'gitlens.showQuickFileHistory' | 'gitlens.showQuickRepoHistory'; +export type StatusBarCommand = 'gitlens.toggleFileBlame' | + 'gitlens.showBlameHistory' | + 'gitlens.showFileHistory' | + 'gitlens.toggleCodeLens' | + 'gitlens.diffWithPrevious' | + 'gitlens.diffWithWorking' | + 'gitlens.showQuickCommitDetails' | + 'gitlens.showQuickCommitFileDetails' | + 'gitlens.showQuickFileHistory' | + 'gitlens.showQuickRepoHistory'; export const StatusBarCommand = { BlameAnnotate: Commands.ToggleFileBlame as StatusBarCommand, ShowBlameHistory: Commands.ShowBlameHistory as StatusBarCommand, diff --git a/src/constants.ts b/src/constants.ts index e106098..67c155d 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -7,7 +7,20 @@ export const QualifiedExtensionId = `eamodio.${ExtensionId}`; export const ApplicationInsightsKey = 'a9c302f8-6483-4d01-b92c-c159c799c679'; -export type BuiltInCommands = 'cursorMove' | 'editor.action.showReferences' | 'editor.action.toggleRenderWhitespace' | 'editorScroll' | 'revealLine' | 'setContext' | 'vscode.diff' | 'vscode.executeDocumentSymbolProvider' | 'vscode.executeCodeLensProvider' | 'vscode.open' | 'vscode.previewHtml' | 'workbench.action.closeActiveEditor' | 'workbench.action.closeAllEditors' | 'workbench.action.nextEditor'; +export type BuiltInCommands = 'cursorMove' | + 'editor.action.showReferences' | + 'editor.action.toggleRenderWhitespace' | + 'editorScroll' | + 'revealLine' | + 'setContext' | + 'vscode.diff' | + 'vscode.executeDocumentSymbolProvider' | + 'vscode.executeCodeLensProvider' | + 'vscode.open' | + 'vscode.previewHtml' | + 'workbench.action.closeActiveEditor' | + 'workbench.action.closeAllEditors' | + 'workbench.action.nextEditor'; export const BuiltInCommands = { CloseActiveEditor: 'workbench.action.closeActiveEditor' as BuiltInCommands, CloseAllEditors: 'workbench.action.closeAllEditors' as BuiltInCommands,