forked from irinazheltisheva/vscode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquickaccess.ts
More file actions
41 lines (34 loc) · 1.71 KB
/
Copy pathquickaccess.ts
File metadata and controls
41 lines (34 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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);
};
}