@codingame/monaco-vscode-api 1.78.4 → 1.78.5-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.
Files changed (799) hide show
  1. package/README.md +28 -9
  2. package/dist/api.js +192 -2
  3. package/dist/assets/breakpointWidget.css +31 -0
  4. package/dist/assets/callStackEditorContribution.css +12 -0
  5. package/dist/assets/debug.contribution.css +138 -0
  6. package/dist/assets/debugHover.css +80 -0
  7. package/dist/assets/debugToolBar.css +49 -0
  8. package/dist/assets/editorquickaccess.css +8 -0
  9. package/dist/assets/editorstatus.css +51 -0
  10. package/dist/assets/exceptionWidget.css +52 -0
  11. package/dist/assets/notificationsActions.css +14 -0
  12. package/dist/assets/notificationsCenter.css +69 -0
  13. package/dist/assets/notificationsList.css +152 -0
  14. package/dist/assets/notificationsToasts.css +63 -0
  15. package/dist/assets/panelpart.css +75 -0
  16. package/dist/assets/paneview.css +148 -0
  17. package/dist/assets/paneviewlet.css +79 -0
  18. package/dist/assets/sidebysideeditor.css +9 -0
  19. package/dist/assets.js +15 -0
  20. package/dist/default-extensions/bat.js +6 -6
  21. package/dist/default-extensions/clojure.js +5 -5
  22. package/dist/default-extensions/coffeescript.js +6 -6
  23. package/dist/default-extensions/cpp.js +11 -11
  24. package/dist/default-extensions/csharp.js +6 -6
  25. package/dist/default-extensions/css.js +5 -5
  26. package/dist/default-extensions/dart.js +5 -5
  27. package/dist/default-extensions/diff.js +5 -5
  28. package/dist/default-extensions/docker.js +5 -5
  29. package/dist/default-extensions/fsharp.js +6 -6
  30. package/dist/default-extensions/go.js +5 -5
  31. package/dist/default-extensions/groovy.js +6 -6
  32. package/dist/default-extensions/handlebars.js +5 -5
  33. package/dist/default-extensions/hlsl.js +5 -5
  34. package/dist/default-extensions/html.js +7 -7
  35. package/dist/default-extensions/ini.js +6 -6
  36. package/dist/default-extensions/java.js +6 -6
  37. package/dist/default-extensions/javascript.js +9 -9
  38. package/dist/default-extensions/json.js +6 -6
  39. package/dist/default-extensions/julia.js +5 -5
  40. package/dist/default-extensions/latex.js +11 -11
  41. package/dist/default-extensions/less.js +5 -5
  42. package/dist/default-extensions/log.js +4 -4
  43. package/dist/default-extensions/lua.js +5 -5
  44. package/dist/default-extensions/make.js +5 -5
  45. package/dist/default-extensions/markdown-basics.js +6 -6
  46. package/dist/default-extensions/objective-c.js +6 -6
  47. package/dist/default-extensions/perl.js +7 -7
  48. package/dist/default-extensions/php.js +7 -7
  49. package/dist/default-extensions/powershell.js +5 -5
  50. package/dist/default-extensions/pug.js +5 -5
  51. package/dist/default-extensions/python.js +6 -6
  52. package/dist/default-extensions/r.js +5 -5
  53. package/dist/default-extensions/razor.js +5 -5
  54. package/dist/default-extensions/ruby.js +5 -5
  55. package/dist/default-extensions/rust.js +5 -5
  56. package/dist/default-extensions/scss.js +6 -6
  57. package/dist/default-extensions/shaderlab.js +5 -5
  58. package/dist/default-extensions/shellscript.js +5 -5
  59. package/dist/default-extensions/sql.js +5 -5
  60. package/dist/default-extensions/swift.js +6 -6
  61. package/dist/default-extensions/theme-abyss.js +4 -4
  62. package/dist/default-extensions/theme-defaults.js +12 -12
  63. package/dist/default-extensions/theme-kimbie-dark.js +4 -4
  64. package/dist/default-extensions/theme-monokai-dimmed.js +4 -4
  65. package/dist/default-extensions/theme-monokai.js +4 -4
  66. package/dist/default-extensions/theme-quietlight.js +4 -4
  67. package/dist/default-extensions/theme-red.js +4 -4
  68. package/dist/default-extensions/theme-seti.js +4 -4
  69. package/dist/default-extensions/theme-solarized-dark.js +4 -4
  70. package/dist/default-extensions/theme-solarized-light.js +4 -4
  71. package/dist/default-extensions/theme-tomorrow-night-blue.js +4 -4
  72. package/dist/default-extensions/typescript-basics.js +9 -9
  73. package/dist/default-extensions/typescript-language-features.js +3 -3
  74. package/dist/default-extensions/vb.js +6 -6
  75. package/dist/default-extensions/xml.js +7 -7
  76. package/dist/default-extensions/yaml.js +5 -5
  77. package/dist/{extension-tools-b2d018a3.js → extension-tools-b68a64de.js} +2 -15
  78. package/dist/extensions.js +150 -4
  79. package/dist/json.js +92 -0
  80. package/dist/monaco-treemending.js +882 -0
  81. package/dist/monaco.js +24 -458
  82. package/dist/node_modules/tslib/tslib.es6.js +21 -0
  83. package/dist/override/vs/workbench/browser/parts/editor/textEditor.js +2 -0
  84. package/dist/rollup-extension-directory-plugin.js +1 -1
  85. package/dist/rollup-vsix-plugin.js +1 -1
  86. package/dist/service-override/_46__46__47__46__46__47_vscode_47_vs_47_platform_47_audioCues_47_browser_47_media_47__42__46_mp3.js +11 -0
  87. package/dist/service-override/audioCue.js +13 -0
  88. package/dist/service-override/configuration.js +100 -0
  89. package/dist/service-override/debug.js +23 -0
  90. package/dist/service-override/dialogs.js +13 -0
  91. package/dist/service-override/files.js +244 -0
  92. package/dist/service-override/keybindings.js +100 -0
  93. package/dist/service-override/languages.js +27 -0
  94. package/dist/service-override/layout.js +41 -0
  95. package/dist/service-override/modelEditor.js +128 -0
  96. package/dist/service-override/notifications.js +34 -0
  97. package/dist/service-override/preferences.js +10 -0
  98. package/dist/{snippets.js → service-override/snippets.js} +5 -3
  99. package/dist/service-override/textmate.js +36 -0
  100. package/dist/service-override/theme.js +26 -0
  101. package/dist/services.d.ts +118 -1
  102. package/dist/services.js +59 -3
  103. package/dist/tools.js +20 -0
  104. package/dist/vscode/vs/base/browser/ui/splitview/paneview.js +289 -0
  105. package/dist/vscode/vs/base/common/console.js +58 -0
  106. package/dist/vscode/vs/base/common/date.js +204 -0
  107. package/dist/vscode/vs/base/common/json.js +713 -0
  108. package/dist/vscode/vs/base/common/jsonEdit.js +164 -0
  109. package/dist/vscode/vs/base/common/jsonFormatter.js +187 -0
  110. package/dist/vscode/vs/base/common/keybindingParser.js +87 -0
  111. package/dist/vscode/vs/base/common/performance.js +18 -0
  112. package/dist/vscode/vs/base/common/skipList.js +160 -0
  113. package/dist/vscode/vs/base/common/stream.js +300 -0
  114. package/dist/vscode/vs/base/common/uriIpc.js +32 -0
  115. package/dist/vscode/vs/base/parts/ipc/common/ipc.net.js +45 -0
  116. package/dist/vscode/vs/base/parts/request/browser/request.js +60 -0
  117. package/dist/vscode/vs/base/parts/request/common/request.js +8 -0
  118. package/dist/vscode/vs/editor/browser/config/editorConfiguration.js +91 -0
  119. package/dist/vscode/vs/editor/common/services/languageFeaturesService.js +41 -0
  120. package/dist/vscode/vs/editor/common/services/modelUndoRedoParticipant.js +56 -0
  121. package/dist/vscode/vs/editor/common/services/textResourceConfigurationService.js +112 -0
  122. package/dist/vscode/vs/platform/actions/browser/dropdownWithPrimaryActionViewItem.js +112 -0
  123. package/dist/vscode/vs/platform/debug/common/extensionHostDebug.js +3 -0
  124. package/dist/{extensionManagement.js → vscode/vs/platform/extensionManagement/common/extensionManagement.js} +2 -1
  125. package/dist/vscode/vs/platform/extensionManagement/common/extensionManagementUtil.js +14 -0
  126. package/dist/vscode/vs/platform/extensionManagement/common/extensionNls.js +66 -0
  127. package/dist/vscode/vs/platform/extensionManagement/common/implicitActivationEvents.js +53 -0
  128. package/dist/vscode/vs/platform/extensionResourceLoader/common/extensionResourceLoader.js +69 -0
  129. package/dist/vscode/vs/platform/externalServices/common/serviceMachineId.js +27 -0
  130. package/dist/vscode/vs/platform/files/common/fileService.js +920 -0
  131. package/dist/vscode/vs/platform/files/common/inMemoryFilesystemProvider.js +175 -0
  132. package/dist/vscode/vs/platform/files/common/io.js +80 -0
  133. package/dist/vscode/vs/platform/files/common/watcher.js +69 -0
  134. package/dist/vscode/vs/platform/keyboardLayout/common/keyboardConfig.js +42 -0
  135. package/dist/vscode/vs/platform/keyboardLayout/common/keyboardLayout.js +12 -0
  136. package/dist/vscode/vs/platform/keyboardLayout/common/keyboardMapper.js +23 -0
  137. package/dist/vscode/vs/platform/product/common/productService.js +4 -0
  138. package/dist/vscode/vs/platform/remote/common/remoteAuthorityResolver.js +17 -0
  139. package/dist/vscode/vs/platform/remote/common/remoteHosts.js +18 -0
  140. package/dist/vscode/vs/platform/request/browser/requestService.js +25 -0
  141. package/dist/vscode/vs/platform/request/common/request.js +50 -0
  142. package/dist/vscode/vs/platform/telemetry/common/telemetryUtils.js +119 -0
  143. package/dist/{tokenClassificationRegistry.js → vscode/vs/platform/theme/common/tokenClassificationRegistry.js} +82 -136
  144. package/dist/vscode/vs/platform/tunnel/common/tunnel.js +3 -0
  145. package/dist/vscode/vs/platform/uriIdentity/common/uriIdentity.js +3 -0
  146. package/dist/vscode/vs/platform/uriIdentity/common/uriIdentityService.js +80 -0
  147. package/dist/vscode/vs/platform/userDataProfile/common/userDataProfile.js +427 -0
  148. package/dist/vscode/vs/platform/userDataSync/common/content.js +9 -0
  149. package/dist/vscode/vs/platform/userDataSync/common/settingsMerge.js +299 -0
  150. package/dist/vscode/vs/platform/workspace/common/editSessions.js +3 -0
  151. package/dist/vscode/vs/platform/workspace/common/virtualWorkspace.js +17 -0
  152. package/dist/vscode/vs/platform/workspaces/common/workspaces.js +195 -0
  153. package/dist/vscode/vs/workbench/api/browser/mainThreadBulkEdits.js +49 -0
  154. package/dist/vscode/vs/workbench/api/browser/mainThreadClipboard.js +22 -0
  155. package/dist/vscode/vs/workbench/api/browser/mainThreadCommands.js +93 -0
  156. package/dist/vscode/vs/workbench/api/browser/mainThreadConfiguration.js +78 -0
  157. package/dist/vscode/vs/workbench/api/browser/mainThreadConsole.js +33 -0
  158. package/dist/vscode/vs/workbench/api/browser/mainThreadDebugService.js +347 -0
  159. package/dist/vscode/vs/workbench/api/browser/mainThreadDiagnostics.js +67 -0
  160. package/dist/vscode/vs/workbench/api/browser/mainThreadDocumentContentProviders.js +73 -0
  161. package/dist/vscode/vs/workbench/api/browser/mainThreadDocuments.js +246 -0
  162. package/dist/vscode/vs/workbench/api/browser/mainThreadDocumentsAndEditors.js +379 -0
  163. package/dist/vscode/vs/workbench/api/browser/mainThreadEditor.js +410 -0
  164. package/dist/vscode/vs/workbench/api/browser/mainThreadEditors.js +223 -0
  165. package/dist/vscode/vs/workbench/api/browser/mainThreadExtensionService.js +213 -0
  166. package/dist/vscode/vs/workbench/api/browser/mainThreadFileSystem.js +270 -0
  167. package/dist/vscode/vs/workbench/api/browser/mainThreadFileSystemEventService.js +223 -0
  168. package/dist/vscode/vs/workbench/api/browser/mainThreadLanguageFeatures.js +909 -0
  169. package/dist/vscode/vs/workbench/api/browser/mainThreadLanguages.js +76 -0
  170. package/dist/vscode/vs/workbench/api/browser/mainThreadMessageService.js +114 -0
  171. package/dist/vscode/vs/workbench/api/browser/mainThreadOutputService.js +73 -0
  172. package/dist/vscode/vs/workbench/api/browser/mainThreadProgress.js +62 -0
  173. package/dist/vscode/vs/workbench/api/browser/mainThreadQuickOpen.js +183 -0
  174. package/dist/vscode/vs/workbench/api/browser/mainThreadSaveParticipant.js +43 -0
  175. package/dist/vscode/vs/workbench/api/browser/mainThreadTelemetry.js +50 -0
  176. package/dist/vscode/vs/workbench/api/browser/mainThreadWindow.js +48 -0
  177. package/dist/vscode/vs/workbench/api/browser/mainThreadWorkspace.js +227 -0
  178. package/dist/vscode/vs/workbench/api/common/cache.js +28 -0
  179. package/dist/vscode/vs/workbench/api/common/configurationExtensionPoint.js +450 -0
  180. package/dist/vscode/vs/workbench/api/common/extHost.protocol.js +131 -0
  181. package/dist/vscode/vs/workbench/api/common/extHostApiCommands.js +656 -0
  182. package/dist/vscode/vs/workbench/api/common/extHostApiDeprecationService.js +35 -0
  183. package/dist/vscode/vs/workbench/api/common/extHostBulkEdits.js +21 -0
  184. package/dist/vscode/vs/workbench/api/common/extHostClipboard.js +15 -0
  185. package/dist/vscode/vs/workbench/api/common/extHostCommands.js +415 -0
  186. package/dist/vscode/vs/workbench/api/common/extHostConfiguration.js +264 -0
  187. package/dist/vscode/vs/workbench/api/common/extHostDebugService.js +786 -0
  188. package/dist/vscode/vs/workbench/api/common/extHostDecorations.js +94 -0
  189. package/dist/vscode/vs/workbench/api/common/extHostDiagnostics.js +292 -0
  190. package/dist/vscode/vs/workbench/api/common/extHostDocumentContentProviders.js +65 -0
  191. package/dist/vscode/vs/workbench/api/common/extHostDocumentData.js +212 -0
  192. package/dist/vscode/vs/workbench/api/common/extHostDocumentSaveParticipant.js +126 -0
  193. package/dist/vscode/vs/workbench/api/common/extHostDocuments.js +144 -0
  194. package/dist/vscode/vs/workbench/api/common/extHostDocumentsAndEditors.js +147 -0
  195. package/dist/vscode/vs/workbench/api/common/extHostEditorTabs.js +328 -0
  196. package/dist/vscode/vs/workbench/api/common/extHostExtensionActivator.js +309 -0
  197. package/dist/vscode/vs/workbench/api/common/extHostExtensionService.js +814 -0
  198. package/dist/vscode/vs/workbench/api/common/extHostFileSystem.js +272 -0
  199. package/dist/vscode/vs/workbench/api/common/extHostFileSystemConsumer.js +153 -0
  200. package/dist/vscode/vs/workbench/api/common/extHostFileSystemEventService.js +193 -0
  201. package/dist/vscode/vs/workbench/api/common/extHostFileSystemInfo.js +35 -0
  202. package/dist/vscode/vs/workbench/api/common/extHostInitDataService.js +3 -0
  203. package/dist/vscode/vs/workbench/api/common/extHostLanguageFeatures.js +2038 -0
  204. package/dist/vscode/vs/workbench/api/common/extHostLanguages.js +164 -0
  205. package/dist/vscode/vs/workbench/api/common/extHostLocalizationService.js +85 -0
  206. package/dist/vscode/vs/workbench/api/common/extHostMemento.js +74 -0
  207. package/dist/vscode/vs/workbench/api/common/extHostMessageService.js +55 -0
  208. package/dist/vscode/vs/workbench/api/common/extHostOutput.js +257 -0
  209. package/dist/vscode/vs/workbench/api/common/extHostProgress.js +80 -0
  210. package/dist/vscode/vs/workbench/api/common/extHostQuickOpen.js +580 -0
  211. package/dist/vscode/vs/workbench/api/common/extHostRpcService.js +12 -0
  212. package/dist/vscode/vs/workbench/api/common/extHostSecretState.js +24 -0
  213. package/dist/vscode/vs/workbench/api/common/extHostSecrets.js +29 -0
  214. package/dist/vscode/vs/workbench/api/common/extHostStorage.js +42 -0
  215. package/dist/vscode/vs/workbench/api/common/extHostStoragePaths.js +64 -0
  216. package/dist/vscode/vs/workbench/api/common/extHostTelemetry.js +266 -0
  217. package/dist/vscode/vs/workbench/api/common/extHostTerminalService.js +3 -0
  218. package/dist/vscode/vs/workbench/api/common/extHostTestItem.js +122 -0
  219. package/dist/vscode/vs/workbench/api/common/extHostTestingPrivateApi.js +15 -0
  220. package/dist/vscode/vs/workbench/api/common/extHostTextEditor.js +511 -0
  221. package/dist/vscode/vs/workbench/api/common/extHostTextEditors.js +128 -0
  222. package/dist/vscode/vs/workbench/api/common/extHostTunnelService.js +36 -0
  223. package/dist/vscode/vs/workbench/api/common/extHostTypeConverters.js +1766 -0
  224. package/dist/vscode/vs/workbench/api/common/extHostTypes.js +2810 -0
  225. package/dist/vscode/vs/workbench/api/common/extHostUriTransformerService.js +19 -0
  226. package/dist/vscode/vs/workbench/api/common/extHostVariableResolverService.js +138 -0
  227. package/dist/vscode/vs/workbench/api/common/extHostWindow.js +59 -0
  228. package/dist/vscode/vs/workbench/api/common/extHostWorkspace.js +534 -0
  229. package/dist/vscode/vs/workbench/api/common/jsonValidationExtensionPoint.js +97 -0
  230. package/dist/vscode/vs/workbench/api/common/shared/dataTransferCache.js +36 -0
  231. package/dist/vscode/vs/workbench/browser/actions/layoutActions.js +1201 -0
  232. package/dist/vscode/vs/workbench/browser/actions.js +77 -0
  233. package/dist/vscode/vs/workbench/browser/codeeditor.js +185 -0
  234. package/dist/vscode/vs/workbench/browser/composite.js +102 -0
  235. package/dist/vscode/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarActions.js +146 -0
  236. package/dist/vscode/vs/workbench/browser/parts/dialogs/dialog.web.contribution.js +68 -0
  237. package/dist/vscode/vs/workbench/browser/parts/dialogs/dialogHandler.js +124 -0
  238. package/dist/vscode/vs/workbench/browser/parts/editor/editor.contribution.js +876 -0
  239. package/dist/vscode/vs/workbench/browser/parts/editor/editor.js +4 -0
  240. package/dist/vscode/vs/workbench/browser/parts/editor/editorActions.js +1946 -0
  241. package/dist/vscode/vs/workbench/browser/parts/editor/editorAutoSave.js +157 -0
  242. package/dist/vscode/vs/workbench/browser/parts/editor/editorCommands.js +1289 -0
  243. package/dist/vscode/vs/workbench/browser/parts/editor/editorPane.js +242 -0
  244. package/dist/vscode/vs/workbench/browser/parts/editor/editorQuickAccess.js +213 -0
  245. package/dist/vscode/vs/workbench/browser/parts/editor/editorStatus.js +460 -0
  246. package/dist/vscode/vs/workbench/browser/parts/editor/editorWithViewState.js +139 -0
  247. package/dist/vscode/vs/workbench/browser/parts/editor/sideBySideEditor.js +387 -0
  248. package/dist/vscode/vs/workbench/browser/parts/editor/textDiffEditor.js +289 -0
  249. package/dist/vscode/vs/workbench/browser/parts/notifications/notificationsActions.js +124 -0
  250. package/dist/vscode/vs/workbench/browser/parts/notifications/notificationsAlerts.js +58 -0
  251. package/dist/vscode/vs/workbench/browser/parts/notifications/notificationsCenter.js +224 -0
  252. package/dist/vscode/vs/workbench/browser/parts/notifications/notificationsCommands.js +241 -0
  253. package/dist/vscode/vs/workbench/browser/parts/notifications/notificationsList.js +185 -0
  254. package/dist/vscode/vs/workbench/browser/parts/notifications/notificationsTelemetry.js +35 -0
  255. package/dist/vscode/vs/workbench/browser/parts/notifications/notificationsToasts.js +417 -0
  256. package/dist/vscode/vs/workbench/browser/parts/notifications/notificationsViewer.js +392 -0
  257. package/dist/vscode/vs/workbench/browser/parts/panel/panelActions.js +422 -0
  258. package/dist/vscode/vs/workbench/browser/parts/views/viewPane.js +520 -0
  259. package/dist/vscode/vs/workbench/browser/quickaccess.js +17 -0
  260. package/dist/vscode/vs/workbench/common/component.js +23 -0
  261. package/dist/vscode/vs/workbench/common/configuration.js +8 -0
  262. package/dist/vscode/vs/workbench/common/contextkeys.js +170 -0
  263. package/dist/vscode/vs/workbench/common/contributions.js +111 -0
  264. package/dist/vscode/vs/workbench/common/dialogs.js +31 -0
  265. package/dist/vscode/vs/workbench/common/editor/binaryEditorModel.js +39 -0
  266. package/dist/vscode/vs/workbench/common/editor/diffEditorInput.js +164 -0
  267. package/dist/vscode/vs/workbench/common/editor/diffEditorModel.js +23 -0
  268. package/dist/vscode/vs/workbench/common/editor/editorInput.js +97 -0
  269. package/dist/vscode/vs/workbench/common/editor/editorModel.js +26 -0
  270. package/dist/vscode/vs/workbench/common/editor/editorOptions.js +48 -0
  271. package/dist/vscode/vs/workbench/common/editor/resourceEditorInput.js +133 -0
  272. package/dist/vscode/vs/workbench/common/editor/sideBySideEditorInput.js +228 -0
  273. package/dist/vscode/vs/workbench/common/editor/textDiffEditorModel.js +42 -0
  274. package/dist/vscode/vs/workbench/common/editor/textEditorModel.js +165 -0
  275. package/dist/vscode/vs/workbench/common/editor/textResourceEditorInput.js +146 -0
  276. package/dist/vscode/vs/workbench/common/editor/textResourceEditorModel.js +24 -0
  277. package/dist/vscode/vs/workbench/common/editor.js +307 -0
  278. package/dist/{memento.js → vscode/vs/workbench/common/memento.js} +1 -1
  279. package/dist/vscode/vs/workbench/common/notifications.js +448 -0
  280. package/dist/vscode/vs/workbench/common/resources.js +86 -0
  281. package/dist/{theme2.js → vscode/vs/workbench/common/theme.js} +1 -168
  282. package/dist/vscode/vs/workbench/common/views.js +20 -0
  283. package/dist/vscode/vs/workbench/contrib/audioCues/browser/audioCueDebuggerContribution.js +45 -0
  284. package/dist/vscode/vs/workbench/contrib/audioCues/browser/audioCueLineFeatureContribution.js +170 -0
  285. package/dist/vscode/vs/workbench/contrib/audioCues/browser/audioCues.contribution.js +160 -0
  286. package/dist/vscode/vs/workbench/contrib/audioCues/browser/commands.js +49 -0
  287. package/dist/vscode/vs/workbench/contrib/bulkEdit/browser/bulkCellEdits.js +25 -0
  288. package/dist/vscode/vs/workbench/contrib/callHierarchy/common/callHierarchy.js +126 -0
  289. package/dist/vscode/vs/workbench/contrib/codeEditor/browser/editorLineNumberMenu.js +100 -0
  290. package/dist/{languages.js → vscode/vs/workbench/contrib/codeEditor/browser/languageConfigurationExtensionPoint.js} +154 -180
  291. package/dist/vscode/vs/workbench/contrib/codeEditor/browser/menuPreventer.js +35 -0
  292. package/dist/vscode/vs/workbench/contrib/codeEditor/browser/selectionClipboard.js +2 -0
  293. package/dist/vscode/vs/workbench/contrib/codeEditor/browser/simpleEditorOptions.js +50 -0
  294. package/dist/vscode/vs/workbench/contrib/debug/browser/baseDebugView.js +192 -0
  295. package/dist/vscode/vs/workbench/contrib/debug/browser/breakpointEditorContribution.js +776 -0
  296. package/dist/vscode/vs/workbench/contrib/debug/browser/breakpointWidget.js +378 -0
  297. package/dist/vscode/vs/workbench/contrib/debug/browser/breakpointsView.js +714 -0
  298. package/dist/vscode/vs/workbench/contrib/debug/browser/callStackEditorContribution.js +172 -0
  299. package/dist/vscode/vs/workbench/contrib/debug/browser/debug.contribution.js +451 -0
  300. package/dist/vscode/vs/workbench/contrib/debug/browser/debugActionViewItems.js +294 -0
  301. package/dist/vscode/vs/workbench/contrib/debug/browser/debugAdapterManager.js +397 -0
  302. package/dist/vscode/vs/workbench/contrib/debug/browser/debugColors.js +309 -0
  303. package/dist/vscode/vs/workbench/contrib/debug/browser/debugCommands.js +749 -0
  304. package/dist/vscode/vs/workbench/contrib/debug/browser/debugConfigurationManager.js +619 -0
  305. package/dist/vscode/vs/workbench/contrib/debug/browser/debugConsoleQuickAccess.js +58 -0
  306. package/dist/vscode/vs/workbench/contrib/debug/browser/debugEditorContribution.js +675 -0
  307. package/dist/vscode/vs/workbench/contrib/debug/browser/debugHover.js +317 -0
  308. package/dist/vscode/vs/workbench/contrib/debug/browser/debugIcons.js +135 -0
  309. package/dist/vscode/vs/workbench/contrib/debug/browser/debugMemory.js +204 -0
  310. package/dist/vscode/vs/workbench/contrib/debug/browser/debugQuickAccess.js +142 -0
  311. package/dist/vscode/vs/workbench/contrib/debug/browser/debugService.js +1171 -0
  312. package/dist/vscode/vs/workbench/contrib/debug/browser/debugSession.js +1134 -0
  313. package/dist/vscode/vs/workbench/contrib/debug/browser/debugSessionPicker.js +104 -0
  314. package/dist/vscode/vs/workbench/contrib/debug/browser/debugTaskRunner.js +273 -0
  315. package/dist/vscode/vs/workbench/contrib/debug/browser/debugToolBar.js +312 -0
  316. package/dist/vscode/vs/workbench/contrib/debug/browser/exceptionWidget.js +103 -0
  317. package/dist/vscode/vs/workbench/contrib/debug/browser/linkDetector.js +229 -0
  318. package/dist/vscode/vs/workbench/contrib/debug/browser/rawDebugSession.js +666 -0
  319. package/dist/vscode/vs/workbench/contrib/debug/browser/variablesView.js +287 -0
  320. package/dist/vscode/vs/workbench/contrib/debug/common/abstractDebugAdapter.js +150 -0
  321. package/dist/vscode/vs/workbench/contrib/debug/common/breakpoints.js +19 -0
  322. package/dist/vscode/vs/workbench/contrib/debug/common/debug.js +285 -0
  323. package/dist/vscode/vs/workbench/contrib/debug/common/debugCompoundRoot.js +15 -0
  324. package/dist/vscode/vs/workbench/contrib/debug/common/debugContentProvider.js +96 -0
  325. package/dist/vscode/vs/workbench/contrib/debug/common/debugModel.js +1451 -0
  326. package/dist/vscode/vs/workbench/contrib/debug/common/debugSchemas.js +344 -0
  327. package/dist/vscode/vs/workbench/contrib/debug/common/debugSource.js +121 -0
  328. package/dist/vscode/vs/workbench/contrib/debug/common/debugStorage.js +148 -0
  329. package/dist/vscode/vs/workbench/contrib/debug/common/debugTelemetry.js +34 -0
  330. package/dist/vscode/vs/workbench/contrib/debug/common/debugUtils.js +292 -0
  331. package/dist/vscode/vs/workbench/contrib/debug/common/debugViewModel.js +107 -0
  332. package/dist/vscode/vs/workbench/contrib/debug/common/debugger.js +254 -0
  333. package/dist/vscode/vs/workbench/contrib/debug/common/disassemblyViewInput.js +25 -0
  334. package/dist/vscode/vs/workbench/contrib/debug/common/loadedScriptsPicker.js +81 -0
  335. package/dist/vscode/vs/workbench/contrib/debug/common/replModel.js +230 -0
  336. package/dist/vscode/vs/workbench/contrib/extensions/common/extensions.js +3 -0
  337. package/dist/vscode/vs/workbench/contrib/files/browser/editors/fileEditorInput.js +321 -0
  338. package/dist/vscode/vs/workbench/contrib/files/browser/explorerService.js +398 -0
  339. package/dist/vscode/vs/workbench/contrib/files/browser/files.contribution.js +389 -0
  340. package/dist/vscode/vs/workbench/contrib/files/browser/files.js +3 -0
  341. package/dist/vscode/vs/workbench/contrib/files/common/explorerFileNestingTrie.js +212 -0
  342. package/dist/vscode/vs/workbench/contrib/files/common/explorerModel.js +369 -0
  343. package/dist/{files2.js → vscode/vs/workbench/contrib/files/common/files.js} +1 -1
  344. package/dist/vscode/vs/workbench/contrib/markers/common/markers.js +20 -0
  345. package/dist/vscode/vs/workbench/contrib/notebook/common/notebookCommon.js +9 -0
  346. package/dist/vscode/vs/workbench/contrib/output/browser/outputLinkProvider.js +74 -0
  347. package/dist/vscode/vs/workbench/contrib/output/browser/outputServices.js +166 -0
  348. package/dist/vscode/vs/workbench/contrib/output/common/outputChannelModel.js +317 -0
  349. package/dist/vscode/vs/workbench/contrib/output/common/outputChannelModelService.js +31 -0
  350. package/dist/vscode/vs/workbench/contrib/quickaccess/browser/commandsQuickAccess.js +153 -0
  351. package/dist/vscode/vs/workbench/contrib/search/common/search.js +27 -0
  352. package/dist/vscode/vs/workbench/contrib/snippets/browser/snippetCompletionProvider.js +159 -0
  353. package/dist/vscode/vs/workbench/contrib/snippets/browser/snippets.js +3 -0
  354. package/dist/vscode/vs/workbench/contrib/snippets/browser/snippetsFile.js +229 -0
  355. package/dist/{snippetsService.js → vscode/vs/workbench/contrib/snippets/browser/snippetsService.js} +28 -412
  356. package/dist/vscode/vs/workbench/contrib/snippets/browser/tabCompletion.js +166 -0
  357. package/dist/vscode/vs/workbench/contrib/tasks/common/taskDefinitionRegistry.js +161 -0
  358. package/dist/vscode/vs/workbench/contrib/tasks/common/taskService.js +3 -0
  359. package/dist/vscode/vs/workbench/contrib/testing/common/testId.js +109 -0
  360. package/dist/vscode/vs/workbench/contrib/testing/common/testItemCollection.js +75 -0
  361. package/dist/vscode/vs/workbench/contrib/testing/common/testTypes.js +7 -0
  362. package/dist/vscode/vs/workbench/contrib/typeHierarchy/common/typeHierarchy.js +133 -0
  363. package/dist/vscode/vs/workbench/services/actions/common/menusExtensionPoint.js +829 -0
  364. package/dist/vscode/vs/workbench/services/activity/common/activity.js +22 -0
  365. package/dist/vscode/vs/workbench/services/configuration/browser/configuration.js +847 -0
  366. package/dist/vscode/vs/workbench/services/configuration/browser/configurationService.js +1104 -0
  367. package/dist/{configuration2.js → vscode/vs/workbench/services/configuration/common/configuration.js} +1 -1
  368. package/dist/vscode/vs/workbench/services/configuration/common/configurationCache.js +80 -0
  369. package/dist/vscode/vs/workbench/services/configuration/common/configurationEditing.js +590 -0
  370. package/dist/vscode/vs/workbench/services/configuration/common/configurationModels.js +119 -0
  371. package/dist/vscode/vs/workbench/services/configuration/common/jsonEditing.js +9 -0
  372. package/dist/vscode/vs/workbench/services/configuration/common/jsonEditingService.js +119 -0
  373. package/dist/vscode/vs/workbench/services/configurationResolver/browser/baseConfigurationResolverService.js +303 -0
  374. package/dist/vscode/vs/workbench/services/configurationResolver/browser/configurationResolverService.js +26 -0
  375. package/dist/vscode/vs/workbench/services/configurationResolver/common/configurationResolver.js +36 -0
  376. package/dist/vscode/vs/workbench/services/configurationResolver/common/configurationResolverSchema.js +174 -0
  377. package/dist/vscode/vs/workbench/services/configurationResolver/common/configurationResolverUtils.js +10 -0
  378. package/dist/vscode/vs/workbench/services/configurationResolver/common/variableResolver.js +299 -0
  379. package/dist/vscode/vs/workbench/services/decorations/browser/decorationsService.js +312 -0
  380. package/dist/vscode/vs/workbench/services/decorations/common/decorations.js +3 -0
  381. package/dist/vscode/vs/workbench/services/dialogs/common/dialogService.js +65 -0
  382. package/dist/vscode/vs/workbench/services/editor/browser/codeEditorService.js +80 -0
  383. package/dist/vscode/vs/workbench/services/editor/common/editorGroupColumn.js +23 -0
  384. package/dist/vscode/vs/workbench/services/editor/common/editorGroupsService.js +14 -0
  385. package/dist/vscode/vs/workbench/services/editor/common/editorResolverService.js +31 -0
  386. package/dist/vscode/vs/workbench/services/editor/common/editorService.js +10 -0
  387. package/dist/vscode/vs/workbench/services/environment/browser/environmentService.js +4 -0
  388. package/dist/vscode/vs/workbench/services/environment/common/environmentService.js +4 -0
  389. package/dist/vscode/vs/workbench/services/extensionManagement/common/extensionManagement.js +6 -0
  390. package/dist/vscode/vs/workbench/services/extensions/common/extHostCustomers.js +40 -0
  391. package/dist/vscode/vs/workbench/services/extensions/common/extensionDescriptionRegistry.js +189 -0
  392. package/dist/vscode/vs/workbench/services/extensions/common/extensionDevOptions.js +23 -0
  393. package/dist/vscode/vs/workbench/services/extensions/common/extensionHostProtocol.js +6 -0
  394. package/dist/vscode/vs/workbench/services/extensions/common/extensions.js +57 -0
  395. package/dist/vscode/vs/workbench/services/extensions/common/extensionsApiProposals.js +74 -0
  396. package/dist/{extensionsRegistry.js → vscode/vs/workbench/services/extensions/common/extensionsRegistry.js} +87 -208
  397. package/dist/vscode/vs/workbench/services/extensions/common/lazyPromise.js +70 -0
  398. package/dist/vscode/vs/workbench/services/extensions/common/proxyIdentifier.js +23 -0
  399. package/dist/vscode/vs/workbench/services/extensions/common/remoteConsoleUtil.js +47 -0
  400. package/dist/vscode/vs/workbench/services/extensions/common/rpcProtocol.js +762 -0
  401. package/dist/vscode/vs/workbench/services/extensions/common/workspaceContains.js +92 -0
  402. package/dist/vscode/vs/workbench/services/files/browser/elevatedFileService.js +9 -0
  403. package/dist/vscode/vs/workbench/services/files/common/elevatedFileService.js +3 -0
  404. package/dist/vscode/vs/workbench/services/files/common/files.js +4 -0
  405. package/dist/vscode/vs/workbench/services/filesConfiguration/common/filesConfigurationService.js +124 -0
  406. package/dist/vscode/vs/workbench/services/history/common/history.js +3 -0
  407. package/dist/vscode/vs/workbench/services/host/browser/host.js +3 -0
  408. package/dist/vscode/vs/workbench/services/keybinding/browser/keybindingService.js +855 -0
  409. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayoutService.js +490 -0
  410. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/cz.win.js +162 -0
  411. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/de-swiss.win.js +162 -0
  412. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/de.darwin.js +125 -0
  413. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/de.linux.js +180 -0
  414. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/de.win.js +162 -0
  415. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/dk.win.js +162 -0
  416. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/dvorak.darwin.js +125 -0
  417. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/en-belgian.win.js +162 -0
  418. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/en-ext.darwin.js +125 -0
  419. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/en-in.win.js +162 -0
  420. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/en-intl.darwin.js +125 -0
  421. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/en-intl.win.js +162 -0
  422. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/en-uk.darwin.js +125 -0
  423. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/en-uk.win.js +162 -0
  424. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/en.darwin.js +133 -0
  425. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/en.linux.js +182 -0
  426. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/en.win.js +167 -0
  427. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/es-latin.win.js +162 -0
  428. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/es.darwin.js +125 -0
  429. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/es.linux.js +180 -0
  430. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/es.win.js +162 -0
  431. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/fr.darwin.js +125 -0
  432. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/fr.linux.js +180 -0
  433. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/fr.win.js +162 -0
  434. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/hu.win.js +162 -0
  435. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/it.darwin.js +125 -0
  436. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/it.win.js +162 -0
  437. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/jp-roman.darwin.js +125 -0
  438. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/jp.darwin.js +125 -0
  439. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/ko.darwin.js +125 -0
  440. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.darwin.js +17 -0
  441. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.linux.js +6 -0
  442. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.win.js +23 -0
  443. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/no.win.js +162 -0
  444. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/pl.darwin.js +125 -0
  445. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/pl.win.js +162 -0
  446. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/pt-br.win.js +162 -0
  447. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/pt.darwin.js +125 -0
  448. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/pt.win.js +162 -0
  449. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/ru.darwin.js +125 -0
  450. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/ru.linux.js +180 -0
  451. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/ru.win.js +162 -0
  452. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/sv.win.js +164 -0
  453. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/thai.win.js +162 -0
  454. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/tr.win.js +162 -0
  455. package/dist/vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/zh-hans.darwin.js +125 -0
  456. package/dist/vscode/vs/workbench/services/keybinding/common/fallbackKeyboardMapper.js +28 -0
  457. package/dist/vscode/vs/workbench/services/keybinding/common/keybindingIO.js +72 -0
  458. package/dist/vscode/vs/workbench/services/keybinding/common/keymapInfo.js +108 -0
  459. package/dist/vscode/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.js +888 -0
  460. package/dist/vscode/vs/workbench/services/keybinding/common/windowsKeyboardMapper.js +350 -0
  461. package/dist/vscode/vs/workbench/services/label/common/labelService.js +302 -0
  462. package/dist/{languageService.js → vscode/vs/workbench/services/language/common/languageService.js} +8 -163
  463. package/dist/vscode/vs/workbench/services/languageDetection/common/languageDetectionWorkerService.js +5 -0
  464. package/dist/vscode/vs/workbench/services/languageStatus/common/languageStatusService.js +3 -0
  465. package/dist/vscode/vs/workbench/services/layout/browser/layoutService.js +12 -0
  466. package/dist/vscode/vs/workbench/services/lifecycle/common/lifecycle.js +11 -0
  467. package/dist/vscode/vs/workbench/services/lifecycle/common/lifecycleService.js +85 -0
  468. package/dist/vscode/vs/workbench/services/notification/common/notificationService.js +186 -0
  469. package/dist/vscode/vs/workbench/services/output/common/output.js +51 -0
  470. package/dist/vscode/vs/workbench/services/panecomposite/browser/panecomposite.js +3 -0
  471. package/dist/vscode/vs/workbench/services/path/browser/pathService.js +34 -0
  472. package/dist/vscode/vs/workbench/services/path/common/pathService.js +107 -0
  473. package/dist/vscode/vs/workbench/services/preferences/browser/keybindingsEditorInput.js +35 -0
  474. package/dist/vscode/vs/workbench/services/preferences/browser/keybindingsEditorModel.js +555 -0
  475. package/dist/vscode/vs/workbench/services/preferences/browser/preferencesService.js +547 -0
  476. package/dist/vscode/vs/workbench/services/preferences/common/preferences.js +20 -0
  477. package/dist/vscode/vs/workbench/services/preferences/common/preferencesEditorInput.js +37 -0
  478. package/dist/vscode/vs/workbench/services/preferences/common/preferencesModels.js +1031 -0
  479. package/dist/vscode/vs/workbench/services/preferences/common/preferencesValidation.js +357 -0
  480. package/dist/vscode/vs/workbench/services/progress/browser/progressIndicator.js +174 -0
  481. package/dist/vscode/vs/workbench/services/remote/common/remoteAgentService.js +3 -0
  482. package/dist/vscode/vs/workbench/services/search/common/queryBuilder.js +428 -0
  483. package/dist/vscode/vs/workbench/services/search/common/search.js +158 -0
  484. package/dist/vscode/vs/workbench/services/search/common/searchHelpers.js +72 -0
  485. package/dist/vscode/vs/workbench/services/search/common/searchService.js +355 -0
  486. package/dist/vscode/vs/workbench/services/textMate/browser/arrayOperation.js +62 -0
  487. package/dist/vscode/vs/workbench/services/textMate/browser/textMateTokenizationFeature.js +3 -0
  488. package/dist/vscode/vs/workbench/services/textMate/browser/textMateTokenizationFeatureImpl.js +422 -0
  489. package/dist/vscode/vs/workbench/services/textMate/browser/tokenizationSupport/textMateTokenizationSupport.js +60 -0
  490. package/dist/vscode/vs/workbench/services/textMate/browser/tokenizationSupport/tokenizationSupportWithLineLimit.js +36 -0
  491. package/dist/vscode/vs/workbench/services/textMate/browser/workerHost/textMateWorkerHost.js +198 -0
  492. package/dist/vscode/vs/workbench/services/textMate/browser/workerHost/textMateWorkerTokenizerController.js +151 -0
  493. package/dist/vscode/vs/workbench/services/textMate/common/TMGrammarFactory.js +117 -0
  494. package/dist/vscode/vs/workbench/services/textMate/common/TMGrammars.js +93 -0
  495. package/dist/vscode/vs/workbench/services/textMate/common/TMScopeRegistry.js +24 -0
  496. package/dist/vscode/vs/workbench/services/textfile/browser/browserTextFileService.js +55 -0
  497. package/dist/vscode/vs/workbench/services/textfile/browser/textFileService.js +578 -0
  498. package/dist/vscode/vs/workbench/services/textfile/common/encoding.js +493 -0
  499. package/dist/vscode/vs/workbench/services/textfile/common/textEditorService.js +150 -0
  500. package/dist/vscode/vs/workbench/services/textfile/common/textFileEditorModel.js +711 -0
  501. package/dist/vscode/vs/workbench/services/textfile/common/textFileEditorModelManager.js +401 -0
  502. package/dist/vscode/vs/workbench/services/textfile/common/textFileSaveParticipant.js +54 -0
  503. package/dist/vscode/vs/workbench/services/textfile/common/textfiles.js +45 -0
  504. package/dist/vscode/vs/workbench/services/textmodelResolver/common/textModelResolverService.js +187 -0
  505. package/dist/vscode/vs/workbench/services/themes/browser/browserHostColorSchemeService.js +37 -0
  506. package/dist/vscode/vs/workbench/services/themes/browser/fileIconThemeData.js +353 -0
  507. package/dist/vscode/vs/workbench/services/themes/browser/productIconThemeData.js +291 -0
  508. package/dist/vscode/vs/workbench/services/themes/browser/workbenchThemeService.js +736 -0
  509. package/dist/vscode/vs/workbench/services/themes/common/colorExtensionPoint.js +171 -0
  510. package/dist/vscode/vs/workbench/services/themes/common/colorThemeData.js +864 -0
  511. package/dist/vscode/vs/workbench/services/themes/common/colorThemeSchema.js +265 -0
  512. package/dist/vscode/vs/workbench/services/themes/common/fileIconThemeSchema.js +303 -0
  513. package/dist/vscode/vs/workbench/services/themes/common/hostColorSchemeService.js +3 -0
  514. package/dist/vscode/vs/workbench/services/themes/common/plistParser.js +439 -0
  515. package/dist/vscode/vs/workbench/services/themes/common/productIconThemeSchema.js +94 -0
  516. package/dist/vscode/vs/workbench/services/themes/common/textMateScopeMatcher.js +120 -0
  517. package/dist/vscode/vs/workbench/services/themes/common/themeCompatibility.js +66 -0
  518. package/dist/vscode/vs/workbench/services/themes/common/themeConfiguration.js +374 -0
  519. package/dist/vscode/vs/workbench/services/themes/common/themeExtensionPoints.js +258 -0
  520. package/dist/vscode/vs/workbench/services/themes/common/tokenClassificationExtensionPoint.js +268 -0
  521. package/dist/vscode/vs/workbench/services/themes/common/workbenchThemeService.js +46 -0
  522. package/dist/vscode/vs/workbench/services/timer/browser/timerService.js +3 -0
  523. package/dist/vscode/vs/workbench/services/untitled/common/untitledTextEditorInput.js +122 -0
  524. package/dist/vscode/vs/workbench/services/untitled/common/untitledTextEditorModel.js +240 -0
  525. package/dist/vscode/vs/workbench/services/untitled/common/untitledTextEditorService.js +3 -0
  526. package/dist/vscode/vs/workbench/services/userData/browser/userDataInit.js +3 -0
  527. package/dist/vscode/vs/workbench/services/userDataProfile/common/userDataProfile.js +7 -0
  528. package/dist/vscode/vs/workbench/services/userDataProfile/common/userDataProfileService.js +52 -0
  529. package/dist/vscode/vs/workbench/services/workingCopy/common/storedFileWorkingCopySaveParticipant.js +55 -0
  530. package/dist/vscode/vs/workbench/services/workingCopy/common/workingCopy.js +2 -0
  531. package/dist/vscode/vs/workbench/services/workingCopy/common/workingCopyBackup.js +3 -0
  532. package/dist/vscode/vs/workbench/services/workingCopy/common/workingCopyBackupService.js +414 -0
  533. package/dist/vscode/vs/workbench/services/workingCopy/common/workingCopyFileOperationParticipant.js +39 -0
  534. package/dist/vscode/vs/workbench/services/workingCopy/common/workingCopyFileService.js +181 -0
  535. package/dist/vscode/vs/workbench/services/workingCopy/common/workingCopyService.js +112 -0
  536. package/dist/vscode/vs/workbench/services/workspaces/browser/abstractWorkspaceEditingService.js +325 -0
  537. package/dist/vscode/vs/workbench/services/workspaces/browser/workspaces.js +11 -0
  538. package/dist/vscode/vs/workbench/services/workspaces/browser/workspacesService.js +154 -0
  539. package/dist/vscode/vs/workbench/services/workspaces/common/workspaceEditing.js +3 -0
  540. package/dist/vscode-default-extensions/bat/package.json.js +2 -0
  541. package/dist/vscode-default-extensions/clojure/package.json.js +2 -0
  542. package/dist/vscode-default-extensions/coffeescript/package.json.js +2 -0
  543. package/dist/vscode-default-extensions/cpp/package.json.js +2 -0
  544. package/dist/vscode-default-extensions/csharp/package.json.js +2 -0
  545. package/dist/vscode-default-extensions/css/package.json.js +2 -0
  546. package/dist/vscode-default-extensions/dart/package.json.js +2 -0
  547. package/dist/vscode-default-extensions/diff/package.json.js +2 -0
  548. package/dist/vscode-default-extensions/docker/package.json.js +2 -0
  549. package/dist/vscode-default-extensions/fsharp/package.json.js +2 -0
  550. package/dist/vscode-default-extensions/go/package.json.js +2 -0
  551. package/dist/vscode-default-extensions/groovy/package.json.js +2 -0
  552. package/dist/vscode-default-extensions/handlebars/package.json.js +2 -0
  553. package/dist/vscode-default-extensions/hlsl/package.json.js +2 -0
  554. package/dist/vscode-default-extensions/html/package.json.js +2 -0
  555. package/dist/vscode-default-extensions/ini/package.json.js +2 -0
  556. package/dist/vscode-default-extensions/java/package.json.js +2 -0
  557. package/dist/vscode-default-extensions/javascript/package.json.js +2 -0
  558. package/dist/vscode-default-extensions/json/package.json.js +2 -0
  559. package/dist/vscode-default-extensions/julia/package.json.js +2 -0
  560. package/dist/vscode-default-extensions/latex/package.json.js +2 -0
  561. package/dist/vscode-default-extensions/less/package.json.js +2 -0
  562. package/dist/vscode-default-extensions/log/package.json.js +2 -0
  563. package/dist/vscode-default-extensions/lua/package.json.js +2 -0
  564. package/dist/vscode-default-extensions/make/package.json.js +2 -0
  565. package/dist/vscode-default-extensions/markdown-basics/package.json.js +2 -0
  566. package/dist/vscode-default-extensions/objective-c/package.json.js +2 -0
  567. package/dist/vscode-default-extensions/perl/package.json.js +2 -0
  568. package/dist/vscode-default-extensions/php/package.json.js +2 -0
  569. package/dist/vscode-default-extensions/powershell/package.json.js +2 -0
  570. package/dist/vscode-default-extensions/pug/package.json.js +2 -0
  571. package/dist/vscode-default-extensions/python/package.json.js +2 -0
  572. package/dist/vscode-default-extensions/r/package.json.js +2 -0
  573. package/dist/vscode-default-extensions/razor/package.json.js +2 -0
  574. package/dist/vscode-default-extensions/ruby/package.json.js +2 -0
  575. package/dist/vscode-default-extensions/rust/package.json.js +2 -0
  576. package/dist/vscode-default-extensions/scss/package.json.js +2 -0
  577. package/dist/vscode-default-extensions/shaderlab/package.json.js +2 -0
  578. package/dist/vscode-default-extensions/shellscript/package.json.js +2 -0
  579. package/dist/vscode-default-extensions/sql/package.json.js +2 -0
  580. package/dist/vscode-default-extensions/swift/package.json.js +2 -0
  581. package/dist/vscode-default-extensions/theme-abyss/package.json.js +2 -0
  582. package/dist/vscode-default-extensions/theme-defaults/package.json.js +2 -0
  583. package/dist/vscode-default-extensions/theme-kimbie-dark/package.json.js +2 -0
  584. package/dist/vscode-default-extensions/theme-monokai/package.json.js +2 -0
  585. package/dist/vscode-default-extensions/theme-monokai-dimmed/package.json.js +2 -0
  586. package/dist/vscode-default-extensions/theme-quietlight/package.json.js +2 -0
  587. package/dist/vscode-default-extensions/theme-red/package.json.js +2 -0
  588. package/dist/vscode-default-extensions/theme-seti/package.json.js +2 -0
  589. package/dist/vscode-default-extensions/theme-solarized-dark/package.json.js +2 -0
  590. package/dist/vscode-default-extensions/theme-solarized-light/package.json.js +2 -0
  591. package/dist/vscode-default-extensions/theme-tomorrow-night-blue/package.json.js +2 -0
  592. package/dist/vscode-default-extensions/typescript-basics/package.json.js +2 -0
  593. package/dist/vscode-default-extensions/typescript-language-features/package.json.js +2 -0
  594. package/dist/vscode-default-extensions/vb/package.json.js +2 -0
  595. package/dist/vscode-default-extensions/xml/package.json.js +2 -0
  596. package/dist/vscode-default-extensions/yaml/package.json.js +2 -0
  597. package/dist/vscode-services/commands.js +37 -0
  598. package/dist/vscode-services/debug.js +74 -0
  599. package/dist/vscode-services/env.js +69 -0
  600. package/dist/vscode-services/extHost.js +385 -0
  601. package/dist/vscode-services/extensions.js +46 -0
  602. package/dist/vscode-services/languages.js +203 -0
  603. package/dist/vscode-services/missing-services.js +959 -0
  604. package/dist/vscode-services/window.js +189 -0
  605. package/dist/vscode-services/workspace.js +164 -0
  606. package/monaco-editor-treemending.patch +23574 -0
  607. package/monaco-treemending.js +3 -0
  608. package/package.json +55 -59
  609. package/dist/api2.js +0 -1294
  610. package/dist/audioCue.js +0 -805
  611. package/dist/button.js +0 -352
  612. package/dist/configuration.js +0 -4438
  613. package/dist/debug.js +0 -15673
  614. package/dist/dialogs.js +0 -752
  615. package/dist/dom.js +0 -101
  616. package/dist/files.js +0 -3167
  617. package/dist/keybindings.js +0 -4310
  618. package/dist/layout.contribution.darwin.js +0 -1994
  619. package/dist/layout.contribution.linux.js +0 -899
  620. package/dist/layout.contribution.win.js +0 -3551
  621. package/dist/modelEditor.js +0 -8893
  622. package/dist/notifications.js +0 -2302
  623. package/dist/platform.js +0 -105
  624. package/dist/polyfill.js +0 -55651
  625. package/dist/preferences.js +0 -2532
  626. package/dist/textmate.js +0 -1428
  627. package/dist/theme.js +0 -4116
  628. package/dist/utils.js +0 -345
  629. package/dist/webpack-loader.cjs +0 -18
  630. package/dist/webpack-loader.d.ts +0 -4
  631. package/dist/{iconv.js → override/iconv.js} +0 -0
  632. package/dist/{jschardet.js → override/jschardet.js} +0 -0
  633. package/dist/{audioCue.d.ts → service-override/audioCue.d.ts} +0 -0
  634. package/dist/{configuration.d.ts → service-override/configuration.d.ts} +0 -0
  635. package/dist/{debug.d.ts → service-override/debug.d.ts} +0 -0
  636. package/dist/{dialogs.d.ts → service-override/dialogs.d.ts} +0 -0
  637. package/dist/{files.d.ts → service-override/files.d.ts} +0 -0
  638. package/dist/{keybindings.d.ts → service-override/keybindings.d.ts} +0 -0
  639. package/dist/{languages.d.ts → service-override/languages.d.ts} +0 -0
  640. package/dist/{modelEditor.d.ts → service-override/modelEditor.d.ts} +0 -0
  641. package/dist/{notifications.d.ts → service-override/notifications.d.ts} +0 -0
  642. package/dist/{preferences.d.ts → service-override/preferences.d.ts} +0 -0
  643. package/dist/{snippets.d.ts → service-override/snippets.d.ts} +0 -0
  644. package/dist/{textmate.d.ts → service-override/textmate.d.ts} +0 -0
  645. package/dist/{theme.d.ts → service-override/theme.d.ts} +0 -0
  646. package/dist/{injection.js → tools/injection.js} +0 -0
  647. package/dist/{jsonErrorMessages.js → vscode/vs/base/common/jsonErrorMessages.js} +0 -0
  648. package/dist/{_.contribution.js → vscode/vs/workbench/services/keybinding/browser/keyboardLayouts/_.contribution.js} +0 -0
  649. package/dist/{unboundCommands.js → vscode/vs/workbench/services/keybinding/browser/unboundCommands.js} +2 -2
  650. /package/dist/{language-configuration.js → vscode-default-extensions/bat/language-configuration.json.js} +0 -0
  651. /package/dist/{batchfile.js → vscode-default-extensions/bat/snippets/batchfile.code-snippets.js} +0 -0
  652. /package/dist/{batchfile.tmLanguage.js → vscode-default-extensions/bat/syntaxes/batchfile.tmLanguage.json.js} +0 -0
  653. /package/dist/{language-configuration2.js → vscode-default-extensions/clojure/language-configuration.json.js} +0 -0
  654. /package/dist/{clojure.tmLanguage.js → vscode-default-extensions/clojure/syntaxes/clojure.tmLanguage.json.js} +0 -0
  655. /package/dist/{language-configuration3.js → vscode-default-extensions/coffeescript/language-configuration.json.js} +0 -0
  656. /package/dist/{coffeescript.js → vscode-default-extensions/coffeescript/snippets/coffeescript.code-snippets.js} +0 -0
  657. /package/dist/{coffeescript.tmLanguage.js → vscode-default-extensions/coffeescript/syntaxes/coffeescript.tmLanguage.json.js} +0 -0
  658. /package/dist/{language-configuration4.js → vscode-default-extensions/cpp/language-configuration.json.js} +0 -0
  659. /package/dist/{c.js → vscode-default-extensions/cpp/snippets/c.code-snippets.js} +0 -0
  660. /package/dist/{cpp.js → vscode-default-extensions/cpp/snippets/cpp.code-snippets.js} +0 -0
  661. /package/dist/{c.tmLanguage.js → vscode-default-extensions/cpp/syntaxes/c.tmLanguage.json.js} +0 -0
  662. /package/dist/{cpp.embedded.macro.tmLanguage.js → vscode-default-extensions/cpp/syntaxes/cpp.embedded.macro.tmLanguage.json.js} +0 -0
  663. /package/dist/{cpp.tmLanguage.js → vscode-default-extensions/cpp/syntaxes/cpp.tmLanguage.json.js} +0 -0
  664. /package/dist/{cuda-cpp.tmLanguage.js → vscode-default-extensions/cpp/syntaxes/cuda-cpp.tmLanguage.json.js} +0 -0
  665. /package/dist/{platform.tmLanguage.js → vscode-default-extensions/cpp/syntaxes/platform.tmLanguage.json.js} +0 -0
  666. /package/dist/{language-configuration5.js → vscode-default-extensions/csharp/language-configuration.json.js} +0 -0
  667. /package/dist/{csharp.js → vscode-default-extensions/csharp/snippets/csharp.code-snippets.js} +0 -0
  668. /package/dist/{csharp.tmLanguage.js → vscode-default-extensions/csharp/syntaxes/csharp.tmLanguage.json.js} +0 -0
  669. /package/dist/{language-configuration6.js → vscode-default-extensions/css/language-configuration.json.js} +0 -0
  670. /package/dist/{css.tmLanguage.js → vscode-default-extensions/css/syntaxes/css.tmLanguage.json.js} +0 -0
  671. /package/dist/{language-configuration7.js → vscode-default-extensions/dart/language-configuration.json.js} +0 -0
  672. /package/dist/{dart.tmLanguage.js → vscode-default-extensions/dart/syntaxes/dart.tmLanguage.json.js} +0 -0
  673. /package/dist/{language-configuration8.js → vscode-default-extensions/diff/language-configuration.json.js} +0 -0
  674. /package/dist/{diff.tmLanguage.js → vscode-default-extensions/diff/syntaxes/diff.tmLanguage.json.js} +0 -0
  675. /package/dist/{language-configuration9.js → vscode-default-extensions/docker/language-configuration.json.js} +0 -0
  676. /package/dist/{docker.tmLanguage.js → vscode-default-extensions/docker/syntaxes/docker.tmLanguage.json.js} +0 -0
  677. /package/dist/{language-configuration10.js → vscode-default-extensions/fsharp/language-configuration.json.js} +0 -0
  678. /package/dist/{fsharp.js → vscode-default-extensions/fsharp/snippets/fsharp.code-snippets.js} +0 -0
  679. /package/dist/{fsharp.tmLanguage.js → vscode-default-extensions/fsharp/syntaxes/fsharp.tmLanguage.json.js} +0 -0
  680. /package/dist/{language-configuration11.js → vscode-default-extensions/go/language-configuration.json.js} +0 -0
  681. /package/dist/{go.tmLanguage.js → vscode-default-extensions/go/syntaxes/go.tmLanguage.json.js} +0 -0
  682. /package/dist/{language-configuration12.js → vscode-default-extensions/groovy/language-configuration.json.js} +0 -0
  683. /package/dist/{groovy.js → vscode-default-extensions/groovy/snippets/groovy.code-snippets.js} +0 -0
  684. /package/dist/{groovy.tmLanguage.js → vscode-default-extensions/groovy/syntaxes/groovy.tmLanguage.json.js} +0 -0
  685. /package/dist/{language-configuration13.js → vscode-default-extensions/handlebars/language-configuration.json.js} +0 -0
  686. /package/dist/{Handlebars.tmLanguage.js → vscode-default-extensions/handlebars/syntaxes/Handlebars.tmLanguage.json.js} +0 -0
  687. /package/dist/{language-configuration14.js → vscode-default-extensions/hlsl/language-configuration.json.js} +0 -0
  688. /package/dist/{hlsl.tmLanguage.js → vscode-default-extensions/hlsl/syntaxes/hlsl.tmLanguage.json.js} +0 -0
  689. /package/dist/{language-configuration15.js → vscode-default-extensions/html/language-configuration.json.js} +0 -0
  690. /package/dist/{html.js → vscode-default-extensions/html/snippets/html.code-snippets.js} +0 -0
  691. /package/dist/{html-derivative.tmLanguage.js → vscode-default-extensions/html/syntaxes/html-derivative.tmLanguage.json.js} +0 -0
  692. /package/dist/{html.tmLanguage.js → vscode-default-extensions/html/syntaxes/html.tmLanguage.json.js} +0 -0
  693. /package/dist/{ini.language-configuration.js → vscode-default-extensions/ini/ini.language-configuration.json.js} +0 -0
  694. /package/dist/{properties.language-configuration.js → vscode-default-extensions/ini/properties.language-configuration.json.js} +0 -0
  695. /package/dist/{ini.tmLanguage.js → vscode-default-extensions/ini/syntaxes/ini.tmLanguage.json.js} +0 -0
  696. /package/dist/{language-configuration16.js → vscode-default-extensions/java/language-configuration.json.js} +0 -0
  697. /package/dist/{java.js → vscode-default-extensions/java/snippets/java.code-snippets.js} +0 -0
  698. /package/dist/{java.tmLanguage.js → vscode-default-extensions/java/syntaxes/java.tmLanguage.json.js} +0 -0
  699. /package/dist/{javascript-language-configuration.js → vscode-default-extensions/javascript/javascript-language-configuration.json.js} +0 -0
  700. /package/dist/{javascript.js → vscode-default-extensions/javascript/snippets/javascript.code-snippets.js} +0 -0
  701. /package/dist/{JavaScript.tmLanguage.js → vscode-default-extensions/javascript/syntaxes/JavaScript.tmLanguage.json.js} +0 -0
  702. /package/dist/{JavaScriptReact.tmLanguage.js → vscode-default-extensions/javascript/syntaxes/JavaScriptReact.tmLanguage.json.js} +0 -0
  703. /package/dist/{Regular Expressions (JavaScript).js → vscode-default-extensions/javascript/syntaxes/Regular Expressions (JavaScript).tmLanguage.js} +0 -0
  704. /package/dist/{tags-language-configuration.js → vscode-default-extensions/javascript/tags-language-configuration.json.js} +0 -0
  705. /package/dist/{language-configuration17.js → vscode-default-extensions/json/language-configuration.json.js} +0 -0
  706. /package/dist/{JSON.tmLanguage.js → vscode-default-extensions/json/syntaxes/JSON.tmLanguage.json.js} +0 -0
  707. /package/dist/{JSONC.tmLanguage.js → vscode-default-extensions/json/syntaxes/JSONC.tmLanguage.json.js} +0 -0
  708. /package/dist/{language-configuration18.js → vscode-default-extensions/julia/language-configuration.json.js} +0 -0
  709. /package/dist/{julia.tmLanguage.js → vscode-default-extensions/julia/syntaxes/julia.tmLanguage.json.js} +0 -0
  710. /package/dist/{latex-cpp-embedded-language-configuration.js → vscode-default-extensions/latex/latex-cpp-embedded-language-configuration.json.js} +0 -0
  711. /package/dist/{latex-language-configuration.js → vscode-default-extensions/latex/latex-language-configuration.json.js} +0 -0
  712. /package/dist/{markdown-latex-combined-language-configuration.js → vscode-default-extensions/latex/markdown-latex-combined-language-configuration.json.js} +0 -0
  713. /package/dist/{Bibtex.tmLanguage.js → vscode-default-extensions/latex/syntaxes/Bibtex.tmLanguage.json.js} +0 -0
  714. /package/dist/{LaTeX.tmLanguage.js → vscode-default-extensions/latex/syntaxes/LaTeX.tmLanguage.json.js} +0 -0
  715. /package/dist/{TeX.tmLanguage.js → vscode-default-extensions/latex/syntaxes/TeX.tmLanguage.json.js} +0 -0
  716. /package/dist/{cpp-grammar-bailout.tmLanguage.js → vscode-default-extensions/latex/syntaxes/cpp-grammar-bailout.tmLanguage.json.js} +0 -0
  717. /package/dist/{markdown-latex-combined.tmLanguage.js → vscode-default-extensions/latex/syntaxes/markdown-latex-combined.tmLanguage.json.js} +0 -0
  718. /package/dist/{language-configuration19.js → vscode-default-extensions/less/language-configuration.json.js} +0 -0
  719. /package/dist/{less.tmLanguage.js → vscode-default-extensions/less/syntaxes/less.tmLanguage.json.js} +0 -0
  720. /package/dist/{log.tmLanguage.js → vscode-default-extensions/log/syntaxes/log.tmLanguage.json.js} +0 -0
  721. /package/dist/{language-configuration20.js → vscode-default-extensions/lua/language-configuration.json.js} +0 -0
  722. /package/dist/{lua.tmLanguage.js → vscode-default-extensions/lua/syntaxes/lua.tmLanguage.json.js} +0 -0
  723. /package/dist/{language-configuration21.js → vscode-default-extensions/make/language-configuration.json.js} +0 -0
  724. /package/dist/{make.tmLanguage.js → vscode-default-extensions/make/syntaxes/make.tmLanguage.json.js} +0 -0
  725. /package/dist/{language-configuration22.js → vscode-default-extensions/markdown-basics/language-configuration.json.js} +0 -0
  726. /package/dist/{markdown.js → vscode-default-extensions/markdown-basics/snippets/markdown.code-snippets.js} +0 -0
  727. /package/dist/{markdown.tmLanguage.js → vscode-default-extensions/markdown-basics/syntaxes/markdown.tmLanguage.json.js} +0 -0
  728. /package/dist/{language-configuration23.js → vscode-default-extensions/objective-c/language-configuration.json.js} +0 -0
  729. /package/dist/{objective-c.tmLanguage.js → vscode-default-extensions/objective-c/syntaxes/objective-c.tmLanguage.json.js} +0 -0
  730. /package/dist/{objective-c__.tmLanguage.js → vscode-default-extensions/objective-c/syntaxes/objective-c__.tmLanguage.json.js} +0 -0
  731. /package/dist/{perl.language-configuration.js → vscode-default-extensions/perl/perl.language-configuration.json.js} +0 -0
  732. /package/dist/{perl6.language-configuration.js → vscode-default-extensions/perl/perl6.language-configuration.json.js} +0 -0
  733. /package/dist/{perl.tmLanguage.js → vscode-default-extensions/perl/syntaxes/perl.tmLanguage.json.js} +0 -0
  734. /package/dist/{perl6.tmLanguage.js → vscode-default-extensions/perl/syntaxes/perl6.tmLanguage.json.js} +0 -0
  735. /package/dist/{language-configuration24.js → vscode-default-extensions/php/language-configuration.json.js} +0 -0
  736. /package/dist/{php.js → vscode-default-extensions/php/snippets/php.code-snippets.js} +0 -0
  737. /package/dist/{html.tmLanguage2.js → vscode-default-extensions/php/syntaxes/html.tmLanguage.json.js} +0 -0
  738. /package/dist/{php.tmLanguage.js → vscode-default-extensions/php/syntaxes/php.tmLanguage.json.js} +0 -0
  739. /package/dist/{language-configuration25.js → vscode-default-extensions/powershell/language-configuration.json.js} +0 -0
  740. /package/dist/{powershell.tmLanguage.js → vscode-default-extensions/powershell/syntaxes/powershell.tmLanguage.json.js} +0 -0
  741. /package/dist/{language-configuration26.js → vscode-default-extensions/pug/language-configuration.json.js} +0 -0
  742. /package/dist/{pug.tmLanguage.js → vscode-default-extensions/pug/syntaxes/pug.tmLanguage.json.js} +0 -0
  743. /package/dist/{language-configuration27.js → vscode-default-extensions/python/language-configuration.json.js} +0 -0
  744. /package/dist/{MagicPython.tmLanguage.js → vscode-default-extensions/python/syntaxes/MagicPython.tmLanguage.json.js} +0 -0
  745. /package/dist/{MagicRegExp.tmLanguage.js → vscode-default-extensions/python/syntaxes/MagicRegExp.tmLanguage.json.js} +0 -0
  746. /package/dist/{language-configuration28.js → vscode-default-extensions/r/language-configuration.json.js} +0 -0
  747. /package/dist/{r.tmLanguage.js → vscode-default-extensions/r/syntaxes/r.tmLanguage.json.js} +0 -0
  748. /package/dist/{language-configuration29.js → vscode-default-extensions/razor/language-configuration.json.js} +0 -0
  749. /package/dist/{cshtml.tmLanguage.js → vscode-default-extensions/razor/syntaxes/cshtml.tmLanguage.json.js} +0 -0
  750. /package/dist/{language-configuration30.js → vscode-default-extensions/ruby/language-configuration.json.js} +0 -0
  751. /package/dist/{ruby.tmLanguage.js → vscode-default-extensions/ruby/syntaxes/ruby.tmLanguage.json.js} +0 -0
  752. /package/dist/{language-configuration31.js → vscode-default-extensions/rust/language-configuration.json.js} +0 -0
  753. /package/dist/{rust.tmLanguage.js → vscode-default-extensions/rust/syntaxes/rust.tmLanguage.json.js} +0 -0
  754. /package/dist/{language-configuration32.js → vscode-default-extensions/scss/language-configuration.json.js} +0 -0
  755. /package/dist/{sassdoc.tmLanguage.js → vscode-default-extensions/scss/syntaxes/sassdoc.tmLanguage.json.js} +0 -0
  756. /package/dist/{scss.tmLanguage.js → vscode-default-extensions/scss/syntaxes/scss.tmLanguage.json.js} +0 -0
  757. /package/dist/{language-configuration33.js → vscode-default-extensions/shaderlab/language-configuration.json.js} +0 -0
  758. /package/dist/{shaderlab.tmLanguage.js → vscode-default-extensions/shaderlab/syntaxes/shaderlab.tmLanguage.json.js} +0 -0
  759. /package/dist/{language-configuration34.js → vscode-default-extensions/shellscript/language-configuration.json.js} +0 -0
  760. /package/dist/{shell-unix-bash.tmLanguage.js → vscode-default-extensions/shellscript/syntaxes/shell-unix-bash.tmLanguage.json.js} +0 -0
  761. /package/dist/{language-configuration35.js → vscode-default-extensions/sql/language-configuration.json.js} +0 -0
  762. /package/dist/{sql.tmLanguage.js → vscode-default-extensions/sql/syntaxes/sql.tmLanguage.json.js} +0 -0
  763. /package/dist/{language-configuration36.js → vscode-default-extensions/swift/language-configuration.json.js} +0 -0
  764. /package/dist/{swift.js → vscode-default-extensions/swift/snippets/swift.code-snippets.js} +0 -0
  765. /package/dist/{swift.tmLanguage.js → vscode-default-extensions/swift/syntaxes/swift.tmLanguage.json.js} +0 -0
  766. /package/dist/{abyss-color-theme.js → vscode-default-extensions/theme-abyss/themes/abyss-color-theme.json.js} +0 -0
  767. /package/dist/{vs_minimal-icon-theme.js → vscode-default-extensions/theme-defaults/fileicons/vs_minimal-icon-theme.json.js} +0 -0
  768. /package/dist/{dark_plus.js → vscode-default-extensions/theme-defaults/themes/dark_plus.json.js} +0 -0
  769. /package/dist/{dark_plus_experimental.js → vscode-default-extensions/theme-defaults/themes/dark_plus_experimental.json.js} +0 -0
  770. /package/dist/{dark_vs.js → vscode-default-extensions/theme-defaults/themes/dark_vs.json.js} +0 -0
  771. /package/dist/{hc_black.js → vscode-default-extensions/theme-defaults/themes/hc_black.json.js} +0 -0
  772. /package/dist/{hc_light.js → vscode-default-extensions/theme-defaults/themes/hc_light.json.js} +0 -0
  773. /package/dist/{light_plus.js → vscode-default-extensions/theme-defaults/themes/light_plus.json.js} +0 -0
  774. /package/dist/{light_plus_experimental.js → vscode-default-extensions/theme-defaults/themes/light_plus_experimental.json.js} +0 -0
  775. /package/dist/{light_vs.js → vscode-default-extensions/theme-defaults/themes/light_vs.json.js} +0 -0
  776. /package/dist/{kimbie-dark-color-theme.js → vscode-default-extensions/theme-kimbie-dark/themes/kimbie-dark-color-theme.json.js} +0 -0
  777. /package/dist/{monokai-color-theme.js → vscode-default-extensions/theme-monokai/themes/monokai-color-theme.json.js} +0 -0
  778. /package/dist/{dimmed-monokai-color-theme.js → vscode-default-extensions/theme-monokai-dimmed/themes/dimmed-monokai-color-theme.json.js} +0 -0
  779. /package/dist/{quietlight-color-theme.js → vscode-default-extensions/theme-quietlight/themes/quietlight-color-theme.json.js} +0 -0
  780. /package/dist/{Red-color-theme.js → vscode-default-extensions/theme-red/themes/Red-color-theme.json.js} +0 -0
  781. /package/dist/{vs-seti-icon-theme.js → vscode-default-extensions/theme-seti/icons/vs-seti-icon-theme.json.js} +0 -0
  782. /package/dist/{solarized-dark-color-theme.js → vscode-default-extensions/theme-solarized-dark/themes/solarized-dark-color-theme.json.js} +0 -0
  783. /package/dist/{solarized-light-color-theme.js → vscode-default-extensions/theme-solarized-light/themes/solarized-light-color-theme.json.js} +0 -0
  784. /package/dist/{tomorrow-night-blue-color-theme.js → vscode-default-extensions/theme-tomorrow-night-blue/themes/tomorrow-night-blue-color-theme.json.js} +0 -0
  785. /package/dist/{language-configuration37.js → vscode-default-extensions/typescript-basics/language-configuration.json.js} +0 -0
  786. /package/dist/{typescript.js → vscode-default-extensions/typescript-basics/snippets/typescript.code-snippets.js} +0 -0
  787. /package/dist/{TypeScript.tmLanguage.js → vscode-default-extensions/typescript-basics/syntaxes/TypeScript.tmLanguage.json.js} +0 -0
  788. /package/dist/{TypeScriptReact.tmLanguage.js → vscode-default-extensions/typescript-basics/syntaxes/TypeScriptReact.tmLanguage.json.js} +0 -0
  789. /package/dist/{jsdoc.js.injection.tmLanguage.js → vscode-default-extensions/typescript-basics/syntaxes/jsdoc.js.injection.tmLanguage.json.js} +0 -0
  790. /package/dist/{jsdoc.ts.injection.tmLanguage.js → vscode-default-extensions/typescript-basics/syntaxes/jsdoc.ts.injection.tmLanguage.json.js} +0 -0
  791. /package/dist/{language-configuration38.js → vscode-default-extensions/vb/language-configuration.json.js} +0 -0
  792. /package/dist/{vb.js → vscode-default-extensions/vb/snippets/vb.code-snippets.js} +0 -0
  793. /package/dist/{asp-vb-net.tmlanguage.js → vscode-default-extensions/vb/syntaxes/asp-vb-net.tmlanguage.json.js} +0 -0
  794. /package/dist/{xml.tmLanguage.js → vscode-default-extensions/xml/syntaxes/xml.tmLanguage.json.js} +0 -0
  795. /package/dist/{xsl.tmLanguage.js → vscode-default-extensions/xml/syntaxes/xsl.tmLanguage.json.js} +0 -0
  796. /package/dist/{xml.language-configuration.js → vscode-default-extensions/xml/xml.language-configuration.json.js} +0 -0
  797. /package/dist/{xsl.language-configuration.js → vscode-default-extensions/xml/xsl.language-configuration.json.js} +0 -0
  798. /package/dist/{language-configuration39.js → vscode-default-extensions/yaml/language-configuration.json.js} +0 -0
  799. /package/dist/{yaml.tmLanguage.js → vscode-default-extensions/yaml/syntaxes/yaml.tmLanguage.json.js} +0 -0
@@ -1,4310 +0,0 @@
1
- import { __decorate, __param, IUserDataProfilesService, IFileService, IKeyboardLayoutService, index, IEditorService, IExtensionService, IEditorGroupsService, IPreferencesService, IProductService, Emitter, getKeyboardLayoutId, IUserDataProfileService, IHostService, parse$1, getNodeType, FallbackKeyboardMapper } from './polyfill.js';
2
- import { KeyCodeChord, ScanCodeChord, Keybinding } from 'monaco-editor/esm/vs/base/common/keybindings.js';
3
- import { KeyCodeUtils, IMMUTABLE_CODE_TO_KEY_CODE, NATIVE_WINDOWS_KEY_CODE_TO_KEY_CODE, IMMUTABLE_KEY_CODE_TO_CODE } from 'monaco-editor/esm/vs/base/common/keyCodes.js';
4
- import { ExtensionsRegistry } from './extensionsRegistry.js';
5
- import { localize } from 'monaco-editor/esm/vs/nls.js';
6
- import { DisposableStore, Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
7
- import { ThemeIcon } from 'monaco-editor/esm/vs/base/common/themables.js';
8
- import { joinPath, dirname } from 'monaco-editor/esm/vs/base/common/resources.js';
9
- import { MenuRegistry, MenuId, MenuItemAction, Action2, IMenuService } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
10
- import { ContextKeyExpr, IContextKeyService } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
11
- import { isFalsyOrWhitespace } from 'monaco-editor/esm/vs/base/common/strings.js';
12
- import { getAllUnboundCommands } from './unboundCommands.js';
13
- import { AbstractKeybindingService } from 'monaco-editor/esm/vs/platform/keybinding/common/abstractKeybindingService.js';
14
- import { KeybindingsRegistry } from 'monaco-editor/esm/vs/platform/keybinding/common/keybindingsRegistry.js';
15
- import { addDisposableListener, EventType } from 'monaco-editor/esm/vs/base/browser/dom.js';
16
- import { BrowserFeatures } from 'monaco-editor/esm/vs/base/browser/canIUse.js';
17
- import { UserSettingsLabelProvider, UILabelProvider } from 'monaco-editor/esm/vs/base/common/keybindingLabels.js';
18
- import { OS, isMacintosh, isWindows, isLinux } from 'monaco-editor/esm/vs/base/common/platform.js';
19
- import { KeybindingResolver } from 'monaco-editor/esm/vs/platform/keybinding/common/keybindingResolver.js';
20
- import { ResolvedKeybindingItem, toEmptyArrayIfContainsNull } from 'monaco-editor/esm/vs/platform/keybinding/common/resolvedKeybindingItem.js';
21
- import { ICommandService, CommandsRegistry } from 'monaco-editor/esm/vs/platform/commands/common/commands.js';
22
- import { ITelemetryService } from 'monaco-editor/esm/vs/platform/telemetry/common/telemetry.js';
23
- import { INotificationService } from 'monaco-editor/esm/vs/platform/notification/common/notification.js';
24
- import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
25
- import { timeout, RunOnceScheduler } from 'monaco-editor/esm/vs/base/common/async.js';
26
- import { Event } from 'monaco-editor/esm/vs/base/common/event.js';
27
- import { equals } from 'monaco-editor/esm/vs/base/common/objects.js';
28
- import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
29
- import { Extensions as Extensions$2 } from 'monaco-editor/esm/vs/platform/jsonschemas/common/jsonContributionRegistry.js';
30
- import { StandardKeyboardEvent } from 'monaco-editor/esm/vs/base/browser/keyboardEvent.js';
31
- import { Language } from './platform.js';
32
- import { AbstractEditorCommandsQuickAccessProvider } from 'monaco-editor/esm/vs/editor/contrib/quickAccess/browser/commandsQuickAccess.js';
33
- import { DefaultQuickAccessFilterValue, Extensions as Extensions$1 } from 'monaco-editor/esm/vs/platform/quickinput/common/quickAccess.js';
34
- import { Codicon } from 'monaco-editor/esm/vs/base/common/codicons.js';
35
- import { TriggerAction } from 'monaco-editor/esm/vs/platform/quickinput/browser/pickerQuickAccess.js';
36
- import { stripIcons } from 'monaco-editor/esm/vs/base/common/iconLabels.js';
37
- import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
38
- import { IKeybindingService } from 'monaco-editor/esm/vs/platform/keybinding/common/keybinding.js';
39
- import { IDialogService } from 'monaco-editor/esm/vs/platform/dialogs/common/dialogs.js';
40
- import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
41
- import { isFirefox } from 'monaco-editor/esm/vs/base/browser/browser.js';
42
- import { IQuickInputService } from 'monaco-editor/esm/vs/platform/quickinput/common/quickInput.js';
43
- import { Extensions } from 'monaco-editor/esm/vs/platform/configuration/common/configurationRegistry.js';
44
- import { BaseResolvedKeybinding } from 'monaco-editor/esm/vs/platform/keybinding/common/baseResolvedKeybinding.js';
45
- import { IEnvironmentService } from 'monaco-editor/esm/vs/platform/environment/common/environment.js';
46
- import { IStorageService } from 'monaco-editor/esm/vs/platform/storage/common/storage.js';
47
- import getServiceOverride$1 from './files.js';
48
- import { createInjectedClass } from './injection.js';
49
- import { StandaloneCommandsQuickAccessProvider } from 'monaco-editor/esm/vs/editor/standalone/browser/quickAccess/standaloneCommandsQuickAccess.js';
50
- import { SyncDescriptor } from 'monaco-editor/esm/vs/platform/instantiation/common/descriptors.js';
51
- import { StandaloneServices, StandaloneKeybindingService } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js';
52
- import { VSBuffer } from 'monaco-editor/esm/vs/base/common/buffer.js';
53
- class WindowManager {
54
- constructor() {
55
- this._zoomLevel = 0;
56
- this._zoomFactor = 1;
57
- this._fullscreen = false;
58
- this._onDidChangeFullscreen = ( (new Emitter()));
59
- this.onDidChangeFullscreen = this._onDidChangeFullscreen.event;
60
- }
61
- getZoomLevel() {
62
- return this._zoomLevel;
63
- }
64
- setZoomLevel(zoomLevel, isTrusted) {
65
- if (this._zoomLevel === zoomLevel) {
66
- return;
67
- }
68
- this._zoomLevel = zoomLevel;
69
- }
70
- getZoomFactor() {
71
- return this._zoomFactor;
72
- }
73
- setZoomFactor(zoomFactor) {
74
- this._zoomFactor = zoomFactor;
75
- }
76
- setFullscreen(fullscreen) {
77
- if (this._fullscreen === fullscreen) {
78
- return;
79
- }
80
- this._fullscreen = fullscreen;
81
- this._onDidChangeFullscreen.fire();
82
- }
83
- isFullscreen() {
84
- return this._fullscreen;
85
- }
86
- }
87
- WindowManager.INSTANCE = ( (new WindowManager()));
88
- function addMatchMediaChangeListener(query, callback) {
89
- if (typeof query === 'string') {
90
- query = window.matchMedia(query);
91
- }
92
- query.addEventListener('change', callback);
93
- }
94
- function isFullscreen() {
95
- return WindowManager.INSTANCE.isFullscreen();
96
- }
97
- const onDidChangeFullscreen = WindowManager.INSTANCE.onDidChangeFullscreen;
98
- const userAgent = navigator.userAgent;
99
- (userAgent.indexOf('Firefox') >= 0);
100
- (userAgent.indexOf('AppleWebKit') >= 0);
101
- const isChrome = (userAgent.indexOf('Chrome') >= 0);
102
- (!isChrome && (userAgent.indexOf('Safari') >= 0));
103
- (userAgent.indexOf('Electron/') >= 0);
104
- (userAgent.indexOf('Android') >= 0);
105
- let standalone = false;
106
- if (window.matchMedia) {
107
- const standaloneMatchMedia = window.matchMedia('(display-mode: standalone) or (display-mode: window-controls-overlay)');
108
- const fullScreenMatchMedia = window.matchMedia('(display-mode: fullscreen)');
109
- standalone = standaloneMatchMedia.matches;
110
- addMatchMediaChangeListener(standaloneMatchMedia, ({ matches }) => {
111
- if (standalone && fullScreenMatchMedia.matches) {
112
- return;
113
- }
114
- standalone = matches;
115
- });
116
- }
117
- class KeyCodeStrMap {
118
- constructor() {
119
- this._keyCodeToStr = [];
120
- this._strToKeyCode = Object.create(null);
121
- }
122
- define(keyCode, str) {
123
- this._keyCodeToStr[keyCode] = str;
124
- this._strToKeyCode[str.toLowerCase()] = keyCode;
125
- }
126
- keyCodeToStr(keyCode) {
127
- return this._keyCodeToStr[keyCode];
128
- }
129
- strToKeyCode(str) {
130
- return this._strToKeyCode[str.toLowerCase()] || 0 ;
131
- }
132
- }
133
- const uiMap = ( (new KeyCodeStrMap()));
134
- const userSettingsUSMap = ( (new KeyCodeStrMap()));
135
- const userSettingsGeneralMap = ( (new KeyCodeStrMap()));
136
- const EVENT_KEY_CODE_MAP = ( (new Array(230)));
137
- const scanCodeIntToStr = [];
138
- const scanCodeStrToInt = Object.create(null);
139
- const scanCodeLowerCaseStrToInt = Object.create(null);
140
- const ScanCodeUtils = {
141
- lowerCaseToEnum: (scanCode) => scanCodeLowerCaseStrToInt[scanCode] || 0 ,
142
- toEnum: (scanCode) => scanCodeStrToInt[scanCode] || 0 ,
143
- toString: (scanCode) => scanCodeIntToStr[scanCode] || 'None'
144
- };
145
- (function () {
146
- const empty = '';
147
- const mappings = [
148
- [0, 1, 0 , 'None', 0 , 'unknown', 0, 'VK_UNKNOWN', empty, empty],
149
- [0, 1, 1 , 'Hyper', 0 , empty, 0, empty, empty, empty],
150
- [0, 1, 2 , 'Super', 0 , empty, 0, empty, empty, empty],
151
- [0, 1, 3 , 'Fn', 0 , empty, 0, empty, empty, empty],
152
- [0, 1, 4 , 'FnLock', 0 , empty, 0, empty, empty, empty],
153
- [0, 1, 5 , 'Suspend', 0 , empty, 0, empty, empty, empty],
154
- [0, 1, 6 , 'Resume', 0 , empty, 0, empty, empty, empty],
155
- [0, 1, 7 , 'Turbo', 0 , empty, 0, empty, empty, empty],
156
- [0, 1, 8 , 'Sleep', 0 , empty, 0, 'VK_SLEEP', empty, empty],
157
- [0, 1, 9 , 'WakeUp', 0 , empty, 0, empty, empty, empty],
158
- [31, 0, 10 , 'KeyA', 31 , 'A', 65, 'VK_A', empty, empty],
159
- [32, 0, 11 , 'KeyB', 32 , 'B', 66, 'VK_B', empty, empty],
160
- [33, 0, 12 , 'KeyC', 33 , 'C', 67, 'VK_C', empty, empty],
161
- [34, 0, 13 , 'KeyD', 34 , 'D', 68, 'VK_D', empty, empty],
162
- [35, 0, 14 , 'KeyE', 35 , 'E', 69, 'VK_E', empty, empty],
163
- [36, 0, 15 , 'KeyF', 36 , 'F', 70, 'VK_F', empty, empty],
164
- [37, 0, 16 , 'KeyG', 37 , 'G', 71, 'VK_G', empty, empty],
165
- [38, 0, 17 , 'KeyH', 38 , 'H', 72, 'VK_H', empty, empty],
166
- [39, 0, 18 , 'KeyI', 39 , 'I', 73, 'VK_I', empty, empty],
167
- [40, 0, 19 , 'KeyJ', 40 , 'J', 74, 'VK_J', empty, empty],
168
- [41, 0, 20 , 'KeyK', 41 , 'K', 75, 'VK_K', empty, empty],
169
- [42, 0, 21 , 'KeyL', 42 , 'L', 76, 'VK_L', empty, empty],
170
- [43, 0, 22 , 'KeyM', 43 , 'M', 77, 'VK_M', empty, empty],
171
- [44, 0, 23 , 'KeyN', 44 , 'N', 78, 'VK_N', empty, empty],
172
- [45, 0, 24 , 'KeyO', 45 , 'O', 79, 'VK_O', empty, empty],
173
- [46, 0, 25 , 'KeyP', 46 , 'P', 80, 'VK_P', empty, empty],
174
- [47, 0, 26 , 'KeyQ', 47 , 'Q', 81, 'VK_Q', empty, empty],
175
- [48, 0, 27 , 'KeyR', 48 , 'R', 82, 'VK_R', empty, empty],
176
- [49, 0, 28 , 'KeyS', 49 , 'S', 83, 'VK_S', empty, empty],
177
- [50, 0, 29 , 'KeyT', 50 , 'T', 84, 'VK_T', empty, empty],
178
- [51, 0, 30 , 'KeyU', 51 , 'U', 85, 'VK_U', empty, empty],
179
- [52, 0, 31 , 'KeyV', 52 , 'V', 86, 'VK_V', empty, empty],
180
- [53, 0, 32 , 'KeyW', 53 , 'W', 87, 'VK_W', empty, empty],
181
- [54, 0, 33 , 'KeyX', 54 , 'X', 88, 'VK_X', empty, empty],
182
- [55, 0, 34 , 'KeyY', 55 , 'Y', 89, 'VK_Y', empty, empty],
183
- [56, 0, 35 , 'KeyZ', 56 , 'Z', 90, 'VK_Z', empty, empty],
184
- [22, 0, 36 , 'Digit1', 22 , '1', 49, 'VK_1', empty, empty],
185
- [23, 0, 37 , 'Digit2', 23 , '2', 50, 'VK_2', empty, empty],
186
- [24, 0, 38 , 'Digit3', 24 , '3', 51, 'VK_3', empty, empty],
187
- [25, 0, 39 , 'Digit4', 25 , '4', 52, 'VK_4', empty, empty],
188
- [26, 0, 40 , 'Digit5', 26 , '5', 53, 'VK_5', empty, empty],
189
- [27, 0, 41 , 'Digit6', 27 , '6', 54, 'VK_6', empty, empty],
190
- [28, 0, 42 , 'Digit7', 28 , '7', 55, 'VK_7', empty, empty],
191
- [29, 0, 43 , 'Digit8', 29 , '8', 56, 'VK_8', empty, empty],
192
- [30, 0, 44 , 'Digit9', 30 , '9', 57, 'VK_9', empty, empty],
193
- [21, 0, 45 , 'Digit0', 21 , '0', 48, 'VK_0', empty, empty],
194
- [3, 1, 46 , 'Enter', 3 , 'Enter', 13, 'VK_RETURN', empty, empty],
195
- [9, 1, 47 , 'Escape', 9 , 'Escape', 27, 'VK_ESCAPE', empty, empty],
196
- [1, 1, 48 , 'Backspace', 1 , 'Backspace', 8, 'VK_BACK', empty, empty],
197
- [2, 1, 49 , 'Tab', 2 , 'Tab', 9, 'VK_TAB', empty, empty],
198
- [10, 1, 50 , 'Space', 10 , 'Space', 32, 'VK_SPACE', empty, empty],
199
- [83, 0, 51 , 'Minus', 83 , '-', 189, 'VK_OEM_MINUS', '-', 'OEM_MINUS'],
200
- [81, 0, 52 , 'Equal', 81 , '=', 187, 'VK_OEM_PLUS', '=', 'OEM_PLUS'],
201
- [87, 0, 53 , 'BracketLeft', 87 , '[', 219, 'VK_OEM_4', '[', 'OEM_4'],
202
- [89, 0, 54 , 'BracketRight', 89 , ']', 221, 'VK_OEM_6', ']', 'OEM_6'],
203
- [88, 0, 55 , 'Backslash', 88 , '\\', 220, 'VK_OEM_5', '\\', 'OEM_5'],
204
- [0, 0, 56 , 'IntlHash', 0 , empty, 0, empty, empty, empty],
205
- [80, 0, 57 , 'Semicolon', 80 , ';', 186, 'VK_OEM_1', ';', 'OEM_1'],
206
- [90, 0, 58 , 'Quote', 90 , '\'', 222, 'VK_OEM_7', '\'', 'OEM_7'],
207
- [86, 0, 59 , 'Backquote', 86 , '`', 192, 'VK_OEM_3', '`', 'OEM_3'],
208
- [82, 0, 60 , 'Comma', 82 , ',', 188, 'VK_OEM_COMMA', ',', 'OEM_COMMA'],
209
- [84, 0, 61 , 'Period', 84 , '.', 190, 'VK_OEM_PERIOD', '.', 'OEM_PERIOD'],
210
- [85, 0, 62 , 'Slash', 85 , '/', 191, 'VK_OEM_2', '/', 'OEM_2'],
211
- [8, 1, 63 , 'CapsLock', 8 , 'CapsLock', 20, 'VK_CAPITAL', empty, empty],
212
- [59, 1, 64 , 'F1', 59 , 'F1', 112, 'VK_F1', empty, empty],
213
- [60, 1, 65 , 'F2', 60 , 'F2', 113, 'VK_F2', empty, empty],
214
- [61, 1, 66 , 'F3', 61 , 'F3', 114, 'VK_F3', empty, empty],
215
- [62, 1, 67 , 'F4', 62 , 'F4', 115, 'VK_F4', empty, empty],
216
- [63, 1, 68 , 'F5', 63 , 'F5', 116, 'VK_F5', empty, empty],
217
- [64, 1, 69 , 'F6', 64 , 'F6', 117, 'VK_F6', empty, empty],
218
- [65, 1, 70 , 'F7', 65 , 'F7', 118, 'VK_F7', empty, empty],
219
- [66, 1, 71 , 'F8', 66 , 'F8', 119, 'VK_F8', empty, empty],
220
- [67, 1, 72 , 'F9', 67 , 'F9', 120, 'VK_F9', empty, empty],
221
- [68, 1, 73 , 'F10', 68 , 'F10', 121, 'VK_F10', empty, empty],
222
- [69, 1, 74 , 'F11', 69 , 'F11', 122, 'VK_F11', empty, empty],
223
- [70, 1, 75 , 'F12', 70 , 'F12', 123, 'VK_F12', empty, empty],
224
- [0, 1, 76 , 'PrintScreen', 0 , empty, 0, empty, empty, empty],
225
- [79, 1, 77 , 'ScrollLock', 79 , 'ScrollLock', 145, 'VK_SCROLL', empty, empty],
226
- [7, 1, 78 , 'Pause', 7 , 'PauseBreak', 19, 'VK_PAUSE', empty, empty],
227
- [19, 1, 79 , 'Insert', 19 , 'Insert', 45, 'VK_INSERT', empty, empty],
228
- [14, 1, 80 , 'Home', 14 , 'Home', 36, 'VK_HOME', empty, empty],
229
- [11, 1, 81 , 'PageUp', 11 , 'PageUp', 33, 'VK_PRIOR', empty, empty],
230
- [20, 1, 82 , 'Delete', 20 , 'Delete', 46, 'VK_DELETE', empty, empty],
231
- [13, 1, 83 , 'End', 13 , 'End', 35, 'VK_END', empty, empty],
232
- [12, 1, 84 , 'PageDown', 12 , 'PageDown', 34, 'VK_NEXT', empty, empty],
233
- [17, 1, 85 , 'ArrowRight', 17 , 'RightArrow', 39, 'VK_RIGHT', 'Right', empty],
234
- [15, 1, 86 , 'ArrowLeft', 15 , 'LeftArrow', 37, 'VK_LEFT', 'Left', empty],
235
- [18, 1, 87 , 'ArrowDown', 18 , 'DownArrow', 40, 'VK_DOWN', 'Down', empty],
236
- [16, 1, 88 , 'ArrowUp', 16 , 'UpArrow', 38, 'VK_UP', 'Up', empty],
237
- [78, 1, 89 , 'NumLock', 78 , 'NumLock', 144, 'VK_NUMLOCK', empty, empty],
238
- [108, 1, 90 , 'NumpadDivide', 108 , 'NumPad_Divide', 111, 'VK_DIVIDE', empty, empty],
239
- [103, 1, 91 , 'NumpadMultiply', 103 , 'NumPad_Multiply', 106, 'VK_MULTIPLY', empty, empty],
240
- [106, 1, 92 , 'NumpadSubtract', 106 , 'NumPad_Subtract', 109, 'VK_SUBTRACT', empty, empty],
241
- [104, 1, 93 , 'NumpadAdd', 104 , 'NumPad_Add', 107, 'VK_ADD', empty, empty],
242
- [3, 1, 94 , 'NumpadEnter', 3 , empty, 0, empty, empty, empty],
243
- [94, 1, 95 , 'Numpad1', 94 , 'NumPad1', 97, 'VK_NUMPAD1', empty, empty],
244
- [95, 1, 96 , 'Numpad2', 95 , 'NumPad2', 98, 'VK_NUMPAD2', empty, empty],
245
- [96, 1, 97 , 'Numpad3', 96 , 'NumPad3', 99, 'VK_NUMPAD3', empty, empty],
246
- [97, 1, 98 , 'Numpad4', 97 , 'NumPad4', 100, 'VK_NUMPAD4', empty, empty],
247
- [98, 1, 99 , 'Numpad5', 98 , 'NumPad5', 101, 'VK_NUMPAD5', empty, empty],
248
- [99, 1, 100 , 'Numpad6', 99 , 'NumPad6', 102, 'VK_NUMPAD6', empty, empty],
249
- [100, 1, 101 , 'Numpad7', 100 , 'NumPad7', 103, 'VK_NUMPAD7', empty, empty],
250
- [101, 1, 102 , 'Numpad8', 101 , 'NumPad8', 104, 'VK_NUMPAD8', empty, empty],
251
- [102, 1, 103 , 'Numpad9', 102 , 'NumPad9', 105, 'VK_NUMPAD9', empty, empty],
252
- [93, 1, 104 , 'Numpad0', 93 , 'NumPad0', 96, 'VK_NUMPAD0', empty, empty],
253
- [107, 1, 105 , 'NumpadDecimal', 107 , 'NumPad_Decimal', 110, 'VK_DECIMAL', empty, empty],
254
- [92, 0, 106 , 'IntlBackslash', 92 , 'OEM_102', 226, 'VK_OEM_102', empty, empty],
255
- [58, 1, 107 , 'ContextMenu', 58 , 'ContextMenu', 93, empty, empty, empty],
256
- [0, 1, 108 , 'Power', 0 , empty, 0, empty, empty, empty],
257
- [0, 1, 109 , 'NumpadEqual', 0 , empty, 0, empty, empty, empty],
258
- [71, 1, 110 , 'F13', 71 , 'F13', 124, 'VK_F13', empty, empty],
259
- [72, 1, 111 , 'F14', 72 , 'F14', 125, 'VK_F14', empty, empty],
260
- [73, 1, 112 , 'F15', 73 , 'F15', 126, 'VK_F15', empty, empty],
261
- [74, 1, 113 , 'F16', 74 , 'F16', 127, 'VK_F16', empty, empty],
262
- [75, 1, 114 , 'F17', 75 , 'F17', 128, 'VK_F17', empty, empty],
263
- [76, 1, 115 , 'F18', 76 , 'F18', 129, 'VK_F18', empty, empty],
264
- [77, 1, 116 , 'F19', 77 , 'F19', 130, 'VK_F19', empty, empty],
265
- [0, 1, 117 , 'F20', 0 , empty, 0, 'VK_F20', empty, empty],
266
- [0, 1, 118 , 'F21', 0 , empty, 0, 'VK_F21', empty, empty],
267
- [0, 1, 119 , 'F22', 0 , empty, 0, 'VK_F22', empty, empty],
268
- [0, 1, 120 , 'F23', 0 , empty, 0, 'VK_F23', empty, empty],
269
- [0, 1, 121 , 'F24', 0 , empty, 0, 'VK_F24', empty, empty],
270
- [0, 1, 122 , 'Open', 0 , empty, 0, empty, empty, empty],
271
- [0, 1, 123 , 'Help', 0 , empty, 0, empty, empty, empty],
272
- [0, 1, 124 , 'Select', 0 , empty, 0, empty, empty, empty],
273
- [0, 1, 125 , 'Again', 0 , empty, 0, empty, empty, empty],
274
- [0, 1, 126 , 'Undo', 0 , empty, 0, empty, empty, empty],
275
- [0, 1, 127 , 'Cut', 0 , empty, 0, empty, empty, empty],
276
- [0, 1, 128 , 'Copy', 0 , empty, 0, empty, empty, empty],
277
- [0, 1, 129 , 'Paste', 0 , empty, 0, empty, empty, empty],
278
- [0, 1, 130 , 'Find', 0 , empty, 0, empty, empty, empty],
279
- [0, 1, 131 , 'AudioVolumeMute', 112 , 'AudioVolumeMute', 173, 'VK_VOLUME_MUTE', empty, empty],
280
- [0, 1, 132 , 'AudioVolumeUp', 113 , 'AudioVolumeUp', 175, 'VK_VOLUME_UP', empty, empty],
281
- [0, 1, 133 , 'AudioVolumeDown', 114 , 'AudioVolumeDown', 174, 'VK_VOLUME_DOWN', empty, empty],
282
- [105, 1, 134 , 'NumpadComma', 105 , 'NumPad_Separator', 108, 'VK_SEPARATOR', empty, empty],
283
- [110, 0, 135 , 'IntlRo', 110 , 'ABNT_C1', 193, 'VK_ABNT_C1', empty, empty],
284
- [0, 1, 136 , 'KanaMode', 0 , empty, 0, empty, empty, empty],
285
- [0, 0, 137 , 'IntlYen', 0 , empty, 0, empty, empty, empty],
286
- [0, 1, 138 , 'Convert', 0 , empty, 0, empty, empty, empty],
287
- [0, 1, 139 , 'NonConvert', 0 , empty, 0, empty, empty, empty],
288
- [0, 1, 140 , 'Lang1', 0 , empty, 0, empty, empty, empty],
289
- [0, 1, 141 , 'Lang2', 0 , empty, 0, empty, empty, empty],
290
- [0, 1, 142 , 'Lang3', 0 , empty, 0, empty, empty, empty],
291
- [0, 1, 143 , 'Lang4', 0 , empty, 0, empty, empty, empty],
292
- [0, 1, 144 , 'Lang5', 0 , empty, 0, empty, empty, empty],
293
- [0, 1, 145 , 'Abort', 0 , empty, 0, empty, empty, empty],
294
- [0, 1, 146 , 'Props', 0 , empty, 0, empty, empty, empty],
295
- [0, 1, 147 , 'NumpadParenLeft', 0 , empty, 0, empty, empty, empty],
296
- [0, 1, 148 , 'NumpadParenRight', 0 , empty, 0, empty, empty, empty],
297
- [0, 1, 149 , 'NumpadBackspace', 0 , empty, 0, empty, empty, empty],
298
- [0, 1, 150 , 'NumpadMemoryStore', 0 , empty, 0, empty, empty, empty],
299
- [0, 1, 151 , 'NumpadMemoryRecall', 0 , empty, 0, empty, empty, empty],
300
- [0, 1, 152 , 'NumpadMemoryClear', 0 , empty, 0, empty, empty, empty],
301
- [0, 1, 153 , 'NumpadMemoryAdd', 0 , empty, 0, empty, empty, empty],
302
- [0, 1, 154 , 'NumpadMemorySubtract', 0 , empty, 0, empty, empty, empty],
303
- [0, 1, 155 , 'NumpadClear', 126 , 'Clear', 12, 'VK_CLEAR', empty, empty],
304
- [0, 1, 156 , 'NumpadClearEntry', 0 , empty, 0, empty, empty, empty],
305
- [5, 1, 0 , empty, 5 , 'Ctrl', 17, 'VK_CONTROL', empty, empty],
306
- [4, 1, 0 , empty, 4 , 'Shift', 16, 'VK_SHIFT', empty, empty],
307
- [6, 1, 0 , empty, 6 , 'Alt', 18, 'VK_MENU', empty, empty],
308
- [57, 1, 0 , empty, 57 , 'Meta', 91, 'VK_COMMAND', empty, empty],
309
- [5, 1, 157 , 'ControlLeft', 5 , empty, 0, 'VK_LCONTROL', empty, empty],
310
- [4, 1, 158 , 'ShiftLeft', 4 , empty, 0, 'VK_LSHIFT', empty, empty],
311
- [6, 1, 159 , 'AltLeft', 6 , empty, 0, 'VK_LMENU', empty, empty],
312
- [57, 1, 160 , 'MetaLeft', 57 , empty, 0, 'VK_LWIN', empty, empty],
313
- [5, 1, 161 , 'ControlRight', 5 , empty, 0, 'VK_RCONTROL', empty, empty],
314
- [4, 1, 162 , 'ShiftRight', 4 , empty, 0, 'VK_RSHIFT', empty, empty],
315
- [6, 1, 163 , 'AltRight', 6 , empty, 0, 'VK_RMENU', empty, empty],
316
- [57, 1, 164 , 'MetaRight', 57 , empty, 0, 'VK_RWIN', empty, empty],
317
- [0, 1, 165 , 'BrightnessUp', 0 , empty, 0, empty, empty, empty],
318
- [0, 1, 166 , 'BrightnessDown', 0 , empty, 0, empty, empty, empty],
319
- [0, 1, 167 , 'MediaPlay', 0 , empty, 0, empty, empty, empty],
320
- [0, 1, 168 , 'MediaRecord', 0 , empty, 0, empty, empty, empty],
321
- [0, 1, 169 , 'MediaFastForward', 0 , empty, 0, empty, empty, empty],
322
- [0, 1, 170 , 'MediaRewind', 0 , empty, 0, empty, empty, empty],
323
- [114, 1, 171 , 'MediaTrackNext', 119 , 'MediaTrackNext', 176, 'VK_MEDIA_NEXT_TRACK', empty, empty],
324
- [115, 1, 172 , 'MediaTrackPrevious', 120 , 'MediaTrackPrevious', 177, 'VK_MEDIA_PREV_TRACK', empty, empty],
325
- [116, 1, 173 , 'MediaStop', 121 , 'MediaStop', 178, 'VK_MEDIA_STOP', empty, empty],
326
- [0, 1, 174 , 'Eject', 0 , empty, 0, empty, empty, empty],
327
- [117, 1, 175 , 'MediaPlayPause', 122 , 'MediaPlayPause', 179, 'VK_MEDIA_PLAY_PAUSE', empty, empty],
328
- [0, 1, 176 , 'MediaSelect', 123 , 'LaunchMediaPlayer', 181, 'VK_MEDIA_LAUNCH_MEDIA_SELECT', empty, empty],
329
- [0, 1, 177 , 'LaunchMail', 124 , 'LaunchMail', 180, 'VK_MEDIA_LAUNCH_MAIL', empty, empty],
330
- [0, 1, 178 , 'LaunchApp2', 125 , 'LaunchApp2', 183, 'VK_MEDIA_LAUNCH_APP2', empty, empty],
331
- [0, 1, 179 , 'LaunchApp1', 0 , empty, 0, 'VK_MEDIA_LAUNCH_APP1', empty, empty],
332
- [0, 1, 180 , 'SelectTask', 0 , empty, 0, empty, empty, empty],
333
- [0, 1, 181 , 'LaunchScreenSaver', 0 , empty, 0, empty, empty, empty],
334
- [0, 1, 182 , 'BrowserSearch', 115 , 'BrowserSearch', 170, 'VK_BROWSER_SEARCH', empty, empty],
335
- [0, 1, 183 , 'BrowserHome', 116 , 'BrowserHome', 172, 'VK_BROWSER_HOME', empty, empty],
336
- [112, 1, 184 , 'BrowserBack', 117 , 'BrowserBack', 166, 'VK_BROWSER_BACK', empty, empty],
337
- [113, 1, 185 , 'BrowserForward', 118 , 'BrowserForward', 167, 'VK_BROWSER_FORWARD', empty, empty],
338
- [0, 1, 186 , 'BrowserStop', 0 , empty, 0, 'VK_BROWSER_STOP', empty, empty],
339
- [0, 1, 187 , 'BrowserRefresh', 0 , empty, 0, 'VK_BROWSER_REFRESH', empty, empty],
340
- [0, 1, 188 , 'BrowserFavorites', 0 , empty, 0, 'VK_BROWSER_FAVORITES', empty, empty],
341
- [0, 1, 189 , 'ZoomToggle', 0 , empty, 0, empty, empty, empty],
342
- [0, 1, 190 , 'MailReply', 0 , empty, 0, empty, empty, empty],
343
- [0, 1, 191 , 'MailForward', 0 , empty, 0, empty, empty, empty],
344
- [0, 1, 192 , 'MailSend', 0 , empty, 0, empty, empty, empty],
345
- [109, 1, 0 , empty, 109 , 'KeyInComposition', 229, empty, empty, empty],
346
- [111, 1, 0 , empty, 111 , 'ABNT_C2', 194, 'VK_ABNT_C2', empty, empty],
347
- [91, 1, 0 , empty, 91 , 'OEM_8', 223, 'VK_OEM_8', empty, empty],
348
- [0, 1, 0 , empty, 0 , empty, 0, 'VK_KANA', empty, empty],
349
- [0, 1, 0 , empty, 0 , empty, 0, 'VK_HANGUL', empty, empty],
350
- [0, 1, 0 , empty, 0 , empty, 0, 'VK_JUNJA', empty, empty],
351
- [0, 1, 0 , empty, 0 , empty, 0, 'VK_FINAL', empty, empty],
352
- [0, 1, 0 , empty, 0 , empty, 0, 'VK_HANJA', empty, empty],
353
- [0, 1, 0 , empty, 0 , empty, 0, 'VK_KANJI', empty, empty],
354
- [0, 1, 0 , empty, 0 , empty, 0, 'VK_CONVERT', empty, empty],
355
- [0, 1, 0 , empty, 0 , empty, 0, 'VK_NONCONVERT', empty, empty],
356
- [0, 1, 0 , empty, 0 , empty, 0, 'VK_ACCEPT', empty, empty],
357
- [0, 1, 0 , empty, 0 , empty, 0, 'VK_MODECHANGE', empty, empty],
358
- [0, 1, 0 , empty, 0 , empty, 0, 'VK_SELECT', empty, empty],
359
- [0, 1, 0 , empty, 0 , empty, 0, 'VK_PRINT', empty, empty],
360
- [0, 1, 0 , empty, 0 , empty, 0, 'VK_EXECUTE', empty, empty],
361
- [0, 1, 0 , empty, 0 , empty, 0, 'VK_SNAPSHOT', empty, empty],
362
- [0, 1, 0 , empty, 0 , empty, 0, 'VK_HELP', empty, empty],
363
- [0, 1, 0 , empty, 0 , empty, 0, 'VK_APPS', empty, empty],
364
- [0, 1, 0 , empty, 0 , empty, 0, 'VK_PROCESSKEY', empty, empty],
365
- [0, 1, 0 , empty, 0 , empty, 0, 'VK_PACKET', empty, empty],
366
- [0, 1, 0 , empty, 0 , empty, 0, 'VK_DBE_SBCSCHAR', empty, empty],
367
- [0, 1, 0 , empty, 0 , empty, 0, 'VK_DBE_DBCSCHAR', empty, empty],
368
- [0, 1, 0 , empty, 0 , empty, 0, 'VK_ATTN', empty, empty],
369
- [0, 1, 0 , empty, 0 , empty, 0, 'VK_CRSEL', empty, empty],
370
- [0, 1, 0 , empty, 0 , empty, 0, 'VK_EXSEL', empty, empty],
371
- [0, 1, 0 , empty, 0 , empty, 0, 'VK_EREOF', empty, empty],
372
- [0, 1, 0 , empty, 0 , empty, 0, 'VK_PLAY', empty, empty],
373
- [0, 1, 0 , empty, 0 , empty, 0, 'VK_ZOOM', empty, empty],
374
- [0, 1, 0 , empty, 0 , empty, 0, 'VK_NONAME', empty, empty],
375
- [0, 1, 0 , empty, 0 , empty, 0, 'VK_PA1', empty, empty],
376
- [0, 1, 0 , empty, 0 , empty, 0, 'VK_OEM_CLEAR', empty, empty],
377
- ];
378
- const seenKeyCode = [];
379
- const seenScanCode = [];
380
- for (const mapping of mappings) {
381
- const [_keyCodeOrd, immutable, scanCode, scanCodeStr, keyCode, keyCodeStr, eventKeyCode, vkey, usUserSettingsLabel, generalUserSettingsLabel] = mapping;
382
- if (!seenScanCode[scanCode]) {
383
- seenScanCode[scanCode] = true;
384
- scanCodeIntToStr[scanCode] = scanCodeStr;
385
- scanCodeStrToInt[scanCodeStr] = scanCode;
386
- scanCodeLowerCaseStrToInt[scanCodeStr.toLowerCase()] = scanCode;
387
- }
388
- if (!seenKeyCode[keyCode]) {
389
- seenKeyCode[keyCode] = true;
390
- if (!keyCodeStr) {
391
- throw new Error(`String representation missing for key code ${keyCode} around scan code ${scanCodeStr}`);
392
- }
393
- uiMap.define(keyCode, keyCodeStr);
394
- userSettingsUSMap.define(keyCode, usUserSettingsLabel || keyCodeStr);
395
- userSettingsGeneralMap.define(keyCode, generalUserSettingsLabel || usUserSettingsLabel || keyCodeStr);
396
- }
397
- if (eventKeyCode) {
398
- EVENT_KEY_CODE_MAP[eventKeyCode] = keyCode;
399
- }
400
- }
401
- })();
402
- function printKeyboardEvent(e) {
403
- const modifiers = [];
404
- if (e.ctrlKey) {
405
- modifiers.push(`ctrl`);
406
- }
407
- if (e.shiftKey) {
408
- modifiers.push(`shift`);
409
- }
410
- if (e.altKey) {
411
- modifiers.push(`alt`);
412
- }
413
- if (e.metaKey) {
414
- modifiers.push(`meta`);
415
- }
416
- return `modifiers: [${modifiers.join(',')}], code: ${e.code}, keyCode: ${e.keyCode}, key: ${e.key}`;
417
- }
418
- function printStandardKeyboardEvent(e) {
419
- const modifiers = [];
420
- if (e.ctrlKey) {
421
- modifiers.push(`ctrl`);
422
- }
423
- if (e.shiftKey) {
424
- modifiers.push(`shift`);
425
- }
426
- if (e.altKey) {
427
- modifiers.push(`alt`);
428
- }
429
- if (e.metaKey) {
430
- modifiers.push(`meta`);
431
- }
432
- return `modifiers: [${modifiers.join(',')}], code: ${e.code}, keyCode: ${e.keyCode} ('${( ( KeyCodeUtils.toString(e.keyCode)))}')`;
433
- }
434
- class KeybindingParser {
435
- static _readModifiers(input) {
436
- input = input.toLowerCase().trim();
437
- let ctrl = false;
438
- let shift = false;
439
- let alt = false;
440
- let meta = false;
441
- let matchedModifier;
442
- do {
443
- matchedModifier = false;
444
- if (/^ctrl(\+|\-)/.test(input)) {
445
- ctrl = true;
446
- input = input.substr('ctrl-'.length);
447
- matchedModifier = true;
448
- }
449
- if (/^shift(\+|\-)/.test(input)) {
450
- shift = true;
451
- input = input.substr('shift-'.length);
452
- matchedModifier = true;
453
- }
454
- if (/^alt(\+|\-)/.test(input)) {
455
- alt = true;
456
- input = input.substr('alt-'.length);
457
- matchedModifier = true;
458
- }
459
- if (/^meta(\+|\-)/.test(input)) {
460
- meta = true;
461
- input = input.substr('meta-'.length);
462
- matchedModifier = true;
463
- }
464
- if (/^win(\+|\-)/.test(input)) {
465
- meta = true;
466
- input = input.substr('win-'.length);
467
- matchedModifier = true;
468
- }
469
- if (/^cmd(\+|\-)/.test(input)) {
470
- meta = true;
471
- input = input.substr('cmd-'.length);
472
- matchedModifier = true;
473
- }
474
- } while (matchedModifier);
475
- let key;
476
- const firstSpaceIdx = input.indexOf(' ');
477
- if (firstSpaceIdx > 0) {
478
- key = input.substring(0, firstSpaceIdx);
479
- input = input.substring(firstSpaceIdx);
480
- }
481
- else {
482
- key = input;
483
- input = '';
484
- }
485
- return {
486
- remains: input,
487
- ctrl,
488
- shift,
489
- alt,
490
- meta,
491
- key
492
- };
493
- }
494
- static parseChord(input) {
495
- const mods = this._readModifiers(input);
496
- const scanCodeMatch = mods.key.match(/^\[([^\]]+)\]$/);
497
- if (scanCodeMatch) {
498
- const strScanCode = scanCodeMatch[1];
499
- const scanCode = ScanCodeUtils.lowerCaseToEnum(strScanCode);
500
- return [( (new ScanCodeChord(mods.ctrl, mods.shift, mods.alt, mods.meta, scanCode))), mods.remains];
501
- }
502
- const keyCode = KeyCodeUtils.fromUserSettings(mods.key);
503
- return [( (new KeyCodeChord(mods.ctrl, mods.shift, mods.alt, mods.meta, keyCode))), mods.remains];
504
- }
505
- static parseKeybinding(input) {
506
- if (!input) {
507
- return null;
508
- }
509
- const chords = [];
510
- let chord;
511
- while (input.length > 0) {
512
- [chord, input] = this.parseChord(input);
513
- chords.push(chord);
514
- }
515
- return (chords.length > 0 ? (new Keybinding(chords)) : null);
516
- }
517
- }
518
- const apiMenus = [
519
- {
520
- key: 'commandPalette',
521
- id: MenuId.CommandPalette,
522
- description: ( (localize('menus.commandPalette', "The Command Palette"))),
523
- supportsSubmenus: false
524
- },
525
- {
526
- key: 'touchBar',
527
- id: MenuId.TouchBarContext,
528
- description: ( (localize('menus.touchBar', "The touch bar (macOS only)"))),
529
- supportsSubmenus: false
530
- },
531
- {
532
- key: 'editor/title',
533
- id: MenuId.EditorTitle,
534
- description: ( (localize('menus.editorTitle', "The editor title menu")))
535
- },
536
- {
537
- key: 'editor/title/run',
538
- id: MenuId.EditorTitleRun,
539
- description: ( (localize('menus.editorTitleRun', "Run submenu inside the editor title menu")))
540
- },
541
- {
542
- key: 'editor/context',
543
- id: MenuId.EditorContext,
544
- description: ( (localize('menus.editorContext', "The editor context menu")))
545
- },
546
- {
547
- key: 'editor/context/copy',
548
- id: MenuId.EditorContextCopy,
549
- description: ( (localize(
550
- 'menus.editorContextCopyAs',
551
- "'Copy as' submenu in the editor context menu"
552
- )))
553
- },
554
- {
555
- key: 'editor/context/share',
556
- id: MenuId.EditorContextShare,
557
- description: ( (localize('menus.editorContextShare', "'Share' submenu in the editor context menu"))),
558
- proposed: 'contribShareMenu'
559
- },
560
- {
561
- key: 'explorer/context',
562
- id: MenuId.ExplorerContext,
563
- description: ( (localize('menus.explorerContext', "The file explorer context menu")))
564
- },
565
- {
566
- key: 'explorer/context/share',
567
- id: MenuId.ExplorerContextShare,
568
- description: ( (localize(
569
- 'menus.explorerContextShare',
570
- "'Share' submenu in the file explorer context menu"
571
- ))),
572
- proposed: 'contribShareMenu'
573
- },
574
- {
575
- key: 'editor/title/context',
576
- id: MenuId.EditorTitleContext,
577
- description: ( (localize('menus.editorTabContext', "The editor tabs context menu")))
578
- },
579
- {
580
- key: 'editor/title/context/share',
581
- id: MenuId.EditorTitleContextShare,
582
- description: ( (localize(
583
- 'menus.editorTitleContextShare',
584
- "'Share' submenu inside the editor title context menu"
585
- ))),
586
- proposed: 'contribShareMenu'
587
- },
588
- {
589
- key: 'debug/callstack/context',
590
- id: MenuId.DebugCallStackContext,
591
- description: ( (localize('menus.debugCallstackContext', "The debug callstack view context menu")))
592
- },
593
- {
594
- key: 'debug/variables/context',
595
- id: MenuId.DebugVariablesContext,
596
- description: ( (localize('menus.debugVariablesContext', "The debug variables view context menu")))
597
- },
598
- {
599
- key: 'debug/toolBar',
600
- id: MenuId.DebugToolBar,
601
- description: ( (localize('menus.debugToolBar', "The debug toolbar menu")))
602
- },
603
- {
604
- key: 'menuBar/home',
605
- id: MenuId.MenubarHomeMenu,
606
- description: ( (localize('menus.home', "The home indicator context menu (web only)"))),
607
- proposed: 'contribMenuBarHome',
608
- supportsSubmenus: false
609
- },
610
- {
611
- key: 'menuBar/edit/copy',
612
- id: MenuId.MenubarCopy,
613
- description: ( (localize('menus.opy', "'Copy as' submenu in the top level Edit menu")))
614
- },
615
- {
616
- key: 'scm/title',
617
- id: MenuId.SCMTitle,
618
- description: ( (localize('menus.scmTitle', "The Source Control title menu")))
619
- },
620
- {
621
- key: 'scm/sourceControl',
622
- id: MenuId.SCMSourceControl,
623
- description: ( (localize('menus.scmSourceControl', "The Source Control menu")))
624
- },
625
- {
626
- key: 'scm/resourceState/context',
627
- id: MenuId.SCMResourceContext,
628
- description: ( (localize(
629
- 'menus.resourceStateContext',
630
- "The Source Control resource state context menu"
631
- )))
632
- },
633
- {
634
- key: 'scm/resourceFolder/context',
635
- id: MenuId.SCMResourceFolderContext,
636
- description: ( (localize(
637
- 'menus.resourceFolderContext',
638
- "The Source Control resource folder context menu"
639
- )))
640
- },
641
- {
642
- key: 'scm/resourceGroup/context',
643
- id: MenuId.SCMResourceGroupContext,
644
- description: ( (localize(
645
- 'menus.resourceGroupContext',
646
- "The Source Control resource group context menu"
647
- )))
648
- },
649
- {
650
- key: 'scm/change/title',
651
- id: MenuId.SCMChangeContext,
652
- description: ( (localize('menus.changeTitle', "The Source Control inline change menu")))
653
- },
654
- {
655
- key: 'statusBar/remoteIndicator',
656
- id: MenuId.StatusBarRemoteIndicatorMenu,
657
- description: ( (localize(
658
- 'menus.statusBarRemoteIndicator',
659
- "The remote indicator menu in the status bar"
660
- ))),
661
- supportsSubmenus: false
662
- },
663
- {
664
- key: 'view/title',
665
- id: MenuId.ViewTitle,
666
- description: ( (localize('view.viewTitle', "The contributed view title menu")))
667
- },
668
- {
669
- key: 'view/item/context',
670
- id: MenuId.ViewItemContext,
671
- description: ( (localize('view.itemContext', "The contributed view item context menu")))
672
- },
673
- {
674
- key: 'comments/comment/editorActions',
675
- id: MenuId.CommentEditorActions,
676
- description: ( (localize('commentThread.editorActions', "The contributed comment editor actions"))),
677
- proposed: 'contribCommentEditorActionsMenu'
678
- },
679
- {
680
- key: 'comments/commentThread/title',
681
- id: MenuId.CommentThreadTitle,
682
- description: ( (localize('commentThread.title', "The contributed comment thread title menu")))
683
- },
684
- {
685
- key: 'comments/commentThread/context',
686
- id: MenuId.CommentThreadActions,
687
- description: ( (localize(
688
- 'commentThread.actions',
689
- "The contributed comment thread context menu, rendered as buttons below the comment editor"
690
- ))),
691
- supportsSubmenus: false
692
- },
693
- {
694
- key: 'comments/commentThread/additionalActions',
695
- id: MenuId.CommentThreadAdditionalActions,
696
- description: ( (localize(
697
- 'commentThread.actions',
698
- "The contributed comment thread context menu, rendered as buttons below the comment editor"
699
- ))),
700
- supportsSubmenus: false,
701
- proposed: 'contribCommentThreadAdditionalMenu'
702
- },
703
- {
704
- key: 'comments/commentThread/title/context',
705
- id: MenuId.CommentThreadTitleContext,
706
- description: ( (localize(
707
- 'commentThread.titleContext',
708
- "The contributed comment thread title's peek context menu, rendered as a right click menu on the comment thread's peek title."
709
- ))),
710
- proposed: 'contribCommentPeekContext'
711
- },
712
- {
713
- key: 'comments/comment/title',
714
- id: MenuId.CommentTitle,
715
- description: ( (localize('comment.title', "The contributed comment title menu")))
716
- },
717
- {
718
- key: 'comments/comment/context',
719
- id: MenuId.CommentActions,
720
- description: ( (localize(
721
- 'comment.actions',
722
- "The contributed comment context menu, rendered as buttons below the comment editor"
723
- ))),
724
- supportsSubmenus: false
725
- },
726
- {
727
- key: 'comments/commentThread/comment/context',
728
- id: MenuId.CommentThreadCommentContext,
729
- description: ( (localize(
730
- 'comment.commentContext',
731
- "The contributed comment context menu, rendered as a right click menu on the an individual comment in the comment thread's peek view."
732
- ))),
733
- proposed: 'contribCommentPeekContext'
734
- },
735
- {
736
- key: 'notebook/toolbar',
737
- id: MenuId.NotebookToolbar,
738
- description: ( (localize('notebook.toolbar', "The contributed notebook toolbar menu")))
739
- },
740
- {
741
- key: 'notebook/kernelSource',
742
- id: MenuId.NotebookKernelSource,
743
- description: ( (localize('notebook.kernelSource', "The contributed notebook kernel sources menu"))),
744
- proposed: 'notebookKernelSource'
745
- },
746
- {
747
- key: 'notebook/cell/title',
748
- id: MenuId.NotebookCellTitle,
749
- description: ( (localize('notebook.cell.title', "The contributed notebook cell title menu")))
750
- },
751
- {
752
- key: 'notebook/cell/execute',
753
- id: MenuId.NotebookCellExecute,
754
- description: ( (localize('notebook.cell.execute', "The contributed notebook cell execution menu")))
755
- },
756
- {
757
- key: 'interactive/toolbar',
758
- id: MenuId.InteractiveToolbar,
759
- description: ( (localize('interactive.toolbar', "The contributed interactive toolbar menu"))),
760
- },
761
- {
762
- key: 'interactive/cell/title',
763
- id: MenuId.InteractiveCellTitle,
764
- description: ( (localize('interactive.cell.title', "The contributed interactive cell title menu"))),
765
- },
766
- {
767
- key: 'testing/item/context',
768
- id: MenuId.TestItem,
769
- description: ( (localize('testing.item.context', "The contributed test item menu"))),
770
- },
771
- {
772
- key: 'testing/item/gutter',
773
- id: MenuId.TestItemGutter,
774
- description: ( (localize(
775
- 'testing.item.gutter.title',
776
- "The menu for a gutter decoration for a test item"
777
- ))),
778
- },
779
- {
780
- key: 'extension/context',
781
- id: MenuId.ExtensionContext,
782
- description: ( (localize('menus.extensionContext', "The extension context menu")))
783
- },
784
- {
785
- key: 'timeline/title',
786
- id: MenuId.TimelineTitle,
787
- description: ( (localize('view.timelineTitle', "The Timeline view title menu")))
788
- },
789
- {
790
- key: 'timeline/item/context',
791
- id: MenuId.TimelineItemContext,
792
- description: ( (localize('view.timelineContext', "The Timeline view item context menu")))
793
- },
794
- {
795
- key: 'ports/item/context',
796
- id: MenuId.TunnelContext,
797
- description: ( (localize('view.tunnelContext', "The Ports view item context menu")))
798
- },
799
- {
800
- key: 'ports/item/origin/inline',
801
- id: MenuId.TunnelOriginInline,
802
- description: ( (localize('view.tunnelOriginInline', "The Ports view item origin inline menu")))
803
- },
804
- {
805
- key: 'ports/item/port/inline',
806
- id: MenuId.TunnelPortInline,
807
- description: ( (localize('view.tunnelPortInline', "The Ports view item port inline menu")))
808
- },
809
- {
810
- key: 'file/newFile',
811
- id: MenuId.NewFile,
812
- description: ( (localize(
813
- 'file.newFile',
814
- "The 'New File...' quick pick, shown on welcome page and File menu."
815
- ))),
816
- supportsSubmenus: false,
817
- },
818
- {
819
- key: 'webview/context',
820
- id: MenuId.WebviewContext,
821
- description: ( (localize('webview.context', "The webview context menu")))
822
- },
823
- {
824
- key: 'file/share',
825
- id: MenuId.MenubarShare,
826
- description: ( (localize('menus.share', "Share submenu shown in the top level File menu."))),
827
- proposed: 'contribShareMenu'
828
- },
829
- {
830
- key: 'editor/inlineCompletions/actions',
831
- id: MenuId.InlineCompletionsActions,
832
- description: ( (localize(
833
- 'inlineCompletions.actions',
834
- "The actions shown when hovering on an inline completion"
835
- ))),
836
- supportsSubmenus: false,
837
- proposed: 'inlineCompletionsAdditions'
838
- },
839
- {
840
- key: 'editor/content',
841
- id: MenuId.EditorContent,
842
- description: ( (localize('merge.toolbar', "The prominent button in an editor, overlays its content"))),
843
- proposed: 'contribEditorContentMenu'
844
- },
845
- {
846
- key: 'editor/lineNumber/context',
847
- id: MenuId.EditorLineNumberContext,
848
- description: ( (localize(
849
- 'editorLineNumberContext',
850
- "The contributed editor line number context menu"
851
- )))
852
- },
853
- {
854
- key: 'mergeEditor/result/title',
855
- id: MenuId.MergeInputResultToolbar,
856
- description: ( (localize('menus.mergeEditorResult', "The result toolbar of the merge editor"))),
857
- proposed: 'contribMergeEditorMenus'
858
- },
859
- ];
860
- var schema;
861
- ( ((function(schema) {
862
- function isMenuItem(item) {
863
- return typeof item.command === 'string';
864
- }
865
- schema.isMenuItem = isMenuItem;
866
- function isValidMenuItem(item, collector) {
867
- if (typeof item.command !== 'string') {
868
- collector.error(( (localize(
869
- 'requirestring',
870
- "property `{0}` is mandatory and must be of type `string`",
871
- 'command'
872
- ))));
873
- return false;
874
- }
875
- if (item.alt && typeof item.alt !== 'string') {
876
- collector.error(( (localize(
877
- 'optstring',
878
- "property `{0}` can be omitted or must be of type `string`",
879
- 'alt'
880
- ))));
881
- return false;
882
- }
883
- if (item.when && typeof item.when !== 'string') {
884
- collector.error(( (localize(
885
- 'optstring',
886
- "property `{0}` can be omitted or must be of type `string`",
887
- 'when'
888
- ))));
889
- return false;
890
- }
891
- if (item.group && typeof item.group !== 'string') {
892
- collector.error(( (localize(
893
- 'optstring',
894
- "property `{0}` can be omitted or must be of type `string`",
895
- 'group'
896
- ))));
897
- return false;
898
- }
899
- return true;
900
- }
901
- schema.isValidMenuItem = isValidMenuItem;
902
- function isValidSubmenuItem(item, collector) {
903
- if (typeof item.submenu !== 'string') {
904
- collector.error(( (localize(
905
- 'requirestring',
906
- "property `{0}` is mandatory and must be of type `string`",
907
- 'submenu'
908
- ))));
909
- return false;
910
- }
911
- if (item.when && typeof item.when !== 'string') {
912
- collector.error(( (localize(
913
- 'optstring',
914
- "property `{0}` can be omitted or must be of type `string`",
915
- 'when'
916
- ))));
917
- return false;
918
- }
919
- if (item.group && typeof item.group !== 'string') {
920
- collector.error(( (localize(
921
- 'optstring',
922
- "property `{0}` can be omitted or must be of type `string`",
923
- 'group'
924
- ))));
925
- return false;
926
- }
927
- return true;
928
- }
929
- schema.isValidSubmenuItem = isValidSubmenuItem;
930
- function isValidItems(items, collector) {
931
- if (!Array.isArray(items)) {
932
- collector.error(( (localize('requirearray', "submenu items must be an array"))));
933
- return false;
934
- }
935
- for (const item of items) {
936
- if (isMenuItem(item)) {
937
- if (!isValidMenuItem(item, collector)) {
938
- return false;
939
- }
940
- }
941
- else {
942
- if (!isValidSubmenuItem(item, collector)) {
943
- return false;
944
- }
945
- }
946
- }
947
- return true;
948
- }
949
- schema.isValidItems = isValidItems;
950
- function isValidSubmenu(submenu, collector) {
951
- if (typeof submenu !== 'object') {
952
- collector.error(( (localize('require', "submenu items must be an object"))));
953
- return false;
954
- }
955
- if (typeof submenu.id !== 'string') {
956
- collector.error(( (localize(
957
- 'requirestring',
958
- "property `{0}` is mandatory and must be of type `string`",
959
- 'id'
960
- ))));
961
- return false;
962
- }
963
- if (typeof submenu.label !== 'string') {
964
- collector.error(( (localize(
965
- 'requirestring',
966
- "property `{0}` is mandatory and must be of type `string`",
967
- 'label'
968
- ))));
969
- return false;
970
- }
971
- return true;
972
- }
973
- schema.isValidSubmenu = isValidSubmenu;
974
- const menuItem = {
975
- type: 'object',
976
- required: ['command'],
977
- properties: {
978
- command: {
979
- description: ( (localize(
980
- 'vscode.extension.contributes.menuItem.command',
981
- 'Identifier of the command to execute. The command must be declared in the \'commands\'-section'
982
- ))),
983
- type: 'string'
984
- },
985
- alt: {
986
- description: ( (localize(
987
- 'vscode.extension.contributes.menuItem.alt',
988
- 'Identifier of an alternative command to execute. The command must be declared in the \'commands\'-section'
989
- ))),
990
- type: 'string'
991
- },
992
- when: {
993
- description: ( (localize(
994
- 'vscode.extension.contributes.menuItem.when',
995
- 'Condition which must be true to show this item'
996
- ))),
997
- type: 'string'
998
- },
999
- group: {
1000
- description: ( (localize(
1001
- 'vscode.extension.contributes.menuItem.group',
1002
- 'Group into which this item belongs'
1003
- ))),
1004
- type: 'string'
1005
- }
1006
- }
1007
- };
1008
- const submenuItem = {
1009
- type: 'object',
1010
- required: ['submenu'],
1011
- properties: {
1012
- submenu: {
1013
- description: ( (localize(
1014
- 'vscode.extension.contributes.menuItem.submenu',
1015
- 'Identifier of the submenu to display in this item.'
1016
- ))),
1017
- type: 'string'
1018
- },
1019
- when: {
1020
- description: ( (localize(
1021
- 'vscode.extension.contributes.menuItem.when',
1022
- 'Condition which must be true to show this item'
1023
- ))),
1024
- type: 'string'
1025
- },
1026
- group: {
1027
- description: ( (localize(
1028
- 'vscode.extension.contributes.menuItem.group',
1029
- 'Group into which this item belongs'
1030
- ))),
1031
- type: 'string'
1032
- }
1033
- }
1034
- };
1035
- const submenu = {
1036
- type: 'object',
1037
- required: ['id', 'label'],
1038
- properties: {
1039
- id: {
1040
- description: ( (localize(
1041
- 'vscode.extension.contributes.submenu.id',
1042
- 'Identifier of the menu to display as a submenu.'
1043
- ))),
1044
- type: 'string'
1045
- },
1046
- label: {
1047
- description: ( (localize(
1048
- 'vscode.extension.contributes.submenu.label',
1049
- 'The label of the menu item which leads to this submenu.'
1050
- ))),
1051
- type: 'string'
1052
- },
1053
- icon: {
1054
- description: ( (localize(
1055
- { key: 'vscode.extension.contributes.submenu.icon', comment: ['do not translate or change `\\$(zap)`, \\ in front of $ is important.'] },
1056
- '(Optional) Icon which is used to represent the submenu in the UI. Either a file path, an object with file paths for dark and light themes, or a theme icon references, like `\\$(zap)`'
1057
- ))),
1058
- anyOf: [{
1059
- type: 'string'
1060
- },
1061
- {
1062
- type: 'object',
1063
- properties: {
1064
- light: {
1065
- description: ( (localize(
1066
- 'vscode.extension.contributes.submenu.icon.light',
1067
- 'Icon path when a light theme is used'
1068
- ))),
1069
- type: 'string'
1070
- },
1071
- dark: {
1072
- description: ( (localize(
1073
- 'vscode.extension.contributes.submenu.icon.dark',
1074
- 'Icon path when a dark theme is used'
1075
- ))),
1076
- type: 'string'
1077
- }
1078
- }
1079
- }]
1080
- }
1081
- }
1082
- };
1083
- schema.menusContribution = {
1084
- description: ( (localize(
1085
- 'vscode.extension.contributes.menus',
1086
- "Contributes menu items to the editor"
1087
- ))),
1088
- type: 'object',
1089
- properties: index(apiMenus, menu => menu.key, menu => ({
1090
- markdownDescription: menu.proposed ? ( (localize(
1091
- 'proposed',
1092
- "Proposed API, requires `enabledApiProposal: [\"{0}\"]` - {1}",
1093
- menu.proposed,
1094
- menu.description
1095
- ))) : menu.description,
1096
- type: 'array',
1097
- items: menu.supportsSubmenus === false ? menuItem : { oneOf: [menuItem, submenuItem] }
1098
- })),
1099
- additionalProperties: {
1100
- description: 'Submenu',
1101
- type: 'array',
1102
- items: { oneOf: [menuItem, submenuItem] }
1103
- }
1104
- };
1105
- schema.submenusContribution = {
1106
- description: ( (localize(
1107
- 'vscode.extension.contributes.submenus',
1108
- "Contributes submenu items to the editor"
1109
- ))),
1110
- type: 'array',
1111
- items: submenu
1112
- };
1113
- function isValidCommand(command, collector) {
1114
- if (!command) {
1115
- collector.error(( (localize('nonempty', "expected non-empty value."))));
1116
- return false;
1117
- }
1118
- if (isFalsyOrWhitespace(command.command)) {
1119
- collector.error(( (localize(
1120
- 'requirestring',
1121
- "property `{0}` is mandatory and must be of type `string`",
1122
- 'command'
1123
- ))));
1124
- return false;
1125
- }
1126
- if (!isValidLocalizedString(command.title, collector, 'title')) {
1127
- return false;
1128
- }
1129
- if (command.shortTitle && !isValidLocalizedString(command.shortTitle, collector, 'shortTitle')) {
1130
- return false;
1131
- }
1132
- if (command.enablement && typeof command.enablement !== 'string') {
1133
- collector.error(( (localize(
1134
- 'optstring',
1135
- "property `{0}` can be omitted or must be of type `string`",
1136
- 'precondition'
1137
- ))));
1138
- return false;
1139
- }
1140
- if (command.category && !isValidLocalizedString(command.category, collector, 'category')) {
1141
- return false;
1142
- }
1143
- if (!isValidIcon(command.icon, collector)) {
1144
- return false;
1145
- }
1146
- return true;
1147
- }
1148
- schema.isValidCommand = isValidCommand;
1149
- function isValidIcon(icon, collector) {
1150
- if (typeof icon === 'undefined') {
1151
- return true;
1152
- }
1153
- if (typeof icon === 'string') {
1154
- return true;
1155
- }
1156
- else if (typeof icon.dark === 'string' && typeof icon.light === 'string') {
1157
- return true;
1158
- }
1159
- collector.error(( (localize(
1160
- 'opticon',
1161
- "property `icon` can be omitted or must be either a string or a literal like `{dark, light}`"
1162
- ))));
1163
- return false;
1164
- }
1165
- function isValidLocalizedString(localized, collector, propertyName) {
1166
- if (typeof localized === 'undefined') {
1167
- collector.error(( (localize(
1168
- 'requireStringOrObject',
1169
- "property `{0}` is mandatory and must be of type `string` or `object`",
1170
- propertyName
1171
- ))));
1172
- return false;
1173
- }
1174
- else if (typeof localized === 'string' && isFalsyOrWhitespace(localized)) {
1175
- collector.error(( (localize(
1176
- 'requirestring',
1177
- "property `{0}` is mandatory and must be of type `string`",
1178
- propertyName
1179
- ))));
1180
- return false;
1181
- }
1182
- else if (typeof localized !== 'string' && (isFalsyOrWhitespace(localized.original) || isFalsyOrWhitespace(localized.value))) {
1183
- collector.error(( (localize(
1184
- 'requirestrings',
1185
- "properties `{0}` and `{1}` are mandatory and must be of type `string`",
1186
- `${propertyName}.value`,
1187
- `${propertyName}.original`
1188
- ))));
1189
- return false;
1190
- }
1191
- return true;
1192
- }
1193
- const commandType = {
1194
- type: 'object',
1195
- required: ['command', 'title'],
1196
- properties: {
1197
- command: {
1198
- description: ( (localize(
1199
- 'vscode.extension.contributes.commandType.command',
1200
- 'Identifier of the command to execute'
1201
- ))),
1202
- type: 'string'
1203
- },
1204
- title: {
1205
- description: ( (localize(
1206
- 'vscode.extension.contributes.commandType.title',
1207
- 'Title by which the command is represented in the UI'
1208
- ))),
1209
- type: 'string'
1210
- },
1211
- shortTitle: {
1212
- markdownDescription: ( (localize(
1213
- 'vscode.extension.contributes.commandType.shortTitle',
1214
- '(Optional) Short title by which the command is represented in the UI. Menus pick either `title` or `shortTitle` depending on the context in which they show commands.'
1215
- ))),
1216
- type: 'string'
1217
- },
1218
- category: {
1219
- description: ( (localize(
1220
- 'vscode.extension.contributes.commandType.category',
1221
- '(Optional) Category string by which the command is grouped in the UI'
1222
- ))),
1223
- type: 'string'
1224
- },
1225
- enablement: {
1226
- description: ( (localize(
1227
- 'vscode.extension.contributes.commandType.precondition',
1228
- '(Optional) Condition which must be true to enable the command in the UI (menu and keybindings). Does not prevent executing the command by other means, like the `executeCommand`-api.'
1229
- ))),
1230
- type: 'string'
1231
- },
1232
- icon: {
1233
- description: ( (localize(
1234
- { key: 'vscode.extension.contributes.commandType.icon', comment: ['do not translate or change `\\$(zap)`, \\ in front of $ is important.'] },
1235
- '(Optional) Icon which is used to represent the command in the UI. Either a file path, an object with file paths for dark and light themes, or a theme icon references, like `\\$(zap)`'
1236
- ))),
1237
- anyOf: [{
1238
- type: 'string'
1239
- },
1240
- {
1241
- type: 'object',
1242
- properties: {
1243
- light: {
1244
- description: ( (localize(
1245
- 'vscode.extension.contributes.commandType.icon.light',
1246
- 'Icon path when a light theme is used'
1247
- ))),
1248
- type: 'string'
1249
- },
1250
- dark: {
1251
- description: ( (localize(
1252
- 'vscode.extension.contributes.commandType.icon.dark',
1253
- 'Icon path when a dark theme is used'
1254
- ))),
1255
- type: 'string'
1256
- }
1257
- }
1258
- }]
1259
- }
1260
- }
1261
- };
1262
- schema.commandsContribution = {
1263
- description: ( (localize(
1264
- 'vscode.extension.contributes.commands',
1265
- "Contributes commands to the command palette."
1266
- ))),
1267
- oneOf: [
1268
- commandType,
1269
- {
1270
- type: 'array',
1271
- items: commandType
1272
- }
1273
- ]
1274
- };
1275
- })(schema || (schema = {}))));
1276
- const _commandRegistrations = ( (new DisposableStore()));
1277
- const commandsExtensionPoint = ( (ExtensionsRegistry.registerExtensionPoint({
1278
- extensionPoint: 'commands',
1279
- jsonSchema: schema.commandsContribution,
1280
- activationEventsGenerator: (contribs, result) => {
1281
- for (const contrib of contribs) {
1282
- if (contrib.command) {
1283
- result.push(`onCommand:${contrib.command}`);
1284
- }
1285
- }
1286
- }
1287
- })));
1288
- commandsExtensionPoint.setHandler(extensions => {
1289
- function handleCommand(userFriendlyCommand, extension) {
1290
- if (!schema.isValidCommand(userFriendlyCommand, extension.collector)) {
1291
- return;
1292
- }
1293
- const { icon, enablement, category, title, shortTitle, command } = userFriendlyCommand;
1294
- let absoluteIcon;
1295
- if (icon) {
1296
- if (typeof icon === 'string') {
1297
- absoluteIcon = ThemeIcon.fromString(icon) ?? { dark: joinPath(extension.description.extensionLocation, icon), light: joinPath(extension.description.extensionLocation, icon) };
1298
- }
1299
- else {
1300
- absoluteIcon = {
1301
- dark: joinPath(extension.description.extensionLocation, icon.dark),
1302
- light: joinPath(extension.description.extensionLocation, icon.light)
1303
- };
1304
- }
1305
- }
1306
- if (MenuRegistry.getCommand(command)) {
1307
- extension.collector.info(( (localize(
1308
- 'dup',
1309
- "Command `{0}` appears multiple times in the `commands` section.",
1310
- userFriendlyCommand.command
1311
- ))));
1312
- }
1313
- _commandRegistrations.add(MenuRegistry.addCommand({
1314
- id: command,
1315
- title,
1316
- source: { id: extension.description.identifier.value, title: extension.description.displayName ?? extension.description.name },
1317
- shortTitle,
1318
- tooltip: title,
1319
- category,
1320
- precondition: ContextKeyExpr.deserialize(enablement),
1321
- icon: absoluteIcon
1322
- }));
1323
- }
1324
- _commandRegistrations.clear();
1325
- for (const extension of extensions) {
1326
- const { value } = extension;
1327
- if (Array.isArray(value)) {
1328
- for (const command of value) {
1329
- handleCommand(command, extension);
1330
- }
1331
- }
1332
- else {
1333
- handleCommand(value, extension);
1334
- }
1335
- }
1336
- });
1337
- class KeybindingIO {
1338
- static writeKeybindingItem(out, item) {
1339
- if (!item.resolvedKeybinding) {
1340
- return;
1341
- }
1342
- const quotedSerializedKeybinding = JSON.stringify(item.resolvedKeybinding.getUserSettingsLabel());
1343
- out.write(`{ "key": ${rightPaddedString(quotedSerializedKeybinding + ',', 25)} "command": `);
1344
- const quotedSerializedWhen = item.when ? JSON.stringify(item.when.serialize()) : '';
1345
- const quotedSerializeCommand = JSON.stringify(item.command);
1346
- if (quotedSerializedWhen.length > 0) {
1347
- out.write(`${quotedSerializeCommand},`);
1348
- out.writeLine();
1349
- out.write(` "when": ${quotedSerializedWhen}`);
1350
- }
1351
- else {
1352
- out.write(`${quotedSerializeCommand}`);
1353
- }
1354
- if (item.commandArgs) {
1355
- out.write(',');
1356
- out.writeLine();
1357
- out.write(` "args": ${JSON.stringify(item.commandArgs)}`);
1358
- }
1359
- out.write(' }');
1360
- }
1361
- static readUserKeybindingItem(input) {
1362
- const keybinding = 'key' in input && typeof input.key === 'string'
1363
- ? KeybindingParser.parseKeybinding(input.key)
1364
- : null;
1365
- const when = 'when' in input && typeof input.when === 'string'
1366
- ? ContextKeyExpr.deserialize(input.when)
1367
- : undefined;
1368
- const command = 'command' in input && typeof input.command === 'string'
1369
- ? input.command
1370
- : null;
1371
- const commandArgs = 'args' in input && typeof input.args !== 'undefined'
1372
- ? input.args
1373
- : undefined;
1374
- return {
1375
- keybinding,
1376
- command,
1377
- commandArgs,
1378
- when,
1379
- _sourceKey: 'key' in input && typeof input.key === 'string' ? input.key : undefined,
1380
- };
1381
- }
1382
- }
1383
- function rightPaddedString(str, minChars) {
1384
- if (str.length < minChars) {
1385
- return str + (( (new Array(minChars - str.length))).join(' '));
1386
- }
1387
- return str;
1388
- }
1389
- class OutputBuilder {
1390
- constructor() {
1391
- this._lines = [];
1392
- this._currentLine = '';
1393
- }
1394
- write(str) {
1395
- this._currentLine += str;
1396
- }
1397
- writeLine(str = '') {
1398
- this._lines.push(this._currentLine + str);
1399
- this._currentLine = '';
1400
- }
1401
- toString() {
1402
- this.writeLine();
1403
- return this._lines.join('\n');
1404
- }
1405
- }
1406
- function isValidContributedKeyBinding(keyBinding, rejects) {
1407
- if (!keyBinding) {
1408
- rejects.push(( (localize('nonempty', "expected non-empty value."))));
1409
- return false;
1410
- }
1411
- if (typeof keyBinding.command !== 'string') {
1412
- rejects.push(( (localize(
1413
- 'requirestring',
1414
- "property `{0}` is mandatory and must be of type `string`",
1415
- 'command'
1416
- ))));
1417
- return false;
1418
- }
1419
- if (keyBinding.key && typeof keyBinding.key !== 'string') {
1420
- rejects.push(( (localize(
1421
- 'optstring',
1422
- "property `{0}` can be omitted or must be of type `string`",
1423
- 'key'
1424
- ))));
1425
- return false;
1426
- }
1427
- if (keyBinding.when && typeof keyBinding.when !== 'string') {
1428
- rejects.push(( (localize(
1429
- 'optstring',
1430
- "property `{0}` can be omitted or must be of type `string`",
1431
- 'when'
1432
- ))));
1433
- return false;
1434
- }
1435
- if (keyBinding.mac && typeof keyBinding.mac !== 'string') {
1436
- rejects.push(( (localize(
1437
- 'optstring',
1438
- "property `{0}` can be omitted or must be of type `string`",
1439
- 'mac'
1440
- ))));
1441
- return false;
1442
- }
1443
- if (keyBinding.linux && typeof keyBinding.linux !== 'string') {
1444
- rejects.push(( (localize(
1445
- 'optstring',
1446
- "property `{0}` can be omitted or must be of type `string`",
1447
- 'linux'
1448
- ))));
1449
- return false;
1450
- }
1451
- if (keyBinding.win && typeof keyBinding.win !== 'string') {
1452
- rejects.push(( (localize(
1453
- 'optstring',
1454
- "property `{0}` can be omitted or must be of type `string`",
1455
- 'win'
1456
- ))));
1457
- return false;
1458
- }
1459
- return true;
1460
- }
1461
- const keybindingType = {
1462
- type: 'object',
1463
- default: { command: '', key: '' },
1464
- properties: {
1465
- command: {
1466
- description: ( (localize(
1467
- 'vscode.extension.contributes.keybindings.command',
1468
- 'Identifier of the command to run when keybinding is triggered.'
1469
- ))),
1470
- type: 'string'
1471
- },
1472
- args: {
1473
- description: ( (localize(
1474
- 'vscode.extension.contributes.keybindings.args',
1475
- "Arguments to pass to the command to execute."
1476
- )))
1477
- },
1478
- key: {
1479
- description: ( (localize(
1480
- 'vscode.extension.contributes.keybindings.key',
1481
- 'Key or key sequence (separate keys with plus-sign and sequences with space, e.g. Ctrl+O and Ctrl+L L for a chord).'
1482
- ))),
1483
- type: 'string'
1484
- },
1485
- mac: {
1486
- description: ( (localize(
1487
- 'vscode.extension.contributes.keybindings.mac',
1488
- 'Mac specific key or key sequence.'
1489
- ))),
1490
- type: 'string'
1491
- },
1492
- linux: {
1493
- description: ( (localize(
1494
- 'vscode.extension.contributes.keybindings.linux',
1495
- 'Linux specific key or key sequence.'
1496
- ))),
1497
- type: 'string'
1498
- },
1499
- win: {
1500
- description: ( (localize(
1501
- 'vscode.extension.contributes.keybindings.win',
1502
- 'Windows specific key or key sequence.'
1503
- ))),
1504
- type: 'string'
1505
- },
1506
- when: {
1507
- description: ( (localize(
1508
- 'vscode.extension.contributes.keybindings.when',
1509
- 'Condition when the key is active.'
1510
- ))),
1511
- type: 'string'
1512
- },
1513
- }
1514
- };
1515
- const keybindingsExtPoint = ( (ExtensionsRegistry.registerExtensionPoint({
1516
- extensionPoint: 'keybindings',
1517
- deps: [commandsExtensionPoint],
1518
- jsonSchema: {
1519
- description: ( (localize('vscode.extension.contributes.keybindings', "Contributes keybindings."))),
1520
- oneOf: [
1521
- keybindingType,
1522
- {
1523
- type: 'array',
1524
- items: keybindingType
1525
- }
1526
- ]
1527
- }
1528
- })));
1529
- const NUMPAD_PRINTABLE_SCANCODES = [
1530
- 90 ,
1531
- 91 ,
1532
- 92 ,
1533
- 93 ,
1534
- 95 ,
1535
- 96 ,
1536
- 97 ,
1537
- 98 ,
1538
- 99 ,
1539
- 100 ,
1540
- 101 ,
1541
- 102 ,
1542
- 103 ,
1543
- 104 ,
1544
- 105
1545
- ];
1546
- const otherMacNumpadMapping = ( (new Map()));
1547
- otherMacNumpadMapping.set(95 , 22 );
1548
- otherMacNumpadMapping.set(96 , 23 );
1549
- otherMacNumpadMapping.set(97 , 24 );
1550
- otherMacNumpadMapping.set(98 , 25 );
1551
- otherMacNumpadMapping.set(99 , 26 );
1552
- otherMacNumpadMapping.set(100 , 27 );
1553
- otherMacNumpadMapping.set(101 , 28 );
1554
- otherMacNumpadMapping.set(102 , 29 );
1555
- otherMacNumpadMapping.set(103 , 30 );
1556
- otherMacNumpadMapping.set(104 , 21 );
1557
- let WorkbenchKeybindingService = class WorkbenchKeybindingService extends AbstractKeybindingService {
1558
- constructor(contextKeyService, commandService, telemetryService, notificationService, userDataProfileService, hostService, extensionService, fileService, logService, keyboardLayoutService) {
1559
- super(contextKeyService, commandService, telemetryService, notificationService, logService);
1560
- this.hostService = hostService;
1561
- this.keyboardLayoutService = keyboardLayoutService;
1562
- this._contributions = [];
1563
- this.isComposingGlobalContextKey = contextKeyService.createKey('isComposing', false);
1564
- this.kbsJsonSchema = ( (new KeybindingsJsonSchema()));
1565
- this.updateKeybindingsJsonSchema();
1566
- this._keyboardMapper = this.keyboardLayoutService.getKeyboardMapper();
1567
- this.keyboardLayoutService.onDidChangeKeyboardLayout(() => {
1568
- this._keyboardMapper = this.keyboardLayoutService.getKeyboardMapper();
1569
- this.updateResolver();
1570
- });
1571
- this._cachedResolver = null;
1572
- this.userKeybindings = this._register(( (new UserKeybindings(userDataProfileService, fileService, logService))));
1573
- this.userKeybindings.initialize().then(() => {
1574
- if (this.userKeybindings.keybindings.length) {
1575
- this.updateResolver();
1576
- }
1577
- });
1578
- this._register(this.userKeybindings.onDidChange(() => {
1579
- logService.debug('User keybindings changed');
1580
- this.updateResolver();
1581
- }));
1582
- keybindingsExtPoint.setHandler((extensions) => {
1583
- const keybindings = [];
1584
- for (const extension of extensions) {
1585
- this._handleKeybindingsExtensionPointUser(extension.description.identifier, extension.description.isBuiltin, extension.value, extension.collector, keybindings);
1586
- }
1587
- KeybindingsRegistry.setExtensionKeybindings(keybindings);
1588
- this.updateResolver();
1589
- });
1590
- this.updateKeybindingsJsonSchema();
1591
- this._register(extensionService.onDidRegisterExtensions(() => this.updateKeybindingsJsonSchema()));
1592
- this._register(addDisposableListener(window, EventType.KEY_DOWN, (e) => {
1593
- this.isComposingGlobalContextKey.set(e.isComposing);
1594
- const keyEvent = ( (new StandardKeyboardEvent(e)));
1595
- this._log(`/ Received keydown event - ${printKeyboardEvent(e)}`);
1596
- this._log(`| Converted keydown event - ${printStandardKeyboardEvent(keyEvent)}`);
1597
- const shouldPreventDefault = this._dispatch(keyEvent, keyEvent.target);
1598
- if (shouldPreventDefault) {
1599
- keyEvent.preventDefault();
1600
- }
1601
- this.isComposingGlobalContextKey.set(false);
1602
- }));
1603
- this._register(addDisposableListener(window, EventType.KEY_UP, (e) => {
1604
- this.isComposingGlobalContextKey.set(e.isComposing);
1605
- const keyEvent = ( (new StandardKeyboardEvent(e)));
1606
- const shouldPreventDefault = this._singleModifierDispatch(keyEvent, keyEvent.target);
1607
- if (shouldPreventDefault) {
1608
- keyEvent.preventDefault();
1609
- }
1610
- this.isComposingGlobalContextKey.set(false);
1611
- }));
1612
- this._register(onDidChangeFullscreen(() => {
1613
- const keyboard = navigator.keyboard;
1614
- if (BrowserFeatures.keyboard === 2 ) {
1615
- return;
1616
- }
1617
- if (isFullscreen()) {
1618
- keyboard?.lock(['Escape']);
1619
- }
1620
- else {
1621
- keyboard?.unlock();
1622
- }
1623
- this._cachedResolver = null;
1624
- this._onDidUpdateKeybindings.fire();
1625
- }));
1626
- }
1627
- registerSchemaContribution(contribution) {
1628
- this._contributions.push(contribution);
1629
- if (contribution.onDidChange) {
1630
- this._register(contribution.onDidChange(() => this.updateKeybindingsJsonSchema()));
1631
- }
1632
- this.updateKeybindingsJsonSchema();
1633
- }
1634
- updateKeybindingsJsonSchema() {
1635
- this.kbsJsonSchema.updateSchema(this._contributions.flatMap(x => x.getSchemaAdditions()));
1636
- }
1637
- _printKeybinding(keybinding) {
1638
- return UserSettingsLabelProvider.toLabel(OS, keybinding.chords, (chord) => {
1639
- if (chord instanceof KeyCodeChord) {
1640
- return (
1641
- (KeyCodeUtils.toString(chord.keyCode))
1642
- );
1643
- }
1644
- return (
1645
- (ScanCodeUtils.toString(chord.scanCode))
1646
- );
1647
- }) || '[null]';
1648
- }
1649
- _printResolvedKeybinding(resolvedKeybinding) {
1650
- return ( (resolvedKeybinding.getDispatchChords().map(x => x || '[null]'))).join(' ');
1651
- }
1652
- _printResolvedKeybindings(output, input, resolvedKeybindings) {
1653
- const padLength = 35;
1654
- const firstRow = `${input.padStart(padLength, ' ')} => `;
1655
- if (resolvedKeybindings.length === 0) {
1656
- output.push(`${firstRow}${'[NO BINDING]'.padStart(padLength, ' ')}`);
1657
- return;
1658
- }
1659
- for (const resolvedKeybinding of resolvedKeybindings) {
1660
- {
1661
- output.push(`${firstRow}${this._printResolvedKeybinding(resolvedKeybinding).padStart(padLength, ' ')}`);
1662
- }
1663
- }
1664
- }
1665
- _dumpResolveKeybindingDebugInfo() {
1666
- const seenBindings = ( (new Set()));
1667
- const result = [];
1668
- result.push(`Default Resolved Keybindings (unique only):`);
1669
- for (const item of KeybindingsRegistry.getDefaultKeybindings()) {
1670
- if (!item.keybinding) {
1671
- continue;
1672
- }
1673
- const input = this._printKeybinding(item.keybinding);
1674
- if (seenBindings.has(input)) {
1675
- continue;
1676
- }
1677
- seenBindings.add(input);
1678
- const resolvedKeybindings = this._keyboardMapper.resolveKeybinding(item.keybinding);
1679
- this._printResolvedKeybindings(result, input, resolvedKeybindings);
1680
- }
1681
- result.push(`User Resolved Keybindings (unique only):`);
1682
- for (const item of this.userKeybindings.keybindings) {
1683
- if (!item.keybinding) {
1684
- continue;
1685
- }
1686
- const input = item._sourceKey ?? 'Impossible: missing source key, but has keybinding';
1687
- if (seenBindings.has(input)) {
1688
- continue;
1689
- }
1690
- seenBindings.add(input);
1691
- const resolvedKeybindings = this._keyboardMapper.resolveKeybinding(item.keybinding);
1692
- this._printResolvedKeybindings(result, input, resolvedKeybindings);
1693
- }
1694
- return result.join('\n');
1695
- }
1696
- _dumpDebugInfo() {
1697
- const layoutInfo = JSON.stringify(this.keyboardLayoutService.getCurrentKeyboardLayout(), null, '\t');
1698
- const mapperInfo = this._keyboardMapper.dumpDebugInfo();
1699
- const resolvedKeybindings = this._dumpResolveKeybindingDebugInfo();
1700
- const rawMapping = JSON.stringify(this.keyboardLayoutService.getRawKeyboardMapping(), null, '\t');
1701
- return `Layout info:\n${layoutInfo}\n\n${resolvedKeybindings}\n\n${mapperInfo}\n\nRaw mapping:\n${rawMapping}`;
1702
- }
1703
- _dumpDebugInfoJSON() {
1704
- const info = {
1705
- layout: this.keyboardLayoutService.getCurrentKeyboardLayout(),
1706
- rawMapping: this.keyboardLayoutService.getRawKeyboardMapping()
1707
- };
1708
- return JSON.stringify(info, null, '\t');
1709
- }
1710
- customKeybindingsCount() {
1711
- return this.userKeybindings.keybindings.length;
1712
- }
1713
- updateResolver() {
1714
- this._cachedResolver = null;
1715
- this._onDidUpdateKeybindings.fire();
1716
- }
1717
- _getResolver() {
1718
- if (!this._cachedResolver) {
1719
- const defaults = this._resolveKeybindingItems(KeybindingsRegistry.getDefaultKeybindings(), true);
1720
- const overrides = this._resolveUserKeybindingItems(this.userKeybindings.keybindings, false);
1721
- this._cachedResolver = ( (new KeybindingResolver(defaults, overrides, (str) => this._log(str))));
1722
- }
1723
- return this._cachedResolver;
1724
- }
1725
- _documentHasFocus() {
1726
- return this.hostService.hasFocus;
1727
- }
1728
- _resolveKeybindingItems(items, isDefault) {
1729
- const result = [];
1730
- let resultLen = 0;
1731
- for (const item of items) {
1732
- const when = item.when || undefined;
1733
- const keybinding = item.keybinding;
1734
- if (!keybinding) {
1735
- result[resultLen++] = ( (new ResolvedKeybindingItem(
1736
- undefined,
1737
- item.command,
1738
- item.commandArgs,
1739
- when,
1740
- isDefault,
1741
- item.extensionId,
1742
- item.isBuiltinExtension
1743
- )));
1744
- }
1745
- else {
1746
- if (this._assertBrowserConflicts(keybinding)) {
1747
- continue;
1748
- }
1749
- const resolvedKeybindings = this._keyboardMapper.resolveKeybinding(keybinding);
1750
- for (let i = resolvedKeybindings.length - 1; i >= 0; i--) {
1751
- const resolvedKeybinding = resolvedKeybindings[i];
1752
- result[resultLen++] = ( (new ResolvedKeybindingItem(
1753
- resolvedKeybinding,
1754
- item.command,
1755
- item.commandArgs,
1756
- when,
1757
- isDefault,
1758
- item.extensionId,
1759
- item.isBuiltinExtension
1760
- )));
1761
- }
1762
- }
1763
- }
1764
- return result;
1765
- }
1766
- _resolveUserKeybindingItems(items, isDefault) {
1767
- const result = [];
1768
- let resultLen = 0;
1769
- for (const item of items) {
1770
- const when = item.when || undefined;
1771
- if (!item.keybinding) {
1772
- result[resultLen++] = ( (new ResolvedKeybindingItem(undefined, item.command, item.commandArgs, when, isDefault, null, false)));
1773
- }
1774
- else {
1775
- const resolvedKeybindings = this._keyboardMapper.resolveKeybinding(item.keybinding);
1776
- for (const resolvedKeybinding of resolvedKeybindings) {
1777
- result[resultLen++] = ( (new ResolvedKeybindingItem(
1778
- resolvedKeybinding,
1779
- item.command,
1780
- item.commandArgs,
1781
- when,
1782
- isDefault,
1783
- null,
1784
- false
1785
- )));
1786
- }
1787
- }
1788
- }
1789
- return result;
1790
- }
1791
- _assertBrowserConflicts(keybinding) {
1792
- if (BrowserFeatures.keyboard === 0 ) {
1793
- return false;
1794
- }
1795
- if (BrowserFeatures.keyboard === 1 && isFullscreen()) {
1796
- return false;
1797
- }
1798
- for (const chord of keybinding.chords) {
1799
- if (!chord.metaKey && !chord.altKey && !chord.ctrlKey && !chord.shiftKey) {
1800
- continue;
1801
- }
1802
- const modifiersMask = 2048 | 512 | 1024 ;
1803
- let partModifiersMask = 0;
1804
- if (chord.metaKey) {
1805
- partModifiersMask |= 2048 ;
1806
- }
1807
- if (chord.shiftKey) {
1808
- partModifiersMask |= 1024 ;
1809
- }
1810
- if (chord.altKey) {
1811
- partModifiersMask |= 512 ;
1812
- }
1813
- if (chord.ctrlKey && OS === 2 ) {
1814
- partModifiersMask |= 256 ;
1815
- }
1816
- if ((partModifiersMask & modifiersMask) === ((2048 | 512) )) {
1817
- if (chord instanceof ScanCodeChord && ((chord.scanCode === 86 || chord.scanCode === 85) )) {
1818
- return true;
1819
- }
1820
- if (chord instanceof KeyCodeChord && ((chord.keyCode === 15 || chord.keyCode === 17) )) {
1821
- return true;
1822
- }
1823
- }
1824
- if ((partModifiersMask & modifiersMask) === 2048 ) {
1825
- if (chord instanceof ScanCodeChord && ((chord.scanCode >= 36 && chord.scanCode <= 45) )) {
1826
- return true;
1827
- }
1828
- if (chord instanceof KeyCodeChord && ((chord.keyCode >= 21 && chord.keyCode <= 30) )) {
1829
- return true;
1830
- }
1831
- }
1832
- }
1833
- return false;
1834
- }
1835
- resolveKeybinding(kb) {
1836
- return this._keyboardMapper.resolveKeybinding(kb);
1837
- }
1838
- resolveKeyboardEvent(keyboardEvent) {
1839
- this.keyboardLayoutService.validateCurrentKeyboardMapping(keyboardEvent);
1840
- return this._keyboardMapper.resolveKeyboardEvent(keyboardEvent);
1841
- }
1842
- resolveUserBinding(userBinding) {
1843
- const keybinding = KeybindingParser.parseKeybinding(userBinding);
1844
- return (keybinding ? this._keyboardMapper.resolveKeybinding(keybinding) : []);
1845
- }
1846
- _handleKeybindingsExtensionPointUser(extensionId, isBuiltin, keybindings, collector, result) {
1847
- if (Array.isArray(keybindings)) {
1848
- for (let i = 0, len = keybindings.length; i < len; i++) {
1849
- this._handleKeybinding(extensionId, isBuiltin, i + 1, keybindings[i], collector, result);
1850
- }
1851
- }
1852
- else {
1853
- this._handleKeybinding(extensionId, isBuiltin, 1, keybindings, collector, result);
1854
- }
1855
- }
1856
- _handleKeybinding(extensionId, isBuiltin, idx, keybindings, collector, result) {
1857
- const rejects = [];
1858
- if (isValidContributedKeyBinding(keybindings, rejects)) {
1859
- const rule = this._asCommandRule(extensionId, isBuiltin, idx++, keybindings);
1860
- if (rule) {
1861
- result.push(rule);
1862
- }
1863
- }
1864
- if (rejects.length > 0) {
1865
- collector.error(( (localize(
1866
- 'invalid.keybindings',
1867
- "Invalid `contributes.{0}`: {1}",
1868
- keybindingsExtPoint.name,
1869
- rejects.join('\n')
1870
- ))));
1871
- }
1872
- }
1873
- static bindToCurrentPlatform(key, mac, linux, win) {
1874
- if (OS === 1 && win) {
1875
- if (win) {
1876
- return win;
1877
- }
1878
- }
1879
- else if (OS === 2 ) {
1880
- if (mac) {
1881
- return mac;
1882
- }
1883
- }
1884
- else {
1885
- if (linux) {
1886
- return linux;
1887
- }
1888
- }
1889
- return key;
1890
- }
1891
- _asCommandRule(extensionId, isBuiltin, idx, binding) {
1892
- const { command, args, when, key, mac, linux, win } = binding;
1893
- const keybinding = WorkbenchKeybindingService.bindToCurrentPlatform(key, mac, linux, win);
1894
- if (!keybinding) {
1895
- return undefined;
1896
- }
1897
- let weight;
1898
- if (isBuiltin) {
1899
- weight = 300 + idx;
1900
- }
1901
- else {
1902
- weight = 400 + idx;
1903
- }
1904
- const commandAction = MenuRegistry.getCommand(command);
1905
- const precondition = commandAction && commandAction.precondition;
1906
- let fullWhen;
1907
- if (when && precondition) {
1908
- fullWhen = ( (ContextKeyExpr.and(precondition, ContextKeyExpr.deserialize(when))));
1909
- }
1910
- else if (when) {
1911
- fullWhen = ContextKeyExpr.deserialize(when);
1912
- }
1913
- else if (precondition) {
1914
- fullWhen = precondition;
1915
- }
1916
- const desc = {
1917
- id: command,
1918
- args,
1919
- when: fullWhen,
1920
- weight: weight,
1921
- keybinding: KeybindingParser.parseKeybinding(keybinding),
1922
- extensionId: extensionId.value,
1923
- isBuiltinExtension: isBuiltin
1924
- };
1925
- return desc;
1926
- }
1927
- getDefaultKeybindingsContent() {
1928
- const resolver = this._getResolver();
1929
- const defaultKeybindings = resolver.getDefaultKeybindings();
1930
- const boundCommands = resolver.getDefaultBoundCommands();
1931
- return (WorkbenchKeybindingService._getDefaultKeybindings(defaultKeybindings)
1932
- + '\n\n'
1933
- + WorkbenchKeybindingService._getAllCommandsAsComment(boundCommands));
1934
- }
1935
- static _getDefaultKeybindings(defaultKeybindings) {
1936
- const out = ( (new OutputBuilder()));
1937
- out.writeLine('[');
1938
- const lastIndex = defaultKeybindings.length - 1;
1939
- defaultKeybindings.forEach((k, index) => {
1940
- KeybindingIO.writeKeybindingItem(out, k);
1941
- if (index !== lastIndex) {
1942
- out.writeLine(',');
1943
- }
1944
- else {
1945
- out.writeLine();
1946
- }
1947
- });
1948
- out.writeLine(']');
1949
- return (
1950
- (out.toString())
1951
- );
1952
- }
1953
- static _getAllCommandsAsComment(boundCommands) {
1954
- const unboundCommands = getAllUnboundCommands(boundCommands);
1955
- const pretty = unboundCommands.sort().join('\n// - ');
1956
- return '// ' + ( (localize('unboundCommands', "Here are other available commands: "))) + '\n// - ' + pretty;
1957
- }
1958
- mightProducePrintableCharacter(event) {
1959
- if (event.ctrlKey || event.metaKey || event.altKey) {
1960
- return false;
1961
- }
1962
- const code = ScanCodeUtils.toEnum(event.code);
1963
- if (NUMPAD_PRINTABLE_SCANCODES.indexOf(code) !== -1) {
1964
- if (event.keyCode === IMMUTABLE_CODE_TO_KEY_CODE[code]) {
1965
- return true;
1966
- }
1967
- if (isMacintosh && event.keyCode === otherMacNumpadMapping.get(code)) {
1968
- return true;
1969
- }
1970
- return false;
1971
- }
1972
- const keycode = IMMUTABLE_CODE_TO_KEY_CODE[code];
1973
- if (keycode !== -1) {
1974
- return false;
1975
- }
1976
- const mapping = this.keyboardLayoutService.getRawKeyboardMapping();
1977
- if (!mapping) {
1978
- return false;
1979
- }
1980
- const keyInfo = mapping[event.code];
1981
- if (!keyInfo) {
1982
- return false;
1983
- }
1984
- if (!keyInfo.value || /\s/.test(keyInfo.value)) {
1985
- return false;
1986
- }
1987
- return true;
1988
- }
1989
- };
1990
- WorkbenchKeybindingService = ( (__decorate([
1991
- ( (__param(0, IContextKeyService))),
1992
- ( (__param(1, ICommandService))),
1993
- ( (__param(2, ITelemetryService))),
1994
- ( (__param(3, INotificationService))),
1995
- ( (__param(4, IUserDataProfileService))),
1996
- ( (__param(5, IHostService))),
1997
- ( (__param(6, IExtensionService))),
1998
- ( (__param(7, IFileService))),
1999
- ( (__param(8, ILogService))),
2000
- ( (__param(9, IKeyboardLayoutService)))
2001
- ], WorkbenchKeybindingService)));
2002
- class UserKeybindings extends Disposable {
2003
- get keybindings() { return this._keybindings; }
2004
- constructor(userDataProfileService, fileService, logService) {
2005
- super();
2006
- this.userDataProfileService = userDataProfileService;
2007
- this.fileService = fileService;
2008
- this._rawKeybindings = [];
2009
- this._keybindings = [];
2010
- this.watchDisposables = this._register(( (new DisposableStore())));
2011
- this._onDidChange = this._register(( (new Emitter())));
2012
- this.onDidChange = this._onDidChange.event;
2013
- this.watch();
2014
- this.reloadConfigurationScheduler = this._register(( (new RunOnceScheduler(() => this.reload().then(changed => {
2015
- if (changed) {
2016
- this._onDidChange.fire();
2017
- }
2018
- }), 50))));
2019
- this._register(Event.filter(this.fileService.onDidFilesChange, e => e.contains(this.userDataProfileService.currentProfile.keybindingsResource))(() => {
2020
- logService.debug('Keybindings file changed');
2021
- this.reloadConfigurationScheduler.schedule();
2022
- }));
2023
- this._register(this.fileService.onDidRunOperation((e) => {
2024
- if (e.operation === 4 && ( (e.resource.toString())) === ( (this.userDataProfileService.currentProfile.keybindingsResource.toString()))) {
2025
- logService.debug('Keybindings file written');
2026
- this.reloadConfigurationScheduler.schedule();
2027
- }
2028
- }));
2029
- this._register(userDataProfileService.onDidChangeCurrentProfile(e => e.join(this.whenCurrentProfileChanged(e))));
2030
- }
2031
- async whenCurrentProfileChanged(e) {
2032
- if (e.preserveData) {
2033
- if (await this.fileService.exists(e.previous.keybindingsResource)) {
2034
- await this.fileService.copy(e.previous.keybindingsResource, e.profile.keybindingsResource);
2035
- }
2036
- }
2037
- this.watch();
2038
- this.reloadConfigurationScheduler.schedule();
2039
- }
2040
- watch() {
2041
- this.watchDisposables.clear();
2042
- this.watchDisposables.add(this.fileService.watch(dirname(this.userDataProfileService.currentProfile.keybindingsResource)));
2043
- this.watchDisposables.add(this.fileService.watch(this.userDataProfileService.currentProfile.keybindingsResource));
2044
- }
2045
- async initialize() {
2046
- await this.reload();
2047
- }
2048
- async reload() {
2049
- const newKeybindings = await this.readUserKeybindings();
2050
- if (equals(this._rawKeybindings, newKeybindings)) {
2051
- return false;
2052
- }
2053
- this._rawKeybindings = newKeybindings;
2054
- this._keybindings = ( (this._rawKeybindings.map((k) => KeybindingIO.readUserKeybindingItem(k))));
2055
- return true;
2056
- }
2057
- async readUserKeybindings() {
2058
- try {
2059
- const content = await this.fileService.readFile(this.userDataProfileService.currentProfile.keybindingsResource);
2060
- const value = parse$1(( (content.value.toString())));
2061
- return Array.isArray(value)
2062
- ? value.filter(v => v && typeof v === 'object' )
2063
- : [];
2064
- }
2065
- catch (e) {
2066
- return [];
2067
- }
2068
- }
2069
- }
2070
- class KeybindingsJsonSchema {
2071
- constructor() {
2072
- this.commandsSchemas = [];
2073
- this.commandsEnum = [];
2074
- this.removalCommandsEnum = [];
2075
- this.commandsEnumDescriptions = [];
2076
- this.schema = {
2077
- id: KeybindingsJsonSchema.schemaId,
2078
- type: 'array',
2079
- title: ( (localize('keybindings.json.title', "Keybindings configuration"))),
2080
- allowTrailingCommas: true,
2081
- allowComments: true,
2082
- definitions: {
2083
- 'editorGroupsSchema': {
2084
- 'type': 'array',
2085
- 'items': {
2086
- 'type': 'object',
2087
- 'properties': {
2088
- 'groups': {
2089
- '$ref': '#/definitions/editorGroupsSchema',
2090
- 'default': [{}, {}]
2091
- },
2092
- 'size': {
2093
- 'type': 'number',
2094
- 'default': 0.5
2095
- }
2096
- }
2097
- }
2098
- },
2099
- 'commandNames': {
2100
- 'type': 'string',
2101
- 'enum': this.commandsEnum,
2102
- 'enumDescriptions': this.commandsEnumDescriptions,
2103
- 'description': ( (localize('keybindings.json.command', "Name of the command to execute"))),
2104
- },
2105
- 'commandType': {
2106
- 'anyOf': [
2107
- {
2108
- $ref: '#/definitions/commandNames'
2109
- },
2110
- {
2111
- 'type': 'string',
2112
- 'enum': this.removalCommandsEnum,
2113
- 'enumDescriptions': this.commandsEnumDescriptions,
2114
- 'description': ( (localize(
2115
- 'keybindings.json.removalCommand',
2116
- "Name of the command to remove keyboard shortcut for"
2117
- ))),
2118
- },
2119
- {
2120
- 'type': 'string'
2121
- },
2122
- ]
2123
- },
2124
- 'commandsSchemas': {
2125
- 'allOf': this.commandsSchemas
2126
- }
2127
- },
2128
- items: {
2129
- 'required': ['key'],
2130
- 'type': 'object',
2131
- 'defaultSnippets': [{ 'body': { 'key': '$1', 'command': '$2', 'when': '$3' } }],
2132
- 'properties': {
2133
- 'key': {
2134
- 'type': 'string',
2135
- 'description': ( (localize('keybindings.json.key', "Key or key sequence (separated by space)"))),
2136
- },
2137
- 'command': {
2138
- 'anyOf': [
2139
- {
2140
- 'if': {
2141
- 'type': 'array'
2142
- },
2143
- 'then': {
2144
- 'not': {
2145
- 'type': 'array'
2146
- },
2147
- 'errorMessage': ( (localize(
2148
- 'keybindings.commandsIsArray',
2149
- "Incorrect type. Expected \"{0}\". The field 'command' does not support running multiple commands. Use command 'runCommands' to pass it multiple commands to run.",
2150
- 'string'
2151
- )))
2152
- },
2153
- 'else': {
2154
- '$ref': '#/definitions/commandType'
2155
- }
2156
- },
2157
- {
2158
- '$ref': '#/definitions/commandType'
2159
- }
2160
- ]
2161
- },
2162
- 'when': {
2163
- 'type': 'string',
2164
- 'description': ( (localize('keybindings.json.when', "Condition when the key is active.")))
2165
- },
2166
- 'args': {
2167
- 'description': ( (localize('keybindings.json.args', "Arguments to pass to the command to execute.")))
2168
- }
2169
- },
2170
- '$ref': '#/definitions/commandsSchemas'
2171
- }
2172
- };
2173
- this.schemaRegistry = ( (Registry.as(Extensions$2.JSONContribution)));
2174
- this.schemaRegistry.registerSchema(KeybindingsJsonSchema.schemaId, this.schema);
2175
- }
2176
- updateSchema(additionalContributions) {
2177
- this.commandsSchemas.length = 0;
2178
- this.commandsEnum.length = 0;
2179
- this.removalCommandsEnum.length = 0;
2180
- this.commandsEnumDescriptions.length = 0;
2181
- const knownCommands = ( (new Set()));
2182
- const addKnownCommand = (commandId, description) => {
2183
- if (!/^_/.test(commandId)) {
2184
- if (!knownCommands.has(commandId)) {
2185
- knownCommands.add(commandId);
2186
- this.commandsEnum.push(commandId);
2187
- this.commandsEnumDescriptions.push(description);
2188
- this.removalCommandsEnum.push(`-${commandId}`);
2189
- }
2190
- }
2191
- };
2192
- const allCommands = CommandsRegistry.getCommands();
2193
- for (const [commandId, command] of allCommands) {
2194
- const commandDescription = command.description;
2195
- addKnownCommand(commandId, commandDescription ? commandDescription.description : undefined);
2196
- if (!commandDescription || !commandDescription.args || commandDescription.args.length !== 1 || !commandDescription.args[0].schema) {
2197
- continue;
2198
- }
2199
- const argsSchema = commandDescription.args[0].schema;
2200
- const argsRequired = ((typeof commandDescription.args[0].isOptional !== 'undefined')
2201
- ? (!commandDescription.args[0].isOptional)
2202
- : (Array.isArray(argsSchema.required) && argsSchema.required.length > 0));
2203
- const addition = {
2204
- 'if': {
2205
- 'required': ['command'],
2206
- 'properties': {
2207
- 'command': { 'const': commandId }
2208
- }
2209
- },
2210
- 'then': {
2211
- 'required': [].concat(argsRequired ? ['args'] : []),
2212
- 'properties': {
2213
- 'args': argsSchema
2214
- }
2215
- }
2216
- };
2217
- this.commandsSchemas.push(addition);
2218
- }
2219
- const menuCommands = MenuRegistry.getCommands();
2220
- for (const commandId of ( (menuCommands.keys()))) {
2221
- addKnownCommand(commandId);
2222
- }
2223
- this.commandsSchemas.push(...additionalContributions);
2224
- this.schemaRegistry.notifySchemaChanged(KeybindingsJsonSchema.schemaId);
2225
- }
2226
- }
2227
- KeybindingsJsonSchema.schemaId = 'vscode://schemas/keybindings';
2228
- let CommandsQuickAccessProvider = class CommandsQuickAccessProvider extends AbstractEditorCommandsQuickAccessProvider {
2229
- get activeTextEditorControl() { return this.editorService.activeTextEditorControl; }
2230
- get defaultFilterValue() {
2231
- if (this.configuration.preserveInput) {
2232
- return DefaultQuickAccessFilterValue.LAST;
2233
- }
2234
- return undefined;
2235
- }
2236
- constructor(editorService, menuService, extensionService, instantiationService, keybindingService, commandService, telemetryService, dialogService, configurationService, editorGroupService, preferencesService, productService) {
2237
- super({
2238
- showAlias: !Language.isDefaultVariant(),
2239
- noResultsPick: {
2240
- label: ( (localize('noCommandResults', "No matching commands"))),
2241
- commandId: ''
2242
- }
2243
- }, instantiationService, keybindingService, commandService, telemetryService, dialogService);
2244
- this.editorService = editorService;
2245
- this.menuService = menuService;
2246
- this.extensionService = extensionService;
2247
- this.configurationService = configurationService;
2248
- this.editorGroupService = editorGroupService;
2249
- this.preferencesService = preferencesService;
2250
- this.productService = productService;
2251
- this.extensionRegistrationRace = Promise.race([
2252
- timeout(800),
2253
- this.extensionService.whenInstalledExtensionsRegistered()
2254
- ]);
2255
- this._register(configurationService.onDidChangeConfiguration((e) => this.updateSuggestedCommandIds(e)));
2256
- this.updateSuggestedCommandIds();
2257
- }
2258
- get configuration() {
2259
- const commandPaletteConfig = this.configurationService.getValue().workbench.commandPalette;
2260
- return {
2261
- preserveInput: commandPaletteConfig.preserveInput,
2262
- experimental: commandPaletteConfig.experimental
2263
- };
2264
- }
2265
- updateSuggestedCommandIds(e) {
2266
- if (e && !e.affectsConfiguration('workbench.commandPalette.experimental.suggestCommands')) {
2267
- return;
2268
- }
2269
- const config = this.configuration;
2270
- const suggestedCommandIds = config.experimental.suggestCommands && this.productService.commandPaletteSuggestedCommandIds?.length
2271
- ? ( (new Set(this.productService.commandPaletteSuggestedCommandIds)))
2272
- : undefined;
2273
- this.options.suggestedCommandIds = suggestedCommandIds;
2274
- }
2275
- async getCommandPicks(token) {
2276
- await this.extensionRegistrationRace;
2277
- if (token.isCancellationRequested) {
2278
- return [];
2279
- }
2280
- return (
2281
- ([
2282
- ...this.getCodeEditorCommandPicks(),
2283
- ...this.getGlobalCommandPicks()
2284
- ].map(c => ({
2285
- ...c,
2286
- buttons: [{
2287
- iconClass: ThemeIcon.asClassName(Codicon.gear),
2288
- tooltip: ( (localize('configure keybinding', "Configure Keybinding"))),
2289
- }],
2290
- trigger: () => {
2291
- this.preferencesService.openGlobalKeybindingSettings(false, { query: `@command:${c.commandId}` });
2292
- return TriggerAction.CLOSE_PICKER;
2293
- },
2294
- })))
2295
- );
2296
- }
2297
- getGlobalCommandPicks() {
2298
- const globalCommandPicks = [];
2299
- const scopedContextKeyService = this.editorService.activeEditorPane?.scopedContextKeyService || this.editorGroupService.activeGroup.scopedContextKeyService;
2300
- const globalCommandsMenu = this.menuService.createMenu(MenuId.CommandPalette, scopedContextKeyService);
2301
- const globalCommandsMenuActions = globalCommandsMenu.getActions()
2302
- .reduce((r, [, actions]) => [...r, ...actions], [])
2303
- .filter(action => action instanceof MenuItemAction && action.enabled);
2304
- for (const action of globalCommandsMenuActions) {
2305
- let label = (typeof action.item.title === 'string' ? action.item.title : action.item.title.value) || action.item.id;
2306
- const category = typeof action.item.category === 'string' ? action.item.category : action.item.category?.value;
2307
- if (category) {
2308
- label = ( (localize('commandWithCategory', "{0}: {1}", category, label)));
2309
- }
2310
- const aliasLabel = typeof action.item.title !== 'string' ? action.item.title.original : undefined;
2311
- const aliasCategory = (category && action.item.category && typeof action.item.category !== 'string') ? action.item.category.original : undefined;
2312
- const commandAlias = (aliasLabel && category) ?
2313
- aliasCategory ? `${aliasCategory}: ${aliasLabel}` : `${category}: ${aliasLabel}` :
2314
- aliasLabel;
2315
- globalCommandPicks.push({
2316
- commandId: action.item.id,
2317
- commandAlias,
2318
- label: stripIcons(label)
2319
- });
2320
- }
2321
- globalCommandsMenu.dispose();
2322
- return globalCommandPicks;
2323
- }
2324
- };
2325
- CommandsQuickAccessProvider = ( (__decorate([
2326
- ( (__param(0, IEditorService))),
2327
- ( (__param(1, IMenuService))),
2328
- ( (__param(2, IExtensionService))),
2329
- ( (__param(3, IInstantiationService))),
2330
- ( (__param(4, IKeybindingService))),
2331
- ( (__param(5, ICommandService))),
2332
- ( (__param(6, ITelemetryService))),
2333
- ( (__param(7, IDialogService))),
2334
- ( (__param(8, IConfigurationService))),
2335
- ( (__param(9, IEditorGroupsService))),
2336
- ( (__param(10, IPreferencesService))),
2337
- ( (__param(11, IProductService)))
2338
- ], CommandsQuickAccessProvider)));
2339
- class ShowAllCommandsAction extends Action2 {
2340
- constructor() {
2341
- super({
2342
- id: ShowAllCommandsAction.ID,
2343
- title: { value: ( (localize('showTriggerActions', "Show All Commands"))), original: 'Show All Commands' },
2344
- keybinding: {
2345
- weight: 200 ,
2346
- when: undefined,
2347
- primary: !isFirefox ? ((2048 | 1024 | 46) ) : undefined,
2348
- secondary: [59 ]
2349
- },
2350
- f1: true
2351
- });
2352
- }
2353
- async run(accessor) {
2354
- accessor.get(IQuickInputService).quickAccess.show(CommandsQuickAccessProvider.PREFIX);
2355
- }
2356
- }
2357
- ShowAllCommandsAction.ID = 'workbench.action.showCommands';
2358
- function deserializeMapping(serializedMapping) {
2359
- const mapping = serializedMapping;
2360
- const ret = {};
2361
- for (const key in mapping) {
2362
- const result = mapping[key];
2363
- if (result.length) {
2364
- const value = result[0];
2365
- const withShift = result[1];
2366
- const withAltGr = result[2];
2367
- const withShiftAltGr = result[3];
2368
- const mask = Number(result[4]);
2369
- const vkey = result.length === 6 ? result[5] : undefined;
2370
- ret[key] = {
2371
- 'value': value,
2372
- 'vkey': vkey,
2373
- 'withShift': withShift,
2374
- 'withAltGr': withAltGr,
2375
- 'withShiftAltGr': withShiftAltGr,
2376
- 'valueIsDeadKey': (mask & 1) > 0,
2377
- 'withShiftIsDeadKey': (mask & 2) > 0,
2378
- 'withAltGrIsDeadKey': (mask & 4) > 0,
2379
- 'withShiftAltGrIsDeadKey': (mask & 8) > 0
2380
- };
2381
- }
2382
- else {
2383
- ret[key] = {
2384
- 'value': '',
2385
- 'valueIsDeadKey': false,
2386
- 'withShift': '',
2387
- 'withShiftIsDeadKey': false,
2388
- 'withAltGr': '',
2389
- 'withAltGrIsDeadKey': false,
2390
- 'withShiftAltGr': '',
2391
- 'withShiftAltGrIsDeadKey': false
2392
- };
2393
- }
2394
- }
2395
- return ret;
2396
- }
2397
- class KeymapInfo {
2398
- constructor(layout, secondaryLayouts, keyboardMapping, isUserKeyboardLayout) {
2399
- this.layout = layout;
2400
- this.secondaryLayouts = secondaryLayouts;
2401
- this.mapping = deserializeMapping(keyboardMapping);
2402
- this.isUserKeyboardLayout = !!isUserKeyboardLayout;
2403
- this.layout.isUserKeyboardLayout = !!isUserKeyboardLayout;
2404
- }
2405
- static createKeyboardLayoutFromDebugInfo(layout, value, isUserKeyboardLayout) {
2406
- const keyboardLayoutInfo = ( (new KeymapInfo(layout, [], {}, true)));
2407
- keyboardLayoutInfo.mapping = value;
2408
- return keyboardLayoutInfo;
2409
- }
2410
- update(other) {
2411
- this.layout = other.layout;
2412
- this.secondaryLayouts = other.secondaryLayouts;
2413
- this.mapping = other.mapping;
2414
- this.isUserKeyboardLayout = other.isUserKeyboardLayout;
2415
- this.layout.isUserKeyboardLayout = other.isUserKeyboardLayout;
2416
- }
2417
- getScore(other) {
2418
- let score = 0;
2419
- for (const key in other) {
2420
- if (isWindows && (key === 'Backslash' || key === 'KeyQ')) {
2421
- continue;
2422
- }
2423
- if (isLinux && (key === 'Backspace' || key === 'Escape')) {
2424
- continue;
2425
- }
2426
- const currentMapping = this.mapping[key];
2427
- if (currentMapping === undefined) {
2428
- score -= 1;
2429
- }
2430
- const otherMapping = other[key];
2431
- if (currentMapping && otherMapping && currentMapping.value !== otherMapping.value) {
2432
- score -= 1;
2433
- }
2434
- }
2435
- return score;
2436
- }
2437
- equal(other) {
2438
- if (this.isUserKeyboardLayout !== other.isUserKeyboardLayout) {
2439
- return false;
2440
- }
2441
- if (getKeyboardLayoutId(this.layout) !== getKeyboardLayoutId(other.layout)) {
2442
- return false;
2443
- }
2444
- return this.fuzzyEqual(other.mapping);
2445
- }
2446
- fuzzyEqual(other) {
2447
- for (const key in other) {
2448
- if (isWindows && (key === 'Backslash' || key === 'KeyQ')) {
2449
- continue;
2450
- }
2451
- if (this.mapping[key] === undefined) {
2452
- return false;
2453
- }
2454
- const currentMapping = this.mapping[key];
2455
- const otherMapping = other[key];
2456
- if (currentMapping.value !== otherMapping.value) {
2457
- return false;
2458
- }
2459
- }
2460
- return true;
2461
- }
2462
- }
2463
- function readKeyboardConfig(configurationService) {
2464
- const keyboard = configurationService.getValue('keyboard');
2465
- const dispatch = ((keyboard?.dispatch === 'keyCode' ? 1 : 0) );
2466
- const mapAltGrToCtrlAlt = Boolean(keyboard?.mapAltGrToCtrlAlt);
2467
- return { dispatch, mapAltGrToCtrlAlt };
2468
- }
2469
- const configurationRegistry$2 = ( (Registry.as(Extensions.Configuration)));
2470
- const keyboardConfiguration$1 = {
2471
- 'id': 'keyboard',
2472
- 'order': 15,
2473
- 'type': 'object',
2474
- 'title': ( (localize('keyboardConfigurationTitle', "Keyboard"))),
2475
- 'properties': {
2476
- 'keyboard.dispatch': {
2477
- scope: 1 ,
2478
- type: 'string',
2479
- enum: ['code', 'keyCode'],
2480
- default: 'code',
2481
- markdownDescription: ( (localize(
2482
- 'dispatch',
2483
- "Controls the dispatching logic for key presses to use either `code` (recommended) or `keyCode`."
2484
- ))),
2485
- included: OS === 2 || OS === 3
2486
- },
2487
- 'keyboard.mapAltGrToCtrlAlt': {
2488
- scope: 1 ,
2489
- type: 'boolean',
2490
- default: false,
2491
- markdownDescription: ( (localize(
2492
- 'mapAltGrToCtrlAlt',
2493
- "Controls if the AltGraph+ modifier should be treated as Ctrl+Alt+."
2494
- ))),
2495
- included: OS === 1
2496
- }
2497
- }
2498
- };
2499
- configurationRegistry$2.registerConfiguration(keyboardConfiguration$1);
2500
- class CachedKeyboardMapper {
2501
- constructor(actual) {
2502
- this._actual = actual;
2503
- this._cache = ( (new Map()));
2504
- }
2505
- dumpDebugInfo() {
2506
- return this._actual.dumpDebugInfo();
2507
- }
2508
- resolveKeyboardEvent(keyboardEvent) {
2509
- return this._actual.resolveKeyboardEvent(keyboardEvent);
2510
- }
2511
- resolveKeybinding(keybinding) {
2512
- const hashCode = keybinding.getHashCode();
2513
- const resolved = this._cache.get(hashCode);
2514
- if (!resolved) {
2515
- const r = this._actual.resolveKeybinding(keybinding);
2516
- this._cache.set(hashCode, r);
2517
- return r;
2518
- }
2519
- return resolved;
2520
- }
2521
- }
2522
- class WindowsNativeResolvedKeybinding extends BaseResolvedKeybinding {
2523
- constructor(mapper, chords) {
2524
- super(1 , chords);
2525
- this._mapper = mapper;
2526
- }
2527
- _getLabel(chord) {
2528
- if (chord.isDuplicateModifierCase()) {
2529
- return '';
2530
- }
2531
- return this._mapper.getUILabelForKeyCode(chord.keyCode);
2532
- }
2533
- _getUSLabelForKeybinding(chord) {
2534
- if (chord.isDuplicateModifierCase()) {
2535
- return '';
2536
- }
2537
- return (
2538
- (KeyCodeUtils.toString(chord.keyCode))
2539
- );
2540
- }
2541
- getUSLabel() {
2542
- return UILabelProvider.toLabel(this._os, this._chords, (keybinding) => this._getUSLabelForKeybinding(keybinding));
2543
- }
2544
- _getAriaLabel(chord) {
2545
- if (chord.isDuplicateModifierCase()) {
2546
- return '';
2547
- }
2548
- return this._mapper.getAriaLabelForKeyCode(chord.keyCode);
2549
- }
2550
- _getElectronAccelerator(chord) {
2551
- return this._mapper.getElectronAcceleratorForKeyBinding(chord);
2552
- }
2553
- _getUserSettingsLabel(chord) {
2554
- if (chord.isDuplicateModifierCase()) {
2555
- return '';
2556
- }
2557
- const result = this._mapper.getUserSettingsLabelForKeyCode(chord.keyCode);
2558
- return (result ? result.toLowerCase() : result);
2559
- }
2560
- _isWYSIWYG(chord) {
2561
- return this.__isWYSIWYG(chord.keyCode);
2562
- }
2563
- __isWYSIWYG(keyCode) {
2564
- if (keyCode === 15
2565
- || keyCode === 16
2566
- || keyCode === 17
2567
- || keyCode === 18 ) {
2568
- return true;
2569
- }
2570
- const ariaLabel = this._mapper.getAriaLabelForKeyCode(keyCode);
2571
- const userSettingsLabel = this._mapper.getUserSettingsLabelForKeyCode(keyCode);
2572
- return (ariaLabel === userSettingsLabel);
2573
- }
2574
- _getChordDispatch(chord) {
2575
- if (chord.isModifierKey()) {
2576
- return null;
2577
- }
2578
- let result = '';
2579
- if (chord.ctrlKey) {
2580
- result += 'ctrl+';
2581
- }
2582
- if (chord.shiftKey) {
2583
- result += 'shift+';
2584
- }
2585
- if (chord.altKey) {
2586
- result += 'alt+';
2587
- }
2588
- if (chord.metaKey) {
2589
- result += 'meta+';
2590
- }
2591
- result += ( (KeyCodeUtils.toString(chord.keyCode)));
2592
- return result;
2593
- }
2594
- _getSingleModifierChordDispatch(chord) {
2595
- if (chord.keyCode === 5 && !chord.shiftKey && !chord.altKey && !chord.metaKey) {
2596
- return 'ctrl';
2597
- }
2598
- if (chord.keyCode === 4 && !chord.ctrlKey && !chord.altKey && !chord.metaKey) {
2599
- return 'shift';
2600
- }
2601
- if (chord.keyCode === 6 && !chord.ctrlKey && !chord.shiftKey && !chord.metaKey) {
2602
- return 'alt';
2603
- }
2604
- if (chord.keyCode === 57 && !chord.ctrlKey && !chord.shiftKey && !chord.altKey) {
2605
- return 'meta';
2606
- }
2607
- return null;
2608
- }
2609
- static getProducedCharCode(chord, mapping) {
2610
- if (!mapping) {
2611
- return null;
2612
- }
2613
- if (chord.ctrlKey && chord.shiftKey && chord.altKey) {
2614
- return mapping.withShiftAltGr;
2615
- }
2616
- if (chord.ctrlKey && chord.altKey) {
2617
- return mapping.withAltGr;
2618
- }
2619
- if (chord.shiftKey) {
2620
- return mapping.withShift;
2621
- }
2622
- return mapping.value;
2623
- }
2624
- static getProducedChar(chord, mapping) {
2625
- const char = this.getProducedCharCode(chord, mapping);
2626
- if (char === null || char.length === 0) {
2627
- return ' --- ';
2628
- }
2629
- return ' ' + char + ' ';
2630
- }
2631
- }
2632
- class WindowsKeyboardMapper {
2633
- constructor(_isUSStandard, rawMappings, _mapAltGrToCtrlAlt) {
2634
- this._isUSStandard = _isUSStandard;
2635
- this._mapAltGrToCtrlAlt = _mapAltGrToCtrlAlt;
2636
- this._keyCodeToLabel = [];
2637
- this._scanCodeToKeyCode = [];
2638
- this._keyCodeToLabel = [];
2639
- this._keyCodeExists = [];
2640
- this._keyCodeToLabel[0 ] = ( (KeyCodeUtils.toString(0 )));
2641
- for (let scanCode = 0 ; scanCode < 193 ; scanCode++) {
2642
- const immutableKeyCode = IMMUTABLE_CODE_TO_KEY_CODE[scanCode];
2643
- if (immutableKeyCode !== -1 ) {
2644
- this._scanCodeToKeyCode[scanCode] = immutableKeyCode;
2645
- this._keyCodeToLabel[immutableKeyCode] = ( (KeyCodeUtils.toString(immutableKeyCode)));
2646
- this._keyCodeExists[immutableKeyCode] = true;
2647
- }
2648
- }
2649
- const producesLetter = [];
2650
- let producesLetters = false;
2651
- this._codeInfo = [];
2652
- for (const strCode in rawMappings) {
2653
- if (rawMappings.hasOwnProperty(strCode)) {
2654
- const scanCode = ScanCodeUtils.toEnum(strCode);
2655
- if (scanCode === 0 ) {
2656
- continue;
2657
- }
2658
- const rawMapping = rawMappings[strCode];
2659
- const immutableKeyCode = IMMUTABLE_CODE_TO_KEY_CODE[scanCode];
2660
- if (immutableKeyCode !== -1 ) {
2661
- const keyCode = NATIVE_WINDOWS_KEY_CODE_TO_KEY_CODE[rawMapping.vkey] || 0 ;
2662
- if (keyCode === 0 || immutableKeyCode === keyCode) {
2663
- continue;
2664
- }
2665
- if (scanCode !== 134 ) {
2666
- continue;
2667
- }
2668
- }
2669
- const value = rawMapping.value;
2670
- const withShift = rawMapping.withShift;
2671
- const withAltGr = rawMapping.withAltGr;
2672
- const withShiftAltGr = rawMapping.withShiftAltGr;
2673
- const keyCode = NATIVE_WINDOWS_KEY_CODE_TO_KEY_CODE[rawMapping.vkey] || 0 ;
2674
- const mapping = {
2675
- scanCode: scanCode,
2676
- keyCode: keyCode,
2677
- value: value,
2678
- withShift: withShift,
2679
- withAltGr: withAltGr,
2680
- withShiftAltGr: withShiftAltGr,
2681
- };
2682
- this._codeInfo[scanCode] = mapping;
2683
- this._scanCodeToKeyCode[scanCode] = keyCode;
2684
- if (keyCode === 0 ) {
2685
- continue;
2686
- }
2687
- this._keyCodeExists[keyCode] = true;
2688
- if (value.length === 0) {
2689
- this._keyCodeToLabel[keyCode] = null;
2690
- }
2691
- else if (value.length > 1) {
2692
- this._keyCodeToLabel[keyCode] = value;
2693
- }
2694
- else {
2695
- const charCode = value.charCodeAt(0);
2696
- if (charCode >= 97 && charCode <= 122 ) {
2697
- const upperCaseValue = 65 + ((charCode - 97) );
2698
- producesLetter[upperCaseValue] = true;
2699
- producesLetters = true;
2700
- this._keyCodeToLabel[keyCode] = String.fromCharCode(65 + ((charCode - 97) ));
2701
- }
2702
- else if (charCode >= 65 && charCode <= 90 ) {
2703
- producesLetter[charCode] = true;
2704
- producesLetters = true;
2705
- this._keyCodeToLabel[keyCode] = value;
2706
- }
2707
- else {
2708
- this._keyCodeToLabel[keyCode] = value;
2709
- }
2710
- }
2711
- }
2712
- }
2713
- const _registerLetterIfMissing = (charCode, keyCode) => {
2714
- if (!producesLetter[charCode]) {
2715
- this._keyCodeToLabel[keyCode] = String.fromCharCode(charCode);
2716
- }
2717
- };
2718
- _registerLetterIfMissing(65 , 31 );
2719
- _registerLetterIfMissing(66 , 32 );
2720
- _registerLetterIfMissing(67 , 33 );
2721
- _registerLetterIfMissing(68 , 34 );
2722
- _registerLetterIfMissing(69 , 35 );
2723
- _registerLetterIfMissing(70 , 36 );
2724
- _registerLetterIfMissing(71 , 37 );
2725
- _registerLetterIfMissing(72 , 38 );
2726
- _registerLetterIfMissing(73 , 39 );
2727
- _registerLetterIfMissing(74 , 40 );
2728
- _registerLetterIfMissing(75 , 41 );
2729
- _registerLetterIfMissing(76 , 42 );
2730
- _registerLetterIfMissing(77 , 43 );
2731
- _registerLetterIfMissing(78 , 44 );
2732
- _registerLetterIfMissing(79 , 45 );
2733
- _registerLetterIfMissing(80 , 46 );
2734
- _registerLetterIfMissing(81 , 47 );
2735
- _registerLetterIfMissing(82 , 48 );
2736
- _registerLetterIfMissing(83 , 49 );
2737
- _registerLetterIfMissing(84 , 50 );
2738
- _registerLetterIfMissing(85 , 51 );
2739
- _registerLetterIfMissing(86 , 52 );
2740
- _registerLetterIfMissing(87 , 53 );
2741
- _registerLetterIfMissing(88 , 54 );
2742
- _registerLetterIfMissing(89 , 55 );
2743
- _registerLetterIfMissing(90 , 56 );
2744
- if (!producesLetters) {
2745
- const _registerLabel = (keyCode, charCode) => {
2746
- this._keyCodeToLabel[keyCode] = String.fromCharCode(charCode);
2747
- };
2748
- _registerLabel(80 , 59 );
2749
- _registerLabel(81 , 61 );
2750
- _registerLabel(82 , 44 );
2751
- _registerLabel(83 , 45 );
2752
- _registerLabel(84 , 46 );
2753
- _registerLabel(85 , 47 );
2754
- _registerLabel(86 , 96 );
2755
- _registerLabel(87 , 91 );
2756
- _registerLabel(88 , 92 );
2757
- _registerLabel(89 , 93 );
2758
- _registerLabel(90 , 39 );
2759
- }
2760
- }
2761
- dumpDebugInfo() {
2762
- const result = [];
2763
- const immutableSamples = [
2764
- 88 ,
2765
- 104
2766
- ];
2767
- let cnt = 0;
2768
- result.push(`-----------------------------------------------------------------------------------------------------------------------------------------`);
2769
- for (let scanCode = 0 ; scanCode < 193 ; scanCode++) {
2770
- if (IMMUTABLE_CODE_TO_KEY_CODE[scanCode] !== -1 ) {
2771
- if (immutableSamples.indexOf(scanCode) === -1) {
2772
- continue;
2773
- }
2774
- }
2775
- if (cnt % 6 === 0) {
2776
- result.push(`| HW Code combination | Key | KeyCode combination | UI label | User settings | WYSIWYG |`);
2777
- result.push(`-----------------------------------------------------------------------------------------------------------------------------------------`);
2778
- }
2779
- cnt++;
2780
- const mapping = this._codeInfo[scanCode];
2781
- const strCode = ( (ScanCodeUtils.toString(scanCode)));
2782
- const mods = [0b000, 0b010, 0b101, 0b111];
2783
- for (const mod of mods) {
2784
- const ctrlKey = (mod & 0b001) ? true : false;
2785
- const shiftKey = (mod & 0b010) ? true : false;
2786
- const altKey = (mod & 0b100) ? true : false;
2787
- const scanCodeChord = ( (new ScanCodeChord(ctrlKey, shiftKey, altKey, false, scanCode)));
2788
- const keyCodeChord = this._resolveChord(scanCodeChord);
2789
- const strKeyCode = (keyCodeChord ? ( (KeyCodeUtils.toString(keyCodeChord.keyCode))) : null);
2790
- const resolvedKb = (keyCodeChord ? ( (new WindowsNativeResolvedKeybinding(this, [keyCodeChord]))) : null);
2791
- const outScanCode = `${ctrlKey ? 'Ctrl+' : ''}${shiftKey ? 'Shift+' : ''}${altKey ? 'Alt+' : ''}${strCode}`;
2792
- const ariaLabel = (resolvedKb ? resolvedKb.getAriaLabel() : null);
2793
- const outUILabel = (ariaLabel ? ariaLabel.replace(/Control\+/, 'Ctrl+') : null);
2794
- const outUserSettings = (resolvedKb ? resolvedKb.getUserSettingsLabel() : null);
2795
- const outKey = WindowsNativeResolvedKeybinding.getProducedChar(scanCodeChord, mapping);
2796
- const outKb = (strKeyCode ? `${ctrlKey ? 'Ctrl+' : ''}${shiftKey ? 'Shift+' : ''}${altKey ? 'Alt+' : ''}${strKeyCode}` : null);
2797
- const isWYSIWYG = (resolvedKb ? resolvedKb.isWYSIWYG() : false);
2798
- const outWYSIWYG = (isWYSIWYG ? ' ' : ' NO ');
2799
- result.push(`| ${this._leftPad(outScanCode, 30)} | ${outKey} | ${this._leftPad(outKb, 25)} | ${this._leftPad(outUILabel, 25)} | ${this._leftPad(outUserSettings, 25)} | ${outWYSIWYG} |`);
2800
- }
2801
- result.push(`-----------------------------------------------------------------------------------------------------------------------------------------`);
2802
- }
2803
- return result.join('\n');
2804
- }
2805
- _leftPad(str, cnt) {
2806
- if (str === null) {
2807
- str = 'null';
2808
- }
2809
- while (str.length < cnt) {
2810
- str = ' ' + str;
2811
- }
2812
- return str;
2813
- }
2814
- getUILabelForKeyCode(keyCode) {
2815
- return this._getLabelForKeyCode(keyCode);
2816
- }
2817
- getAriaLabelForKeyCode(keyCode) {
2818
- return this._getLabelForKeyCode(keyCode);
2819
- }
2820
- getUserSettingsLabelForKeyCode(keyCode) {
2821
- if (this._isUSStandard) {
2822
- return KeyCodeUtils.toUserSettingsUS(keyCode);
2823
- }
2824
- return KeyCodeUtils.toUserSettingsGeneral(keyCode);
2825
- }
2826
- getElectronAcceleratorForKeyBinding(chord) {
2827
- return KeyCodeUtils.toElectronAccelerator(chord.keyCode);
2828
- }
2829
- _getLabelForKeyCode(keyCode) {
2830
- return this._keyCodeToLabel[keyCode] || ( (KeyCodeUtils.toString(0 )));
2831
- }
2832
- resolveKeyboardEvent(keyboardEvent) {
2833
- const ctrlKey = keyboardEvent.ctrlKey || (this._mapAltGrToCtrlAlt && keyboardEvent.altGraphKey);
2834
- const altKey = keyboardEvent.altKey || (this._mapAltGrToCtrlAlt && keyboardEvent.altGraphKey);
2835
- const chord = ( (new KeyCodeChord(
2836
- ctrlKey,
2837
- keyboardEvent.shiftKey,
2838
- altKey,
2839
- keyboardEvent.metaKey,
2840
- keyboardEvent.keyCode
2841
- )));
2842
- return (
2843
- (new WindowsNativeResolvedKeybinding(this, [chord]))
2844
- );
2845
- }
2846
- _resolveChord(chord) {
2847
- if (!chord) {
2848
- return null;
2849
- }
2850
- if (chord instanceof KeyCodeChord) {
2851
- if (!this._keyCodeExists[chord.keyCode]) {
2852
- return null;
2853
- }
2854
- return chord;
2855
- }
2856
- const keyCode = this._scanCodeToKeyCode[chord.scanCode] || 0 ;
2857
- if (keyCode === 0 || !this._keyCodeExists[keyCode]) {
2858
- return null;
2859
- }
2860
- return (
2861
- (new KeyCodeChord(chord.ctrlKey, chord.shiftKey, chord.altKey, chord.metaKey, keyCode))
2862
- );
2863
- }
2864
- resolveKeybinding(keybinding) {
2865
- const chords = toEmptyArrayIfContainsNull(( (keybinding.chords.map(chord => this._resolveChord(chord)))));
2866
- if (chords.length > 0) {
2867
- return [( (new WindowsNativeResolvedKeybinding(this, chords)))];
2868
- }
2869
- return [];
2870
- }
2871
- }
2872
- const CHAR_CODE_TO_KEY_CODE = [];
2873
- class NativeResolvedKeybinding extends BaseResolvedKeybinding {
2874
- constructor(mapper, os, chords) {
2875
- super(os, chords);
2876
- this._mapper = mapper;
2877
- }
2878
- _getLabel(chord) {
2879
- return this._mapper.getUILabelForScanCodeChord(chord);
2880
- }
2881
- _getAriaLabel(chord) {
2882
- return this._mapper.getAriaLabelForScanCodeChord(chord);
2883
- }
2884
- _getElectronAccelerator(chord) {
2885
- return this._mapper.getElectronAcceleratorLabelForScanCodeChord(chord);
2886
- }
2887
- _getUserSettingsLabel(chord) {
2888
- return this._mapper.getUserSettingsLabelForScanCodeChord(chord);
2889
- }
2890
- _isWYSIWYG(binding) {
2891
- if (!binding) {
2892
- return true;
2893
- }
2894
- if (IMMUTABLE_CODE_TO_KEY_CODE[binding.scanCode] !== -1 ) {
2895
- return true;
2896
- }
2897
- const a = this._mapper.getAriaLabelForScanCodeChord(binding);
2898
- const b = this._mapper.getUserSettingsLabelForScanCodeChord(binding);
2899
- if (!a && !b) {
2900
- return true;
2901
- }
2902
- if (!a || !b) {
2903
- return false;
2904
- }
2905
- return (a.toLowerCase() === b.toLowerCase());
2906
- }
2907
- _getChordDispatch(chord) {
2908
- return this._mapper.getDispatchStrForScanCodeChord(chord);
2909
- }
2910
- _getSingleModifierChordDispatch(chord) {
2911
- if (((chord.scanCode === 157 || chord.scanCode === 161) ) && !chord.shiftKey && !chord.altKey && !chord.metaKey) {
2912
- return 'ctrl';
2913
- }
2914
- if (((chord.scanCode === 159 || chord.scanCode === 163) ) && !chord.ctrlKey && !chord.shiftKey && !chord.metaKey) {
2915
- return 'alt';
2916
- }
2917
- if (((chord.scanCode === 158 || chord.scanCode === 162) ) && !chord.ctrlKey && !chord.altKey && !chord.metaKey) {
2918
- return 'shift';
2919
- }
2920
- if (((chord.scanCode === 160 || chord.scanCode === 164) ) && !chord.ctrlKey && !chord.shiftKey && !chord.altKey) {
2921
- return 'meta';
2922
- }
2923
- return null;
2924
- }
2925
- }
2926
- class ScanCodeCombo {
2927
- constructor(ctrlKey, shiftKey, altKey, scanCode) {
2928
- this.ctrlKey = ctrlKey;
2929
- this.shiftKey = shiftKey;
2930
- this.altKey = altKey;
2931
- this.scanCode = scanCode;
2932
- }
2933
- toString() {
2934
- return `${this.ctrlKey ? 'Ctrl+' : ''}${this.shiftKey ? 'Shift+' : ''}${this.altKey ? 'Alt+' : ''}${( ( ScanCodeUtils.toString(this.scanCode)))}`;
2935
- }
2936
- equals(other) {
2937
- return (this.ctrlKey === other.ctrlKey
2938
- && this.shiftKey === other.shiftKey
2939
- && this.altKey === other.altKey
2940
- && this.scanCode === other.scanCode);
2941
- }
2942
- getProducedCharCode(mapping) {
2943
- if (!mapping) {
2944
- return '';
2945
- }
2946
- if (this.ctrlKey && this.shiftKey && this.altKey) {
2947
- return mapping.withShiftAltGr;
2948
- }
2949
- if (this.ctrlKey && this.altKey) {
2950
- return mapping.withAltGr;
2951
- }
2952
- if (this.shiftKey) {
2953
- return mapping.withShift;
2954
- }
2955
- return mapping.value;
2956
- }
2957
- getProducedChar(mapping) {
2958
- const charCode = MacLinuxKeyboardMapper.getCharCode(this.getProducedCharCode(mapping));
2959
- if (charCode === 0) {
2960
- return ' --- ';
2961
- }
2962
- if (charCode >= 768 && charCode <= 879 ) {
2963
- return 'U+' + ( (charCode.toString(16)));
2964
- }
2965
- return ' ' + String.fromCharCode(charCode) + ' ';
2966
- }
2967
- }
2968
- class KeyCodeCombo {
2969
- constructor(ctrlKey, shiftKey, altKey, keyCode) {
2970
- this.ctrlKey = ctrlKey;
2971
- this.shiftKey = shiftKey;
2972
- this.altKey = altKey;
2973
- this.keyCode = keyCode;
2974
- }
2975
- toString() {
2976
- return `${this.ctrlKey ? 'Ctrl+' : ''}${this.shiftKey ? 'Shift+' : ''}${this.altKey ? 'Alt+' : ''}${( ( KeyCodeUtils.toString(this.keyCode)))}`;
2977
- }
2978
- }
2979
- class ScanCodeKeyCodeMapper {
2980
- constructor() {
2981
- this._scanCodeToKeyCode = [];
2982
- this._keyCodeToScanCode = [];
2983
- this._scanCodeToKeyCode = [];
2984
- this._keyCodeToScanCode = [];
2985
- }
2986
- registrationComplete() {
2987
- this._moveToEnd(56 );
2988
- this._moveToEnd(106 );
2989
- }
2990
- _moveToEnd(scanCode) {
2991
- for (let mod = 0; mod < 8; mod++) {
2992
- const encodedKeyCodeCombos = this._scanCodeToKeyCode[(scanCode << 3) + mod];
2993
- if (!encodedKeyCodeCombos) {
2994
- continue;
2995
- }
2996
- for (let i = 0, len = encodedKeyCodeCombos.length; i < len; i++) {
2997
- const encodedScanCodeCombos = this._keyCodeToScanCode[encodedKeyCodeCombos[i]];
2998
- if (encodedScanCodeCombos.length === 1) {
2999
- continue;
3000
- }
3001
- for (let j = 0, len = encodedScanCodeCombos.length; j < len; j++) {
3002
- const entry = encodedScanCodeCombos[j];
3003
- const entryScanCode = (entry >>> 3);
3004
- if (entryScanCode === scanCode) {
3005
- for (let k = j + 1; k < len; k++) {
3006
- encodedScanCodeCombos[k - 1] = encodedScanCodeCombos[k];
3007
- }
3008
- encodedScanCodeCombos[len - 1] = entry;
3009
- }
3010
- }
3011
- }
3012
- }
3013
- }
3014
- registerIfUnknown(scanCodeCombo, keyCodeCombo) {
3015
- if (keyCodeCombo.keyCode === 0 ) {
3016
- return;
3017
- }
3018
- const scanCodeComboEncoded = this._encodeScanCodeCombo(scanCodeCombo);
3019
- const keyCodeComboEncoded = this._encodeKeyCodeCombo(keyCodeCombo);
3020
- const keyCodeIsDigit = ((keyCodeCombo.keyCode >= 21 && keyCodeCombo.keyCode <= 30) );
3021
- const keyCodeIsLetter = ((keyCodeCombo.keyCode >= 31 && keyCodeCombo.keyCode <= 56) );
3022
- const existingKeyCodeCombos = this._scanCodeToKeyCode[scanCodeComboEncoded];
3023
- if (keyCodeIsDigit || keyCodeIsLetter) {
3024
- if (existingKeyCodeCombos) {
3025
- for (let i = 0, len = existingKeyCodeCombos.length; i < len; i++) {
3026
- if (existingKeyCodeCombos[i] === keyCodeComboEncoded) {
3027
- return;
3028
- }
3029
- }
3030
- }
3031
- }
3032
- else {
3033
- if (existingKeyCodeCombos && existingKeyCodeCombos.length !== 0) {
3034
- return;
3035
- }
3036
- }
3037
- this._scanCodeToKeyCode[scanCodeComboEncoded] = this._scanCodeToKeyCode[scanCodeComboEncoded] || [];
3038
- this._scanCodeToKeyCode[scanCodeComboEncoded].unshift(keyCodeComboEncoded);
3039
- this._keyCodeToScanCode[keyCodeComboEncoded] = this._keyCodeToScanCode[keyCodeComboEncoded] || [];
3040
- this._keyCodeToScanCode[keyCodeComboEncoded].unshift(scanCodeComboEncoded);
3041
- }
3042
- lookupKeyCodeCombo(keyCodeCombo) {
3043
- const keyCodeComboEncoded = this._encodeKeyCodeCombo(keyCodeCombo);
3044
- const scanCodeCombosEncoded = this._keyCodeToScanCode[keyCodeComboEncoded];
3045
- if (!scanCodeCombosEncoded || scanCodeCombosEncoded.length === 0) {
3046
- return [];
3047
- }
3048
- const result = [];
3049
- for (let i = 0, len = scanCodeCombosEncoded.length; i < len; i++) {
3050
- const scanCodeComboEncoded = scanCodeCombosEncoded[i];
3051
- const ctrlKey = (scanCodeComboEncoded & 0b001) ? true : false;
3052
- const shiftKey = (scanCodeComboEncoded & 0b010) ? true : false;
3053
- const altKey = (scanCodeComboEncoded & 0b100) ? true : false;
3054
- const scanCode = (scanCodeComboEncoded >>> 3);
3055
- result[i] = ( (new ScanCodeCombo(ctrlKey, shiftKey, altKey, scanCode)));
3056
- }
3057
- return result;
3058
- }
3059
- lookupScanCodeCombo(scanCodeCombo) {
3060
- const scanCodeComboEncoded = this._encodeScanCodeCombo(scanCodeCombo);
3061
- const keyCodeCombosEncoded = this._scanCodeToKeyCode[scanCodeComboEncoded];
3062
- if (!keyCodeCombosEncoded || keyCodeCombosEncoded.length === 0) {
3063
- return [];
3064
- }
3065
- const result = [];
3066
- for (let i = 0, len = keyCodeCombosEncoded.length; i < len; i++) {
3067
- const keyCodeComboEncoded = keyCodeCombosEncoded[i];
3068
- const ctrlKey = (keyCodeComboEncoded & 0b001) ? true : false;
3069
- const shiftKey = (keyCodeComboEncoded & 0b010) ? true : false;
3070
- const altKey = (keyCodeComboEncoded & 0b100) ? true : false;
3071
- const keyCode = (keyCodeComboEncoded >>> 3);
3072
- result[i] = ( (new KeyCodeCombo(ctrlKey, shiftKey, altKey, keyCode)));
3073
- }
3074
- return result;
3075
- }
3076
- guessStableKeyCode(scanCode) {
3077
- if (scanCode >= 36 && scanCode <= 45 ) {
3078
- switch (scanCode) {
3079
- case 36 : return 22 ;
3080
- case 37 : return 23 ;
3081
- case 38 : return 24 ;
3082
- case 39 : return 25 ;
3083
- case 40 : return 26 ;
3084
- case 41 : return 27 ;
3085
- case 42 : return 28 ;
3086
- case 43 : return 29 ;
3087
- case 44 : return 30 ;
3088
- case 45 : return 21 ;
3089
- }
3090
- }
3091
- const keyCodeCombos1 = this.lookupScanCodeCombo(( (new ScanCodeCombo(false, false, false, scanCode))));
3092
- const keyCodeCombos2 = this.lookupScanCodeCombo(( (new ScanCodeCombo(false, true, false, scanCode))));
3093
- if (keyCodeCombos1.length === 1 && keyCodeCombos2.length === 1) {
3094
- const shiftKey1 = keyCodeCombos1[0].shiftKey;
3095
- const keyCode1 = keyCodeCombos1[0].keyCode;
3096
- const shiftKey2 = keyCodeCombos2[0].shiftKey;
3097
- const keyCode2 = keyCodeCombos2[0].keyCode;
3098
- if (keyCode1 === keyCode2 && shiftKey1 !== shiftKey2) {
3099
- return keyCode1;
3100
- }
3101
- }
3102
- return -1 ;
3103
- }
3104
- _encodeScanCodeCombo(scanCodeCombo) {
3105
- return this._encode(scanCodeCombo.ctrlKey, scanCodeCombo.shiftKey, scanCodeCombo.altKey, scanCodeCombo.scanCode);
3106
- }
3107
- _encodeKeyCodeCombo(keyCodeCombo) {
3108
- return this._encode(keyCodeCombo.ctrlKey, keyCodeCombo.shiftKey, keyCodeCombo.altKey, keyCodeCombo.keyCode);
3109
- }
3110
- _encode(ctrlKey, shiftKey, altKey, principal) {
3111
- return (((ctrlKey ? 1 : 0) << 0)
3112
- | ((shiftKey ? 1 : 0) << 1)
3113
- | ((altKey ? 1 : 0) << 2)
3114
- | principal << 3) >>> 0;
3115
- }
3116
- }
3117
- class MacLinuxKeyboardMapper {
3118
- constructor(_isUSStandard, rawMappings, _mapAltGrToCtrlAlt, _OS) {
3119
- this._isUSStandard = _isUSStandard;
3120
- this._mapAltGrToCtrlAlt = _mapAltGrToCtrlAlt;
3121
- this._OS = _OS;
3122
- this._scanCodeToLabel = [];
3123
- this._scanCodeToDispatch = [];
3124
- this._codeInfo = [];
3125
- this._scanCodeKeyCodeMapper = ( (new ScanCodeKeyCodeMapper()));
3126
- this._scanCodeToLabel = [];
3127
- this._scanCodeToDispatch = [];
3128
- const _registerIfUnknown = (hwCtrlKey, hwShiftKey, hwAltKey, scanCode, kbCtrlKey, kbShiftKey, kbAltKey, keyCode) => {
3129
- this._scanCodeKeyCodeMapper.registerIfUnknown(( (new ScanCodeCombo(
3130
- hwCtrlKey ? true : false,
3131
- hwShiftKey ? true : false,
3132
- hwAltKey ? true : false,
3133
- scanCode
3134
- ))), ( (new KeyCodeCombo(
3135
- kbCtrlKey ? true : false,
3136
- kbShiftKey ? true : false,
3137
- kbAltKey ? true : false,
3138
- keyCode
3139
- ))));
3140
- };
3141
- const _registerAllCombos = (_ctrlKey, _shiftKey, _altKey, scanCode, keyCode) => {
3142
- for (let ctrlKey = _ctrlKey; ctrlKey <= 1; ctrlKey++) {
3143
- for (let shiftKey = _shiftKey; shiftKey <= 1; shiftKey++) {
3144
- for (let altKey = _altKey; altKey <= 1; altKey++) {
3145
- _registerIfUnknown(ctrlKey, shiftKey, altKey, scanCode, ctrlKey, shiftKey, altKey, keyCode);
3146
- }
3147
- }
3148
- }
3149
- };
3150
- for (let scanCode = 0 ; scanCode < 193 ; scanCode++) {
3151
- this._scanCodeToLabel[scanCode] = null;
3152
- }
3153
- for (let scanCode = 0 ; scanCode < 193 ; scanCode++) {
3154
- this._scanCodeToDispatch[scanCode] = null;
3155
- }
3156
- for (let scanCode = 0 ; scanCode < 193 ; scanCode++) {
3157
- const keyCode = IMMUTABLE_CODE_TO_KEY_CODE[scanCode];
3158
- if (keyCode !== -1 ) {
3159
- _registerAllCombos(0, 0, 0, scanCode, keyCode);
3160
- this._scanCodeToLabel[scanCode] = ( (KeyCodeUtils.toString(keyCode)));
3161
- if (keyCode === 0 || keyCode === 5 || keyCode === 57 || keyCode === 6 || keyCode === 4 ) {
3162
- this._scanCodeToDispatch[scanCode] = null;
3163
- }
3164
- else {
3165
- this._scanCodeToDispatch[scanCode] = `[${( ( ScanCodeUtils.toString(scanCode)))}]`;
3166
- }
3167
- }
3168
- }
3169
- const missingLatinLettersOverride = {};
3170
- {
3171
- const producesLatinLetter = [];
3172
- for (const strScanCode in rawMappings) {
3173
- if (rawMappings.hasOwnProperty(strScanCode)) {
3174
- const scanCode = ScanCodeUtils.toEnum(strScanCode);
3175
- if (scanCode === 0 ) {
3176
- continue;
3177
- }
3178
- if (IMMUTABLE_CODE_TO_KEY_CODE[scanCode] !== -1 ) {
3179
- continue;
3180
- }
3181
- const rawMapping = rawMappings[strScanCode];
3182
- const value = MacLinuxKeyboardMapper.getCharCode(rawMapping.value);
3183
- if (value >= 97 && value <= 122 ) {
3184
- const upperCaseValue = 65 + ((value - 97) );
3185
- producesLatinLetter[upperCaseValue] = true;
3186
- }
3187
- }
3188
- }
3189
- const _registerLetterIfMissing = (charCode, scanCode, value, withShift) => {
3190
- if (!producesLatinLetter[charCode]) {
3191
- missingLatinLettersOverride[( (ScanCodeUtils.toString(scanCode)))] = {
3192
- value: value,
3193
- withShift: withShift,
3194
- withAltGr: '',
3195
- withShiftAltGr: ''
3196
- };
3197
- }
3198
- };
3199
- _registerLetterIfMissing(65 , 10 , 'a', 'A');
3200
- _registerLetterIfMissing(66 , 11 , 'b', 'B');
3201
- _registerLetterIfMissing(67 , 12 , 'c', 'C');
3202
- _registerLetterIfMissing(68 , 13 , 'd', 'D');
3203
- _registerLetterIfMissing(69 , 14 , 'e', 'E');
3204
- _registerLetterIfMissing(70 , 15 , 'f', 'F');
3205
- _registerLetterIfMissing(71 , 16 , 'g', 'G');
3206
- _registerLetterIfMissing(72 , 17 , 'h', 'H');
3207
- _registerLetterIfMissing(73 , 18 , 'i', 'I');
3208
- _registerLetterIfMissing(74 , 19 , 'j', 'J');
3209
- _registerLetterIfMissing(75 , 20 , 'k', 'K');
3210
- _registerLetterIfMissing(76 , 21 , 'l', 'L');
3211
- _registerLetterIfMissing(77 , 22 , 'm', 'M');
3212
- _registerLetterIfMissing(78 , 23 , 'n', 'N');
3213
- _registerLetterIfMissing(79 , 24 , 'o', 'O');
3214
- _registerLetterIfMissing(80 , 25 , 'p', 'P');
3215
- _registerLetterIfMissing(81 , 26 , 'q', 'Q');
3216
- _registerLetterIfMissing(82 , 27 , 'r', 'R');
3217
- _registerLetterIfMissing(83 , 28 , 's', 'S');
3218
- _registerLetterIfMissing(84 , 29 , 't', 'T');
3219
- _registerLetterIfMissing(85 , 30 , 'u', 'U');
3220
- _registerLetterIfMissing(86 , 31 , 'v', 'V');
3221
- _registerLetterIfMissing(87 , 32 , 'w', 'W');
3222
- _registerLetterIfMissing(88 , 33 , 'x', 'X');
3223
- _registerLetterIfMissing(89 , 34 , 'y', 'Y');
3224
- _registerLetterIfMissing(90 , 35 , 'z', 'Z');
3225
- }
3226
- const mappings = [];
3227
- let mappingsLen = 0;
3228
- for (const strScanCode in rawMappings) {
3229
- if (rawMappings.hasOwnProperty(strScanCode)) {
3230
- const scanCode = ScanCodeUtils.toEnum(strScanCode);
3231
- if (scanCode === 0 ) {
3232
- continue;
3233
- }
3234
- if (IMMUTABLE_CODE_TO_KEY_CODE[scanCode] !== -1 ) {
3235
- continue;
3236
- }
3237
- this._codeInfo[scanCode] = rawMappings[strScanCode];
3238
- const rawMapping = missingLatinLettersOverride[strScanCode] || rawMappings[strScanCode];
3239
- const value = MacLinuxKeyboardMapper.getCharCode(rawMapping.value);
3240
- const withShift = MacLinuxKeyboardMapper.getCharCode(rawMapping.withShift);
3241
- const withAltGr = MacLinuxKeyboardMapper.getCharCode(rawMapping.withAltGr);
3242
- const withShiftAltGr = MacLinuxKeyboardMapper.getCharCode(rawMapping.withShiftAltGr);
3243
- const mapping = {
3244
- scanCode: scanCode,
3245
- value: value,
3246
- withShift: withShift,
3247
- withAltGr: withAltGr,
3248
- withShiftAltGr: withShiftAltGr,
3249
- };
3250
- mappings[mappingsLen++] = mapping;
3251
- this._scanCodeToDispatch[scanCode] = `[${( ( ScanCodeUtils.toString(scanCode)))}]`;
3252
- if (value >= 97 && value <= 122 ) {
3253
- const upperCaseValue = 65 + ((value - 97) );
3254
- this._scanCodeToLabel[scanCode] = String.fromCharCode(upperCaseValue);
3255
- }
3256
- else if (value >= 65 && value <= 90 ) {
3257
- this._scanCodeToLabel[scanCode] = String.fromCharCode(value);
3258
- }
3259
- else if (value) {
3260
- this._scanCodeToLabel[scanCode] = String.fromCharCode(value);
3261
- }
3262
- else {
3263
- this._scanCodeToLabel[scanCode] = null;
3264
- }
3265
- }
3266
- }
3267
- for (let i = mappings.length - 1; i >= 0; i--) {
3268
- const mapping = mappings[i];
3269
- const scanCode = mapping.scanCode;
3270
- const withShiftAltGr = mapping.withShiftAltGr;
3271
- if (withShiftAltGr === mapping.withAltGr || withShiftAltGr === mapping.withShift || withShiftAltGr === mapping.value) {
3272
- continue;
3273
- }
3274
- const kb = MacLinuxKeyboardMapper._charCodeToKb(withShiftAltGr);
3275
- if (!kb) {
3276
- continue;
3277
- }
3278
- const kbShiftKey = kb.shiftKey;
3279
- const keyCode = kb.keyCode;
3280
- if (kbShiftKey) {
3281
- _registerIfUnknown(1, 1, 1, scanCode, 0, 1, 0, keyCode);
3282
- }
3283
- else {
3284
- _registerIfUnknown(1, 1, 1, scanCode, 0, 0, 0, keyCode);
3285
- }
3286
- }
3287
- for (let i = mappings.length - 1; i >= 0; i--) {
3288
- const mapping = mappings[i];
3289
- const scanCode = mapping.scanCode;
3290
- const withAltGr = mapping.withAltGr;
3291
- if (withAltGr === mapping.withShift || withAltGr === mapping.value) {
3292
- continue;
3293
- }
3294
- const kb = MacLinuxKeyboardMapper._charCodeToKb(withAltGr);
3295
- if (!kb) {
3296
- continue;
3297
- }
3298
- const kbShiftKey = kb.shiftKey;
3299
- const keyCode = kb.keyCode;
3300
- if (kbShiftKey) {
3301
- _registerIfUnknown(1, 0, 1, scanCode, 0, 1, 0, keyCode);
3302
- }
3303
- else {
3304
- _registerIfUnknown(1, 0, 1, scanCode, 0, 0, 0, keyCode);
3305
- }
3306
- }
3307
- for (let i = mappings.length - 1; i >= 0; i--) {
3308
- const mapping = mappings[i];
3309
- const scanCode = mapping.scanCode;
3310
- const withShift = mapping.withShift;
3311
- if (withShift === mapping.value) {
3312
- continue;
3313
- }
3314
- const kb = MacLinuxKeyboardMapper._charCodeToKb(withShift);
3315
- if (!kb) {
3316
- continue;
3317
- }
3318
- const kbShiftKey = kb.shiftKey;
3319
- const keyCode = kb.keyCode;
3320
- if (kbShiftKey) {
3321
- _registerIfUnknown(0, 1, 0, scanCode, 0, 1, 0, keyCode);
3322
- _registerIfUnknown(0, 1, 1, scanCode, 0, 1, 1, keyCode);
3323
- _registerIfUnknown(1, 1, 0, scanCode, 1, 1, 0, keyCode);
3324
- _registerIfUnknown(1, 1, 1, scanCode, 1, 1, 1, keyCode);
3325
- }
3326
- else {
3327
- _registerIfUnknown(0, 1, 0, scanCode, 0, 0, 0, keyCode);
3328
- _registerIfUnknown(0, 1, 0, scanCode, 0, 1, 0, keyCode);
3329
- _registerIfUnknown(0, 1, 1, scanCode, 0, 0, 1, keyCode);
3330
- _registerIfUnknown(0, 1, 1, scanCode, 0, 1, 1, keyCode);
3331
- _registerIfUnknown(1, 1, 0, scanCode, 1, 0, 0, keyCode);
3332
- _registerIfUnknown(1, 1, 0, scanCode, 1, 1, 0, keyCode);
3333
- _registerIfUnknown(1, 1, 1, scanCode, 1, 0, 1, keyCode);
3334
- _registerIfUnknown(1, 1, 1, scanCode, 1, 1, 1, keyCode);
3335
- }
3336
- }
3337
- for (let i = mappings.length - 1; i >= 0; i--) {
3338
- const mapping = mappings[i];
3339
- const scanCode = mapping.scanCode;
3340
- const kb = MacLinuxKeyboardMapper._charCodeToKb(mapping.value);
3341
- if (!kb) {
3342
- continue;
3343
- }
3344
- const kbShiftKey = kb.shiftKey;
3345
- const keyCode = kb.keyCode;
3346
- if (kbShiftKey) {
3347
- _registerIfUnknown(0, 0, 0, scanCode, 0, 1, 0, keyCode);
3348
- _registerIfUnknown(0, 0, 1, scanCode, 0, 1, 1, keyCode);
3349
- _registerIfUnknown(1, 0, 0, scanCode, 1, 1, 0, keyCode);
3350
- _registerIfUnknown(1, 0, 1, scanCode, 1, 1, 1, keyCode);
3351
- }
3352
- else {
3353
- _registerIfUnknown(0, 0, 0, scanCode, 0, 0, 0, keyCode);
3354
- _registerIfUnknown(0, 0, 1, scanCode, 0, 0, 1, keyCode);
3355
- _registerIfUnknown(0, 1, 0, scanCode, 0, 1, 0, keyCode);
3356
- _registerIfUnknown(0, 1, 1, scanCode, 0, 1, 1, keyCode);
3357
- _registerIfUnknown(1, 0, 0, scanCode, 1, 0, 0, keyCode);
3358
- _registerIfUnknown(1, 0, 1, scanCode, 1, 0, 1, keyCode);
3359
- _registerIfUnknown(1, 1, 0, scanCode, 1, 1, 0, keyCode);
3360
- _registerIfUnknown(1, 1, 1, scanCode, 1, 1, 1, keyCode);
3361
- }
3362
- }
3363
- _registerAllCombos(0, 0, 0, 36 , 22 );
3364
- _registerAllCombos(0, 0, 0, 37 , 23 );
3365
- _registerAllCombos(0, 0, 0, 38 , 24 );
3366
- _registerAllCombos(0, 0, 0, 39 , 25 );
3367
- _registerAllCombos(0, 0, 0, 40 , 26 );
3368
- _registerAllCombos(0, 0, 0, 41 , 27 );
3369
- _registerAllCombos(0, 0, 0, 42 , 28 );
3370
- _registerAllCombos(0, 0, 0, 43 , 29 );
3371
- _registerAllCombos(0, 0, 0, 44 , 30 );
3372
- _registerAllCombos(0, 0, 0, 45 , 21 );
3373
- this._scanCodeKeyCodeMapper.registrationComplete();
3374
- }
3375
- dumpDebugInfo() {
3376
- const result = [];
3377
- const immutableSamples = [
3378
- 88 ,
3379
- 104
3380
- ];
3381
- let cnt = 0;
3382
- result.push(`isUSStandard: ${this._isUSStandard}`);
3383
- result.push(`----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------`);
3384
- for (let scanCode = 0 ; scanCode < 193 ; scanCode++) {
3385
- if (IMMUTABLE_CODE_TO_KEY_CODE[scanCode] !== -1 ) {
3386
- if (immutableSamples.indexOf(scanCode) === -1) {
3387
- continue;
3388
- }
3389
- }
3390
- if (cnt % 4 === 0) {
3391
- result.push(`| HW Code combination | Key | KeyCode combination | Pri | UI label | User settings | Electron accelerator | Dispatching string | WYSIWYG |`);
3392
- result.push(`----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------`);
3393
- }
3394
- cnt++;
3395
- const mapping = this._codeInfo[scanCode];
3396
- for (let mod = 0; mod < 8; mod++) {
3397
- const hwCtrlKey = (mod & 0b001) ? true : false;
3398
- const hwShiftKey = (mod & 0b010) ? true : false;
3399
- const hwAltKey = (mod & 0b100) ? true : false;
3400
- const scanCodeCombo = ( (new ScanCodeCombo(hwCtrlKey, hwShiftKey, hwAltKey, scanCode)));
3401
- const resolvedKb = this.resolveKeyboardEvent({
3402
- _standardKeyboardEventBrand: true,
3403
- ctrlKey: scanCodeCombo.ctrlKey,
3404
- shiftKey: scanCodeCombo.shiftKey,
3405
- altKey: scanCodeCombo.altKey,
3406
- metaKey: false,
3407
- altGraphKey: false,
3408
- keyCode: -1 ,
3409
- code: ( (ScanCodeUtils.toString(scanCode)))
3410
- });
3411
- const outScanCodeCombo = ( (scanCodeCombo.toString()));
3412
- const outKey = scanCodeCombo.getProducedChar(mapping);
3413
- const ariaLabel = resolvedKb.getAriaLabel();
3414
- const outUILabel = (ariaLabel ? ariaLabel.replace(/Control\+/, 'Ctrl+') : null);
3415
- const outUserSettings = resolvedKb.getUserSettingsLabel();
3416
- const outElectronAccelerator = resolvedKb.getElectronAccelerator();
3417
- const outDispatchStr = resolvedKb.getDispatchChords()[0];
3418
- const isWYSIWYG = (resolvedKb ? resolvedKb.isWYSIWYG() : false);
3419
- const outWYSIWYG = (isWYSIWYG ? ' ' : ' NO ');
3420
- const kbCombos = this._scanCodeKeyCodeMapper.lookupScanCodeCombo(scanCodeCombo);
3421
- if (kbCombos.length === 0) {
3422
- result.push(`| ${this._leftPad(outScanCodeCombo, 30)} | ${outKey} | ${this._leftPad('', 25)} | ${this._leftPad('', 3)} | ${this._leftPad(outUILabel, 25)} | ${this._leftPad(outUserSettings, 30)} | ${this._leftPad(outElectronAccelerator, 25)} | ${this._leftPad(outDispatchStr, 30)} | ${outWYSIWYG} |`);
3423
- }
3424
- else {
3425
- for (let i = 0, len = kbCombos.length; i < len; i++) {
3426
- const kbCombo = kbCombos[i];
3427
- let colPriority;
3428
- const scanCodeCombos = this._scanCodeKeyCodeMapper.lookupKeyCodeCombo(kbCombo);
3429
- if (scanCodeCombos.length === 1) {
3430
- colPriority = '';
3431
- }
3432
- else {
3433
- let priority = -1;
3434
- for (let j = 0; j < scanCodeCombos.length; j++) {
3435
- if (scanCodeCombos[j].equals(scanCodeCombo)) {
3436
- priority = j + 1;
3437
- break;
3438
- }
3439
- }
3440
- colPriority = String(priority);
3441
- }
3442
- const outKeybinding = ( (kbCombo.toString()));
3443
- if (i === 0) {
3444
- result.push(`| ${this._leftPad(outScanCodeCombo, 30)} | ${outKey} | ${this._leftPad(outKeybinding, 25)} | ${this._leftPad(colPriority, 3)} | ${this._leftPad(outUILabel, 25)} | ${this._leftPad(outUserSettings, 30)} | ${this._leftPad(outElectronAccelerator, 25)} | ${this._leftPad(outDispatchStr, 30)} | ${outWYSIWYG} |`);
3445
- }
3446
- else {
3447
- result.push(`| ${this._leftPad('', 30)} | | ${this._leftPad(outKeybinding, 25)} | ${this._leftPad(colPriority, 3)} | ${this._leftPad('', 25)} | ${this._leftPad('', 30)} | ${this._leftPad('', 25)} | ${this._leftPad('', 30)} | |`);
3448
- }
3449
- }
3450
- }
3451
- }
3452
- result.push(`----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------`);
3453
- }
3454
- return result.join('\n');
3455
- }
3456
- _leftPad(str, cnt) {
3457
- if (str === null) {
3458
- str = 'null';
3459
- }
3460
- while (str.length < cnt) {
3461
- str = ' ' + str;
3462
- }
3463
- return str;
3464
- }
3465
- keyCodeChordToScanCodeChord(chord) {
3466
- if (chord.keyCode === 3 ) {
3467
- return [( (new ScanCodeChord(
3468
- chord.ctrlKey,
3469
- chord.shiftKey,
3470
- chord.altKey,
3471
- chord.metaKey,
3472
- 46
3473
- )))];
3474
- }
3475
- const scanCodeCombos = this._scanCodeKeyCodeMapper.lookupKeyCodeCombo(( (new KeyCodeCombo(chord.ctrlKey, chord.shiftKey, chord.altKey, chord.keyCode))));
3476
- const result = [];
3477
- for (let i = 0, len = scanCodeCombos.length; i < len; i++) {
3478
- const scanCodeCombo = scanCodeCombos[i];
3479
- result[i] = ( (new ScanCodeChord(
3480
- scanCodeCombo.ctrlKey,
3481
- scanCodeCombo.shiftKey,
3482
- scanCodeCombo.altKey,
3483
- chord.metaKey,
3484
- scanCodeCombo.scanCode
3485
- )));
3486
- }
3487
- return result;
3488
- }
3489
- getUILabelForScanCodeChord(chord) {
3490
- if (!chord) {
3491
- return null;
3492
- }
3493
- if (chord.isDuplicateModifierCase()) {
3494
- return '';
3495
- }
3496
- if (this._OS === 2 ) {
3497
- switch (chord.scanCode) {
3498
- case 86 :
3499
- return '←';
3500
- case 88 :
3501
- return '↑';
3502
- case 85 :
3503
- return '→';
3504
- case 87 :
3505
- return '↓';
3506
- }
3507
- }
3508
- return this._scanCodeToLabel[chord.scanCode];
3509
- }
3510
- getAriaLabelForScanCodeChord(chord) {
3511
- if (!chord) {
3512
- return null;
3513
- }
3514
- if (chord.isDuplicateModifierCase()) {
3515
- return '';
3516
- }
3517
- return this._scanCodeToLabel[chord.scanCode];
3518
- }
3519
- getDispatchStrForScanCodeChord(chord) {
3520
- const codeDispatch = this._scanCodeToDispatch[chord.scanCode];
3521
- if (!codeDispatch) {
3522
- return null;
3523
- }
3524
- let result = '';
3525
- if (chord.ctrlKey) {
3526
- result += 'ctrl+';
3527
- }
3528
- if (chord.shiftKey) {
3529
- result += 'shift+';
3530
- }
3531
- if (chord.altKey) {
3532
- result += 'alt+';
3533
- }
3534
- if (chord.metaKey) {
3535
- result += 'meta+';
3536
- }
3537
- result += codeDispatch;
3538
- return result;
3539
- }
3540
- getUserSettingsLabelForScanCodeChord(chord) {
3541
- if (!chord) {
3542
- return null;
3543
- }
3544
- if (chord.isDuplicateModifierCase()) {
3545
- return '';
3546
- }
3547
- const immutableKeyCode = IMMUTABLE_CODE_TO_KEY_CODE[chord.scanCode];
3548
- if (immutableKeyCode !== -1 ) {
3549
- return KeyCodeUtils.toUserSettingsUS(immutableKeyCode).toLowerCase();
3550
- }
3551
- const constantKeyCode = this._scanCodeKeyCodeMapper.guessStableKeyCode(chord.scanCode);
3552
- if (constantKeyCode !== -1 ) {
3553
- const reverseChords = this.keyCodeChordToScanCodeChord(( (new KeyCodeChord(
3554
- chord.ctrlKey,
3555
- chord.shiftKey,
3556
- chord.altKey,
3557
- chord.metaKey,
3558
- constantKeyCode
3559
- ))));
3560
- for (let i = 0, len = reverseChords.length; i < len; i++) {
3561
- const reverseChord = reverseChords[i];
3562
- if (reverseChord.scanCode === chord.scanCode) {
3563
- return KeyCodeUtils.toUserSettingsUS(constantKeyCode).toLowerCase();
3564
- }
3565
- }
3566
- }
3567
- return this._scanCodeToDispatch[chord.scanCode];
3568
- }
3569
- getElectronAcceleratorLabelForScanCodeChord(chord) {
3570
- if (!chord) {
3571
- return null;
3572
- }
3573
- const immutableKeyCode = IMMUTABLE_CODE_TO_KEY_CODE[chord.scanCode];
3574
- if (immutableKeyCode !== -1 ) {
3575
- return KeyCodeUtils.toElectronAccelerator(immutableKeyCode);
3576
- }
3577
- const constantKeyCode = this._scanCodeKeyCodeMapper.guessStableKeyCode(chord.scanCode);
3578
- if (this._OS === 3 && !this._isUSStandard) {
3579
- const isOEMKey = ((constantKeyCode === 80
3580
- || constantKeyCode === 81
3581
- || constantKeyCode === 82
3582
- || constantKeyCode === 83
3583
- || constantKeyCode === 84
3584
- || constantKeyCode === 85
3585
- || constantKeyCode === 86
3586
- || constantKeyCode === 87
3587
- || constantKeyCode === 88 || constantKeyCode === 89) );
3588
- if (isOEMKey) {
3589
- return null;
3590
- }
3591
- }
3592
- if (constantKeyCode !== -1 ) {
3593
- return KeyCodeUtils.toElectronAccelerator(constantKeyCode);
3594
- }
3595
- return null;
3596
- }
3597
- _toResolvedKeybinding(chordParts) {
3598
- if (chordParts.length === 0) {
3599
- return [];
3600
- }
3601
- const result = [];
3602
- this._generateResolvedKeybindings(chordParts, 0, [], result);
3603
- return result;
3604
- }
3605
- _generateResolvedKeybindings(chordParts, currentIndex, previousParts, result) {
3606
- const chordPart = chordParts[currentIndex];
3607
- const isFinalIndex = currentIndex === chordParts.length - 1;
3608
- for (let i = 0, len = chordPart.length; i < len; i++) {
3609
- const chords = [...previousParts, chordPart[i]];
3610
- if (isFinalIndex) {
3611
- result.push(( (new NativeResolvedKeybinding(this, this._OS, chords))));
3612
- }
3613
- else {
3614
- this._generateResolvedKeybindings(chordParts, currentIndex + 1, chords, result);
3615
- }
3616
- }
3617
- }
3618
- resolveKeyboardEvent(keyboardEvent) {
3619
- let code = ScanCodeUtils.toEnum(keyboardEvent.code);
3620
- if (code === 94 ) {
3621
- code = 46 ;
3622
- }
3623
- const keyCode = keyboardEvent.keyCode;
3624
- if (((keyCode === 15) )
3625
- || ((keyCode === 16) )
3626
- || ((keyCode === 17) )
3627
- || ((keyCode === 18) )
3628
- || ((keyCode === 20) )
3629
- || ((keyCode === 19) )
3630
- || ((keyCode === 14) )
3631
- || ((keyCode === 13) )
3632
- || ((keyCode === 12) )
3633
- || ((keyCode === 11) )
3634
- || ((keyCode === 1) )) {
3635
- const immutableScanCode = IMMUTABLE_KEY_CODE_TO_CODE[keyCode];
3636
- if (immutableScanCode !== -1 ) {
3637
- code = immutableScanCode;
3638
- }
3639
- }
3640
- else {
3641
- if (((code === 95) )
3642
- || ((code === 96) )
3643
- || ((code === 97) )
3644
- || ((code === 98) )
3645
- || ((code === 99) )
3646
- || ((code === 100) )
3647
- || ((code === 101) )
3648
- || ((code === 102) )
3649
- || ((code === 103) )
3650
- || ((code === 104) )
3651
- || ((code === 105) )) {
3652
- if (keyCode >= 0) {
3653
- const immutableScanCode = IMMUTABLE_KEY_CODE_TO_CODE[keyCode];
3654
- if (immutableScanCode !== -1 ) {
3655
- code = immutableScanCode;
3656
- }
3657
- }
3658
- }
3659
- }
3660
- const ctrlKey = keyboardEvent.ctrlKey || (this._mapAltGrToCtrlAlt && keyboardEvent.altGraphKey);
3661
- const altKey = keyboardEvent.altKey || (this._mapAltGrToCtrlAlt && keyboardEvent.altGraphKey);
3662
- const chord = ( (new ScanCodeChord(ctrlKey, keyboardEvent.shiftKey, altKey, keyboardEvent.metaKey, code)));
3663
- return (
3664
- (new NativeResolvedKeybinding(this, this._OS, [chord]))
3665
- );
3666
- }
3667
- _resolveChord(chord) {
3668
- if (!chord) {
3669
- return [];
3670
- }
3671
- if (chord instanceof ScanCodeChord) {
3672
- return [chord];
3673
- }
3674
- return this.keyCodeChordToScanCodeChord(chord);
3675
- }
3676
- resolveKeybinding(keybinding) {
3677
- const chords = ( (keybinding.chords.map(chord => this._resolveChord(chord))));
3678
- return this._toResolvedKeybinding(chords);
3679
- }
3680
- static _redirectCharCode(charCode) {
3681
- switch (charCode) {
3682
- case 12290 : return 46 ;
3683
- case 12300 : return 91 ;
3684
- case 12301 : return 93 ;
3685
- case 12304 : return 91 ;
3686
- case 12305 : return 93 ;
3687
- case 65307 : return 59 ;
3688
- case 65292 : return 44 ;
3689
- }
3690
- return charCode;
3691
- }
3692
- static _charCodeToKb(charCode) {
3693
- charCode = this._redirectCharCode(charCode);
3694
- if (charCode < CHAR_CODE_TO_KEY_CODE.length) {
3695
- return CHAR_CODE_TO_KEY_CODE[charCode];
3696
- }
3697
- return null;
3698
- }
3699
- static getCharCode(char) {
3700
- if (char.length === 0) {
3701
- return 0;
3702
- }
3703
- const charCode = char.charCodeAt(0);
3704
- switch (charCode) {
3705
- case 768 : return 96 ;
3706
- case 769 : return 180 ;
3707
- case 770 : return 94 ;
3708
- case 771 : return 732 ;
3709
- case 772 : return 175 ;
3710
- case 773 : return 8254 ;
3711
- case 774 : return 728 ;
3712
- case 775 : return 729 ;
3713
- case 776 : return 168 ;
3714
- case 778 : return 730 ;
3715
- case 779 : return 733 ;
3716
- }
3717
- return charCode;
3718
- }
3719
- }
3720
- (function () {
3721
- function define(charCode, keyCode, shiftKey) {
3722
- for (let i = CHAR_CODE_TO_KEY_CODE.length; i < charCode; i++) {
3723
- CHAR_CODE_TO_KEY_CODE[i] = null;
3724
- }
3725
- CHAR_CODE_TO_KEY_CODE[charCode] = { keyCode: keyCode, shiftKey: shiftKey };
3726
- }
3727
- for (let chCode = 65 ; chCode <= 90 ; chCode++) {
3728
- define(chCode, 31 + ((chCode - 65) ), true);
3729
- }
3730
- for (let chCode = 97 ; chCode <= 122 ; chCode++) {
3731
- define(chCode, 31 + ((chCode - 97) ), false);
3732
- }
3733
- define(59 , 80 , false);
3734
- define(58 , 80 , true);
3735
- define(61 , 81 , false);
3736
- define(43 , 81 , true);
3737
- define(44 , 82 , false);
3738
- define(60 , 82 , true);
3739
- define(45 , 83 , false);
3740
- define(95 , 83 , true);
3741
- define(46 , 84 , false);
3742
- define(62 , 84 , true);
3743
- define(47 , 85 , false);
3744
- define(63 , 85 , true);
3745
- define(96 , 86 , false);
3746
- define(126 , 86 , true);
3747
- define(91 , 87 , false);
3748
- define(123 , 87 , true);
3749
- define(92 , 88 , false);
3750
- define(124 , 88 , true);
3751
- define(93 , 89 , false);
3752
- define(125 , 89 , true);
3753
- define(39 , 90 , false);
3754
- define(34 , 90 , true);
3755
- })();
3756
- function __variableDynamicImportRuntime0__(path) {
3757
- switch (path) {
3758
- case './keyboardLayouts/layout.contribution.darwin.js': return import('./layout.contribution.darwin.js').then(module => module.default ?? module);
3759
- case './keyboardLayouts/layout.contribution.linux.js': return import('./layout.contribution.linux.js').then(module => module.default ?? module);
3760
- case './keyboardLayouts/layout.contribution.win.js': return import('./layout.contribution.win.js').then(module => module.default ?? module);
3761
- default: return new Promise(function(resolve, reject) {
3762
- (typeof queueMicrotask === 'function' ? queueMicrotask : setTimeout)(
3763
- reject.bind(null, new Error("Unknown variable dynamic import: " + path))
3764
- );
3765
- })
3766
- }
3767
- }
3768
- class BrowserKeyboardMapperFactoryBase extends Disposable {
3769
- get activeKeymap() {
3770
- return this._activeKeymapInfo;
3771
- }
3772
- get keymapInfos() {
3773
- return this._keymapInfos;
3774
- }
3775
- get activeKeyboardLayout() {
3776
- if (!this._initialized) {
3777
- return null;
3778
- }
3779
- return this._activeKeymapInfo?.layout ?? null;
3780
- }
3781
- get activeKeyMapping() {
3782
- if (!this._initialized) {
3783
- return null;
3784
- }
3785
- return this._activeKeymapInfo?.mapping ?? null;
3786
- }
3787
- get keyboardLayouts() {
3788
- return (
3789
- (this._keymapInfos.map(keymapInfo => keymapInfo.layout))
3790
- );
3791
- }
3792
- constructor(_configurationService) {
3793
- super();
3794
- this._configurationService = _configurationService;
3795
- this._onDidChangeKeyboardMapper = ( (new Emitter()));
3796
- this.onDidChangeKeyboardMapper = this._onDidChangeKeyboardMapper.event;
3797
- this._keyboardMapper = null;
3798
- this._initialized = false;
3799
- this._keymapInfos = [];
3800
- this._mru = [];
3801
- this._activeKeymapInfo = null;
3802
- if (navigator.keyboard && navigator.keyboard.addEventListener) {
3803
- navigator.keyboard.addEventListener('layoutchange', () => {
3804
- this._getBrowserKeyMapping().then((mapping) => {
3805
- if (this.isKeyMappingActive(mapping)) {
3806
- return;
3807
- }
3808
- this.setLayoutFromBrowserAPI();
3809
- });
3810
- });
3811
- }
3812
- this._register(this._configurationService.onDidChangeConfiguration((e) => {
3813
- if (e.affectsConfiguration('keyboard')) {
3814
- this._keyboardMapper = null;
3815
- this._onDidChangeKeyboardMapper.fire();
3816
- }
3817
- }));
3818
- }
3819
- registerKeyboardLayout(layout) {
3820
- this._keymapInfos.push(layout);
3821
- this._mru = this._keymapInfos;
3822
- }
3823
- removeKeyboardLayout(layout) {
3824
- let index = this._mru.indexOf(layout);
3825
- this._mru.splice(index, 1);
3826
- index = this._keymapInfos.indexOf(layout);
3827
- this._keymapInfos.splice(index, 1);
3828
- }
3829
- getMatchedKeymapInfo(keyMapping) {
3830
- if (!keyMapping) {
3831
- return null;
3832
- }
3833
- const usStandard = this.getUSStandardLayout();
3834
- if (usStandard) {
3835
- let maxScore = usStandard.getScore(keyMapping);
3836
- if (maxScore === 0) {
3837
- return {
3838
- result: usStandard,
3839
- score: 0
3840
- };
3841
- }
3842
- let result = usStandard;
3843
- for (let i = 0; i < this._mru.length; i++) {
3844
- const score = this._mru[i].getScore(keyMapping);
3845
- if (score > maxScore) {
3846
- if (score === 0) {
3847
- return {
3848
- result: this._mru[i],
3849
- score: 0
3850
- };
3851
- }
3852
- maxScore = score;
3853
- result = this._mru[i];
3854
- }
3855
- }
3856
- return {
3857
- result,
3858
- score: maxScore
3859
- };
3860
- }
3861
- for (let i = 0; i < this._mru.length; i++) {
3862
- if (this._mru[i].fuzzyEqual(keyMapping)) {
3863
- return {
3864
- result: this._mru[i],
3865
- score: 0
3866
- };
3867
- }
3868
- }
3869
- return null;
3870
- }
3871
- getUSStandardLayout() {
3872
- const usStandardLayouts = this._mru.filter(layout => layout.layout.isUSStandard);
3873
- if (usStandardLayouts.length) {
3874
- return usStandardLayouts[0];
3875
- }
3876
- return null;
3877
- }
3878
- isKeyMappingActive(keymap) {
3879
- return this._activeKeymapInfo && keymap && this._activeKeymapInfo.fuzzyEqual(keymap);
3880
- }
3881
- setUSKeyboardLayout() {
3882
- this._activeKeymapInfo = this.getUSStandardLayout();
3883
- }
3884
- setActiveKeyMapping(keymap) {
3885
- let keymapUpdated = false;
3886
- const matchedKeyboardLayout = this.getMatchedKeymapInfo(keymap);
3887
- if (matchedKeyboardLayout) {
3888
- if (!this._activeKeymapInfo) {
3889
- this._activeKeymapInfo = matchedKeyboardLayout.result;
3890
- keymapUpdated = true;
3891
- }
3892
- else if (keymap) {
3893
- if (matchedKeyboardLayout.result.getScore(keymap) > this._activeKeymapInfo.getScore(keymap)) {
3894
- this._activeKeymapInfo = matchedKeyboardLayout.result;
3895
- keymapUpdated = true;
3896
- }
3897
- }
3898
- }
3899
- if (!this._activeKeymapInfo) {
3900
- this._activeKeymapInfo = this.getUSStandardLayout();
3901
- keymapUpdated = true;
3902
- }
3903
- if (!this._activeKeymapInfo || !keymapUpdated) {
3904
- return;
3905
- }
3906
- const index = this._mru.indexOf(this._activeKeymapInfo);
3907
- this._mru.splice(index, 1);
3908
- this._mru.unshift(this._activeKeymapInfo);
3909
- this._setKeyboardData(this._activeKeymapInfo);
3910
- }
3911
- setActiveKeymapInfo(keymapInfo) {
3912
- this._activeKeymapInfo = keymapInfo;
3913
- const index = this._mru.indexOf(this._activeKeymapInfo);
3914
- if (index === 0) {
3915
- return;
3916
- }
3917
- this._mru.splice(index, 1);
3918
- this._mru.unshift(this._activeKeymapInfo);
3919
- this._setKeyboardData(this._activeKeymapInfo);
3920
- }
3921
- setLayoutFromBrowserAPI() {
3922
- this._updateKeyboardLayoutAsync(this._initialized);
3923
- }
3924
- _updateKeyboardLayoutAsync(initialized, keyboardEvent) {
3925
- if (!initialized) {
3926
- return;
3927
- }
3928
- this._getBrowserKeyMapping(keyboardEvent).then(keyMap => {
3929
- if (this.isKeyMappingActive(keyMap)) {
3930
- return;
3931
- }
3932
- this.setActiveKeyMapping(keyMap);
3933
- });
3934
- }
3935
- getKeyboardMapper() {
3936
- const config = readKeyboardConfig(this._configurationService);
3937
- if (config.dispatch === 1 || !this._initialized || !this._activeKeymapInfo) {
3938
- return (
3939
- (new FallbackKeyboardMapper(config.mapAltGrToCtrlAlt, OS))
3940
- );
3941
- }
3942
- if (!this._keyboardMapper) {
3943
- this._keyboardMapper = ( (new CachedKeyboardMapper(
3944
- BrowserKeyboardMapperFactory._createKeyboardMapper(this._activeKeymapInfo, config.mapAltGrToCtrlAlt)
3945
- )));
3946
- }
3947
- return this._keyboardMapper;
3948
- }
3949
- validateCurrentKeyboardMapping(keyboardEvent) {
3950
- if (!this._initialized) {
3951
- return;
3952
- }
3953
- const isCurrentKeyboard = this._validateCurrentKeyboardMapping(keyboardEvent);
3954
- if (isCurrentKeyboard) {
3955
- return;
3956
- }
3957
- this._updateKeyboardLayoutAsync(true, keyboardEvent);
3958
- }
3959
- setKeyboardLayout(layoutName) {
3960
- const matchedLayouts = this.keymapInfos.filter(keymapInfo => getKeyboardLayoutId(keymapInfo.layout) === layoutName);
3961
- if (matchedLayouts.length > 0) {
3962
- this.setActiveKeymapInfo(matchedLayouts[0]);
3963
- }
3964
- }
3965
- _setKeyboardData(keymapInfo) {
3966
- this._initialized = true;
3967
- this._keyboardMapper = null;
3968
- this._onDidChangeKeyboardMapper.fire();
3969
- }
3970
- static _createKeyboardMapper(keymapInfo, mapAltGrToCtrlAlt) {
3971
- const rawMapping = keymapInfo.mapping;
3972
- const isUSStandard = !!keymapInfo.layout.isUSStandard;
3973
- if (OS === 1 ) {
3974
- return (
3975
- (new WindowsKeyboardMapper(isUSStandard, rawMapping, mapAltGrToCtrlAlt))
3976
- );
3977
- }
3978
- if (( (Object.keys(rawMapping))).length === 0) {
3979
- return (
3980
- (new FallbackKeyboardMapper(mapAltGrToCtrlAlt, OS))
3981
- );
3982
- }
3983
- return (
3984
- (new MacLinuxKeyboardMapper(isUSStandard, rawMapping, mapAltGrToCtrlAlt, OS))
3985
- );
3986
- }
3987
- _validateCurrentKeyboardMapping(keyboardEvent) {
3988
- if (!this._initialized) {
3989
- return true;
3990
- }
3991
- const standardKeyboardEvent = keyboardEvent;
3992
- const currentKeymap = this._activeKeymapInfo;
3993
- if (!currentKeymap) {
3994
- return true;
3995
- }
3996
- if (standardKeyboardEvent.browserEvent.key === 'Dead' || standardKeyboardEvent.browserEvent.isComposing) {
3997
- return true;
3998
- }
3999
- const mapping = currentKeymap.mapping[standardKeyboardEvent.code];
4000
- if (!mapping) {
4001
- return false;
4002
- }
4003
- if (mapping.value === '') {
4004
- if (keyboardEvent.ctrlKey || keyboardEvent.metaKey) {
4005
- setTimeout(() => {
4006
- this._getBrowserKeyMapping().then((keymap) => {
4007
- if (this.isKeyMappingActive(keymap)) {
4008
- return;
4009
- }
4010
- this.setLayoutFromBrowserAPI();
4011
- });
4012
- }, 350);
4013
- }
4014
- return true;
4015
- }
4016
- const expectedValue = standardKeyboardEvent.altKey && standardKeyboardEvent.shiftKey ? mapping.withShiftAltGr :
4017
- standardKeyboardEvent.altKey ? mapping.withAltGr :
4018
- standardKeyboardEvent.shiftKey ? mapping.withShift : mapping.value;
4019
- const isDead = (standardKeyboardEvent.altKey && standardKeyboardEvent.shiftKey && mapping.withShiftAltGrIsDeadKey) ||
4020
- (standardKeyboardEvent.altKey && mapping.withAltGrIsDeadKey) ||
4021
- (standardKeyboardEvent.shiftKey && mapping.withShiftIsDeadKey) ||
4022
- mapping.valueIsDeadKey;
4023
- if (isDead && standardKeyboardEvent.browserEvent.key !== 'Dead') {
4024
- return false;
4025
- }
4026
- if (!isDead && standardKeyboardEvent.browserEvent.key !== expectedValue) {
4027
- return false;
4028
- }
4029
- return true;
4030
- }
4031
- async _getBrowserKeyMapping(keyboardEvent) {
4032
- if (navigator.keyboard) {
4033
- try {
4034
- return navigator.keyboard.getLayoutMap().then((e) => {
4035
- const ret = {};
4036
- for (const key of e) {
4037
- ret[key[0]] = {
4038
- 'value': key[1],
4039
- 'withShift': '',
4040
- 'withAltGr': '',
4041
- 'withShiftAltGr': ''
4042
- };
4043
- }
4044
- return ret;
4045
- });
4046
- }
4047
- catch {
4048
- }
4049
- }
4050
- else if (keyboardEvent && !keyboardEvent.shiftKey && !keyboardEvent.altKey && !keyboardEvent.metaKey && !keyboardEvent.metaKey) {
4051
- const ret = {};
4052
- const standardKeyboardEvent = keyboardEvent;
4053
- ret[standardKeyboardEvent.browserEvent.code] = {
4054
- 'value': standardKeyboardEvent.browserEvent.key,
4055
- 'withShift': '',
4056
- 'withAltGr': '',
4057
- 'withShiftAltGr': ''
4058
- };
4059
- const matchedKeyboardLayout = this.getMatchedKeymapInfo(ret);
4060
- if (matchedKeyboardLayout) {
4061
- return ret;
4062
- }
4063
- return null;
4064
- }
4065
- return null;
4066
- }
4067
- }
4068
- class BrowserKeyboardMapperFactory extends BrowserKeyboardMapperFactoryBase {
4069
- constructor(configurationService, notificationService, storageService, commandService) {
4070
- super(configurationService);
4071
- const platform = isWindows ? 'win' : isMacintosh ? 'darwin' : 'linux';
4072
- __variableDynamicImportRuntime0__('./keyboardLayouts/layout.contribution.' + platform + '.js').then((m) => {
4073
- const keymapInfos = m.KeyboardLayoutContribution.INSTANCE.layoutInfos;
4074
- this._keymapInfos.push(...( (keymapInfos.map(info => (( (new KeymapInfo(
4075
- info.layout,
4076
- info.secondaryLayouts,
4077
- info.mapping,
4078
- info.isUserKeyboardLayout
4079
- ))))))));
4080
- this._mru = this._keymapInfos;
4081
- this._initialized = true;
4082
- this.setLayoutFromBrowserAPI();
4083
- });
4084
- }
4085
- }
4086
- class UserKeyboardLayout extends Disposable {
4087
- get keyboardLayout() { return this._keyboardLayout; }
4088
- constructor(keyboardLayoutResource, fileService) {
4089
- super();
4090
- this.keyboardLayoutResource = keyboardLayoutResource;
4091
- this.fileService = fileService;
4092
- this._onDidChange = this._register(( (new Emitter())));
4093
- this.onDidChange = this._onDidChange.event;
4094
- this._keyboardLayout = null;
4095
- this.reloadConfigurationScheduler = this._register(( (new RunOnceScheduler(() => this.reload().then(changed => {
4096
- if (changed) {
4097
- this._onDidChange.fire();
4098
- }
4099
- }), 50))));
4100
- this._register(Event.filter(this.fileService.onDidFilesChange, e => e.contains(this.keyboardLayoutResource))(() => this.reloadConfigurationScheduler.schedule()));
4101
- }
4102
- async initialize() {
4103
- await this.reload();
4104
- }
4105
- async reload() {
4106
- const existing = this._keyboardLayout;
4107
- try {
4108
- const content = await this.fileService.readFile(this.keyboardLayoutResource);
4109
- const value = parse$1(( (content.value.toString())));
4110
- if (getNodeType(value) === 'object') {
4111
- const layoutInfo = value.layout;
4112
- const mappings = value.rawMapping;
4113
- this._keyboardLayout = KeymapInfo.createKeyboardLayoutFromDebugInfo(layoutInfo, mappings, true);
4114
- }
4115
- else {
4116
- this._keyboardLayout = null;
4117
- }
4118
- }
4119
- catch (e) {
4120
- this._keyboardLayout = null;
4121
- }
4122
- return existing ? !equals(existing, this._keyboardLayout) : true;
4123
- }
4124
- }
4125
- let BrowserKeyboardLayoutService = class BrowserKeyboardLayoutService extends Disposable {
4126
- constructor(environmentService, fileService, notificationService, storageService, commandService, configurationService) {
4127
- super();
4128
- this.configurationService = configurationService;
4129
- this._onDidChangeKeyboardLayout = ( (new Emitter()));
4130
- this.onDidChangeKeyboardLayout = this._onDidChangeKeyboardLayout.event;
4131
- const keyboardConfig = configurationService.getValue('keyboard');
4132
- const layout = keyboardConfig.layout;
4133
- this._keyboardLayoutMode = layout ?? 'autodetect';
4134
- this._factory = ( (new BrowserKeyboardMapperFactory(configurationService, notificationService, storageService, commandService)));
4135
- this._register(this._factory.onDidChangeKeyboardMapper(() => {
4136
- this._onDidChangeKeyboardLayout.fire();
4137
- }));
4138
- if (layout && layout !== 'autodetect') {
4139
- this._factory.setKeyboardLayout(layout);
4140
- }
4141
- this._register(configurationService.onDidChangeConfiguration(e => {
4142
- if (e.affectsConfiguration('keyboard.layout')) {
4143
- const keyboardConfig = configurationService.getValue('keyboard');
4144
- const layout = keyboardConfig.layout;
4145
- this._keyboardLayoutMode = layout;
4146
- if (layout === 'autodetect') {
4147
- this._factory.setLayoutFromBrowserAPI();
4148
- }
4149
- else {
4150
- this._factory.setKeyboardLayout(layout);
4151
- }
4152
- }
4153
- }));
4154
- this._userKeyboardLayout = ( (new UserKeyboardLayout(environmentService.keyboardLayoutResource, fileService)));
4155
- this._userKeyboardLayout.initialize().then(() => {
4156
- if (this._userKeyboardLayout.keyboardLayout) {
4157
- this._factory.registerKeyboardLayout(this._userKeyboardLayout.keyboardLayout);
4158
- this.setUserKeyboardLayoutIfMatched();
4159
- }
4160
- });
4161
- this._register(this._userKeyboardLayout.onDidChange(() => {
4162
- const userKeyboardLayouts = this._factory.keymapInfos.filter(layout => layout.isUserKeyboardLayout);
4163
- if (userKeyboardLayouts.length) {
4164
- if (this._userKeyboardLayout.keyboardLayout) {
4165
- userKeyboardLayouts[0].update(this._userKeyboardLayout.keyboardLayout);
4166
- }
4167
- else {
4168
- this._factory.removeKeyboardLayout(userKeyboardLayouts[0]);
4169
- }
4170
- }
4171
- else {
4172
- if (this._userKeyboardLayout.keyboardLayout) {
4173
- this._factory.registerKeyboardLayout(this._userKeyboardLayout.keyboardLayout);
4174
- }
4175
- }
4176
- this.setUserKeyboardLayoutIfMatched();
4177
- }));
4178
- }
4179
- setUserKeyboardLayoutIfMatched() {
4180
- const keyboardConfig = this.configurationService.getValue('keyboard');
4181
- const layout = keyboardConfig.layout;
4182
- if (layout && this._userKeyboardLayout.keyboardLayout) {
4183
- if (getKeyboardLayoutId(this._userKeyboardLayout.keyboardLayout.layout) === layout && this._factory.activeKeymap) {
4184
- if (!this._userKeyboardLayout.keyboardLayout.equal(this._factory.activeKeymap)) {
4185
- this._factory.setActiveKeymapInfo(this._userKeyboardLayout.keyboardLayout);
4186
- }
4187
- }
4188
- }
4189
- }
4190
- getKeyboardMapper() {
4191
- return this._factory.getKeyboardMapper();
4192
- }
4193
- getCurrentKeyboardLayout() {
4194
- return this._factory.activeKeyboardLayout;
4195
- }
4196
- getAllKeyboardLayouts() {
4197
- return this._factory.keyboardLayouts;
4198
- }
4199
- getRawKeyboardMapping() {
4200
- return this._factory.activeKeyMapping;
4201
- }
4202
- validateCurrentKeyboardMapping(keyboardEvent) {
4203
- if (this._keyboardLayoutMode !== 'autodetect') {
4204
- return;
4205
- }
4206
- this._factory.validateCurrentKeyboardMapping(keyboardEvent);
4207
- }
4208
- };
4209
- BrowserKeyboardLayoutService = ( (__decorate([
4210
- ( (__param(0, IEnvironmentService))),
4211
- ( (__param(1, IFileService))),
4212
- ( (__param(2, INotificationService))),
4213
- ( (__param(3, IStorageService))),
4214
- ( (__param(4, ICommandService))),
4215
- ( (__param(5, IConfigurationService)))
4216
- ], BrowserKeyboardLayoutService)));
4217
- const configurationRegistry$1 = ( (Registry.as(Extensions.Configuration)));
4218
- const keyboardConfiguration = {
4219
- 'id': 'keyboard',
4220
- 'order': 15,
4221
- 'type': 'object',
4222
- 'title': ( (localize('keyboardConfigurationTitle', "Keyboard"))),
4223
- 'properties': {
4224
- 'keyboard.layout': {
4225
- 'type': 'string',
4226
- 'default': 'autodetect',
4227
- 'description': ( (localize('keyboard.layout.config', "Control the keyboard layout used in web.")))
4228
- }
4229
- }
4230
- };
4231
- configurationRegistry$1.registerConfiguration(keyboardConfiguration);
4232
- let DelegateStandaloneKeybindingService = class DelegateStandaloneKeybindingService extends createInjectedClass(StandaloneKeybindingService) {
4233
- constructor(instantiationService) {
4234
- super(instantiationService);
4235
- this.delegate = instantiationService.createInstance(WorkbenchKeybindingService);
4236
- this._cachedOverridenResolver = null;
4237
- this.onDidUpdateKeybindings(() => {
4238
- this._cachedOverridenResolver = null;
4239
- });
4240
- this.delegate.onDidUpdateKeybindings(() => {
4241
- this._cachedOverridenResolver = null;
4242
- });
4243
- }
4244
- _getResolver() {
4245
- if (this._cachedOverridenResolver == null) {
4246
- const overrides = this['_toNormalizedKeybindingItems'](this['_dynamicKeybindings'], false);
4247
- this._cachedOverridenResolver = new KeybindingResolver(
4248
- [...this.delegate['_getResolver']().getKeybindings()], overrides, (str) => this._log(str));
4249
- }
4250
- return this._cachedOverridenResolver;
4251
- }
4252
- };
4253
- DelegateStandaloneKeybindingService = __decorate([
4254
- ( __param(0, IInstantiationService))
4255
- ], DelegateStandaloneKeybindingService);
4256
- const quickAccessRegistry = ( Registry.as(Extensions$1.Quickaccess));
4257
- const provider = quickAccessRegistry.getQuickAccessProviders().find(provider => provider.ctor === StandaloneCommandsQuickAccessProvider);
4258
- if (provider != null) {
4259
- provider.ctor = class extends CommandsQuickAccessProvider {
4260
- get defaultFilterValue() { return undefined; }
4261
- async getCommandPicks(token) {
4262
- return ( (await super.getCommandPicks(token)).map(pick => {
4263
- pick.buttons = [];
4264
- return pick;
4265
- }));
4266
- }
4267
- };
4268
- }
4269
- const configurationRegistry = ( Registry.as(Extensions.Configuration));
4270
- configurationRegistry.registerConfiguration({
4271
- properties: {
4272
- 'workbench.commandPalette.history': {
4273
- type: 'number',
4274
- description: ( localize(
4275
- 'commandHistory',
4276
- 'Controls the number of recently used commands to keep in history for the command palette. Set to 0 to disable command history.'
4277
- )),
4278
- default: 50,
4279
- minimum: 0
4280
- },
4281
- 'workbench.commandPalette.preserveInput': {
4282
- type: 'boolean',
4283
- description: ( localize(
4284
- 'preserveInput',
4285
- 'Controls whether the last typed input to the command palette should be restored when opening it the next time.'
4286
- )),
4287
- default: false
4288
- },
4289
- 'workbench.commandPalette.experimental.suggestCommands': {
4290
- type: 'boolean',
4291
- description: ( localize(
4292
- 'suggestCommands',
4293
- 'Controls whether the command palette should have a list of commonly used commands.'
4294
- )),
4295
- default: false
4296
- }
4297
- }
4298
- });
4299
- async function updateUserKeybindings(keybindingsJson) {
4300
- const userDataProfilesService = StandaloneServices.get(IUserDataProfilesService);
4301
- await StandaloneServices.get(IFileService).writeFile(userDataProfilesService.defaultProfile.keybindingsResource, VSBuffer.fromString(keybindingsJson));
4302
- }
4303
- function getServiceOverride() {
4304
- return {
4305
- ...getServiceOverride$1(),
4306
- [( IKeybindingService.toString())]: new SyncDescriptor(DelegateStandaloneKeybindingService),
4307
- [( IKeyboardLayoutService.toString())]: new SyncDescriptor(BrowserKeyboardLayoutService, undefined, true)
4308
- };
4309
- }
4310
- export { getServiceOverride as default, updateUserKeybindings };