mirror of
https://github.com/coder/code-server.git
synced 2026-05-16 01:07:25 +02:00
Merge commit 'be3e8236086165e5e45a5a10783823874b3f3ebd' as 'lib/vscode'
This commit is contained in:
41
lib/vscode/src/vs/workbench/browser/quickaccess.ts
Normal file
41
lib/vscode/src/vs/workbench/browser/quickaccess.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { ContextKeyExpr, RawContextKey } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { ICommandHandler } from 'vs/platform/commands/common/commands';
|
||||
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput';
|
||||
|
||||
export const inQuickPickContextKeyValue = 'inQuickOpen';
|
||||
export const InQuickPickContextKey = new RawContextKey<boolean>(inQuickPickContextKeyValue, false);
|
||||
export const inQuickPickContext = ContextKeyExpr.has(inQuickPickContextKeyValue);
|
||||
|
||||
export const defaultQuickAccessContextKeyValue = 'inFilesPicker';
|
||||
export const defaultQuickAccessContext = ContextKeyExpr.and(inQuickPickContext, ContextKeyExpr.has(defaultQuickAccessContextKeyValue));
|
||||
|
||||
export interface IWorkbenchQuickAccessConfiguration {
|
||||
workbench: {
|
||||
commandPalette: {
|
||||
history: number;
|
||||
preserveInput: boolean;
|
||||
},
|
||||
quickOpen: {
|
||||
enableExperimentalNewVersion: boolean;
|
||||
preserveInput: boolean;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export function getQuickNavigateHandler(id: string, next?: boolean): ICommandHandler {
|
||||
return accessor => {
|
||||
const keybindingService = accessor.get(IKeybindingService);
|
||||
const quickInputService = accessor.get(IQuickInputService);
|
||||
|
||||
const keys = keybindingService.lookupKeybindings(id);
|
||||
const quickNavigate = { keybindings: keys };
|
||||
|
||||
quickInputService.navigate(!!next, quickNavigate);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user