@codingame/monaco-vscode-keybindings-service-override 1.83.16 → 1.85.0-next.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-keybindings-service-override",
3
- "version": "1.83.16",
3
+ "version": "1.85.0-next.0",
4
4
  "keywords": [],
5
5
  "author": {
6
6
  "name": "CodinGame",
@@ -18,8 +18,8 @@
18
18
  "module": "index.js",
19
19
  "types": "index.d.ts",
20
20
  "dependencies": {
21
- "vscode": "npm:@codingame/monaco-vscode-api@1.83.16",
22
- "monaco-editor": "0.44.0",
23
- "@codingame/monaco-vscode-files-service-override": "1.83.16"
21
+ "vscode": "npm:@codingame/monaco-vscode-api@1.85.0-next.0",
22
+ "monaco-editor": "0.45.0",
23
+ "@codingame/monaco-vscode-files-service-override": "1.85.0-next.0"
24
24
  }
25
25
  }
@@ -3,9 +3,9 @@ import { Event } from 'monaco-editor/esm/vs/base/common/event.js';
3
3
  import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
4
4
  import { setConstant, IContextKeyService } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
5
5
  import { IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsIOSContext, IsMobileContext, IsDevelopmentContext, ProductQualityContext, InputFocusedContext } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkeys.js';
6
- import { RemoteNameContext, VirtualWorkspaceContext, TemporaryWorkspaceContext, HasWebFileSystemAccess, EmbedderIdentifierContext, ActiveEditorContext, ActiveEditorReadonlyContext, ActiveEditorCanToggleReadonlyContext, ActiveEditorCanRevertContext, ActiveEditorCanSplitInGroupContext, ActiveEditorAvailableEditorIdsContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, SideBySideEditorActiveContext, ActiveEditorGroupEmptyContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorGroupLockedContext, MultipleEditorGroupsContext, DirtyWorkingCopiesContext, WorkbenchStateContext, WorkspaceFolderCountContext, OpenFolderWorkspaceSupportContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, SplitEditorsVertically, IsFullscreenContext, InEditorZenModeContext, IsCenteredLayoutContext, EditorAreaVisibleContext, EditorTabsVisibleContext, SideBarVisibleContext, PanelPositionContext, PanelVisibleContext, PanelMaximizedContext, PanelAlignmentContext, AuxiliaryBarVisibleContext, applyAvailableEditorIds } from 'vscode/vscode/vs/workbench/common/contextkeys';
6
+ import { RemoteNameContext, VirtualWorkspaceContext, TemporaryWorkspaceContext, HasWebFileSystemAccess, EmbedderIdentifierContext, ActiveEditorContext, ActiveEditorReadonlyContext, ActiveEditorCanToggleReadonlyContext, ActiveEditorCanRevertContext, ActiveEditorCanSplitInGroupContext, ActiveEditorAvailableEditorIdsContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, SideBySideEditorActiveContext, ActiveEditorGroupEmptyContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorGroupLockedContext, MultipleEditorGroupsContext, DirtyWorkingCopiesContext, WorkbenchStateContext, WorkspaceFolderCountContext, OpenFolderWorkspaceSupportContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, SplitEditorsVertically, IsFullscreenContext, IsAuxiliaryWindowFocusedContext, InEditorZenModeContext, IsCenteredLayoutContext, MainEditorAreaVisibleContext, EditorTabsVisibleContext, SideBarVisibleContext, TitleBarVisibleContext, TitleBarStyleContext, PanelPositionContext, PanelVisibleContext, PanelMaximizedContext, PanelAlignmentContext, AuxiliaryBarVisibleContext, applyAvailableEditorIds } from 'vscode/vscode/vs/workbench/common/contextkeys';
7
7
  import { TEXT_DIFF_EDITOR_ID, SIDE_BY_SIDE_EDITOR_ID, EditorResourceAccessor, SideBySideEditor } from 'vscode/vscode/vs/workbench/common/editor';
8
- import { addDisposableListener, EventType, trackFocus } from 'monaco-editor/esm/vs/base/browser/dom.js';
8
+ import { onDidRegisterWindow, addDisposableListener, EventType, trackFocus, getActiveWindow } from 'monaco-editor/esm/vs/base/browser/dom.js';
9
9
  import { preferredSideBySideGroupDirection, IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService';
10
10
  import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
11
11
  import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService';
@@ -21,6 +21,8 @@ import { IPaneCompositePartService } from 'vscode/vscode/vs/workbench/services/p
21
21
  import { WebFileSystemAccess } from 'monaco-editor/esm/vs/platform/files/browser/webFileSystemAccess.js';
22
22
  import { IProductService } from 'monaco-editor/esm/vs/platform/product/common/productService.js';
23
23
  import { IFileService } from 'monaco-editor/esm/vs/platform/files/common/files.js';
24
+ import { getTitleBarStyle } from 'vscode/vscode/vs/platform/window/common/window';
25
+ import { mainWindow } from 'monaco-editor/esm/vs/base/browser/window.js';
24
26
 
25
27
  let WorkbenchContextKeysHandler = class WorkbenchContextKeysHandler extends Disposable {
26
28
  constructor(contextKeyService, contextService, configurationService, environmentService, productService, editorService, editorResolverService, editorGroupService, layoutService, paneCompositeService, workingCopyService, fileService) {
@@ -48,7 +50,7 @@ let WorkbenchContextKeysHandler = class WorkbenchContextKeysHandler extends Disp
48
50
  this.virtualWorkspaceContext = VirtualWorkspaceContext.bindTo(this.contextKeyService);
49
51
  this.temporaryWorkspaceContext = TemporaryWorkspaceContext.bindTo(this.contextKeyService);
50
52
  this.updateWorkspaceContextKeys();
51
- HasWebFileSystemAccess.bindTo(this.contextKeyService).set(WebFileSystemAccess.supported(window));
53
+ HasWebFileSystemAccess.bindTo(this.contextKeyService).set(WebFileSystemAccess.supported(mainWindow));
52
54
  const isDevelopment = !this.environmentService.isBuilt || this.environmentService.isExtensionDevelopment;
53
55
  IsDevelopmentContext.bindTo(this.contextKeyService).set(isDevelopment);
54
56
  setConstant(IsDevelopmentContext.key, isDevelopment);
@@ -85,11 +87,15 @@ let WorkbenchContextKeysHandler = class WorkbenchContextKeysHandler extends Disp
85
87
  this.splitEditorsVerticallyContext = SplitEditorsVertically.bindTo(this.contextKeyService);
86
88
  this.updateSplitEditorsVerticallyContext();
87
89
  this.isFullscreenContext = IsFullscreenContext.bindTo(this.contextKeyService);
90
+ this.isAuxiliaryWindowFocusedContext = IsAuxiliaryWindowFocusedContext.bindTo(this.contextKeyService);
88
91
  this.inZenModeContext = InEditorZenModeContext.bindTo(this.contextKeyService);
89
92
  this.isCenteredLayoutContext = IsCenteredLayoutContext.bindTo(this.contextKeyService);
90
- this.editorAreaVisibleContext = EditorAreaVisibleContext.bindTo(this.contextKeyService);
93
+ this.mainEditorAreaVisibleContext = MainEditorAreaVisibleContext.bindTo(this.contextKeyService);
91
94
  this.editorTabsVisibleContext = EditorTabsVisibleContext.bindTo(this.contextKeyService);
92
95
  this.sideBarVisibleContext = SideBarVisibleContext.bindTo(this.contextKeyService);
96
+ this.titleAreaVisibleContext = TitleBarVisibleContext.bindTo(this.contextKeyService);
97
+ this.titleBarStyleContext = TitleBarStyleContext.bindTo(this.contextKeyService);
98
+ this.updateTitleBarContextKeys();
93
99
  this.panelPositionContext = PanelPositionContext.bindTo(this.contextKeyService);
94
100
  this.panelPositionContext.set(positionToString(this.layoutService.getPanelPosition()));
95
101
  this.panelVisibleContext = PanelVisibleContext.bindTo(this.contextKeyService);
@@ -103,7 +109,7 @@ let WorkbenchContextKeysHandler = class WorkbenchContextKeysHandler extends Disp
103
109
  this.registerListeners();
104
110
  }
105
111
  registerListeners() {
106
- this.editorGroupService.whenReady.then(() => {
112
+ this.editorGroupService.mainPart.whenReady.then(() => {
107
113
  this.updateEditorAreaContextKeys();
108
114
  this.updateEditorContextKeys();
109
115
  });
@@ -115,7 +121,7 @@ let WorkbenchContextKeysHandler = class WorkbenchContextKeysHandler extends Disp
115
121
  this._register(this.editorGroupService.onDidChangeActiveGroup(() => this.updateEditorGroupContextKeys()));
116
122
  this._register(this.editorGroupService.onDidChangeGroupLocked(() => this.updateEditorGroupContextKeys()));
117
123
  this._register(this.editorGroupService.onDidChangeEditorPartOptions(() => this.updateEditorAreaContextKeys()));
118
- this._register(addDisposableListener(window, EventType.FOCUS_IN, () => this.updateInputContextKeys(), true));
124
+ this._register(Event.runAndSubscribe(onDidRegisterWindow, ({ window, disposables }) => disposables.add(addDisposableListener(window, EventType.FOCUS_IN, () => this.updateInputContextKeys(window.document), true)), { window: mainWindow, disposables: this._store }));
119
125
  this._register(this.contextService.onDidChangeWorkbenchState(() => this.updateWorkbenchStateContextKey()));
120
126
  this._register(this.contextService.onDidChangeWorkspaceFolders(() => {
121
127
  this.updateWorkspaceFolderCountContextKey();
@@ -127,6 +133,7 @@ let WorkbenchContextKeysHandler = class WorkbenchContextKeysHandler extends Disp
127
133
  }
128
134
  }));
129
135
  this._register(this.layoutService.onDidChangeZenMode(enabled => this.inZenModeContext.set(enabled)));
136
+ this._register(this.layoutService.onDidChangeActiveContainer(() => this.isAuxiliaryWindowFocusedContext.set(this.layoutService.activeContainer !== this.layoutService.mainContainer)));
130
137
  this._register(this.layoutService.onDidChangeFullscreen(fullscreen => this.isFullscreenContext.set(fullscreen)));
131
138
  this._register(this.layoutService.onDidChangeCenteredLayout(centered => this.isCenteredLayoutContext.set(centered)));
132
139
  this._register(this.layoutService.onDidChangePanelPosition(position => this.panelPositionContext.set(position)));
@@ -134,15 +141,16 @@ let WorkbenchContextKeysHandler = class WorkbenchContextKeysHandler extends Disp
134
141
  this._register(this.paneCompositeService.onDidPaneCompositeClose(() => this.updateSideBarContextKeys()));
135
142
  this._register(this.paneCompositeService.onDidPaneCompositeOpen(() => this.updateSideBarContextKeys()));
136
143
  this._register(this.layoutService.onDidChangePartVisibility(() => {
137
- this.editorAreaVisibleContext.set(this.layoutService.isVisible("workbench.parts.editor" ));
144
+ this.mainEditorAreaVisibleContext.set(this.layoutService.isVisible("workbench.parts.editor" , mainWindow));
138
145
  this.panelVisibleContext.set(this.layoutService.isVisible("workbench.parts.panel" ));
139
146
  this.panelMaximizedContext.set(this.layoutService.isPanelMaximized());
140
147
  this.auxiliaryBarVisibleContext.set(this.layoutService.isVisible("workbench.parts.auxiliarybar" ));
148
+ this.updateTitleBarContextKeys();
141
149
  }));
142
150
  this._register(this.workingCopyService.onDidChangeDirty(workingCopy => this.dirtyWorkingCopiesContext.set(workingCopy.isDirty() || this.workingCopyService.hasDirty)));
143
151
  }
144
152
  updateEditorAreaContextKeys() {
145
- this.editorTabsVisibleContext.set(!!this.editorGroupService.partOptions.showTabs);
153
+ this.editorTabsVisibleContext.set(this.editorGroupService.partOptions.showTabs === 'multiple');
146
154
  }
147
155
  updateEditorContextKeys() {
148
156
  const activeEditorPane = this.editorService.activeEditorPane;
@@ -194,16 +202,18 @@ let WorkbenchContextKeysHandler = class WorkbenchContextKeysHandler extends Disp
194
202
  this.activeEditorGroupLast.set(activeGroup.index === groupCount - 1);
195
203
  this.activeEditorGroupLocked.set(activeGroup.isLocked);
196
204
  }
197
- updateInputContextKeys() {
205
+ updateInputContextKeys(ownerDocument) {
198
206
  function activeElementIsInput() {
199
- return !!document.activeElement && (document.activeElement.tagName === 'INPUT' || document.activeElement.tagName === 'TEXTAREA');
207
+ return !!ownerDocument.activeElement && (ownerDocument.activeElement.tagName === 'INPUT' || ownerDocument.activeElement.tagName === 'TEXTAREA');
200
208
  }
201
209
  const isInputFocused = activeElementIsInput();
202
210
  this.inputFocusedContext.set(isInputFocused);
203
211
  if (isInputFocused) {
204
- const tracker = trackFocus(document.activeElement);
212
+ const tracker = trackFocus(ownerDocument.activeElement);
205
213
  Event.once(tracker.onDidBlur)(() => {
206
- this.inputFocusedContext.set(activeElementIsInput());
214
+ if (getActiveWindow().document === ownerDocument) {
215
+ this.inputFocusedContext.set(activeElementIsInput());
216
+ }
207
217
  tracker.dispose();
208
218
  });
209
219
  }
@@ -228,6 +238,10 @@ let WorkbenchContextKeysHandler = class WorkbenchContextKeysHandler extends Disp
228
238
  updateSideBarContextKeys() {
229
239
  this.sideBarVisibleContext.set(this.layoutService.isVisible("workbench.parts.sidebar" ));
230
240
  }
241
+ updateTitleBarContextKeys() {
242
+ this.titleAreaVisibleContext.set(this.layoutService.isVisible("workbench.parts.titlebar" , mainWindow));
243
+ this.titleBarStyleContext.set(getTitleBarStyle(this.configurationService));
244
+ }
231
245
  updateWorkspaceContextKeys() {
232
246
  this.virtualWorkspaceContext.set(getVirtualWorkspaceScheme(this.contextService.getWorkspace()) || '');
233
247
  this.temporaryWorkspaceContext.set(isTemporaryWorkspace(this.contextService.getWorkspace()));
@@ -215,6 +215,16 @@ const apiMenus = [
215
215
  "The Source Control inline change menu"
216
216
  ))
217
217
  },
218
+ {
219
+ key: 'scm/inputBox',
220
+ id: MenuId.SCMInputBox,
221
+ description: ( localizeWithPath(
222
+ 'vs/workbench/services/actions/common/menusExtensionPoint',
223
+ 'menus.input',
224
+ "The Source Control input box menu"
225
+ )),
226
+ proposed: 'contribSourceControlInputBoxMenu'
227
+ },
218
228
  {
219
229
  key: 'statusBar/remoteIndicator',
220
230
  id: MenuId.StatusBarRemoteIndicatorMenu,
@@ -5,7 +5,7 @@ import { BrowserFeatures } from 'monaco-editor/esm/vs/base/browser/canIUse.js';
5
5
  import * as dom from 'monaco-editor/esm/vs/base/browser/dom.js';
6
6
  import { StandardKeyboardEvent, printKeyboardEvent, printStandardKeyboardEvent } from 'monaco-editor/esm/vs/base/browser/keyboardEvent.js';
7
7
  import { RunOnceScheduler } from 'monaco-editor/esm/vs/base/common/async.js';
8
- import { Emitter, Event } from 'monaco-editor/esm/vs/base/common/event.js';
8
+ import { Event, Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
9
9
  import { parse } from 'monaco-editor/esm/vs/base/common/json.js';
10
10
  import { UserSettingsLabelProvider } from 'monaco-editor/esm/vs/base/common/keybindingLabels.js';
11
11
  import { KeybindingParser } from '../../../../base/common/keybindingParser.js';
@@ -15,6 +15,7 @@ import { DisposableStore, Disposable } from 'monaco-editor/esm/vs/base/common/li
15
15
  import * as objects from 'monaco-editor/esm/vs/base/common/objects.js';
16
16
  import { OS, isMacintosh } from 'monaco-editor/esm/vs/base/common/platform.js';
17
17
  import { dirname } from 'monaco-editor/esm/vs/base/common/resources.js';
18
+ import { mainWindow } from 'monaco-editor/esm/vs/base/browser/window.js';
18
19
  import { MenuRegistry } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
19
20
  import { CommandsRegistry, ICommandService } from 'monaco-editor/esm/vs/platform/commands/common/commands.js';
20
21
  import { ContextKeyExpr, IContextKeyService } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
@@ -29,6 +30,8 @@ import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
29
30
  import { INotificationService } from 'monaco-editor/esm/vs/platform/notification/common/notification.js';
30
31
  import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
31
32
  import { ITelemetryService } from 'monaco-editor/esm/vs/platform/telemetry/common/telemetry.js';
33
+ import { IUriIdentityService } from 'monaco-editor/esm/vs/platform/uriIdentity/common/uriIdentity.js';
34
+ import { isLocalizedString } from 'monaco-editor/esm/vs/platform/action/common/action.js';
32
35
  import { commandsExtensionPoint } from '../../actions/common/menusExtensionPoint.js';
33
36
  import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions';
34
37
  import { ExtensionsRegistry } from 'vscode/vscode/vs/workbench/services/extensions/common/extensionsRegistry';
@@ -36,7 +39,6 @@ import { IHostService } from 'vscode/vscode/vs/workbench/services/host/browser/h
36
39
  import { getAllUnboundCommands } from 'vscode/vscode/vs/workbench/services/keybinding/browser/unboundCommands';
37
40
  import { KeybindingIO, OutputBuilder } from '../common/keybindingIO.js';
38
41
  import { IUserDataProfileService } from 'vscode/vscode/vs/workbench/services/userDataProfile/common/userDataProfile';
39
- import { IUriIdentityService } from 'monaco-editor/esm/vs/platform/uriIdentity/common/uriIdentity.js';
40
42
 
41
43
  var WorkbenchKeybindingService_1;
42
44
  function isValidContributedKeyBinding(keyBinding, rejects) {
@@ -246,10 +248,7 @@ let WorkbenchKeybindingService = WorkbenchKeybindingService_1 = class WorkbenchK
246
248
  });
247
249
  this.updateKeybindingsJsonSchema();
248
250
  this._register(extensionService.onDidRegisterExtensions(() => this.updateKeybindingsJsonSchema()));
249
- this._register(this._registerKeyListeners(window));
250
- this._register(dom.onDidCreateWindow(({ window, disposableStore }) => {
251
- disposableStore.add(this._registerKeyListeners(window));
252
- }));
251
+ this._register(Event.runAndSubscribe(dom.onDidRegisterWindow, ({ window, disposables }) => disposables.add(this._registerKeyListeners(window)), { window: mainWindow, disposables: this._store }));
253
252
  this._register(browser.onDidChangeFullscreen(() => {
254
253
  const keyboard = navigator.keyboard;
255
254
  if (BrowserFeatures.keyboard === 2 ) {
@@ -875,21 +874,21 @@ class KeybindingsJsonSchema {
875
874
  if (!( knownCommands.has(commandId))) {
876
875
  knownCommands.add(commandId);
877
876
  this.commandsEnum.push(commandId);
878
- this.commandsEnumDescriptions.push(description);
877
+ this.commandsEnumDescriptions.push(isLocalizedString(description) ? description.value : description);
879
878
  this.removalCommandsEnum.push(`-${commandId}`);
880
879
  }
881
880
  }
882
881
  };
883
882
  const allCommands = CommandsRegistry.getCommands();
884
883
  for (const [commandId, command] of allCommands) {
885
- const commandDescription = command.description;
886
- addKnownCommand(commandId, commandDescription ? commandDescription.description : undefined);
887
- if (!commandDescription || !commandDescription.args || commandDescription.args.length !== 1 || !commandDescription.args[0].schema) {
884
+ const commandMetadata = command.metadata;
885
+ addKnownCommand(commandId, commandMetadata?.description);
886
+ if (!commandMetadata || !commandMetadata.args || commandMetadata.args.length !== 1 || !commandMetadata.args[0].schema) {
888
887
  continue;
889
888
  }
890
- const argsSchema = commandDescription.args[0].schema;
891
- const argsRequired = ((typeof commandDescription.args[0].isOptional !== 'undefined')
892
- ? (!commandDescription.args[0].isOptional)
889
+ const argsSchema = commandMetadata.args[0].schema;
890
+ const argsRequired = ((typeof commandMetadata.args[0].isOptional !== 'undefined')
891
+ ? (!commandMetadata.args[0].isOptional)
893
892
  : (Array.isArray(argsSchema.required) && argsSchema.required.length > 0));
894
893
  const addition = {
895
894
  'if': {