@codingame/monaco-vscode-api 1.83.8 → 1.83.9
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/extensions.js +5 -5
- package/lifecycle.js +21 -1
- package/missing-services.js +187 -24
- package/monaco-editor-treemending.patch +955 -955
- package/package.json +12 -6
- package/services.d.ts +2 -4
- package/services.js +28 -27
- package/vscode/src/vs/base/common/uriIpc.js +22 -1
- package/vscode/src/vs/base/parts/request/common/request.js +7 -1
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.js +116 -1
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagementUtil.js +117 -2
- package/vscode/src/vs/platform/extensionRecommendations/common/extensionRecommendations.js +10 -0
- package/vscode/src/vs/platform/extensionResourceLoader/browser/extensionResourceLoaderService.js +42 -0
- package/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.js +12 -1
- package/vscode/src/vs/platform/extensions/common/extensionValidator.js +306 -1
- package/vscode/src/vs/platform/log/common/log.d.ts +27 -2
- package/vscode/src/vs/platform/remote/common/remoteAgentConnection.d.ts +9 -1
- package/vscode/src/vs/platform/remote/common/remoteExtensionsScanner.js +2 -1
- package/vscode/src/vs/platform/request/common/request.js +38 -1
- package/vscode/src/vs/platform/telemetry/common/telemetryUtils.js +2 -1
- package/vscode/src/vs/platform/tunnel/common/tunnel.d.ts +50 -1
- package/vscode/src/vs/platform/userDataProfile/common/userDataProfileIpc.js +63 -0
- package/vscode/src/vs/platform/userDataSync/common/ignoredExtensions.js +65 -0
- package/vscode/src/vs/platform/userDataSync/common/userDataSync.js +2 -1
- package/vscode/src/vs/platform/userDataSync/common/userDataSyncAccount.js +3 -0
- package/vscode/src/vs/platform/workspace/common/workspace.d.ts +16 -1
- package/vscode/src/vs/platform/workspaces/common/workspaces.d.ts +6 -2
- package/vscode/src/vs/workbench/api/worker/extensionHostWorker.js +1 -1
- package/vscode/src/vs/workbench/common/theme.js +3 -3
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.js +248 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.js +3291 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsIcons.js +16 -16
- package/vscode/src/vs/workbench/contrib/extensions/browser/media/extensionActions.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/extensions/common/extensions.js +45 -1
- package/vscode/src/vs/workbench/contrib/extensions/common/extensionsFileTemplate.js +67 -0
- package/vscode/src/vs/workbench/services/extensionManagement/browser/extensionBisect.js +396 -0
- package/vscode/src/vs/workbench/services/extensionManagement/common/extensionManagement.d.ts +23 -3
- package/vscode/src/vs/workbench/services/extensionManagement/common/extensionManagement.js +4 -1
- package/vscode/src/vs/workbench/services/extensionRecommendations/common/extensionRecommendations.js +4 -0
- package/vscode/src/vs/workbench/services/extensionRecommendations/common/workspaceExtensionsConfig.js +255 -0
- package/vscode/src/vs/workbench/services/extensions/browser/extensionService.d.ts +44 -0
- package/vscode/src/vs/workbench/services/extensions/common/extensionDescriptionRegistry.d.ts +1 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostProtocol.d.ts +1 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensions.js +2 -1
- package/vscode/src/vs/workbench/services/localization/common/locale.js +4 -0
- package/vscode/src/vs/workbench/services/log/common/logConstants.js +2 -1
- package/vscode/src/vs/workbench/services/remote/common/remoteExplorerService.d.ts +68 -0
- package/vscode/src/vs/workbench/services/remote/common/tunnelModel.d.ts +172 -1
- package/vscode/src/vs/workbench/services/userDataProfile/common/remoteUserDataProfiles.js +150 -0
- package/vscode/src/vs/workbench/services/userDataSync/common/userDataSync.js +3 -1
- package/vscode.proposed.d.ts +4787 -0
- package/workbench.js +0 -1
- package/service-override/bulkEdit.js +0 -9
- package/service-override/environment.js +0 -21
- package/service-override/extensions.js +0 -465
- package/service-override/files.js +0 -471
- package/service-override/keybindings.js +0 -99
- package/service-override/layout.js +0 -229
- package/service-override/output.js +0 -23
- package/service-override/quickaccess.js +0 -98
- package/vscode/src/vs/base/common/console.js +0 -58
- package/vscode/src/vs/base/common/keybindingParser.js +0 -87
- package/vscode/src/vs/base/common/prefixTree.js +0 -130
- package/vscode/src/vs/base/common/tfIdf.js +0 -137
- package/vscode/src/vs/editor/contrib/quickAccess/browser/commandsQuickAccess.js +0 -23
- package/vscode/src/vs/platform/files/browser/indexedDBFileSystemProvider.js +0 -404
- package/vscode/src/vs/platform/files/common/fileService.js +0 -957
- package/vscode/src/vs/platform/files/common/files.js +0 -81
- package/vscode/src/vs/platform/files/common/inMemoryFilesystemProvider.js +0 -220
- package/vscode/src/vs/platform/files/common/io.js +0 -75
- package/vscode/src/vs/platform/files/common/watcher.js +0 -69
- package/vscode/src/vs/platform/keyboardLayout/common/keyboardConfig.js +0 -48
- package/vscode/src/vs/platform/keyboardLayout/common/keyboardMapper.js +0 -23
- package/vscode/src/vs/platform/lifecycle/common/lifecycle.js +0 -25
- package/vscode/src/vs/platform/log/common/fileLog.js +0 -105
- package/vscode/src/vs/platform/quickinput/browser/commandsQuickAccess.js +0 -331
- package/vscode/src/vs/platform/quickinput/browser/helpQuickAccess.js +0 -65
- package/vscode/src/vs/platform/remote/common/managedSocket.js +0 -96
- package/vscode/src/vs/workbench/api/browser/mainThreadAiEmbeddingVector.js +0 -29
- package/vscode/src/vs/workbench/api/browser/mainThreadAiRelatedInformation.js +0 -33
- package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.js +0 -328
- package/vscode/src/vs/workbench/api/browser/mainThreadBulkEdits.js +0 -66
- package/vscode/src/vs/workbench/api/browser/mainThreadChat.js +0 -172
- package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents.js +0 -50
- package/vscode/src/vs/workbench/api/browser/mainThreadChatProvider.js +0 -59
- package/vscode/src/vs/workbench/api/browser/mainThreadChatSlashCommands.js +0 -47
- package/vscode/src/vs/workbench/api/browser/mainThreadChatVariables.js +0 -29
- package/vscode/src/vs/workbench/api/browser/mainThreadClipboard.js +0 -22
- package/vscode/src/vs/workbench/api/browser/mainThreadCodeInsets.js +0 -105
- package/vscode/src/vs/workbench/api/browser/mainThreadCommands.js +0 -92
- package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +0 -539
- package/vscode/src/vs/workbench/api/browser/mainThreadConfiguration.js +0 -78
- package/vscode/src/vs/workbench/api/browser/mainThreadConsole.js +0 -33
- package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +0 -576
- package/vscode/src/vs/workbench/api/browser/mainThreadDebugService.js +0 -385
- package/vscode/src/vs/workbench/api/browser/mainThreadDecorations.js +0 -100
- package/vscode/src/vs/workbench/api/browser/mainThreadDiagnostics.js +0 -67
- package/vscode/src/vs/workbench/api/browser/mainThreadDialogs.js +0 -66
- package/vscode/src/vs/workbench/api/browser/mainThreadDocumentContentProviders.js +0 -73
- package/vscode/src/vs/workbench/api/browser/mainThreadDocuments.js +0 -247
- package/vscode/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.js +0 -368
- package/vscode/src/vs/workbench/api/browser/mainThreadDownloadService.js +0 -20
- package/vscode/src/vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant.js +0 -39
- package/vscode/src/vs/workbench/api/browser/mainThreadEditor.js +0 -409
- package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +0 -473
- package/vscode/src/vs/workbench/api/browser/mainThreadEditors.js +0 -225
- package/vscode/src/vs/workbench/api/browser/mainThreadErrors.js +0 -22
- package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.js +0 -315
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystem.js +0 -278
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystemEventService.js +0 -281
- package/vscode/src/vs/workbench/api/browser/mainThreadInlineChat.js +0 -66
- package/vscode/src/vs/workbench/api/browser/mainThreadInteractive.js +0 -26
- package/vscode/src/vs/workbench/api/browser/mainThreadIssueReporter.js +0 -31
- package/vscode/src/vs/workbench/api/browser/mainThreadLabelService.js +0 -25
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.js +0 -945
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguages.js +0 -76
- package/vscode/src/vs/workbench/api/browser/mainThreadLocalization.js +0 -33
- package/vscode/src/vs/workbench/api/browser/mainThreadLogService.js +0 -76
- package/vscode/src/vs/workbench/api/browser/mainThreadManagedSockets.js +0 -91
- package/vscode/src/vs/workbench/api/browser/mainThreadMessageService.js +0 -116
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebook.js +0 -156
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocuments.js +0 -121
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.js +0 -186
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDto.js +0 -127
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookEditors.js +0 -129
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookKernels.js +0 -339
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookRenderers.js +0 -23
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.js +0 -46
- package/vscode/src/vs/workbench/api/browser/mainThreadOutputService.js +0 -74
- package/vscode/src/vs/workbench/api/browser/mainThreadProfilContentHandlers.js +0 -36
- package/vscode/src/vs/workbench/api/browser/mainThreadProgress.js +0 -66
- package/vscode/src/vs/workbench/api/browser/mainThreadQuickDiff.js +0 -47
- package/vscode/src/vs/workbench/api/browser/mainThreadQuickOpen.js +0 -183
- package/vscode/src/vs/workbench/api/browser/mainThreadRemoteConnectionData.js +0 -28
- package/vscode/src/vs/workbench/api/browser/mainThreadSCM.js +0 -461
- package/vscode/src/vs/workbench/api/browser/mainThreadSaveParticipant.js +0 -47
- package/vscode/src/vs/workbench/api/browser/mainThreadSearch.js +0 -146
- package/vscode/src/vs/workbench/api/browser/mainThreadSecretState.js +0 -68
- package/vscode/src/vs/workbench/api/browser/mainThreadShare.js +0 -48
- package/vscode/src/vs/workbench/api/browser/mainThreadStatusBar.js +0 -51
- package/vscode/src/vs/workbench/api/browser/mainThreadStorage.js +0 -70
- package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +0 -729
- package/vscode/src/vs/workbench/api/browser/mainThreadTelemetry.js +0 -51
- package/vscode/src/vs/workbench/api/browser/mainThreadTerminalService.js +0 -410
- package/vscode/src/vs/workbench/api/browser/mainThreadTesting.js +0 -180
- package/vscode/src/vs/workbench/api/browser/mainThreadTheming.js +0 -22
- package/vscode/src/vs/workbench/api/browser/mainThreadTimeline.js +0 -53
- package/vscode/src/vs/workbench/api/browser/mainThreadTreeViews.js +0 -311
- package/vscode/src/vs/workbench/api/browser/mainThreadTunnelService.js +0 -221
- package/vscode/src/vs/workbench/api/browser/mainThreadUriOpeners.js +0 -108
- package/vscode/src/vs/workbench/api/browser/mainThreadUrls.js +0 -59
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewManager.js +0 -27
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewPanels.js +0 -281
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewViews.js +0 -98
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviews.js +0 -133
- package/vscode/src/vs/workbench/api/browser/mainThreadWindow.js +0 -55
- package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.js +0 -271
- package/vscode/src/vs/workbench/api/common/shared/dataTransferCache.js +0 -33
- package/vscode/src/vs/workbench/browser/actions/quickAccessActions.js +0 -230
- package/vscode/src/vs/workbench/browser/contextkeys.js +0 -249
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/bulkEditService.js +0 -358
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/bulkFileEdits.js +0 -362
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/bulkTextEdits.js +0 -265
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatActions.js +0 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatModel.js +0 -215
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoLineQuickAccess.js +0 -86
- package/vscode/src/vs/workbench/contrib/comments/browser/commentColors.js +0 -55
- package/vscode/src/vs/workbench/contrib/comments/browser/commentFormActions.js +0 -49
- package/vscode/src/vs/workbench/contrib/comments/browser/commentGlyphWidget.js +0 -90
- package/vscode/src/vs/workbench/contrib/comments/browser/commentNode.js +0 -646
- package/vscode/src/vs/workbench/contrib/comments/browser/commentReply.js +0 -295
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadAdditionalActions.js +0 -60
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadBody.js +0 -247
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadHeader.js +0 -107
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadRangeDecorator.js +0 -107
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadWidget.js +0 -329
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.js +0 -378
- package/vscode/src/vs/workbench/contrib/comments/browser/comments.js +0 -3
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsController.js +0 -1194
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsFilterOptions.js +0 -17
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.js +0 -332
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsView.js +0 -541
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsViewActions.js +0 -176
- package/vscode/src/vs/workbench/contrib/comments/browser/media/panel.css.js +0 -4
- package/vscode/src/vs/workbench/contrib/comments/browser/media/review.css.js +0 -4
- package/vscode/src/vs/workbench/contrib/comments/browser/reactionsAction.js +0 -99
- package/vscode/src/vs/workbench/contrib/comments/browser/timestamp.js +0 -55
- package/vscode/src/vs/workbench/contrib/comments/common/commentModel.js +0 -143
- package/vscode/src/vs/workbench/contrib/comments/common/commentsConfiguration.js +0 -2
- package/vscode/src/vs/workbench/contrib/customEditor/common/customTextEditorModel.js +0 -71
- package/vscode/src/vs/workbench/contrib/externalUriOpener/common/contributedOpeners.js +0 -81
- package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveEditorInput.js +0 -177
- package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveHistoryService.js +0 -3
- package/vscode/src/vs/workbench/contrib/keybindings/browser/keybindings.contribution.js +0 -28
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput.js +0 -142
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +0 -480
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeMarkers/mergeMarkersController.js +0 -5
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/diffComputer.js +0 -83
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/editing.js +0 -54
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/lineRange.js +0 -108
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mapping.js +0 -258
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel.js +0 -614
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/modifiedBaseRange.js +0 -307
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/rangeUtils.js +0 -36
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/textModelDiffs.js +0 -165
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/telemetry.js +0 -78
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/utils.js +0 -68
- package/vscode/src/vs/workbench/contrib/mergeEditor/common/mergeEditor.js +0 -2
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModel.js +0 -106
- package/vscode/src/vs/workbench/contrib/output/browser/output.contribution.js +0 -487
- package/vscode/src/vs/workbench/contrib/output/browser/outputLinkProvider.js +0 -76
- package/vscode/src/vs/workbench/contrib/output/browser/outputServices.js +0 -166
- package/vscode/src/vs/workbench/contrib/output/browser/outputView.js +0 -234
- package/vscode/src/vs/workbench/contrib/quickaccess/browser/commandsQuickAccess.js +0 -287
- package/vscode/src/vs/workbench/contrib/quickaccess/browser/quickAccess.contribution.js +0 -167
- package/vscode/src/vs/workbench/contrib/quickaccess/browser/viewQuickAccess.js +0 -263
- package/vscode/src/vs/workbench/contrib/tasks/common/tasks.js +0 -504
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProcessExtHostProxy.js +0 -130
- package/vscode/src/vs/workbench/contrib/testing/common/getComputedState.js +0 -101
- package/vscode/src/vs/workbench/contrib/testing/common/observableValue.js +0 -26
- package/vscode/src/vs/workbench/contrib/testing/common/testCoverage.js +0 -23
- package/vscode/src/vs/workbench/contrib/testing/common/testResult.js +0 -334
- package/vscode/src/vs/workbench/contrib/testing/common/testingStates.js +0 -45
- package/vscode/src/vs/workbench/services/actions/common/menusExtensionPoint.js +0 -1286
- package/vscode/src/vs/workbench/services/commands/common/commandService.js +0 -77
- package/vscode/src/vs/workbench/services/extensions/browser/extensionService.js +0 -141
- package/vscode/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.js +0 -271
- package/vscode/src/vs/workbench/services/extensions/browser/webWorkerFileSystemProvider.js +0 -50
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +0 -1091
- package/vscode/src/vs/workbench/services/extensions/common/extHostCustomers.js +0 -40
- package/vscode/src/vs/workbench/services/extensions/common/extensionDevOptions.js +0 -23
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +0 -641
- package/vscode/src/vs/workbench/services/extensions/common/extensionRunningLocationTracker.js +0 -272
- package/vscode/src/vs/workbench/services/extensions/common/extensionStorageMigration.js +0 -56
- package/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.js +0 -78
- package/vscode/src/vs/workbench/services/extensions/common/remoteConsoleUtil.js +0 -47
- package/vscode/src/vs/workbench/services/extensions/common/remoteExtensionHost.js +0 -218
- package/vscode/src/vs/workbench/services/keybinding/browser/keybindingService.js +0 -917
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayoutService.js +0 -498
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/_.contribution.js +0 -13
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/cz.win.js +0 -162
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/de-swiss.win.js +0 -162
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/de.darwin.js +0 -125
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/de.linux.js +0 -180
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/de.win.js +0 -162
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/dk.win.js +0 -162
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/dvorak.darwin.js +0 -125
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-belgian.win.js +0 -162
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-ext.darwin.js +0 -125
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-in.win.js +0 -162
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-intl.darwin.js +0 -125
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-intl.win.js +0 -162
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-uk.darwin.js +0 -125
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-uk.win.js +0 -162
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en.darwin.js +0 -133
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en.linux.js +0 -182
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en.win.js +0 -167
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/es-latin.win.js +0 -162
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/es.darwin.js +0 -125
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/es.linux.js +0 -180
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/es.win.js +0 -162
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/fr.darwin.js +0 -125
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/fr.linux.js +0 -180
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/fr.win.js +0 -162
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/hu.win.js +0 -162
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/it.darwin.js +0 -125
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/it.win.js +0 -162
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/jp-roman.darwin.js +0 -125
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/jp.darwin.js +0 -125
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/ko.darwin.js +0 -125
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.darwin.js +0 -17
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.linux.js +0 -6
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.win.js +0 -23
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/no.win.js +0 -162
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/pl.darwin.js +0 -125
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/pl.win.js +0 -162
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/pt-br.win.js +0 -162
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/pt.darwin.js +0 -125
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/pt.win.js +0 -162
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/ru.darwin.js +0 -125
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/ru.linux.js +0 -180
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/ru.win.js +0 -162
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/sv.win.js +0 -164
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/thai.win.js +0 -162
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/tr.win.js +0 -162
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/zh-hans.darwin.js +0 -125
- package/vscode/src/vs/workbench/services/keybinding/common/keybindingIO.js +0 -72
- package/vscode/src/vs/workbench/services/keybinding/common/keymapInfo.js +0 -108
- package/vscode/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.js +0 -886
- package/vscode/src/vs/workbench/services/keybinding/common/windowsKeyboardMapper.js +0 -350
- package/vscode/src/vs/workbench/services/quickinput/browser/quickInputService.js +0 -67
- package/vscode/src/vs/workbench/services/themes/common/iconExtensionPoint.js +0 -4
- package/vscode/src/vs/workbench/services/workingCopy/common/resourceWorkingCopy.js +0 -77
|
@@ -1,917 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import * as nls from 'monaco-editor/esm/vs/nls.js';
|
|
3
|
-
import * as browser from 'monaco-editor/esm/vs/base/browser/browser.js';
|
|
4
|
-
import { BrowserFeatures } from 'monaco-editor/esm/vs/base/browser/canIUse.js';
|
|
5
|
-
import * as dom from 'monaco-editor/esm/vs/base/browser/dom.js';
|
|
6
|
-
import { printKeyboardEvent, printStandardKeyboardEvent, StandardKeyboardEvent } from 'monaco-editor/esm/vs/base/browser/keyboardEvent.js';
|
|
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';
|
|
9
|
-
import { parse } from 'monaco-editor/esm/vs/base/common/json.js';
|
|
10
|
-
import { UserSettingsLabelProvider } from 'monaco-editor/esm/vs/base/common/keybindingLabels.js';
|
|
11
|
-
import { KeybindingParser } from '../../../../base/common/keybindingParser.js';
|
|
12
|
-
import { KeyCodeChord, ScanCodeChord } from 'monaco-editor/esm/vs/base/common/keybindings.js';
|
|
13
|
-
import { KeyCodeUtils, ScanCodeUtils, IMMUTABLE_CODE_TO_KEY_CODE } from 'monaco-editor/esm/vs/base/common/keyCodes.js';
|
|
14
|
-
import { Disposable, DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
15
|
-
import * as objects from 'monaco-editor/esm/vs/base/common/objects.js';
|
|
16
|
-
import { OS, isMacintosh } from 'monaco-editor/esm/vs/base/common/platform.js';
|
|
17
|
-
import { dirname } from 'monaco-editor/esm/vs/base/common/resources.js';
|
|
18
|
-
import { MenuRegistry } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
|
|
19
|
-
import { CommandsRegistry, ICommandService } from 'monaco-editor/esm/vs/platform/commands/common/commands.js';
|
|
20
|
-
import { ContextKeyExpr, IContextKeyService } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
|
|
21
|
-
import { IFileService } from 'monaco-editor/esm/vs/platform/files/common/files.js';
|
|
22
|
-
import { Extensions } from 'monaco-editor/esm/vs/platform/jsonschemas/common/jsonContributionRegistry.js';
|
|
23
|
-
import { AbstractKeybindingService } from 'monaco-editor/esm/vs/platform/keybinding/common/abstractKeybindingService.js';
|
|
24
|
-
import { KeybindingResolver } from 'monaco-editor/esm/vs/platform/keybinding/common/keybindingResolver.js';
|
|
25
|
-
import { KeybindingsRegistry } from 'monaco-editor/esm/vs/platform/keybinding/common/keybindingsRegistry.js';
|
|
26
|
-
import { ResolvedKeybindingItem } from 'monaco-editor/esm/vs/platform/keybinding/common/resolvedKeybindingItem.js';
|
|
27
|
-
import { IKeyboardLayoutService } from '../../../../platform/keyboardLayout/common/keyboardLayout.js';
|
|
28
|
-
import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
|
|
29
|
-
import { INotificationService } from 'monaco-editor/esm/vs/platform/notification/common/notification.js';
|
|
30
|
-
import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
|
|
31
|
-
import { ITelemetryService } from 'monaco-editor/esm/vs/platform/telemetry/common/telemetry.js';
|
|
32
|
-
import { commandsExtensionPoint } from '../../actions/common/menusExtensionPoint.js';
|
|
33
|
-
import { IExtensionService } from '../../extensions/common/extensions.js';
|
|
34
|
-
import { ExtensionsRegistry } from '../../extensions/common/extensionsRegistry.js';
|
|
35
|
-
import { IHostService } from '../../host/browser/host.js';
|
|
36
|
-
import { getAllUnboundCommands } from './unboundCommands.js';
|
|
37
|
-
import { KeybindingIO, OutputBuilder } from '../common/keybindingIO.js';
|
|
38
|
-
import { IUserDataProfileService } from '../../userDataProfile/common/userDataProfile.js';
|
|
39
|
-
import { IUriIdentityService } from 'monaco-editor/esm/vs/platform/uriIdentity/common/uriIdentity.js';
|
|
40
|
-
var WorkbenchKeybindingService_1;
|
|
41
|
-
function isValidContributedKeyBinding(keyBinding, rejects) {
|
|
42
|
-
if (!keyBinding) {
|
|
43
|
-
rejects.push(( nls.localizeWithPath(
|
|
44
|
-
'vs/workbench/services/keybinding/browser/keybindingService',
|
|
45
|
-
'nonempty',
|
|
46
|
-
"expected non-empty value."
|
|
47
|
-
)));
|
|
48
|
-
return false;
|
|
49
|
-
}
|
|
50
|
-
if (typeof keyBinding.command !== 'string') {
|
|
51
|
-
rejects.push(( nls.localizeWithPath(
|
|
52
|
-
'vs/workbench/services/keybinding/browser/keybindingService',
|
|
53
|
-
'requirestring',
|
|
54
|
-
"property `{0}` is mandatory and must be of type `string`",
|
|
55
|
-
'command'
|
|
56
|
-
)));
|
|
57
|
-
return false;
|
|
58
|
-
}
|
|
59
|
-
if (keyBinding.key && typeof keyBinding.key !== 'string') {
|
|
60
|
-
rejects.push(( nls.localizeWithPath(
|
|
61
|
-
'vs/workbench/services/keybinding/browser/keybindingService',
|
|
62
|
-
'optstring',
|
|
63
|
-
"property `{0}` can be omitted or must be of type `string`",
|
|
64
|
-
'key'
|
|
65
|
-
)));
|
|
66
|
-
return false;
|
|
67
|
-
}
|
|
68
|
-
if (keyBinding.when && typeof keyBinding.when !== 'string') {
|
|
69
|
-
rejects.push(( nls.localizeWithPath(
|
|
70
|
-
'vs/workbench/services/keybinding/browser/keybindingService',
|
|
71
|
-
'optstring',
|
|
72
|
-
"property `{0}` can be omitted or must be of type `string`",
|
|
73
|
-
'when'
|
|
74
|
-
)));
|
|
75
|
-
return false;
|
|
76
|
-
}
|
|
77
|
-
if (keyBinding.mac && typeof keyBinding.mac !== 'string') {
|
|
78
|
-
rejects.push(( nls.localizeWithPath(
|
|
79
|
-
'vs/workbench/services/keybinding/browser/keybindingService',
|
|
80
|
-
'optstring',
|
|
81
|
-
"property `{0}` can be omitted or must be of type `string`",
|
|
82
|
-
'mac'
|
|
83
|
-
)));
|
|
84
|
-
return false;
|
|
85
|
-
}
|
|
86
|
-
if (keyBinding.linux && typeof keyBinding.linux !== 'string') {
|
|
87
|
-
rejects.push(( nls.localizeWithPath(
|
|
88
|
-
'vs/workbench/services/keybinding/browser/keybindingService',
|
|
89
|
-
'optstring',
|
|
90
|
-
"property `{0}` can be omitted or must be of type `string`",
|
|
91
|
-
'linux'
|
|
92
|
-
)));
|
|
93
|
-
return false;
|
|
94
|
-
}
|
|
95
|
-
if (keyBinding.win && typeof keyBinding.win !== 'string') {
|
|
96
|
-
rejects.push(( nls.localizeWithPath(
|
|
97
|
-
'vs/workbench/services/keybinding/browser/keybindingService',
|
|
98
|
-
'optstring',
|
|
99
|
-
"property `{0}` can be omitted or must be of type `string`",
|
|
100
|
-
'win'
|
|
101
|
-
)));
|
|
102
|
-
return false;
|
|
103
|
-
}
|
|
104
|
-
return true;
|
|
105
|
-
}
|
|
106
|
-
const keybindingType = {
|
|
107
|
-
type: 'object',
|
|
108
|
-
default: { command: '', key: '' },
|
|
109
|
-
properties: {
|
|
110
|
-
command: {
|
|
111
|
-
description: ( nls.localizeWithPath(
|
|
112
|
-
'vs/workbench/services/keybinding/browser/keybindingService',
|
|
113
|
-
'vscode.extension.contributes.keybindings.command',
|
|
114
|
-
'Identifier of the command to run when keybinding is triggered.'
|
|
115
|
-
)),
|
|
116
|
-
type: 'string'
|
|
117
|
-
},
|
|
118
|
-
args: {
|
|
119
|
-
description: ( nls.localizeWithPath(
|
|
120
|
-
'vs/workbench/services/keybinding/browser/keybindingService',
|
|
121
|
-
'vscode.extension.contributes.keybindings.args',
|
|
122
|
-
"Arguments to pass to the command to execute."
|
|
123
|
-
))
|
|
124
|
-
},
|
|
125
|
-
key: {
|
|
126
|
-
description: ( nls.localizeWithPath(
|
|
127
|
-
'vs/workbench/services/keybinding/browser/keybindingService',
|
|
128
|
-
'vscode.extension.contributes.keybindings.key',
|
|
129
|
-
'Key or key sequence (separate keys with plus-sign and sequences with space, e.g. Ctrl+O and Ctrl+L L for a chord).'
|
|
130
|
-
)),
|
|
131
|
-
type: 'string'
|
|
132
|
-
},
|
|
133
|
-
mac: {
|
|
134
|
-
description: ( nls.localizeWithPath(
|
|
135
|
-
'vs/workbench/services/keybinding/browser/keybindingService',
|
|
136
|
-
'vscode.extension.contributes.keybindings.mac',
|
|
137
|
-
'Mac specific key or key sequence.'
|
|
138
|
-
)),
|
|
139
|
-
type: 'string'
|
|
140
|
-
},
|
|
141
|
-
linux: {
|
|
142
|
-
description: ( nls.localizeWithPath(
|
|
143
|
-
'vs/workbench/services/keybinding/browser/keybindingService',
|
|
144
|
-
'vscode.extension.contributes.keybindings.linux',
|
|
145
|
-
'Linux specific key or key sequence.'
|
|
146
|
-
)),
|
|
147
|
-
type: 'string'
|
|
148
|
-
},
|
|
149
|
-
win: {
|
|
150
|
-
description: ( nls.localizeWithPath(
|
|
151
|
-
'vs/workbench/services/keybinding/browser/keybindingService',
|
|
152
|
-
'vscode.extension.contributes.keybindings.win',
|
|
153
|
-
'Windows specific key or key sequence.'
|
|
154
|
-
)),
|
|
155
|
-
type: 'string'
|
|
156
|
-
},
|
|
157
|
-
when: {
|
|
158
|
-
description: ( nls.localizeWithPath(
|
|
159
|
-
'vs/workbench/services/keybinding/browser/keybindingService',
|
|
160
|
-
'vscode.extension.contributes.keybindings.when',
|
|
161
|
-
'Condition when the key is active.'
|
|
162
|
-
)),
|
|
163
|
-
type: 'string'
|
|
164
|
-
},
|
|
165
|
-
}
|
|
166
|
-
};
|
|
167
|
-
const keybindingsExtPoint = ( ExtensionsRegistry.registerExtensionPoint({
|
|
168
|
-
extensionPoint: 'keybindings',
|
|
169
|
-
deps: [commandsExtensionPoint],
|
|
170
|
-
jsonSchema: {
|
|
171
|
-
description: ( nls.localizeWithPath(
|
|
172
|
-
'vs/workbench/services/keybinding/browser/keybindingService',
|
|
173
|
-
'vscode.extension.contributes.keybindings',
|
|
174
|
-
"Contributes keybindings."
|
|
175
|
-
)),
|
|
176
|
-
oneOf: [
|
|
177
|
-
keybindingType,
|
|
178
|
-
{
|
|
179
|
-
type: 'array',
|
|
180
|
-
items: keybindingType
|
|
181
|
-
}
|
|
182
|
-
]
|
|
183
|
-
}
|
|
184
|
-
}));
|
|
185
|
-
const NUMPAD_PRINTABLE_SCANCODES = [
|
|
186
|
-
90 ,
|
|
187
|
-
91 ,
|
|
188
|
-
92 ,
|
|
189
|
-
93 ,
|
|
190
|
-
95 ,
|
|
191
|
-
96 ,
|
|
192
|
-
97 ,
|
|
193
|
-
98 ,
|
|
194
|
-
99 ,
|
|
195
|
-
100 ,
|
|
196
|
-
101 ,
|
|
197
|
-
102 ,
|
|
198
|
-
103 ,
|
|
199
|
-
104 ,
|
|
200
|
-
105
|
|
201
|
-
];
|
|
202
|
-
const otherMacNumpadMapping = ( new Map());
|
|
203
|
-
otherMacNumpadMapping.set(95 , 22 );
|
|
204
|
-
otherMacNumpadMapping.set(96 , 23 );
|
|
205
|
-
otherMacNumpadMapping.set(97 , 24 );
|
|
206
|
-
otherMacNumpadMapping.set(98 , 25 );
|
|
207
|
-
otherMacNumpadMapping.set(99 , 26 );
|
|
208
|
-
otherMacNumpadMapping.set(100 , 27 );
|
|
209
|
-
otherMacNumpadMapping.set(101 , 28 );
|
|
210
|
-
otherMacNumpadMapping.set(102 , 29 );
|
|
211
|
-
otherMacNumpadMapping.set(103 , 30 );
|
|
212
|
-
otherMacNumpadMapping.set(104 , 21 );
|
|
213
|
-
let WorkbenchKeybindingService = WorkbenchKeybindingService_1 = class WorkbenchKeybindingService extends AbstractKeybindingService {
|
|
214
|
-
constructor(contextKeyService, commandService, telemetryService, notificationService, userDataProfileService, hostService, extensionService, fileService, uriIdentityService, logService, keyboardLayoutService) {
|
|
215
|
-
super(contextKeyService, commandService, telemetryService, notificationService, logService);
|
|
216
|
-
this.hostService = hostService;
|
|
217
|
-
this.keyboardLayoutService = keyboardLayoutService;
|
|
218
|
-
this._contributions = [];
|
|
219
|
-
this.isComposingGlobalContextKey = contextKeyService.createKey('isComposing', false);
|
|
220
|
-
this.kbsJsonSchema = ( new KeybindingsJsonSchema());
|
|
221
|
-
this.updateKeybindingsJsonSchema();
|
|
222
|
-
this._keyboardMapper = this.keyboardLayoutService.getKeyboardMapper();
|
|
223
|
-
this.keyboardLayoutService.onDidChangeKeyboardLayout(() => {
|
|
224
|
-
this._keyboardMapper = this.keyboardLayoutService.getKeyboardMapper();
|
|
225
|
-
this.updateResolver();
|
|
226
|
-
});
|
|
227
|
-
this._cachedResolver = null;
|
|
228
|
-
this.userKeybindings = this._register(( new UserKeybindings(userDataProfileService, uriIdentityService, fileService, logService)));
|
|
229
|
-
this.userKeybindings.initialize().then(() => {
|
|
230
|
-
if (this.userKeybindings.keybindings.length) {
|
|
231
|
-
this.updateResolver();
|
|
232
|
-
}
|
|
233
|
-
});
|
|
234
|
-
this._register(this.userKeybindings.onDidChange(() => {
|
|
235
|
-
logService.debug('User keybindings changed');
|
|
236
|
-
this.updateResolver();
|
|
237
|
-
}));
|
|
238
|
-
keybindingsExtPoint.setHandler((extensions) => {
|
|
239
|
-
const keybindings = [];
|
|
240
|
-
for (const extension of extensions) {
|
|
241
|
-
this._handleKeybindingsExtensionPointUser(extension.description.identifier, extension.description.isBuiltin, extension.value, extension.collector, keybindings);
|
|
242
|
-
}
|
|
243
|
-
KeybindingsRegistry.setExtensionKeybindings(keybindings);
|
|
244
|
-
this.updateResolver();
|
|
245
|
-
});
|
|
246
|
-
this.updateKeybindingsJsonSchema();
|
|
247
|
-
this._register(extensionService.onDidRegisterExtensions(() => this.updateKeybindingsJsonSchema()));
|
|
248
|
-
this._register(this._registerKeyListeners(window));
|
|
249
|
-
this._register(dom.onDidCreateWindow(({ window, disposableStore }) => {
|
|
250
|
-
disposableStore.add(this._registerKeyListeners(window));
|
|
251
|
-
}));
|
|
252
|
-
this._register(browser.onDidChangeFullscreen(() => {
|
|
253
|
-
const keyboard = navigator.keyboard;
|
|
254
|
-
if (BrowserFeatures.keyboard === 2 ) {
|
|
255
|
-
return;
|
|
256
|
-
}
|
|
257
|
-
if (browser.isFullscreen()) {
|
|
258
|
-
keyboard?.lock(['Escape']);
|
|
259
|
-
}
|
|
260
|
-
else {
|
|
261
|
-
keyboard?.unlock();
|
|
262
|
-
}
|
|
263
|
-
this._cachedResolver = null;
|
|
264
|
-
this._onDidUpdateKeybindings.fire();
|
|
265
|
-
}));
|
|
266
|
-
}
|
|
267
|
-
_registerKeyListeners(window) {
|
|
268
|
-
const disposables = ( new DisposableStore());
|
|
269
|
-
disposables.add(dom.addDisposableListener(window, dom.EventType.KEY_DOWN, (e) => {
|
|
270
|
-
this.isComposingGlobalContextKey.set(e.isComposing);
|
|
271
|
-
const keyEvent = ( new StandardKeyboardEvent(e));
|
|
272
|
-
this._log(`/ Received keydown event - ${printKeyboardEvent(e)}`);
|
|
273
|
-
this._log(`| Converted keydown event - ${printStandardKeyboardEvent(keyEvent)}`);
|
|
274
|
-
const shouldPreventDefault = this._dispatch(keyEvent, keyEvent.target);
|
|
275
|
-
if (shouldPreventDefault) {
|
|
276
|
-
keyEvent.preventDefault();
|
|
277
|
-
}
|
|
278
|
-
this.isComposingGlobalContextKey.set(false);
|
|
279
|
-
}));
|
|
280
|
-
disposables.add(dom.addDisposableListener(window, dom.EventType.KEY_UP, (e) => {
|
|
281
|
-
this.isComposingGlobalContextKey.set(e.isComposing);
|
|
282
|
-
const keyEvent = ( new StandardKeyboardEvent(e));
|
|
283
|
-
const shouldPreventDefault = this._singleModifierDispatch(keyEvent, keyEvent.target);
|
|
284
|
-
if (shouldPreventDefault) {
|
|
285
|
-
keyEvent.preventDefault();
|
|
286
|
-
}
|
|
287
|
-
this.isComposingGlobalContextKey.set(false);
|
|
288
|
-
}));
|
|
289
|
-
return disposables;
|
|
290
|
-
}
|
|
291
|
-
registerSchemaContribution(contribution) {
|
|
292
|
-
this._contributions.push(contribution);
|
|
293
|
-
if (contribution.onDidChange) {
|
|
294
|
-
this._register(contribution.onDidChange(() => this.updateKeybindingsJsonSchema()));
|
|
295
|
-
}
|
|
296
|
-
this.updateKeybindingsJsonSchema();
|
|
297
|
-
}
|
|
298
|
-
updateKeybindingsJsonSchema() {
|
|
299
|
-
this.kbsJsonSchema.updateSchema(this._contributions.flatMap(x => x.getSchemaAdditions()));
|
|
300
|
-
}
|
|
301
|
-
_printKeybinding(keybinding) {
|
|
302
|
-
return UserSettingsLabelProvider.toLabel(OS, keybinding.chords, (chord) => {
|
|
303
|
-
if (chord instanceof KeyCodeChord) {
|
|
304
|
-
return ( KeyCodeUtils.toString(chord.keyCode));
|
|
305
|
-
}
|
|
306
|
-
return ( ScanCodeUtils.toString(chord.scanCode));
|
|
307
|
-
}) || '[null]';
|
|
308
|
-
}
|
|
309
|
-
_printResolvedKeybinding(resolvedKeybinding) {
|
|
310
|
-
return ( resolvedKeybinding.getDispatchChords().map(x => x || '[null]')).join(' ');
|
|
311
|
-
}
|
|
312
|
-
_printResolvedKeybindings(output, input, resolvedKeybindings) {
|
|
313
|
-
const padLength = 35;
|
|
314
|
-
const firstRow = `${input.padStart(padLength, ' ')} => `;
|
|
315
|
-
if (resolvedKeybindings.length === 0) {
|
|
316
|
-
output.push(`${firstRow}${'[NO BINDING]'.padStart(padLength, ' ')}`);
|
|
317
|
-
return;
|
|
318
|
-
}
|
|
319
|
-
for (const resolvedKeybinding of resolvedKeybindings) {
|
|
320
|
-
{
|
|
321
|
-
output.push(`${firstRow}${this._printResolvedKeybinding(resolvedKeybinding).padStart(padLength, ' ')}`);
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
_dumpResolveKeybindingDebugInfo() {
|
|
326
|
-
const seenBindings = ( new Set());
|
|
327
|
-
const result = [];
|
|
328
|
-
result.push(`Default Resolved Keybindings (unique only):`);
|
|
329
|
-
for (const item of KeybindingsRegistry.getDefaultKeybindings()) {
|
|
330
|
-
if (!item.keybinding) {
|
|
331
|
-
continue;
|
|
332
|
-
}
|
|
333
|
-
const input = this._printKeybinding(item.keybinding);
|
|
334
|
-
if (( seenBindings.has(input))) {
|
|
335
|
-
continue;
|
|
336
|
-
}
|
|
337
|
-
seenBindings.add(input);
|
|
338
|
-
const resolvedKeybindings = this._keyboardMapper.resolveKeybinding(item.keybinding);
|
|
339
|
-
this._printResolvedKeybindings(result, input, resolvedKeybindings);
|
|
340
|
-
}
|
|
341
|
-
result.push(`User Resolved Keybindings (unique only):`);
|
|
342
|
-
for (const item of this.userKeybindings.keybindings) {
|
|
343
|
-
if (!item.keybinding) {
|
|
344
|
-
continue;
|
|
345
|
-
}
|
|
346
|
-
const input = item._sourceKey ?? 'Impossible: missing source key, but has keybinding';
|
|
347
|
-
if (( seenBindings.has(input))) {
|
|
348
|
-
continue;
|
|
349
|
-
}
|
|
350
|
-
seenBindings.add(input);
|
|
351
|
-
const resolvedKeybindings = this._keyboardMapper.resolveKeybinding(item.keybinding);
|
|
352
|
-
this._printResolvedKeybindings(result, input, resolvedKeybindings);
|
|
353
|
-
}
|
|
354
|
-
return result.join('\n');
|
|
355
|
-
}
|
|
356
|
-
_dumpDebugInfo() {
|
|
357
|
-
const layoutInfo = JSON.stringify(this.keyboardLayoutService.getCurrentKeyboardLayout(), null, '\t');
|
|
358
|
-
const mapperInfo = this._keyboardMapper.dumpDebugInfo();
|
|
359
|
-
const resolvedKeybindings = this._dumpResolveKeybindingDebugInfo();
|
|
360
|
-
const rawMapping = JSON.stringify(this.keyboardLayoutService.getRawKeyboardMapping(), null, '\t');
|
|
361
|
-
return `Layout info:\n${layoutInfo}\n\n${resolvedKeybindings}\n\n${mapperInfo}\n\nRaw mapping:\n${rawMapping}`;
|
|
362
|
-
}
|
|
363
|
-
_dumpDebugInfoJSON() {
|
|
364
|
-
const info = {
|
|
365
|
-
layout: this.keyboardLayoutService.getCurrentKeyboardLayout(),
|
|
366
|
-
rawMapping: this.keyboardLayoutService.getRawKeyboardMapping()
|
|
367
|
-
};
|
|
368
|
-
return JSON.stringify(info, null, '\t');
|
|
369
|
-
}
|
|
370
|
-
customKeybindingsCount() {
|
|
371
|
-
return this.userKeybindings.keybindings.length;
|
|
372
|
-
}
|
|
373
|
-
updateResolver() {
|
|
374
|
-
this._cachedResolver = null;
|
|
375
|
-
this._onDidUpdateKeybindings.fire();
|
|
376
|
-
}
|
|
377
|
-
getUserKeybindingItems() {
|
|
378
|
-
return this._resolveUserKeybindingItems(this.userKeybindings.keybindings, false);
|
|
379
|
-
}
|
|
380
|
-
_getResolver() {
|
|
381
|
-
if (!this._cachedResolver) {
|
|
382
|
-
const defaults = this._resolveKeybindingItems(KeybindingsRegistry.getDefaultKeybindings(), true);
|
|
383
|
-
const overrides = this.getUserKeybindingItems();
|
|
384
|
-
this._cachedResolver = ( new KeybindingResolver(defaults, overrides, (str) => this._log(str)));
|
|
385
|
-
}
|
|
386
|
-
return this._cachedResolver;
|
|
387
|
-
}
|
|
388
|
-
_documentHasFocus() {
|
|
389
|
-
return this.hostService.hasFocus;
|
|
390
|
-
}
|
|
391
|
-
_resolveKeybindingItems(items, isDefault) {
|
|
392
|
-
const result = [];
|
|
393
|
-
let resultLen = 0;
|
|
394
|
-
for (const item of items) {
|
|
395
|
-
const when = item.when || undefined;
|
|
396
|
-
const keybinding = item.keybinding;
|
|
397
|
-
if (!keybinding) {
|
|
398
|
-
result[resultLen++] = ( new ResolvedKeybindingItem(
|
|
399
|
-
undefined,
|
|
400
|
-
item.command,
|
|
401
|
-
item.commandArgs,
|
|
402
|
-
when,
|
|
403
|
-
isDefault,
|
|
404
|
-
item.extensionId,
|
|
405
|
-
item.isBuiltinExtension
|
|
406
|
-
));
|
|
407
|
-
}
|
|
408
|
-
else {
|
|
409
|
-
if (this._assertBrowserConflicts(keybinding)) {
|
|
410
|
-
continue;
|
|
411
|
-
}
|
|
412
|
-
const resolvedKeybindings = this._keyboardMapper.resolveKeybinding(keybinding);
|
|
413
|
-
for (let i = resolvedKeybindings.length - 1; i >= 0; i--) {
|
|
414
|
-
const resolvedKeybinding = resolvedKeybindings[i];
|
|
415
|
-
result[resultLen++] = ( new ResolvedKeybindingItem(
|
|
416
|
-
resolvedKeybinding,
|
|
417
|
-
item.command,
|
|
418
|
-
item.commandArgs,
|
|
419
|
-
when,
|
|
420
|
-
isDefault,
|
|
421
|
-
item.extensionId,
|
|
422
|
-
item.isBuiltinExtension
|
|
423
|
-
));
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
return result;
|
|
428
|
-
}
|
|
429
|
-
_resolveUserKeybindingItems(items, isDefault) {
|
|
430
|
-
const result = [];
|
|
431
|
-
let resultLen = 0;
|
|
432
|
-
for (const item of items) {
|
|
433
|
-
const when = item.when || undefined;
|
|
434
|
-
if (!item.keybinding) {
|
|
435
|
-
result[resultLen++] = ( new ResolvedKeybindingItem(undefined, item.command, item.commandArgs, when, isDefault, null, false));
|
|
436
|
-
}
|
|
437
|
-
else {
|
|
438
|
-
const resolvedKeybindings = this._keyboardMapper.resolveKeybinding(item.keybinding);
|
|
439
|
-
for (const resolvedKeybinding of resolvedKeybindings) {
|
|
440
|
-
result[resultLen++] = ( new ResolvedKeybindingItem(
|
|
441
|
-
resolvedKeybinding,
|
|
442
|
-
item.command,
|
|
443
|
-
item.commandArgs,
|
|
444
|
-
when,
|
|
445
|
-
isDefault,
|
|
446
|
-
null,
|
|
447
|
-
false
|
|
448
|
-
));
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
return result;
|
|
453
|
-
}
|
|
454
|
-
_assertBrowserConflicts(keybinding) {
|
|
455
|
-
if (BrowserFeatures.keyboard === 0 ) {
|
|
456
|
-
return false;
|
|
457
|
-
}
|
|
458
|
-
if (BrowserFeatures.keyboard === 1 && browser.isFullscreen()) {
|
|
459
|
-
return false;
|
|
460
|
-
}
|
|
461
|
-
for (const chord of keybinding.chords) {
|
|
462
|
-
if (!chord.metaKey && !chord.altKey && !chord.ctrlKey && !chord.shiftKey) {
|
|
463
|
-
continue;
|
|
464
|
-
}
|
|
465
|
-
const modifiersMask = 2048 | 512 | 1024 ;
|
|
466
|
-
let partModifiersMask = 0;
|
|
467
|
-
if (chord.metaKey) {
|
|
468
|
-
partModifiersMask |= 2048 ;
|
|
469
|
-
}
|
|
470
|
-
if (chord.shiftKey) {
|
|
471
|
-
partModifiersMask |= 1024 ;
|
|
472
|
-
}
|
|
473
|
-
if (chord.altKey) {
|
|
474
|
-
partModifiersMask |= 512 ;
|
|
475
|
-
}
|
|
476
|
-
if (chord.ctrlKey && OS === 2 ) {
|
|
477
|
-
partModifiersMask |= 256 ;
|
|
478
|
-
}
|
|
479
|
-
if ((partModifiersMask & modifiersMask) === ((2048 | 512) )) {
|
|
480
|
-
if (chord instanceof ScanCodeChord && ((chord.scanCode === 86 || chord.scanCode === 85) )) {
|
|
481
|
-
return true;
|
|
482
|
-
}
|
|
483
|
-
if (chord instanceof KeyCodeChord && ((chord.keyCode === 15 || chord.keyCode === 17) )) {
|
|
484
|
-
return true;
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
if ((partModifiersMask & modifiersMask) === 2048 ) {
|
|
488
|
-
if (chord instanceof ScanCodeChord && ((chord.scanCode >= 36 && chord.scanCode <= 45) )) {
|
|
489
|
-
return true;
|
|
490
|
-
}
|
|
491
|
-
if (chord instanceof KeyCodeChord && ((chord.keyCode >= 21 && chord.keyCode <= 30) )) {
|
|
492
|
-
return true;
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
return false;
|
|
497
|
-
}
|
|
498
|
-
resolveKeybinding(kb) {
|
|
499
|
-
return this._keyboardMapper.resolveKeybinding(kb);
|
|
500
|
-
}
|
|
501
|
-
resolveKeyboardEvent(keyboardEvent) {
|
|
502
|
-
this.keyboardLayoutService.validateCurrentKeyboardMapping(keyboardEvent);
|
|
503
|
-
return this._keyboardMapper.resolveKeyboardEvent(keyboardEvent);
|
|
504
|
-
}
|
|
505
|
-
resolveUserBinding(userBinding) {
|
|
506
|
-
const keybinding = KeybindingParser.parseKeybinding(userBinding);
|
|
507
|
-
return (keybinding ? this._keyboardMapper.resolveKeybinding(keybinding) : []);
|
|
508
|
-
}
|
|
509
|
-
_handleKeybindingsExtensionPointUser(extensionId, isBuiltin, keybindings, collector, result) {
|
|
510
|
-
if (Array.isArray(keybindings)) {
|
|
511
|
-
for (let i = 0, len = keybindings.length; i < len; i++) {
|
|
512
|
-
this._handleKeybinding(extensionId, isBuiltin, i + 1, keybindings[i], collector, result);
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
else {
|
|
516
|
-
this._handleKeybinding(extensionId, isBuiltin, 1, keybindings, collector, result);
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
_handleKeybinding(extensionId, isBuiltin, idx, keybindings, collector, result) {
|
|
520
|
-
const rejects = [];
|
|
521
|
-
if (isValidContributedKeyBinding(keybindings, rejects)) {
|
|
522
|
-
const rule = this._asCommandRule(extensionId, isBuiltin, idx++, keybindings);
|
|
523
|
-
if (rule) {
|
|
524
|
-
result.push(rule);
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
if (rejects.length > 0) {
|
|
528
|
-
collector.error(( nls.localizeWithPath(
|
|
529
|
-
'vs/workbench/services/keybinding/browser/keybindingService',
|
|
530
|
-
'invalid.keybindings',
|
|
531
|
-
"Invalid `contributes.{0}`: {1}",
|
|
532
|
-
keybindingsExtPoint.name,
|
|
533
|
-
rejects.join('\n')
|
|
534
|
-
)));
|
|
535
|
-
}
|
|
536
|
-
}
|
|
537
|
-
static bindToCurrentPlatform(key, mac, linux, win) {
|
|
538
|
-
if (OS === 1 && win) {
|
|
539
|
-
if (win) {
|
|
540
|
-
return win;
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
|
-
else if (OS === 2 ) {
|
|
544
|
-
if (mac) {
|
|
545
|
-
return mac;
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
else {
|
|
549
|
-
if (linux) {
|
|
550
|
-
return linux;
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
return key;
|
|
554
|
-
}
|
|
555
|
-
_asCommandRule(extensionId, isBuiltin, idx, binding) {
|
|
556
|
-
const { command, args, when, key, mac, linux, win } = binding;
|
|
557
|
-
const keybinding = WorkbenchKeybindingService_1.bindToCurrentPlatform(key, mac, linux, win);
|
|
558
|
-
if (!keybinding) {
|
|
559
|
-
return undefined;
|
|
560
|
-
}
|
|
561
|
-
let weight;
|
|
562
|
-
if (isBuiltin) {
|
|
563
|
-
weight = 300 + idx;
|
|
564
|
-
}
|
|
565
|
-
else {
|
|
566
|
-
weight = 400 + idx;
|
|
567
|
-
}
|
|
568
|
-
const commandAction = MenuRegistry.getCommand(command);
|
|
569
|
-
const precondition = commandAction && commandAction.precondition;
|
|
570
|
-
let fullWhen;
|
|
571
|
-
if (when && precondition) {
|
|
572
|
-
fullWhen = ( ContextKeyExpr.and(precondition, ContextKeyExpr.deserialize(when)));
|
|
573
|
-
}
|
|
574
|
-
else if (when) {
|
|
575
|
-
fullWhen = ContextKeyExpr.deserialize(when);
|
|
576
|
-
}
|
|
577
|
-
else if (precondition) {
|
|
578
|
-
fullWhen = precondition;
|
|
579
|
-
}
|
|
580
|
-
const desc = {
|
|
581
|
-
id: command,
|
|
582
|
-
args,
|
|
583
|
-
when: fullWhen,
|
|
584
|
-
weight: weight,
|
|
585
|
-
keybinding: KeybindingParser.parseKeybinding(keybinding),
|
|
586
|
-
extensionId: extensionId.value,
|
|
587
|
-
isBuiltinExtension: isBuiltin
|
|
588
|
-
};
|
|
589
|
-
return desc;
|
|
590
|
-
}
|
|
591
|
-
getDefaultKeybindingsContent() {
|
|
592
|
-
const resolver = this._getResolver();
|
|
593
|
-
const defaultKeybindings = resolver.getDefaultKeybindings();
|
|
594
|
-
const boundCommands = resolver.getDefaultBoundCommands();
|
|
595
|
-
return (WorkbenchKeybindingService_1._getDefaultKeybindings(defaultKeybindings)
|
|
596
|
-
+ '\n\n'
|
|
597
|
-
+ WorkbenchKeybindingService_1._getAllCommandsAsComment(boundCommands));
|
|
598
|
-
}
|
|
599
|
-
static _getDefaultKeybindings(defaultKeybindings) {
|
|
600
|
-
const out = ( new OutputBuilder());
|
|
601
|
-
out.writeLine('[');
|
|
602
|
-
const lastIndex = defaultKeybindings.length - 1;
|
|
603
|
-
defaultKeybindings.forEach((k, index) => {
|
|
604
|
-
KeybindingIO.writeKeybindingItem(out, k);
|
|
605
|
-
if (index !== lastIndex) {
|
|
606
|
-
out.writeLine(',');
|
|
607
|
-
}
|
|
608
|
-
else {
|
|
609
|
-
out.writeLine();
|
|
610
|
-
}
|
|
611
|
-
});
|
|
612
|
-
out.writeLine(']');
|
|
613
|
-
return ( out.toString());
|
|
614
|
-
}
|
|
615
|
-
static _getAllCommandsAsComment(boundCommands) {
|
|
616
|
-
const unboundCommands = getAllUnboundCommands(boundCommands);
|
|
617
|
-
const pretty = unboundCommands.sort().join('\n// - ');
|
|
618
|
-
return '// ' + ( nls.localizeWithPath(
|
|
619
|
-
'vs/workbench/services/keybinding/browser/keybindingService',
|
|
620
|
-
'unboundCommands',
|
|
621
|
-
"Here are other available commands: "
|
|
622
|
-
)) + '\n// - ' + pretty;
|
|
623
|
-
}
|
|
624
|
-
mightProducePrintableCharacter(event) {
|
|
625
|
-
if (event.ctrlKey || event.metaKey || event.altKey) {
|
|
626
|
-
return false;
|
|
627
|
-
}
|
|
628
|
-
const code = ScanCodeUtils.toEnum(event.code);
|
|
629
|
-
if (NUMPAD_PRINTABLE_SCANCODES.indexOf(code) !== -1) {
|
|
630
|
-
if (event.keyCode === IMMUTABLE_CODE_TO_KEY_CODE[code]) {
|
|
631
|
-
return true;
|
|
632
|
-
}
|
|
633
|
-
if (isMacintosh && event.keyCode === otherMacNumpadMapping.get(code)) {
|
|
634
|
-
return true;
|
|
635
|
-
}
|
|
636
|
-
return false;
|
|
637
|
-
}
|
|
638
|
-
const keycode = IMMUTABLE_CODE_TO_KEY_CODE[code];
|
|
639
|
-
if (keycode !== -1) {
|
|
640
|
-
return false;
|
|
641
|
-
}
|
|
642
|
-
const mapping = this.keyboardLayoutService.getRawKeyboardMapping();
|
|
643
|
-
if (!mapping) {
|
|
644
|
-
return false;
|
|
645
|
-
}
|
|
646
|
-
const keyInfo = mapping[event.code];
|
|
647
|
-
if (!keyInfo) {
|
|
648
|
-
return false;
|
|
649
|
-
}
|
|
650
|
-
if (!keyInfo.value || /\s/.test(keyInfo.value)) {
|
|
651
|
-
return false;
|
|
652
|
-
}
|
|
653
|
-
return true;
|
|
654
|
-
}
|
|
655
|
-
};
|
|
656
|
-
WorkbenchKeybindingService = WorkbenchKeybindingService_1 = ( __decorate([
|
|
657
|
-
( __param(0, IContextKeyService)),
|
|
658
|
-
( __param(1, ICommandService)),
|
|
659
|
-
( __param(2, ITelemetryService)),
|
|
660
|
-
( __param(3, INotificationService)),
|
|
661
|
-
( __param(4, IUserDataProfileService)),
|
|
662
|
-
( __param(5, IHostService)),
|
|
663
|
-
( __param(6, IExtensionService)),
|
|
664
|
-
( __param(7, IFileService)),
|
|
665
|
-
( __param(8, IUriIdentityService)),
|
|
666
|
-
( __param(9, ILogService)),
|
|
667
|
-
( __param(10, IKeyboardLayoutService))
|
|
668
|
-
], WorkbenchKeybindingService));
|
|
669
|
-
class UserKeybindings extends Disposable {
|
|
670
|
-
get keybindings() { return this._keybindings; }
|
|
671
|
-
constructor(userDataProfileService, uriIdentityService, fileService, logService) {
|
|
672
|
-
super();
|
|
673
|
-
this.userDataProfileService = userDataProfileService;
|
|
674
|
-
this.uriIdentityService = uriIdentityService;
|
|
675
|
-
this.fileService = fileService;
|
|
676
|
-
this._rawKeybindings = [];
|
|
677
|
-
this._keybindings = [];
|
|
678
|
-
this.watchDisposables = this._register(( new DisposableStore()));
|
|
679
|
-
this._onDidChange = this._register(( new Emitter()));
|
|
680
|
-
this.onDidChange = this._onDidChange.event;
|
|
681
|
-
this.watch();
|
|
682
|
-
this.reloadConfigurationScheduler = this._register(( new RunOnceScheduler(() => this.reload().then(changed => {
|
|
683
|
-
if (changed) {
|
|
684
|
-
this._onDidChange.fire();
|
|
685
|
-
}
|
|
686
|
-
}), 50)));
|
|
687
|
-
this._register(Event.filter(this.fileService.onDidFilesChange, e => e.contains(this.userDataProfileService.currentProfile.keybindingsResource))(() => {
|
|
688
|
-
logService.debug('Keybindings file changed');
|
|
689
|
-
this.reloadConfigurationScheduler.schedule();
|
|
690
|
-
}));
|
|
691
|
-
this._register(this.fileService.onDidRunOperation((e) => {
|
|
692
|
-
if (e.operation === 4 && ( e.resource.toString()) === ( this.userDataProfileService.currentProfile.keybindingsResource.toString())) {
|
|
693
|
-
logService.debug('Keybindings file written');
|
|
694
|
-
this.reloadConfigurationScheduler.schedule();
|
|
695
|
-
}
|
|
696
|
-
}));
|
|
697
|
-
this._register(userDataProfileService.onDidChangeCurrentProfile(e => {
|
|
698
|
-
if (!this.uriIdentityService.extUri.isEqual(e.previous.keybindingsResource, e.profile.keybindingsResource)) {
|
|
699
|
-
e.join(this.whenCurrentProfileChanged());
|
|
700
|
-
}
|
|
701
|
-
}));
|
|
702
|
-
}
|
|
703
|
-
async whenCurrentProfileChanged() {
|
|
704
|
-
this.watch();
|
|
705
|
-
this.reloadConfigurationScheduler.schedule();
|
|
706
|
-
}
|
|
707
|
-
watch() {
|
|
708
|
-
this.watchDisposables.clear();
|
|
709
|
-
this.watchDisposables.add(this.fileService.watch(dirname(this.userDataProfileService.currentProfile.keybindingsResource)));
|
|
710
|
-
this.watchDisposables.add(this.fileService.watch(this.userDataProfileService.currentProfile.keybindingsResource));
|
|
711
|
-
}
|
|
712
|
-
async initialize() {
|
|
713
|
-
await this.reload();
|
|
714
|
-
}
|
|
715
|
-
async reload() {
|
|
716
|
-
const newKeybindings = await this.readUserKeybindings();
|
|
717
|
-
if (objects.equals(this._rawKeybindings, newKeybindings)) {
|
|
718
|
-
return false;
|
|
719
|
-
}
|
|
720
|
-
this._rawKeybindings = newKeybindings;
|
|
721
|
-
this._keybindings = ( this._rawKeybindings.map((k) => KeybindingIO.readUserKeybindingItem(k)));
|
|
722
|
-
return true;
|
|
723
|
-
}
|
|
724
|
-
async readUserKeybindings() {
|
|
725
|
-
try {
|
|
726
|
-
const content = await this.fileService.readFile(this.userDataProfileService.currentProfile.keybindingsResource);
|
|
727
|
-
const value = parse(( content.value.toString()));
|
|
728
|
-
return Array.isArray(value)
|
|
729
|
-
? value.filter(v => v && typeof v === 'object' )
|
|
730
|
-
: [];
|
|
731
|
-
}
|
|
732
|
-
catch (e) {
|
|
733
|
-
return [];
|
|
734
|
-
}
|
|
735
|
-
}
|
|
736
|
-
}
|
|
737
|
-
class KeybindingsJsonSchema {
|
|
738
|
-
static { this.schemaId = 'vscode://schemas/keybindings'; }
|
|
739
|
-
constructor() {
|
|
740
|
-
this.commandsSchemas = [];
|
|
741
|
-
this.commandsEnum = [];
|
|
742
|
-
this.removalCommandsEnum = [];
|
|
743
|
-
this.commandsEnumDescriptions = [];
|
|
744
|
-
this.schema = {
|
|
745
|
-
id: KeybindingsJsonSchema.schemaId,
|
|
746
|
-
type: 'array',
|
|
747
|
-
title: ( nls.localizeWithPath(
|
|
748
|
-
'vs/workbench/services/keybinding/browser/keybindingService',
|
|
749
|
-
'keybindings.json.title',
|
|
750
|
-
"Keybindings configuration"
|
|
751
|
-
)),
|
|
752
|
-
allowTrailingCommas: true,
|
|
753
|
-
allowComments: true,
|
|
754
|
-
definitions: {
|
|
755
|
-
'editorGroupsSchema': {
|
|
756
|
-
'type': 'array',
|
|
757
|
-
'items': {
|
|
758
|
-
'type': 'object',
|
|
759
|
-
'properties': {
|
|
760
|
-
'groups': {
|
|
761
|
-
'$ref': '#/definitions/editorGroupsSchema',
|
|
762
|
-
'default': [{}, {}]
|
|
763
|
-
},
|
|
764
|
-
'size': {
|
|
765
|
-
'type': 'number',
|
|
766
|
-
'default': 0.5
|
|
767
|
-
}
|
|
768
|
-
}
|
|
769
|
-
}
|
|
770
|
-
},
|
|
771
|
-
'commandNames': {
|
|
772
|
-
'type': 'string',
|
|
773
|
-
'enum': this.commandsEnum,
|
|
774
|
-
'enumDescriptions': this.commandsEnumDescriptions,
|
|
775
|
-
'description': ( nls.localizeWithPath(
|
|
776
|
-
'vs/workbench/services/keybinding/browser/keybindingService',
|
|
777
|
-
'keybindings.json.command',
|
|
778
|
-
"Name of the command to execute"
|
|
779
|
-
)),
|
|
780
|
-
},
|
|
781
|
-
'commandType': {
|
|
782
|
-
'anyOf': [
|
|
783
|
-
{
|
|
784
|
-
$ref: '#/definitions/commandNames'
|
|
785
|
-
},
|
|
786
|
-
{
|
|
787
|
-
'type': 'string',
|
|
788
|
-
'enum': this.removalCommandsEnum,
|
|
789
|
-
'enumDescriptions': this.commandsEnumDescriptions,
|
|
790
|
-
'description': ( nls.localizeWithPath(
|
|
791
|
-
'vs/workbench/services/keybinding/browser/keybindingService',
|
|
792
|
-
'keybindings.json.removalCommand',
|
|
793
|
-
"Name of the command to remove keyboard shortcut for"
|
|
794
|
-
)),
|
|
795
|
-
},
|
|
796
|
-
{
|
|
797
|
-
'type': 'string'
|
|
798
|
-
},
|
|
799
|
-
]
|
|
800
|
-
},
|
|
801
|
-
'commandsSchemas': {
|
|
802
|
-
'allOf': this.commandsSchemas
|
|
803
|
-
}
|
|
804
|
-
},
|
|
805
|
-
items: {
|
|
806
|
-
'required': ['key'],
|
|
807
|
-
'type': 'object',
|
|
808
|
-
'defaultSnippets': [{ 'body': { 'key': '$1', 'command': '$2', 'when': '$3' } }],
|
|
809
|
-
'properties': {
|
|
810
|
-
'key': {
|
|
811
|
-
'type': 'string',
|
|
812
|
-
'description': ( nls.localizeWithPath(
|
|
813
|
-
'vs/workbench/services/keybinding/browser/keybindingService',
|
|
814
|
-
'keybindings.json.key',
|
|
815
|
-
"Key or key sequence (separated by space)"
|
|
816
|
-
)),
|
|
817
|
-
},
|
|
818
|
-
'command': {
|
|
819
|
-
'anyOf': [
|
|
820
|
-
{
|
|
821
|
-
'if': {
|
|
822
|
-
'type': 'array'
|
|
823
|
-
},
|
|
824
|
-
'then': {
|
|
825
|
-
'not': {
|
|
826
|
-
'type': 'array'
|
|
827
|
-
},
|
|
828
|
-
'errorMessage': ( nls.localizeWithPath(
|
|
829
|
-
'vs/workbench/services/keybinding/browser/keybindingService',
|
|
830
|
-
'keybindings.commandsIsArray',
|
|
831
|
-
"Incorrect type. Expected \"{0}\". The field 'command' does not support running multiple commands. Use command 'runCommands' to pass it multiple commands to run.",
|
|
832
|
-
'string'
|
|
833
|
-
))
|
|
834
|
-
},
|
|
835
|
-
'else': {
|
|
836
|
-
'$ref': '#/definitions/commandType'
|
|
837
|
-
}
|
|
838
|
-
},
|
|
839
|
-
{
|
|
840
|
-
'$ref': '#/definitions/commandType'
|
|
841
|
-
}
|
|
842
|
-
]
|
|
843
|
-
},
|
|
844
|
-
'when': {
|
|
845
|
-
'type': 'string',
|
|
846
|
-
'description': ( nls.localizeWithPath(
|
|
847
|
-
'vs/workbench/services/keybinding/browser/keybindingService',
|
|
848
|
-
'keybindings.json.when',
|
|
849
|
-
"Condition when the key is active."
|
|
850
|
-
))
|
|
851
|
-
},
|
|
852
|
-
'args': {
|
|
853
|
-
'description': ( nls.localizeWithPath(
|
|
854
|
-
'vs/workbench/services/keybinding/browser/keybindingService',
|
|
855
|
-
'keybindings.json.args',
|
|
856
|
-
"Arguments to pass to the command to execute."
|
|
857
|
-
))
|
|
858
|
-
}
|
|
859
|
-
},
|
|
860
|
-
'$ref': '#/definitions/commandsSchemas'
|
|
861
|
-
}
|
|
862
|
-
};
|
|
863
|
-
this.schemaRegistry = ( Registry.as(Extensions.JSONContribution));
|
|
864
|
-
this.schemaRegistry.registerSchema(KeybindingsJsonSchema.schemaId, this.schema);
|
|
865
|
-
}
|
|
866
|
-
updateSchema(additionalContributions) {
|
|
867
|
-
this.commandsSchemas.length = 0;
|
|
868
|
-
this.commandsEnum.length = 0;
|
|
869
|
-
this.removalCommandsEnum.length = 0;
|
|
870
|
-
this.commandsEnumDescriptions.length = 0;
|
|
871
|
-
const knownCommands = ( new Set());
|
|
872
|
-
const addKnownCommand = (commandId, description) => {
|
|
873
|
-
if (!/^_/.test(commandId)) {
|
|
874
|
-
if (!( knownCommands.has(commandId))) {
|
|
875
|
-
knownCommands.add(commandId);
|
|
876
|
-
this.commandsEnum.push(commandId);
|
|
877
|
-
this.commandsEnumDescriptions.push(description);
|
|
878
|
-
this.removalCommandsEnum.push(`-${commandId}`);
|
|
879
|
-
}
|
|
880
|
-
}
|
|
881
|
-
};
|
|
882
|
-
const allCommands = CommandsRegistry.getCommands();
|
|
883
|
-
for (const [commandId, command] of allCommands) {
|
|
884
|
-
const commandDescription = command.description;
|
|
885
|
-
addKnownCommand(commandId, commandDescription ? commandDescription.description : undefined);
|
|
886
|
-
if (!commandDescription || !commandDescription.args || commandDescription.args.length !== 1 || !commandDescription.args[0].schema) {
|
|
887
|
-
continue;
|
|
888
|
-
}
|
|
889
|
-
const argsSchema = commandDescription.args[0].schema;
|
|
890
|
-
const argsRequired = ((typeof commandDescription.args[0].isOptional !== 'undefined')
|
|
891
|
-
? (!commandDescription.args[0].isOptional)
|
|
892
|
-
: (Array.isArray(argsSchema.required) && argsSchema.required.length > 0));
|
|
893
|
-
const addition = {
|
|
894
|
-
'if': {
|
|
895
|
-
'required': ['command'],
|
|
896
|
-
'properties': {
|
|
897
|
-
'command': { 'const': commandId }
|
|
898
|
-
}
|
|
899
|
-
},
|
|
900
|
-
'then': {
|
|
901
|
-
'required': [].concat(argsRequired ? ['args'] : []),
|
|
902
|
-
'properties': {
|
|
903
|
-
'args': argsSchema
|
|
904
|
-
}
|
|
905
|
-
}
|
|
906
|
-
};
|
|
907
|
-
this.commandsSchemas.push(addition);
|
|
908
|
-
}
|
|
909
|
-
const menuCommands = MenuRegistry.getCommands();
|
|
910
|
-
for (const commandId of ( menuCommands.keys())) {
|
|
911
|
-
addKnownCommand(commandId);
|
|
912
|
-
}
|
|
913
|
-
this.commandsSchemas.push(...additionalContributions);
|
|
914
|
-
this.schemaRegistry.notifySchemaChanged(KeybindingsJsonSchema.schemaId);
|
|
915
|
-
}
|
|
916
|
-
}
|
|
917
|
-
export { WorkbenchKeybindingService };
|