mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-01-23 01:35:37 -05:00
Major refactor/rework -- many new features and breaking changes
Adds all-new, beautiful, highly customizable and themeable, file blame annotations Adds all-new configurability and themeability to the current line blame annotations Adds all-new configurability to the status bar blame information Adds all-new configurability over which commands are added to which menus via the `gitlens.advanced.menus` setting Adds better configurability over where Git code lens will be shown -- both by default and per language Adds an all-new `changes` (diff) hover annotation to the current line - provides instant access to the line's previous version Adds `Toggle Line Blame Annotations` command (`gitlens.toggleLineBlame`) - toggles the current line blame annotations on and off Adds `Show Line Blame Annotations` command (`gitlens.showLineBlame`) - shows the current line blame annotations Adds `Toggle File Blame Annotations` command (`gitlens.toggleFileBlame`) - toggles the file blame annotations on and off Adds `Show File Blame Annotations` command (`gitlens.showFileBlame`) - shows the file blame annotations Adds `Open File in Remote` command (`gitlens.openFileInRemote`) to the `editor/title` context menu Adds `Open Repo in Remote` command (`gitlens.openRepoInRemote`) to the `editor/title` context menu Changes the position of the `Open File in Remote` command (`gitlens.openFileInRemote`) in the context menus - now in the `navigation` group Changes the `Toggle Git Code Lens` command (`gitlens.toggleCodeLens`) to always toggle the Git code lens on and off Removes the on-demand `trailing` file blame annotations -- didn't work out and just ended up with a ton of visual noise Removes `Toggle Blame Annotations` command (`gitlens.toggleBlame`) - replaced by the `Toggle File Blame Annotations` command (`gitlens.toggleFileBlame`) Removes `Show Blame Annotations` command (`gitlens.showBlame`) - replaced by the `Show File Blame Annotations` command (`gitlens.showFileBlame`)
This commit is contained in:
@@ -2,31 +2,18 @@
|
||||
import { Commands } from './commands';
|
||||
import { OutputLevel } from './logger';
|
||||
|
||||
export type BlameAnnotationStyle = 'compact' | 'expanded' | 'trailing';
|
||||
export const BlameAnnotationStyle = {
|
||||
Compact: 'compact' as BlameAnnotationStyle,
|
||||
Expanded: 'expanded' as BlameAnnotationStyle,
|
||||
Trailing: 'trailing' as BlameAnnotationStyle
|
||||
export { ExtensionKey } from './constants';
|
||||
|
||||
export type BlameLineHighlightLocations = 'gutter' | 'line' | 'overviewRuler';
|
||||
export const BlameLineHighlightLocations = {
|
||||
Gutter: 'gutter' as BlameLineHighlightLocations,
|
||||
Line: 'line' as BlameLineHighlightLocations,
|
||||
OverviewRuler: 'overviewRuler' as BlameLineHighlightLocations
|
||||
};
|
||||
|
||||
export interface IBlameConfig {
|
||||
annotation: {
|
||||
style: BlameAnnotationStyle;
|
||||
highlight: 'none' | 'gutter' | 'line' | 'both';
|
||||
sha: boolean;
|
||||
author: boolean;
|
||||
date: 'off' | 'relative' | 'absolute';
|
||||
dateFormat: string;
|
||||
message: boolean;
|
||||
activeLine: 'off' | 'inline' | 'hover' | 'both';
|
||||
activeLineDarkColor: string;
|
||||
activeLineLightColor: string;
|
||||
};
|
||||
}
|
||||
|
||||
export type CodeLensCommand = 'gitlens.toggleBlame' | '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.ToggleBlame as CodeLensCommand,
|
||||
BlameAnnotate: Commands.ToggleFileBlame as CodeLensCommand,
|
||||
ShowBlameHistory: Commands.ShowBlameHistory as CodeLensCommand,
|
||||
ShowFileHistory: Commands.ShowFileHistory as CodeLensCommand,
|
||||
DiffWithPrevious: Commands.DiffWithPrevious as CodeLensCommand,
|
||||
@@ -36,46 +23,29 @@ export const CodeLensCommand = {
|
||||
ShowQuickCurrentBranchHistory: Commands.ShowQuickCurrentBranchHistory as CodeLensCommand
|
||||
};
|
||||
|
||||
export type CodeLensLocation = 'all' | 'document+containers' | 'document' | 'custom' | 'none';
|
||||
export const CodeLensLocation = {
|
||||
All: 'all' as CodeLensLocation,
|
||||
DocumentAndContainers: 'document+containers' as CodeLensLocation,
|
||||
Document: 'document' as CodeLensLocation,
|
||||
Custom: 'custom' as CodeLensLocation,
|
||||
None: 'none' as CodeLensLocation
|
||||
export type CodeLensLocations = 'document' | 'containers' | 'blocks' | 'custom';
|
||||
export const CodeLensLocations = {
|
||||
Document: 'document' as CodeLensLocations,
|
||||
Containers: 'containers' as CodeLensLocations,
|
||||
Blocks: 'blocks' as CodeLensLocations,
|
||||
Custom: 'custom' as CodeLensLocations
|
||||
};
|
||||
|
||||
export type CodeLensVisibility = 'auto' | 'ondemand' | 'off';
|
||||
export const CodeLensVisibility = {
|
||||
Auto: 'auto' as CodeLensVisibility,
|
||||
OnDemand: 'ondemand' as CodeLensVisibility,
|
||||
Off: 'off' as CodeLensVisibility
|
||||
export type FileAnnotationType = 'gutter' | 'hover';
|
||||
export const FileAnnotationType = {
|
||||
Gutter: 'gutter' as FileAnnotationType,
|
||||
Hover: 'hover' as FileAnnotationType
|
||||
};
|
||||
|
||||
export interface ICodeLensConfig {
|
||||
enabled: boolean;
|
||||
command: CodeLensCommand;
|
||||
}
|
||||
export type LineAnnotationType = 'trailing' | 'hover';
|
||||
export const LineAnnotationType = {
|
||||
Trailing: 'trailing' as LineAnnotationType,
|
||||
Hover: 'hover' as LineAnnotationType
|
||||
};
|
||||
|
||||
export interface ICodeLensLanguageLocation {
|
||||
language: string | undefined;
|
||||
location: CodeLensLocation;
|
||||
customSymbols?: string[];
|
||||
}
|
||||
|
||||
export interface ICodeLensesConfig {
|
||||
debug: boolean;
|
||||
visibility: CodeLensVisibility;
|
||||
location: CodeLensLocation;
|
||||
locationCustomSymbols: string[];
|
||||
languageLocations: ICodeLensLanguageLocation[];
|
||||
recentChange: ICodeLensConfig;
|
||||
authors: ICodeLensConfig;
|
||||
}
|
||||
|
||||
export type StatusBarCommand = 'gitlens.toggleBlame' | '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.ToggleBlame as StatusBarCommand,
|
||||
BlameAnnotate: Commands.ToggleFileBlame as StatusBarCommand,
|
||||
ShowBlameHistory: Commands.ShowBlameHistory as StatusBarCommand,
|
||||
ShowFileHistory: Commands.ShowFileHistory as CodeLensCommand,
|
||||
DiffWithPrevious: Commands.DiffWithPrevious as StatusBarCommand,
|
||||
@@ -87,26 +57,44 @@ export const StatusBarCommand = {
|
||||
ShowQuickCurrentBranchHistory: Commands.ShowQuickCurrentBranchHistory as StatusBarCommand
|
||||
};
|
||||
|
||||
export interface IStatusBarConfig {
|
||||
enabled: boolean;
|
||||
command: StatusBarCommand;
|
||||
date: 'off' | 'relative' | 'absolute';
|
||||
dateFormat: string;
|
||||
alignment: 'left' | 'right';
|
||||
}
|
||||
|
||||
export interface IAdvancedConfig {
|
||||
caching: {
|
||||
enabled: boolean;
|
||||
statusBar: {
|
||||
maxLines: number;
|
||||
}
|
||||
maxLines: number;
|
||||
};
|
||||
git: string;
|
||||
gitignore: {
|
||||
enabled: boolean;
|
||||
};
|
||||
maxQuickHistory: number;
|
||||
menus: {
|
||||
explorerContext: {
|
||||
fileDiff: boolean;
|
||||
history: boolean;
|
||||
remote: boolean;
|
||||
};
|
||||
editorContext: {
|
||||
blame: boolean;
|
||||
copy: boolean;
|
||||
details: boolean;
|
||||
fileDiff: boolean;
|
||||
history: boolean;
|
||||
lineDiff: boolean;
|
||||
remote: boolean;
|
||||
};
|
||||
editorTitle: {
|
||||
blame: boolean;
|
||||
fileDiff: boolean;
|
||||
history: boolean;
|
||||
status: boolean;
|
||||
};
|
||||
editorTitleContext: {
|
||||
blame: boolean;
|
||||
fileDiff: boolean;
|
||||
history: boolean;
|
||||
remote: boolean;
|
||||
};
|
||||
};
|
||||
quickPick: {
|
||||
closeOnFocusOut: boolean;
|
||||
};
|
||||
@@ -115,12 +103,192 @@ export interface IAdvancedConfig {
|
||||
};
|
||||
}
|
||||
|
||||
export interface ICodeLensLanguageLocation {
|
||||
language: string | undefined;
|
||||
locations: CodeLensLocations[];
|
||||
customSymbols?: string[];
|
||||
}
|
||||
|
||||
export interface IThemeConfig {
|
||||
annotations: {
|
||||
file: {
|
||||
gutter: {
|
||||
separateLines: boolean;
|
||||
dark: {
|
||||
backgroundColor: string | null;
|
||||
foregroundColor: string;
|
||||
uncommittedForegroundColor: string | null;
|
||||
};
|
||||
light: {
|
||||
backgroundColor: string | null;
|
||||
foregroundColor: string;
|
||||
uncommittedForegroundColor: string | null;
|
||||
};
|
||||
};
|
||||
|
||||
hover: {
|
||||
separateLines: boolean;
|
||||
};
|
||||
};
|
||||
|
||||
line: {
|
||||
trailing: {
|
||||
dark: {
|
||||
backgroundColor: string | null;
|
||||
foregroundColor: string;
|
||||
};
|
||||
light: {
|
||||
backgroundColor: string | null;
|
||||
foregroundColor: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
lineHighlight: {
|
||||
dark: {
|
||||
backgroundColor: string;
|
||||
overviewRulerColor: string;
|
||||
};
|
||||
light: {
|
||||
backgroundColor: string;
|
||||
overviewRulerColor: string;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
export const themeDefaults: IThemeConfig = {
|
||||
annotations: {
|
||||
file: {
|
||||
gutter: {
|
||||
separateLines: true,
|
||||
dark: {
|
||||
backgroundColor: null,
|
||||
foregroundColor: 'rgb(190, 190, 190)',
|
||||
uncommittedForegroundColor: null
|
||||
},
|
||||
light: {
|
||||
backgroundColor: null,
|
||||
foregroundColor: 'rgb(116, 116, 116)',
|
||||
uncommittedForegroundColor: null
|
||||
}
|
||||
},
|
||||
hover: {
|
||||
separateLines: false
|
||||
}
|
||||
},
|
||||
line: {
|
||||
trailing: {
|
||||
dark: {
|
||||
backgroundColor: null,
|
||||
foregroundColor: 'rgba(153, 153, 153, 0.35)'
|
||||
},
|
||||
light: {
|
||||
backgroundColor: null,
|
||||
foregroundColor: 'rgba(153, 153, 153, 0.35)'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
lineHighlight: {
|
||||
dark: {
|
||||
backgroundColor: 'rgba(0, 188, 242, 0.2)',
|
||||
overviewRulerColor: 'rgba(0, 188, 242, 0.6)'
|
||||
},
|
||||
light: {
|
||||
backgroundColor: 'rgba(0, 188, 242, 0.2)',
|
||||
overviewRulerColor: 'rgba(0, 188, 242, 0.6)'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export interface IConfig {
|
||||
annotations: {
|
||||
file: {
|
||||
gutter: {
|
||||
format: string;
|
||||
dateFormat: string;
|
||||
compact: boolean;
|
||||
heatmap: {
|
||||
enabled: boolean;
|
||||
location: 'left' | 'right';
|
||||
};
|
||||
hover: {
|
||||
details: boolean;
|
||||
wholeLine: boolean;
|
||||
};
|
||||
};
|
||||
|
||||
hover: {
|
||||
heatmap: {
|
||||
enabled: boolean;
|
||||
};
|
||||
wholeLine: boolean;
|
||||
};
|
||||
};
|
||||
|
||||
line: {
|
||||
hover: {
|
||||
details: boolean;
|
||||
changes: boolean;
|
||||
};
|
||||
|
||||
trailing: {
|
||||
format: string;
|
||||
dateFormat: string;
|
||||
hover: {
|
||||
changes: boolean;
|
||||
details: boolean;
|
||||
wholeLine: boolean;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
blame: {
|
||||
file: {
|
||||
annotationType: FileAnnotationType;
|
||||
lineHighlight: {
|
||||
enabled: boolean;
|
||||
locations: BlameLineHighlightLocations[];
|
||||
};
|
||||
};
|
||||
|
||||
line: {
|
||||
enabled: boolean;
|
||||
annotationType: LineAnnotationType;
|
||||
};
|
||||
};
|
||||
|
||||
codeLens: {
|
||||
enabled: boolean;
|
||||
recentChange: {
|
||||
enabled: boolean;
|
||||
command: CodeLensCommand;
|
||||
};
|
||||
authors: {
|
||||
enabled: boolean;
|
||||
command: CodeLensCommand;
|
||||
};
|
||||
locations: CodeLensLocations[];
|
||||
customLocationSymbols: string[];
|
||||
perLanguageLocations: ICodeLensLanguageLocation[];
|
||||
debug: boolean;
|
||||
};
|
||||
|
||||
statusBar: {
|
||||
enabled: boolean;
|
||||
alignment: 'left' | 'right';
|
||||
command: StatusBarCommand;
|
||||
format: string;
|
||||
dateFormat: string;
|
||||
};
|
||||
|
||||
theme: IThemeConfig;
|
||||
|
||||
debug: boolean;
|
||||
outputLevel: OutputLevel;
|
||||
blame: IBlameConfig;
|
||||
codeLens: ICodeLensesConfig;
|
||||
statusBar: IStatusBarConfig;
|
||||
advanced: IAdvancedConfig;
|
||||
insiders: boolean;
|
||||
outputLevel: OutputLevel;
|
||||
|
||||
advanced: IAdvancedConfig;
|
||||
}
|
||||
Reference in New Issue
Block a user