mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge from vscode 1ec43773e37997841c5af42b33ddb180e9735bf2
This commit is contained in:
41
src/vs/workbench/browser/quickaccess.ts
Normal file
41
src/vs/workbench/browser/quickaccess.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. 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