mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-02-11 10:38:33 -05:00
Consolidates setContext into commands
Adds context for toggling CodeLens
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
'use strict';
|
||||
import { commands } from 'vscode';
|
||||
import { BuiltInCommands } from './constants';
|
||||
|
||||
export { Keyboard } from './commands/keyboard';
|
||||
|
||||
export { ActiveEditorCommand, Command, Commands, EditorCommand, openEditor } from './commands/commands';
|
||||
@@ -20,4 +23,17 @@ export { ShowQuickFileHistoryCommand } from './commands/showQuickFileHistory';
|
||||
export { ShowQuickRepoHistoryCommand } from './commands/showQuickRepoHistory';
|
||||
export { ShowQuickRepoStatusCommand } from './commands/showQuickRepoStatus';
|
||||
export { ToggleBlameCommand } from './commands/toggleBlame';
|
||||
export { ToggleCodeLensCommand } from './commands/toggleCodeLens';
|
||||
export { ToggleCodeLensCommand } from './commands/toggleCodeLens';
|
||||
|
||||
export type CommandContext = 'gitlens:canToggleCodeLens' | 'gitlens:enabled' | 'gitlens:isBlameable' | 'gitlens:key';
|
||||
export const CommandContext = {
|
||||
CanToggleCodeLens: 'gitlens:canToggleCodeLens' as CommandContext,
|
||||
Enabled: 'gitlens:enabled' as CommandContext,
|
||||
IsBlameable: 'gitlens:isBlameable' as CommandContext,
|
||||
Key: 'gitlens:key' as CommandContext
|
||||
};
|
||||
|
||||
|
||||
export function setCommandContext(key: CommandContext, value: any) {
|
||||
return commands.executeCommand(BuiltInCommands.SetContext, key, value);
|
||||
}
|
||||
Reference in New Issue
Block a user