@codingame/monaco-vscode-keybindings-service-override 17.1.2 → 17.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js
CHANGED
|
@@ -20,12 +20,9 @@ import { IUserDataProfileService } from '@codingame/monaco-vscode-api/vscode/vs/
|
|
|
20
20
|
import { IHostService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/host/browser/host.service';
|
|
21
21
|
import { IExtensionService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service';
|
|
22
22
|
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
23
|
-
import { WorkbenchContextKeysHandler } from './vscode/src/vs/workbench/browser/contextkeys.js';
|
|
24
23
|
import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
|
|
25
24
|
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
26
|
-
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
27
25
|
import getServiceOverride$1, { initFile } from '@codingame/monaco-vscode-files-service-override';
|
|
28
|
-
import { onRenderWorkbench } from '@codingame/monaco-vscode-api/lifecycle';
|
|
29
26
|
import '@codingame/monaco-vscode-40cada32-7e9c-528a-81fc-766e4da54147-common/vscode/vs/workbench/browser/workbench.contribution';
|
|
30
27
|
import './vscode/src/vs/workbench/contrib/keybindings/browser/keybindings.contribution.js';
|
|
31
28
|
import './vscode/src/vs/workbench/contrib/preferences/browser/keybindingsEditorContribution.js';
|
|
@@ -97,9 +94,6 @@ DynamicWorkbenchKeybindingService = __decorate([
|
|
|
97
94
|
__param(11, IKeyboardLayoutService),
|
|
98
95
|
__param(12, ILayoutService)
|
|
99
96
|
], DynamicWorkbenchKeybindingService);
|
|
100
|
-
onRenderWorkbench((accessor) => {
|
|
101
|
-
accessor.get(IInstantiationService).createInstance(WorkbenchContextKeysHandler);
|
|
102
|
-
});
|
|
103
97
|
function getServiceOverride({ shouldUseGlobalKeybindings = () => false } = {}) {
|
|
104
98
|
return {
|
|
105
99
|
...getServiceOverride$1(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-keybindings-service-override",
|
|
3
|
-
"version": "17.
|
|
3
|
+
"version": "17.2.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - keybindings service-override",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,15 +15,13 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-2a22c7b4-b906-5914-8cd1-3ed912fb738f-common": "17.
|
|
19
|
-
"@codingame/monaco-vscode-
|
|
20
|
-
"@codingame/monaco-vscode-
|
|
21
|
-
"@codingame/monaco-vscode-
|
|
22
|
-
"@codingame/monaco-vscode-
|
|
23
|
-
"@codingame/monaco-vscode-
|
|
24
|
-
"@codingame/monaco-vscode-
|
|
25
|
-
"@codingame/monaco-vscode-d609a7d3-bf87-551a-884f-550a8b327ec5-common": "17.1.2",
|
|
26
|
-
"@codingame/monaco-vscode-files-service-override": "17.1.2"
|
|
18
|
+
"@codingame/monaco-vscode-2a22c7b4-b906-5914-8cd1-3ed912fb738f-common": "17.2.0",
|
|
19
|
+
"@codingame/monaco-vscode-40cada32-7e9c-528a-81fc-766e4da54147-common": "17.2.0",
|
|
20
|
+
"@codingame/monaco-vscode-4a0e04a7-c3bd-5fb7-9d3b-4fd047cc9e59-common": "17.2.0",
|
|
21
|
+
"@codingame/monaco-vscode-a3eaa464-944c-5b8f-8886-213068ba4897-common": "17.2.0",
|
|
22
|
+
"@codingame/monaco-vscode-api": "17.2.0",
|
|
23
|
+
"@codingame/monaco-vscode-d609a7d3-bf87-551a-884f-550a8b327ec5-common": "17.2.0",
|
|
24
|
+
"@codingame/monaco-vscode-files-service-override": "17.2.0"
|
|
27
25
|
},
|
|
28
26
|
"main": "index.js",
|
|
29
27
|
"module": "index.js",
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
2
|
-
import { IContextKeyService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service";
|
|
3
|
-
import { IEditorGroupsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service";
|
|
4
|
-
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
5
|
-
import { IWorkbenchEnvironmentService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/environment/common/environmentService.service";
|
|
6
|
-
import { IWorkspaceContextService } from "@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service";
|
|
7
|
-
import { IWorkbenchLayoutService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/layout/browser/layoutService.service";
|
|
8
|
-
import { IWorkingCopyService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/workingCopy/common/workingCopyService.service";
|
|
9
|
-
import { IPaneCompositePartService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/panecomposite/browser/panecomposite.service";
|
|
10
|
-
import { IProductService } from "@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service";
|
|
11
|
-
import { IEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service";
|
|
12
|
-
export declare class WorkbenchContextKeysHandler extends Disposable {
|
|
13
|
-
private readonly contextKeyService;
|
|
14
|
-
private readonly contextService;
|
|
15
|
-
private readonly configurationService;
|
|
16
|
-
private readonly environmentService;
|
|
17
|
-
private readonly productService;
|
|
18
|
-
private readonly editorGroupService;
|
|
19
|
-
private readonly editorService;
|
|
20
|
-
private readonly layoutService;
|
|
21
|
-
private readonly paneCompositeService;
|
|
22
|
-
private readonly workingCopyService;
|
|
23
|
-
private inputFocusedContext;
|
|
24
|
-
private dirtyWorkingCopiesContext;
|
|
25
|
-
private activeEditorGroupEmpty;
|
|
26
|
-
private activeEditorGroupIndex;
|
|
27
|
-
private activeEditorGroupLast;
|
|
28
|
-
private activeEditorGroupLocked;
|
|
29
|
-
private multipleEditorGroupsContext;
|
|
30
|
-
private editorsVisibleContext;
|
|
31
|
-
private splitEditorsVerticallyContext;
|
|
32
|
-
private workbenchStateContext;
|
|
33
|
-
private workspaceFolderCountContext;
|
|
34
|
-
private openFolderWorkspaceSupportContext;
|
|
35
|
-
private enterMultiRootWorkspaceSupportContext;
|
|
36
|
-
private emptyWorkspaceSupportContext;
|
|
37
|
-
private virtualWorkspaceContext;
|
|
38
|
-
private temporaryWorkspaceContext;
|
|
39
|
-
private inZenModeContext;
|
|
40
|
-
private isMainWindowFullscreenContext;
|
|
41
|
-
private isAuxiliaryWindowFocusedContext;
|
|
42
|
-
private isMainEditorCenteredLayoutContext;
|
|
43
|
-
private sideBarVisibleContext;
|
|
44
|
-
private mainEditorAreaVisibleContext;
|
|
45
|
-
private panelPositionContext;
|
|
46
|
-
private panelVisibleContext;
|
|
47
|
-
private panelAlignmentContext;
|
|
48
|
-
private panelMaximizedContext;
|
|
49
|
-
private auxiliaryBarVisibleContext;
|
|
50
|
-
private editorTabsVisibleContext;
|
|
51
|
-
private titleAreaVisibleContext;
|
|
52
|
-
private titleBarStyleContext;
|
|
53
|
-
constructor(contextKeyService: IContextKeyService, contextService: IWorkspaceContextService, configurationService: IConfigurationService, environmentService: IWorkbenchEnvironmentService, productService: IProductService, editorGroupService: IEditorGroupsService, editorService: IEditorService, layoutService: IWorkbenchLayoutService, paneCompositeService: IPaneCompositePartService, workingCopyService: IWorkingCopyService);
|
|
54
|
-
private registerListeners;
|
|
55
|
-
private updateVisiblePanesContextKeys;
|
|
56
|
-
private updateActiveEditorGroupContextKeys;
|
|
57
|
-
private updateEditorGroupsContextKeys;
|
|
58
|
-
private updateEditorAreaContextKeys;
|
|
59
|
-
private updateInputContextKeys;
|
|
60
|
-
private updateWorkbenchStateContextKey;
|
|
61
|
-
private updateWorkspaceFolderCountContextKey;
|
|
62
|
-
private updateSplitEditorsVerticallyContext;
|
|
63
|
-
private getWorkbenchStateString;
|
|
64
|
-
private updateSideBarContextKeys;
|
|
65
|
-
private updateTitleBarContextKeys;
|
|
66
|
-
private updateWorkspaceContextKeys;
|
|
67
|
-
}
|
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
-
import { Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
4
|
-
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
5
|
-
import { setConstant } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
|
|
6
|
-
import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
7
|
-
import { IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsIOSContext, IsMobileContext, IsDevelopmentContext, ProductQualityContext, InputFocusedContext } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkeys';
|
|
8
|
-
import { RemoteNameContext, VirtualWorkspaceContext, TemporaryWorkspaceContext, HasWebFileSystemAccess, EmbedderIdentifierContext, ActiveEditorGroupEmptyContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorGroupLockedContext, MultipleEditorGroupsContext, EditorsVisibleContext, DirtyWorkingCopiesContext, WorkbenchStateContext, WorkspaceFolderCountContext, OpenFolderWorkspaceSupportContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, SplitEditorsVertically, IsMainWindowFullscreenContext, IsAuxiliaryWindowFocusedContext, InEditorZenModeContext, IsMainEditorCenteredLayoutContext, MainEditorAreaVisibleContext, EditorTabsVisibleContext, SideBarVisibleContext, TitleBarVisibleContext, TitleBarStyleContext, PanelPositionContext, PanelVisibleContext, PanelMaximizedContext, PanelAlignmentContext, AuxiliaryBarVisibleContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/contextkeys';
|
|
9
|
-
import { onDidRegisterWindow, addDisposableListener, EventType, isEditableElement, trackFocus, getActiveWindow } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
10
|
-
import { preferredSideBySideGroupDirection, GroupDirection } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService';
|
|
11
|
-
import { IEditorGroupsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
|
|
12
|
-
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
13
|
-
import { IWorkbenchEnvironmentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/environment/common/environmentService.service';
|
|
14
|
-
import { WorkbenchState, isTemporaryWorkspace } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace';
|
|
15
|
-
import { IWorkspaceContextService } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service';
|
|
16
|
-
import { positionToString, Parts } from '@codingame/monaco-vscode-c8227507-8e59-53d6-b50b-71c0ab384cf4-common/vscode/vs/workbench/services/layout/browser/layoutService';
|
|
17
|
-
import { IWorkbenchLayoutService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/layout/browser/layoutService.service';
|
|
18
|
-
import { getRemoteName } from '@codingame/monaco-vscode-api/vscode/vs/platform/remote/common/remoteHosts';
|
|
19
|
-
import { getVirtualWorkspaceScheme } from '@codingame/monaco-vscode-2cbab29e-9393-5de6-b701-9a9555360b6b-common/vscode/vs/platform/workspace/common/virtualWorkspace';
|
|
20
|
-
import { IWorkingCopyService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/workingCopy/common/workingCopyService.service';
|
|
21
|
-
import { isNative } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
|
|
22
|
-
import { IPaneCompositePartService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/panecomposite/browser/panecomposite.service';
|
|
23
|
-
import { WebFileSystemAccess } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/browser/webFileSystemAccess';
|
|
24
|
-
import { IProductService } from '@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service';
|
|
25
|
-
import { getTitleBarStyle } from '@codingame/monaco-vscode-api/vscode/vs/platform/window/common/window';
|
|
26
|
-
import { mainWindow } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/window';
|
|
27
|
-
import { onDidChangeFullscreen, isFullscreen } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/browser';
|
|
28
|
-
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
29
|
-
|
|
30
|
-
let WorkbenchContextKeysHandler = class WorkbenchContextKeysHandler extends Disposable {
|
|
31
|
-
constructor(contextKeyService, contextService, configurationService, environmentService, productService, editorGroupService, editorService, layoutService, paneCompositeService, workingCopyService) {
|
|
32
|
-
super();
|
|
33
|
-
this.contextKeyService = contextKeyService;
|
|
34
|
-
this.contextService = contextService;
|
|
35
|
-
this.configurationService = configurationService;
|
|
36
|
-
this.environmentService = environmentService;
|
|
37
|
-
this.productService = productService;
|
|
38
|
-
this.editorGroupService = editorGroupService;
|
|
39
|
-
this.editorService = editorService;
|
|
40
|
-
this.layoutService = layoutService;
|
|
41
|
-
this.paneCompositeService = paneCompositeService;
|
|
42
|
-
this.workingCopyService = workingCopyService;
|
|
43
|
-
IsMacContext.bindTo(this.contextKeyService);
|
|
44
|
-
IsLinuxContext.bindTo(this.contextKeyService);
|
|
45
|
-
IsWindowsContext.bindTo(this.contextKeyService);
|
|
46
|
-
IsWebContext.bindTo(this.contextKeyService);
|
|
47
|
-
IsMacNativeContext.bindTo(this.contextKeyService);
|
|
48
|
-
IsIOSContext.bindTo(this.contextKeyService);
|
|
49
|
-
IsMobileContext.bindTo(this.contextKeyService);
|
|
50
|
-
RemoteNameContext.bindTo(this.contextKeyService).set(getRemoteName(this.environmentService.remoteAuthority) || '');
|
|
51
|
-
this.virtualWorkspaceContext = VirtualWorkspaceContext.bindTo(this.contextKeyService);
|
|
52
|
-
this.temporaryWorkspaceContext = TemporaryWorkspaceContext.bindTo(this.contextKeyService);
|
|
53
|
-
this.updateWorkspaceContextKeys();
|
|
54
|
-
HasWebFileSystemAccess.bindTo(this.contextKeyService).set(WebFileSystemAccess.supported(mainWindow));
|
|
55
|
-
const isDevelopment = !this.environmentService.isBuilt || this.environmentService.isExtensionDevelopment;
|
|
56
|
-
IsDevelopmentContext.bindTo(this.contextKeyService).set(isDevelopment);
|
|
57
|
-
setConstant(IsDevelopmentContext.key, isDevelopment);
|
|
58
|
-
ProductQualityContext.bindTo(this.contextKeyService).set(this.productService.quality || '');
|
|
59
|
-
EmbedderIdentifierContext.bindTo(this.contextKeyService).set(productService.embedderIdentifier);
|
|
60
|
-
this.activeEditorGroupEmpty = ActiveEditorGroupEmptyContext.bindTo(this.contextKeyService);
|
|
61
|
-
this.activeEditorGroupIndex = ActiveEditorGroupIndexContext.bindTo(this.contextKeyService);
|
|
62
|
-
this.activeEditorGroupLast = ActiveEditorGroupLastContext.bindTo(this.contextKeyService);
|
|
63
|
-
this.activeEditorGroupLocked = ActiveEditorGroupLockedContext.bindTo(this.contextKeyService);
|
|
64
|
-
this.multipleEditorGroupsContext = MultipleEditorGroupsContext.bindTo(this.contextKeyService);
|
|
65
|
-
this.editorsVisibleContext = EditorsVisibleContext.bindTo(this.contextKeyService);
|
|
66
|
-
this.dirtyWorkingCopiesContext = DirtyWorkingCopiesContext.bindTo(this.contextKeyService);
|
|
67
|
-
this.dirtyWorkingCopiesContext.set(this.workingCopyService.hasDirty);
|
|
68
|
-
this.inputFocusedContext = InputFocusedContext.bindTo(this.contextKeyService);
|
|
69
|
-
this.workbenchStateContext = WorkbenchStateContext.bindTo(this.contextKeyService);
|
|
70
|
-
this.updateWorkbenchStateContextKey();
|
|
71
|
-
this.workspaceFolderCountContext = WorkspaceFolderCountContext.bindTo(this.contextKeyService);
|
|
72
|
-
this.updateWorkspaceFolderCountContextKey();
|
|
73
|
-
this.openFolderWorkspaceSupportContext = OpenFolderWorkspaceSupportContext.bindTo(this.contextKeyService);
|
|
74
|
-
this.openFolderWorkspaceSupportContext.set(isNative || typeof this.environmentService.remoteAuthority === 'string');
|
|
75
|
-
this.emptyWorkspaceSupportContext = EmptyWorkspaceSupportContext.bindTo(this.contextKeyService);
|
|
76
|
-
this.emptyWorkspaceSupportContext.set(isNative || typeof this.environmentService.remoteAuthority === 'string');
|
|
77
|
-
this.enterMultiRootWorkspaceSupportContext = EnterMultiRootWorkspaceSupportContext.bindTo(this.contextKeyService);
|
|
78
|
-
this.enterMultiRootWorkspaceSupportContext.set(isNative || typeof this.environmentService.remoteAuthority === 'string');
|
|
79
|
-
this.splitEditorsVerticallyContext = SplitEditorsVertically.bindTo(this.contextKeyService);
|
|
80
|
-
this.updateSplitEditorsVerticallyContext();
|
|
81
|
-
this.isMainWindowFullscreenContext = IsMainWindowFullscreenContext.bindTo(this.contextKeyService);
|
|
82
|
-
this.isAuxiliaryWindowFocusedContext = IsAuxiliaryWindowFocusedContext.bindTo(this.contextKeyService);
|
|
83
|
-
this.inZenModeContext = InEditorZenModeContext.bindTo(this.contextKeyService);
|
|
84
|
-
this.isMainEditorCenteredLayoutContext = IsMainEditorCenteredLayoutContext.bindTo(this.contextKeyService);
|
|
85
|
-
this.mainEditorAreaVisibleContext = MainEditorAreaVisibleContext.bindTo(this.contextKeyService);
|
|
86
|
-
this.editorTabsVisibleContext = EditorTabsVisibleContext.bindTo(this.contextKeyService);
|
|
87
|
-
this.sideBarVisibleContext = SideBarVisibleContext.bindTo(this.contextKeyService);
|
|
88
|
-
this.titleAreaVisibleContext = TitleBarVisibleContext.bindTo(this.contextKeyService);
|
|
89
|
-
this.titleBarStyleContext = TitleBarStyleContext.bindTo(this.contextKeyService);
|
|
90
|
-
this.updateTitleBarContextKeys();
|
|
91
|
-
this.panelPositionContext = PanelPositionContext.bindTo(this.contextKeyService);
|
|
92
|
-
this.panelPositionContext.set(positionToString(this.layoutService.getPanelPosition()));
|
|
93
|
-
this.panelVisibleContext = PanelVisibleContext.bindTo(this.contextKeyService);
|
|
94
|
-
this.panelVisibleContext.set(this.layoutService.isVisible(Parts.PANEL_PART));
|
|
95
|
-
this.panelMaximizedContext = PanelMaximizedContext.bindTo(this.contextKeyService);
|
|
96
|
-
this.panelMaximizedContext.set(this.layoutService.isPanelMaximized());
|
|
97
|
-
this.panelAlignmentContext = PanelAlignmentContext.bindTo(this.contextKeyService);
|
|
98
|
-
this.panelAlignmentContext.set(this.layoutService.getPanelAlignment());
|
|
99
|
-
this.auxiliaryBarVisibleContext = AuxiliaryBarVisibleContext.bindTo(this.contextKeyService);
|
|
100
|
-
this.auxiliaryBarVisibleContext.set(this.layoutService.isVisible(Parts.AUXILIARYBAR_PART));
|
|
101
|
-
this.registerListeners();
|
|
102
|
-
}
|
|
103
|
-
registerListeners() {
|
|
104
|
-
this.editorGroupService.whenReady.then(() => {
|
|
105
|
-
this.updateEditorAreaContextKeys();
|
|
106
|
-
this.updateActiveEditorGroupContextKeys();
|
|
107
|
-
this.updateVisiblePanesContextKeys();
|
|
108
|
-
});
|
|
109
|
-
this._register(this.editorService.onDidActiveEditorChange(() => this.updateActiveEditorGroupContextKeys()));
|
|
110
|
-
this._register(this.editorService.onDidVisibleEditorsChange(() => this.updateVisiblePanesContextKeys()));
|
|
111
|
-
this._register(this.editorGroupService.onDidAddGroup(() => this.updateEditorGroupsContextKeys()));
|
|
112
|
-
this._register(this.editorGroupService.onDidRemoveGroup(() => this.updateEditorGroupsContextKeys()));
|
|
113
|
-
this._register(this.editorGroupService.onDidChangeGroupIndex(() => this.updateActiveEditorGroupContextKeys()));
|
|
114
|
-
this._register(this.editorGroupService.onDidChangeGroupLocked(() => this.updateActiveEditorGroupContextKeys()));
|
|
115
|
-
this._register(this.editorGroupService.onDidChangeEditorPartOptions(() => this.updateEditorAreaContextKeys()));
|
|
116
|
-
this._register(Event.runAndSubscribe(onDidRegisterWindow, ({ window, disposables }) => disposables.add(addDisposableListener(window, EventType.FOCUS_IN, () => this.updateInputContextKeys(window.document, disposables), true)), { window: mainWindow, disposables: this._store }));
|
|
117
|
-
this._register(this.contextService.onDidChangeWorkbenchState(() => this.updateWorkbenchStateContextKey()));
|
|
118
|
-
this._register(this.contextService.onDidChangeWorkspaceFolders(() => {
|
|
119
|
-
this.updateWorkspaceFolderCountContextKey();
|
|
120
|
-
this.updateWorkspaceContextKeys();
|
|
121
|
-
}));
|
|
122
|
-
this._register(this.configurationService.onDidChangeConfiguration(e => {
|
|
123
|
-
if (e.affectsConfiguration('workbench.editor.openSideBySideDirection')) {
|
|
124
|
-
this.updateSplitEditorsVerticallyContext();
|
|
125
|
-
}
|
|
126
|
-
}));
|
|
127
|
-
this._register(this.layoutService.onDidChangeZenMode(enabled => this.inZenModeContext.set(enabled)));
|
|
128
|
-
this._register(this.layoutService.onDidChangeActiveContainer(() => this.isAuxiliaryWindowFocusedContext.set(this.layoutService.activeContainer !== this.layoutService.mainContainer)));
|
|
129
|
-
this._register(onDidChangeFullscreen(windowId => {
|
|
130
|
-
if (windowId === mainWindow.vscodeWindowId) {
|
|
131
|
-
this.isMainWindowFullscreenContext.set(isFullscreen(mainWindow));
|
|
132
|
-
}
|
|
133
|
-
}));
|
|
134
|
-
this._register(this.layoutService.onDidChangeMainEditorCenteredLayout(centered => this.isMainEditorCenteredLayoutContext.set(centered)));
|
|
135
|
-
this._register(this.layoutService.onDidChangePanelPosition(position => this.panelPositionContext.set(position)));
|
|
136
|
-
this._register(this.layoutService.onDidChangePanelAlignment(alignment => this.panelAlignmentContext.set(alignment)));
|
|
137
|
-
this._register(this.paneCompositeService.onDidPaneCompositeClose(() => this.updateSideBarContextKeys()));
|
|
138
|
-
this._register(this.paneCompositeService.onDidPaneCompositeOpen(() => this.updateSideBarContextKeys()));
|
|
139
|
-
this._register(this.layoutService.onDidChangePartVisibility(() => {
|
|
140
|
-
this.mainEditorAreaVisibleContext.set(this.layoutService.isVisible(Parts.EDITOR_PART, mainWindow));
|
|
141
|
-
this.panelVisibleContext.set(this.layoutService.isVisible(Parts.PANEL_PART));
|
|
142
|
-
this.panelMaximizedContext.set(this.layoutService.isPanelMaximized());
|
|
143
|
-
this.auxiliaryBarVisibleContext.set(this.layoutService.isVisible(Parts.AUXILIARYBAR_PART));
|
|
144
|
-
this.updateTitleBarContextKeys();
|
|
145
|
-
}));
|
|
146
|
-
this._register(this.workingCopyService.onDidChangeDirty(workingCopy => this.dirtyWorkingCopiesContext.set(workingCopy.isDirty() || this.workingCopyService.hasDirty)));
|
|
147
|
-
}
|
|
148
|
-
updateVisiblePanesContextKeys() {
|
|
149
|
-
const visibleEditorPanes = this.editorService.visibleEditorPanes;
|
|
150
|
-
if (visibleEditorPanes.length > 0) {
|
|
151
|
-
this.editorsVisibleContext.set(true);
|
|
152
|
-
}
|
|
153
|
-
else {
|
|
154
|
-
this.editorsVisibleContext.reset();
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
updateActiveEditorGroupContextKeys() {
|
|
158
|
-
if (!this.editorService.activeEditor) {
|
|
159
|
-
this.activeEditorGroupEmpty.set(true);
|
|
160
|
-
}
|
|
161
|
-
else {
|
|
162
|
-
this.activeEditorGroupEmpty.reset();
|
|
163
|
-
}
|
|
164
|
-
const activeGroup = this.editorGroupService.activeGroup;
|
|
165
|
-
this.activeEditorGroupIndex.set(activeGroup.index + 1);
|
|
166
|
-
this.activeEditorGroupLocked.set(activeGroup.isLocked);
|
|
167
|
-
this.updateEditorGroupsContextKeys();
|
|
168
|
-
}
|
|
169
|
-
updateEditorGroupsContextKeys() {
|
|
170
|
-
const groupCount = this.editorGroupService.count;
|
|
171
|
-
if (groupCount > 1) {
|
|
172
|
-
this.multipleEditorGroupsContext.set(true);
|
|
173
|
-
}
|
|
174
|
-
else {
|
|
175
|
-
this.multipleEditorGroupsContext.reset();
|
|
176
|
-
}
|
|
177
|
-
const activeGroup = this.editorGroupService.activeGroup;
|
|
178
|
-
this.activeEditorGroupLast.set(activeGroup.index === groupCount - 1);
|
|
179
|
-
}
|
|
180
|
-
updateEditorAreaContextKeys() {
|
|
181
|
-
this.editorTabsVisibleContext.set(this.editorGroupService.partOptions.showTabs === 'multiple');
|
|
182
|
-
}
|
|
183
|
-
updateInputContextKeys(ownerDocument, disposables) {
|
|
184
|
-
function activeElementIsInput() {
|
|
185
|
-
return !!ownerDocument.activeElement && isEditableElement(ownerDocument.activeElement);
|
|
186
|
-
}
|
|
187
|
-
const isInputFocused = activeElementIsInput();
|
|
188
|
-
this.inputFocusedContext.set(isInputFocused);
|
|
189
|
-
if (isInputFocused) {
|
|
190
|
-
const tracker = disposables.add(trackFocus(ownerDocument.activeElement));
|
|
191
|
-
Event.once(tracker.onDidBlur)(() => {
|
|
192
|
-
if (getActiveWindow().document === ownerDocument) {
|
|
193
|
-
this.inputFocusedContext.set(activeElementIsInput());
|
|
194
|
-
}
|
|
195
|
-
tracker.dispose();
|
|
196
|
-
}, undefined, disposables);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
updateWorkbenchStateContextKey() {
|
|
200
|
-
this.workbenchStateContext.set(this.getWorkbenchStateString());
|
|
201
|
-
}
|
|
202
|
-
updateWorkspaceFolderCountContextKey() {
|
|
203
|
-
this.workspaceFolderCountContext.set(this.contextService.getWorkspace().folders.length);
|
|
204
|
-
}
|
|
205
|
-
updateSplitEditorsVerticallyContext() {
|
|
206
|
-
const direction = preferredSideBySideGroupDirection(this.configurationService);
|
|
207
|
-
this.splitEditorsVerticallyContext.set(direction === GroupDirection.DOWN);
|
|
208
|
-
}
|
|
209
|
-
getWorkbenchStateString() {
|
|
210
|
-
switch (this.contextService.getWorkbenchState()) {
|
|
211
|
-
case WorkbenchState.EMPTY: return 'empty';
|
|
212
|
-
case WorkbenchState.FOLDER: return 'folder';
|
|
213
|
-
case WorkbenchState.WORKSPACE: return 'workspace';
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
updateSideBarContextKeys() {
|
|
217
|
-
this.sideBarVisibleContext.set(this.layoutService.isVisible(Parts.SIDEBAR_PART));
|
|
218
|
-
}
|
|
219
|
-
updateTitleBarContextKeys() {
|
|
220
|
-
this.titleAreaVisibleContext.set(this.layoutService.isVisible(Parts.TITLEBAR_PART, mainWindow));
|
|
221
|
-
this.titleBarStyleContext.set(getTitleBarStyle(this.configurationService));
|
|
222
|
-
}
|
|
223
|
-
updateWorkspaceContextKeys() {
|
|
224
|
-
this.virtualWorkspaceContext.set(getVirtualWorkspaceScheme(this.contextService.getWorkspace()) || '');
|
|
225
|
-
this.temporaryWorkspaceContext.set(isTemporaryWorkspace(this.contextService.getWorkspace()));
|
|
226
|
-
}
|
|
227
|
-
};
|
|
228
|
-
WorkbenchContextKeysHandler = ( __decorate([
|
|
229
|
-
( __param(0, IContextKeyService)),
|
|
230
|
-
( __param(1, IWorkspaceContextService)),
|
|
231
|
-
( __param(2, IConfigurationService)),
|
|
232
|
-
( __param(3, IWorkbenchEnvironmentService)),
|
|
233
|
-
( __param(4, IProductService)),
|
|
234
|
-
( __param(5, IEditorGroupsService)),
|
|
235
|
-
( __param(6, IEditorService)),
|
|
236
|
-
( __param(7, IWorkbenchLayoutService)),
|
|
237
|
-
( __param(8, IPaneCompositePartService)),
|
|
238
|
-
( __param(9, IWorkingCopyService))
|
|
239
|
-
], WorkbenchContextKeysHandler));
|
|
240
|
-
|
|
241
|
-
export { WorkbenchContextKeysHandler };
|