@codingame/monaco-vscode-api 1.83.8 → 1.83.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (294) hide show
  1. package/extensions.js +5 -5
  2. package/lifecycle.js +21 -1
  3. package/missing-services.js +187 -24
  4. package/monaco-editor-treemending.patch +955 -955
  5. package/package.json +12 -6
  6. package/services.d.ts +2 -4
  7. package/services.js +28 -27
  8. package/vscode/src/vs/base/common/uriIpc.js +22 -1
  9. package/vscode/src/vs/base/parts/request/common/request.js +7 -1
  10. package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.js +116 -1
  11. package/vscode/src/vs/platform/extensionManagement/common/extensionManagementUtil.js +117 -2
  12. package/vscode/src/vs/platform/extensionRecommendations/common/extensionRecommendations.js +10 -0
  13. package/vscode/src/vs/platform/extensionResourceLoader/browser/extensionResourceLoaderService.js +42 -0
  14. package/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.js +12 -1
  15. package/vscode/src/vs/platform/extensions/common/extensionValidator.js +306 -1
  16. package/vscode/src/vs/platform/log/common/log.d.ts +27 -2
  17. package/vscode/src/vs/platform/remote/common/remoteAgentConnection.d.ts +9 -1
  18. package/vscode/src/vs/platform/remote/common/remoteExtensionsScanner.js +2 -1
  19. package/vscode/src/vs/platform/request/common/request.js +38 -1
  20. package/vscode/src/vs/platform/telemetry/common/telemetryUtils.js +2 -1
  21. package/vscode/src/vs/platform/tunnel/common/tunnel.d.ts +50 -1
  22. package/vscode/src/vs/platform/userDataProfile/common/userDataProfileIpc.js +63 -0
  23. package/vscode/src/vs/platform/userDataSync/common/ignoredExtensions.js +65 -0
  24. package/vscode/src/vs/platform/userDataSync/common/userDataSync.js +2 -1
  25. package/vscode/src/vs/platform/userDataSync/common/userDataSyncAccount.js +3 -0
  26. package/vscode/src/vs/platform/workspace/common/workspace.d.ts +16 -1
  27. package/vscode/src/vs/platform/workspaces/common/workspaces.d.ts +6 -2
  28. package/vscode/src/vs/workbench/api/worker/extensionHostWorker.js +1 -1
  29. package/vscode/src/vs/workbench/common/theme.js +3 -3
  30. package/vscode/src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.css.js +4 -0
  31. package/vscode/src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.js +248 -0
  32. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.js +3291 -0
  33. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsIcons.js +16 -16
  34. package/vscode/src/vs/workbench/contrib/extensions/browser/media/extensionActions.css.js +4 -0
  35. package/vscode/src/vs/workbench/contrib/extensions/common/extensions.js +45 -1
  36. package/vscode/src/vs/workbench/contrib/extensions/common/extensionsFileTemplate.js +67 -0
  37. package/vscode/src/vs/workbench/services/extensionManagement/browser/extensionBisect.js +396 -0
  38. package/vscode/src/vs/workbench/services/extensionManagement/common/extensionManagement.d.ts +23 -3
  39. package/vscode/src/vs/workbench/services/extensionManagement/common/extensionManagement.js +4 -1
  40. package/vscode/src/vs/workbench/services/extensionRecommendations/common/extensionRecommendations.js +4 -0
  41. package/vscode/src/vs/workbench/services/extensionRecommendations/common/workspaceExtensionsConfig.js +255 -0
  42. package/vscode/src/vs/workbench/services/extensions/browser/extensionService.d.ts +44 -0
  43. package/vscode/src/vs/workbench/services/extensions/common/extensionDescriptionRegistry.d.ts +1 -1
  44. package/vscode/src/vs/workbench/services/extensions/common/extensionHostProtocol.d.ts +1 -1
  45. package/vscode/src/vs/workbench/services/extensions/common/extensions.js +2 -1
  46. package/vscode/src/vs/workbench/services/localization/common/locale.js +4 -0
  47. package/vscode/src/vs/workbench/services/log/common/logConstants.js +2 -1
  48. package/vscode/src/vs/workbench/services/remote/common/remoteExplorerService.d.ts +68 -0
  49. package/vscode/src/vs/workbench/services/remote/common/tunnelModel.d.ts +172 -1
  50. package/vscode/src/vs/workbench/services/userDataProfile/common/remoteUserDataProfiles.js +150 -0
  51. package/vscode/src/vs/workbench/services/userDataSync/common/userDataSync.js +3 -1
  52. package/vscode.proposed.d.ts +4787 -0
  53. package/workbench.js +0 -1
  54. package/service-override/bulkEdit.js +0 -9
  55. package/service-override/environment.js +0 -21
  56. package/service-override/extensions.js +0 -465
  57. package/service-override/files.js +0 -471
  58. package/service-override/keybindings.js +0 -99
  59. package/service-override/layout.js +0 -229
  60. package/service-override/output.js +0 -23
  61. package/service-override/quickaccess.js +0 -98
  62. package/vscode/src/vs/base/common/console.js +0 -58
  63. package/vscode/src/vs/base/common/keybindingParser.js +0 -87
  64. package/vscode/src/vs/base/common/prefixTree.js +0 -130
  65. package/vscode/src/vs/base/common/tfIdf.js +0 -137
  66. package/vscode/src/vs/editor/contrib/quickAccess/browser/commandsQuickAccess.js +0 -23
  67. package/vscode/src/vs/platform/files/browser/indexedDBFileSystemProvider.js +0 -404
  68. package/vscode/src/vs/platform/files/common/fileService.js +0 -957
  69. package/vscode/src/vs/platform/files/common/files.js +0 -81
  70. package/vscode/src/vs/platform/files/common/inMemoryFilesystemProvider.js +0 -220
  71. package/vscode/src/vs/platform/files/common/io.js +0 -75
  72. package/vscode/src/vs/platform/files/common/watcher.js +0 -69
  73. package/vscode/src/vs/platform/keyboardLayout/common/keyboardConfig.js +0 -48
  74. package/vscode/src/vs/platform/keyboardLayout/common/keyboardMapper.js +0 -23
  75. package/vscode/src/vs/platform/lifecycle/common/lifecycle.js +0 -25
  76. package/vscode/src/vs/platform/log/common/fileLog.js +0 -105
  77. package/vscode/src/vs/platform/quickinput/browser/commandsQuickAccess.js +0 -331
  78. package/vscode/src/vs/platform/quickinput/browser/helpQuickAccess.js +0 -65
  79. package/vscode/src/vs/platform/remote/common/managedSocket.js +0 -96
  80. package/vscode/src/vs/workbench/api/browser/mainThreadAiEmbeddingVector.js +0 -29
  81. package/vscode/src/vs/workbench/api/browser/mainThreadAiRelatedInformation.js +0 -33
  82. package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.js +0 -328
  83. package/vscode/src/vs/workbench/api/browser/mainThreadBulkEdits.js +0 -66
  84. package/vscode/src/vs/workbench/api/browser/mainThreadChat.js +0 -172
  85. package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents.js +0 -50
  86. package/vscode/src/vs/workbench/api/browser/mainThreadChatProvider.js +0 -59
  87. package/vscode/src/vs/workbench/api/browser/mainThreadChatSlashCommands.js +0 -47
  88. package/vscode/src/vs/workbench/api/browser/mainThreadChatVariables.js +0 -29
  89. package/vscode/src/vs/workbench/api/browser/mainThreadClipboard.js +0 -22
  90. package/vscode/src/vs/workbench/api/browser/mainThreadCodeInsets.js +0 -105
  91. package/vscode/src/vs/workbench/api/browser/mainThreadCommands.js +0 -92
  92. package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +0 -539
  93. package/vscode/src/vs/workbench/api/browser/mainThreadConfiguration.js +0 -78
  94. package/vscode/src/vs/workbench/api/browser/mainThreadConsole.js +0 -33
  95. package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +0 -576
  96. package/vscode/src/vs/workbench/api/browser/mainThreadDebugService.js +0 -385
  97. package/vscode/src/vs/workbench/api/browser/mainThreadDecorations.js +0 -100
  98. package/vscode/src/vs/workbench/api/browser/mainThreadDiagnostics.js +0 -67
  99. package/vscode/src/vs/workbench/api/browser/mainThreadDialogs.js +0 -66
  100. package/vscode/src/vs/workbench/api/browser/mainThreadDocumentContentProviders.js +0 -73
  101. package/vscode/src/vs/workbench/api/browser/mainThreadDocuments.js +0 -247
  102. package/vscode/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.js +0 -368
  103. package/vscode/src/vs/workbench/api/browser/mainThreadDownloadService.js +0 -20
  104. package/vscode/src/vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant.js +0 -39
  105. package/vscode/src/vs/workbench/api/browser/mainThreadEditor.js +0 -409
  106. package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +0 -473
  107. package/vscode/src/vs/workbench/api/browser/mainThreadEditors.js +0 -225
  108. package/vscode/src/vs/workbench/api/browser/mainThreadErrors.js +0 -22
  109. package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.js +0 -315
  110. package/vscode/src/vs/workbench/api/browser/mainThreadFileSystem.js +0 -278
  111. package/vscode/src/vs/workbench/api/browser/mainThreadFileSystemEventService.js +0 -281
  112. package/vscode/src/vs/workbench/api/browser/mainThreadInlineChat.js +0 -66
  113. package/vscode/src/vs/workbench/api/browser/mainThreadInteractive.js +0 -26
  114. package/vscode/src/vs/workbench/api/browser/mainThreadIssueReporter.js +0 -31
  115. package/vscode/src/vs/workbench/api/browser/mainThreadLabelService.js +0 -25
  116. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.js +0 -945
  117. package/vscode/src/vs/workbench/api/browser/mainThreadLanguages.js +0 -76
  118. package/vscode/src/vs/workbench/api/browser/mainThreadLocalization.js +0 -33
  119. package/vscode/src/vs/workbench/api/browser/mainThreadLogService.js +0 -76
  120. package/vscode/src/vs/workbench/api/browser/mainThreadManagedSockets.js +0 -91
  121. package/vscode/src/vs/workbench/api/browser/mainThreadMessageService.js +0 -116
  122. package/vscode/src/vs/workbench/api/browser/mainThreadNotebook.js +0 -156
  123. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocuments.js +0 -121
  124. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.js +0 -186
  125. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDto.js +0 -127
  126. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookEditors.js +0 -129
  127. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookKernels.js +0 -339
  128. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookRenderers.js +0 -23
  129. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.js +0 -46
  130. package/vscode/src/vs/workbench/api/browser/mainThreadOutputService.js +0 -74
  131. package/vscode/src/vs/workbench/api/browser/mainThreadProfilContentHandlers.js +0 -36
  132. package/vscode/src/vs/workbench/api/browser/mainThreadProgress.js +0 -66
  133. package/vscode/src/vs/workbench/api/browser/mainThreadQuickDiff.js +0 -47
  134. package/vscode/src/vs/workbench/api/browser/mainThreadQuickOpen.js +0 -183
  135. package/vscode/src/vs/workbench/api/browser/mainThreadRemoteConnectionData.js +0 -28
  136. package/vscode/src/vs/workbench/api/browser/mainThreadSCM.js +0 -461
  137. package/vscode/src/vs/workbench/api/browser/mainThreadSaveParticipant.js +0 -47
  138. package/vscode/src/vs/workbench/api/browser/mainThreadSearch.js +0 -146
  139. package/vscode/src/vs/workbench/api/browser/mainThreadSecretState.js +0 -68
  140. package/vscode/src/vs/workbench/api/browser/mainThreadShare.js +0 -48
  141. package/vscode/src/vs/workbench/api/browser/mainThreadStatusBar.js +0 -51
  142. package/vscode/src/vs/workbench/api/browser/mainThreadStorage.js +0 -70
  143. package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +0 -729
  144. package/vscode/src/vs/workbench/api/browser/mainThreadTelemetry.js +0 -51
  145. package/vscode/src/vs/workbench/api/browser/mainThreadTerminalService.js +0 -410
  146. package/vscode/src/vs/workbench/api/browser/mainThreadTesting.js +0 -180
  147. package/vscode/src/vs/workbench/api/browser/mainThreadTheming.js +0 -22
  148. package/vscode/src/vs/workbench/api/browser/mainThreadTimeline.js +0 -53
  149. package/vscode/src/vs/workbench/api/browser/mainThreadTreeViews.js +0 -311
  150. package/vscode/src/vs/workbench/api/browser/mainThreadTunnelService.js +0 -221
  151. package/vscode/src/vs/workbench/api/browser/mainThreadUriOpeners.js +0 -108
  152. package/vscode/src/vs/workbench/api/browser/mainThreadUrls.js +0 -59
  153. package/vscode/src/vs/workbench/api/browser/mainThreadWebviewManager.js +0 -27
  154. package/vscode/src/vs/workbench/api/browser/mainThreadWebviewPanels.js +0 -281
  155. package/vscode/src/vs/workbench/api/browser/mainThreadWebviewViews.js +0 -98
  156. package/vscode/src/vs/workbench/api/browser/mainThreadWebviews.js +0 -133
  157. package/vscode/src/vs/workbench/api/browser/mainThreadWindow.js +0 -55
  158. package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.js +0 -271
  159. package/vscode/src/vs/workbench/api/common/shared/dataTransferCache.js +0 -33
  160. package/vscode/src/vs/workbench/browser/actions/quickAccessActions.js +0 -230
  161. package/vscode/src/vs/workbench/browser/contextkeys.js +0 -249
  162. package/vscode/src/vs/workbench/contrib/bulkEdit/browser/bulkEditService.js +0 -358
  163. package/vscode/src/vs/workbench/contrib/bulkEdit/browser/bulkFileEdits.js +0 -362
  164. package/vscode/src/vs/workbench/contrib/bulkEdit/browser/bulkTextEdits.js +0 -265
  165. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatActions.js +0 -2
  166. package/vscode/src/vs/workbench/contrib/chat/common/chatModel.js +0 -215
  167. package/vscode/src/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoLineQuickAccess.js +0 -86
  168. package/vscode/src/vs/workbench/contrib/comments/browser/commentColors.js +0 -55
  169. package/vscode/src/vs/workbench/contrib/comments/browser/commentFormActions.js +0 -49
  170. package/vscode/src/vs/workbench/contrib/comments/browser/commentGlyphWidget.js +0 -90
  171. package/vscode/src/vs/workbench/contrib/comments/browser/commentNode.js +0 -646
  172. package/vscode/src/vs/workbench/contrib/comments/browser/commentReply.js +0 -295
  173. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadAdditionalActions.js +0 -60
  174. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadBody.js +0 -247
  175. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadHeader.js +0 -107
  176. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadRangeDecorator.js +0 -107
  177. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadWidget.js +0 -329
  178. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.js +0 -378
  179. package/vscode/src/vs/workbench/contrib/comments/browser/comments.js +0 -3
  180. package/vscode/src/vs/workbench/contrib/comments/browser/commentsController.js +0 -1194
  181. package/vscode/src/vs/workbench/contrib/comments/browser/commentsFilterOptions.js +0 -17
  182. package/vscode/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.js +0 -332
  183. package/vscode/src/vs/workbench/contrib/comments/browser/commentsView.js +0 -541
  184. package/vscode/src/vs/workbench/contrib/comments/browser/commentsViewActions.js +0 -176
  185. package/vscode/src/vs/workbench/contrib/comments/browser/media/panel.css.js +0 -4
  186. package/vscode/src/vs/workbench/contrib/comments/browser/media/review.css.js +0 -4
  187. package/vscode/src/vs/workbench/contrib/comments/browser/reactionsAction.js +0 -99
  188. package/vscode/src/vs/workbench/contrib/comments/browser/timestamp.js +0 -55
  189. package/vscode/src/vs/workbench/contrib/comments/common/commentModel.js +0 -143
  190. package/vscode/src/vs/workbench/contrib/comments/common/commentsConfiguration.js +0 -2
  191. package/vscode/src/vs/workbench/contrib/customEditor/common/customTextEditorModel.js +0 -71
  192. package/vscode/src/vs/workbench/contrib/externalUriOpener/common/contributedOpeners.js +0 -81
  193. package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveEditorInput.js +0 -177
  194. package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveHistoryService.js +0 -3
  195. package/vscode/src/vs/workbench/contrib/keybindings/browser/keybindings.contribution.js +0 -28
  196. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput.js +0 -142
  197. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +0 -480
  198. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeMarkers/mergeMarkersController.js +0 -5
  199. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/diffComputer.js +0 -83
  200. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/editing.js +0 -54
  201. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/lineRange.js +0 -108
  202. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mapping.js +0 -258
  203. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel.js +0 -614
  204. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/modifiedBaseRange.js +0 -307
  205. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/rangeUtils.js +0 -36
  206. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/textModelDiffs.js +0 -165
  207. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/telemetry.js +0 -78
  208. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/utils.js +0 -68
  209. package/vscode/src/vs/workbench/contrib/mergeEditor/common/mergeEditor.js +0 -2
  210. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModel.js +0 -106
  211. package/vscode/src/vs/workbench/contrib/output/browser/output.contribution.js +0 -487
  212. package/vscode/src/vs/workbench/contrib/output/browser/outputLinkProvider.js +0 -76
  213. package/vscode/src/vs/workbench/contrib/output/browser/outputServices.js +0 -166
  214. package/vscode/src/vs/workbench/contrib/output/browser/outputView.js +0 -234
  215. package/vscode/src/vs/workbench/contrib/quickaccess/browser/commandsQuickAccess.js +0 -287
  216. package/vscode/src/vs/workbench/contrib/quickaccess/browser/quickAccess.contribution.js +0 -167
  217. package/vscode/src/vs/workbench/contrib/quickaccess/browser/viewQuickAccess.js +0 -263
  218. package/vscode/src/vs/workbench/contrib/tasks/common/tasks.js +0 -504
  219. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProcessExtHostProxy.js +0 -130
  220. package/vscode/src/vs/workbench/contrib/testing/common/getComputedState.js +0 -101
  221. package/vscode/src/vs/workbench/contrib/testing/common/observableValue.js +0 -26
  222. package/vscode/src/vs/workbench/contrib/testing/common/testCoverage.js +0 -23
  223. package/vscode/src/vs/workbench/contrib/testing/common/testResult.js +0 -334
  224. package/vscode/src/vs/workbench/contrib/testing/common/testingStates.js +0 -45
  225. package/vscode/src/vs/workbench/services/actions/common/menusExtensionPoint.js +0 -1286
  226. package/vscode/src/vs/workbench/services/commands/common/commandService.js +0 -77
  227. package/vscode/src/vs/workbench/services/extensions/browser/extensionService.js +0 -141
  228. package/vscode/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.js +0 -271
  229. package/vscode/src/vs/workbench/services/extensions/browser/webWorkerFileSystemProvider.js +0 -50
  230. package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +0 -1091
  231. package/vscode/src/vs/workbench/services/extensions/common/extHostCustomers.js +0 -40
  232. package/vscode/src/vs/workbench/services/extensions/common/extensionDevOptions.js +0 -23
  233. package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +0 -641
  234. package/vscode/src/vs/workbench/services/extensions/common/extensionRunningLocationTracker.js +0 -272
  235. package/vscode/src/vs/workbench/services/extensions/common/extensionStorageMigration.js +0 -56
  236. package/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.js +0 -78
  237. package/vscode/src/vs/workbench/services/extensions/common/remoteConsoleUtil.js +0 -47
  238. package/vscode/src/vs/workbench/services/extensions/common/remoteExtensionHost.js +0 -218
  239. package/vscode/src/vs/workbench/services/keybinding/browser/keybindingService.js +0 -917
  240. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayoutService.js +0 -498
  241. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/_.contribution.js +0 -13
  242. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/cz.win.js +0 -162
  243. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/de-swiss.win.js +0 -162
  244. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/de.darwin.js +0 -125
  245. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/de.linux.js +0 -180
  246. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/de.win.js +0 -162
  247. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/dk.win.js +0 -162
  248. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/dvorak.darwin.js +0 -125
  249. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-belgian.win.js +0 -162
  250. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-ext.darwin.js +0 -125
  251. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-in.win.js +0 -162
  252. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-intl.darwin.js +0 -125
  253. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-intl.win.js +0 -162
  254. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-uk.darwin.js +0 -125
  255. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-uk.win.js +0 -162
  256. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en.darwin.js +0 -133
  257. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en.linux.js +0 -182
  258. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en.win.js +0 -167
  259. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/es-latin.win.js +0 -162
  260. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/es.darwin.js +0 -125
  261. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/es.linux.js +0 -180
  262. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/es.win.js +0 -162
  263. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/fr.darwin.js +0 -125
  264. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/fr.linux.js +0 -180
  265. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/fr.win.js +0 -162
  266. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/hu.win.js +0 -162
  267. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/it.darwin.js +0 -125
  268. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/it.win.js +0 -162
  269. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/jp-roman.darwin.js +0 -125
  270. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/jp.darwin.js +0 -125
  271. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/ko.darwin.js +0 -125
  272. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.darwin.js +0 -17
  273. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.linux.js +0 -6
  274. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.win.js +0 -23
  275. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/no.win.js +0 -162
  276. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/pl.darwin.js +0 -125
  277. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/pl.win.js +0 -162
  278. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/pt-br.win.js +0 -162
  279. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/pt.darwin.js +0 -125
  280. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/pt.win.js +0 -162
  281. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/ru.darwin.js +0 -125
  282. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/ru.linux.js +0 -180
  283. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/ru.win.js +0 -162
  284. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/sv.win.js +0 -164
  285. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/thai.win.js +0 -162
  286. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/tr.win.js +0 -162
  287. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/zh-hans.darwin.js +0 -125
  288. package/vscode/src/vs/workbench/services/keybinding/common/keybindingIO.js +0 -72
  289. package/vscode/src/vs/workbench/services/keybinding/common/keymapInfo.js +0 -108
  290. package/vscode/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.js +0 -886
  291. package/vscode/src/vs/workbench/services/keybinding/common/windowsKeyboardMapper.js +0 -350
  292. package/vscode/src/vs/workbench/services/quickinput/browser/quickInputService.js +0 -67
  293. package/vscode/src/vs/workbench/services/themes/common/iconExtensionPoint.js +0 -4
  294. package/vscode/src/vs/workbench/services/workingCopy/common/resourceWorkingCopy.js +0 -77
@@ -0,0 +1,3291 @@
1
+ import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
+ import './media/extensionActions.css.js';
3
+ import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
4
+ import { Action, SubmenuAction, Separator } from 'monaco-editor/esm/vs/base/common/actions.js';
5
+ import { Throttler, Delayer, Promises } from 'monaco-editor/esm/vs/base/common/async.js';
6
+ import * as dom from 'monaco-editor/esm/vs/base/browser/dom.js';
7
+ import { Event, Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
8
+ import * as json from 'monaco-editor/esm/vs/base/common/json.js';
9
+ import { IContextMenuService } from 'monaco-editor/esm/vs/platform/contextview/browser/contextView.js';
10
+ import { disposeIfDisposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
11
+ import { INSTALL_ACTIONS_GROUP, THEME_ACTIONS_GROUP, VIEWLET_ID, IExtensionsWorkbenchService, TOGGLE_IGNORE_EXTENSION_ACTION_ID, SELECT_INSTALL_VSIX_EXTENSION_COMMAND_ID } from '../common/extensions.js';
12
+ import { ExtensionsConfigurationInitialContent } from '../common/extensionsFileTemplate.js';
13
+ import { ExtensionManagementErrorCode, TargetPlatformToString, IExtensionGalleryService } from '../../../../platform/extensionManagement/common/extensionManagement.js';
14
+ import { IExtensionManagementServerService, IWorkbenchExtensionEnablementService } from '../../../services/extensionManagement/common/extensionManagement.js';
15
+ import { IExtensionRecommendationsService, IExtensionIgnoredRecommendationsService } from '../../../services/extensionRecommendations/common/extensionRecommendations.js';
16
+ import { areSameExtensions, getExtensionId } from '../../../../platform/extensionManagement/common/extensionManagementUtil.js';
17
+ import { isLanguagePackExtension, ExtensionIdentifier, getWorkspaceSupportTypeMessage, isApplicationScopedExtension } from 'monaco-editor/esm/vs/platform/extensions/common/extensions.js';
18
+ import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
19
+ import { IFileService } from 'monaco-editor/esm/vs/platform/files/common/files.js';
20
+ import { IWorkspaceContextService } from 'monaco-editor/esm/vs/platform/workspace/common/workspace.js';
21
+ import { IHostService } from '../../../services/host/browser/host.js';
22
+ import { toExtensionDescription, toExtension, IExtensionService } from '../../../services/extensions/common/extensions.js';
23
+ import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
24
+ import { CommandsRegistry, ICommandService } from 'monaco-editor/esm/vs/platform/commands/common/commands.js';
25
+ import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
26
+ import { registerThemingParticipant } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
27
+ import { ThemeIcon } from 'monaco-editor/esm/vs/base/common/themables.js';
28
+ import { registerColor, buttonBackground, buttonForeground, buttonHoverBackground, buttonSeparator, editorErrorForeground, editorWarningForeground, editorInfoForeground } from 'monaco-editor/esm/vs/platform/theme/common/colorRegistry.js';
29
+ import { IJSONEditingService } from '../../../services/configuration/common/jsonEditing.js';
30
+ import { ITextModelService } from 'monaco-editor/esm/vs/editor/common/services/resolverService.js';
31
+ import { IContextKeyService } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
32
+ import { IMenuService, MenuId } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
33
+ import { PICK_WORKSPACE_FOLDER_COMMAND_ID } from '../../../browser/actions/workspaceCommands.js';
34
+ import { Severity, INotificationService } from 'monaco-editor/esm/vs/platform/notification/common/notification.js';
35
+ import { IOpenerService } from 'monaco-editor/esm/vs/platform/opener/common/opener.js';
36
+ import { IEditorService } from '../../../services/editor/common/editorService.js';
37
+ import { IQuickInputService } from 'monaco-editor/esm/vs/platform/quickinput/common/quickInput.js';
38
+ import { CancellationToken } from 'monaco-editor/esm/vs/base/common/cancellation.js';
39
+ import { alert } from 'monaco-editor/esm/vs/base/browser/ui/aria/aria.js';
40
+ import { IWorkbenchThemeService } from '../../../services/themes/common/workbenchThemeService.js';
41
+ import { ILabelService } from 'monaco-editor/esm/vs/platform/label/common/label.js';
42
+ import { ITextFileService } from '../../../services/textfile/common/textfiles.js';
43
+ import { IProductService } from 'monaco-editor/esm/vs/platform/product/common/productService.js';
44
+ import '../../../../../../../override/vs/platform/dialogs/common/dialogs.js';
45
+ import { IProgressService } from 'monaco-editor/esm/vs/platform/progress/common/progress.js';
46
+ import { ActionViewItem } from 'monaco-editor/esm/vs/base/browser/ui/actionbar/actionViewItems.js';
47
+ import { EXTENSIONS_CONFIG } from '../../../services/extensionRecommendations/common/workspaceExtensionsConfig.js';
48
+ import { isCancellationError, getErrorMessage } from 'monaco-editor/esm/vs/base/common/errors.js';
49
+ import { IUserDataSyncEnablementService } from '../../../../platform/userDataSync/common/userDataSync.js';
50
+ import { ActionWithDropdownActionViewItem } from 'monaco-editor/esm/vs/base/browser/ui/dropdown/dropdownActionViewItem.js';
51
+ import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
52
+ import { manageExtensionIcon, preReleaseIcon, syncIgnoredIcon, syncEnabledIcon, warningIcon, infoIcon, trustIcon, errorIcon } from './extensionsIcons.js';
53
+ import { language, isWeb, isIOS } from 'monaco-editor/esm/vs/base/common/platform.js';
54
+ import { IExtensionManifestPropertiesService } from '../../../services/extensions/common/extensionManifestPropertiesService.js';
55
+ import { IWorkspaceTrustEnablementService, IWorkspaceTrustManagementService } from 'monaco-editor/esm/vs/platform/workspace/common/workspaceTrust.js';
56
+ import { isVirtualWorkspace } from '../../../../platform/workspace/common/virtualWorkspace.js';
57
+ import { MarkdownString, escapeMarkdownSyntaxTokens } from 'monaco-editor/esm/vs/base/common/htmlContent.js';
58
+ import { IPaneCompositePartService } from '../../../services/panecomposite/browser/panecomposite.js';
59
+ import { flatten } from 'monaco-editor/esm/vs/base/common/arrays.js';
60
+ import { fromNow } from '../../../../base/common/date.js';
61
+ import { IPreferencesService } from '../../../services/preferences/common/preferences.js';
62
+ import { getLocale } from '../../../../platform/languagePacks/common/languagePacks.js';
63
+ import { ILocaleService } from '../../../services/localization/common/locale.js';
64
+ import { isString } from 'monaco-editor/esm/vs/base/common/types.js';
65
+ import { showWindowLogActionId } from '../../../services/log/common/logConstants.js';
66
+ import { ITelemetryService } from 'monaco-editor/esm/vs/platform/telemetry/common/telemetry.js';
67
+ import { IDialogService } from '../../../../platform/dialogs/common/dialogs.js';
68
+ var InstallAction_1, InstallInOtherServerAction_1, UninstallAction_1, MigrateDeprecatedExtensionAction_1, ManageExtensionAction_1, SwitchToPreReleaseVersionAction_1, SwitchToReleasedVersionAction_1, InstallAnotherVersionAction_1, EnableForWorkspaceAction_1, EnableGloballyAction_1, DisableForWorkspaceAction_1, DisableGloballyAction_1, ReloadAction_1, SetColorThemeAction_1, SetFileIconThemeAction_1, SetProductIconThemeAction_1, SetLanguageAction_1, ClearLanguageAction_1, ShowRecommendedExtensionAction_1, InstallRecommendedExtensionAction_1, IgnoreExtensionRecommendationAction_1, UndoIgnoreExtensionRecommendationAction_1, ExtensionStatusLabelAction_1, ToggleSyncExtensionAction_1, ExtensionStatusAction_1, ReinstallAction_1, InstallSpecificVersionOfExtensionAction_1;
69
+ let PromptExtensionInstallFailureAction = class PromptExtensionInstallFailureAction extends Action {
70
+ constructor(extension, version, installOperation, error, productService, openerService, notificationService, dialogService, commandService, logService, extensionManagementServerService, instantiationService, galleryService, extensionManifestPropertiesService) {
71
+ super('extension.promptExtensionInstallFailure');
72
+ this.extension = extension;
73
+ this.version = version;
74
+ this.installOperation = installOperation;
75
+ this.error = error;
76
+ this.productService = productService;
77
+ this.openerService = openerService;
78
+ this.notificationService = notificationService;
79
+ this.dialogService = dialogService;
80
+ this.commandService = commandService;
81
+ this.logService = logService;
82
+ this.extensionManagementServerService = extensionManagementServerService;
83
+ this.instantiationService = instantiationService;
84
+ this.galleryService = galleryService;
85
+ this.extensionManifestPropertiesService = extensionManifestPropertiesService;
86
+ }
87
+ async run() {
88
+ if (isCancellationError(this.error)) {
89
+ return;
90
+ }
91
+ this.logService.error(this.error);
92
+ if (this.error.name === ExtensionManagementErrorCode.Unsupported) {
93
+ const productName = isWeb ? ( localizeWithPath(
94
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
95
+ 'VS Code for Web',
96
+ "{0} for the Web",
97
+ this.productService.nameLong
98
+ )) : this.productService.nameLong;
99
+ const message = ( localizeWithPath(
100
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
101
+ 'cannot be installed',
102
+ "The '{0}' extension is not available in {1}. Click 'More Information' to learn more.",
103
+ this.extension.displayName || this.extension.identifier.id,
104
+ productName
105
+ ));
106
+ const { confirmed } = await this.dialogService.confirm({
107
+ type: Severity.Info,
108
+ message,
109
+ primaryButton: ( localizeWithPath(
110
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
111
+ { key: 'more information', comment: ['&& denotes a mnemonic'] },
112
+ "&&More Information"
113
+ )),
114
+ cancelButton: ( localizeWithPath(
115
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
116
+ 'close',
117
+ "Close"
118
+ ))
119
+ });
120
+ if (confirmed) {
121
+ this.openerService.open(isWeb ? ( URI.parse('https://aka.ms/vscode-web-extensions-guide')) : ( URI.parse('https://aka.ms/vscode-remote')));
122
+ }
123
+ return;
124
+ }
125
+ if ([ExtensionManagementErrorCode.Incompatible, ExtensionManagementErrorCode.IncompatibleTargetPlatform, ExtensionManagementErrorCode.Malicious, ExtensionManagementErrorCode.ReleaseVersionNotFound, ExtensionManagementErrorCode.Deprecated].includes(this.error.name)) {
126
+ await this.dialogService.info(getErrorMessage(this.error));
127
+ return;
128
+ }
129
+ if (ExtensionManagementErrorCode.Signature === this.error.name) {
130
+ await this.dialogService.prompt({
131
+ type: 'error',
132
+ message: ( localizeWithPath(
133
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
134
+ 'signature verification failed',
135
+ "{0} cannot verify the '{1}' extension. Are you sure you want to install it?",
136
+ this.productService.nameLong,
137
+ this.extension.displayName || this.extension.identifier.id
138
+ )),
139
+ buttons: [{
140
+ label: ( localizeWithPath(
141
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
142
+ 'install anyway',
143
+ "Install Anyway"
144
+ )),
145
+ run: () => {
146
+ const installAction = this.instantiationService.createInstance(InstallAction, { donotVerifySignature: true });
147
+ installAction.extension = this.extension;
148
+ return installAction.run();
149
+ }
150
+ }],
151
+ cancelButton: ( localizeWithPath(
152
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
153
+ 'cancel',
154
+ "Cancel"
155
+ ))
156
+ });
157
+ return;
158
+ }
159
+ const operationMessage = this.installOperation === 3 ? ( localizeWithPath(
160
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
161
+ 'update operation',
162
+ "Error while updating '{0}' extension.",
163
+ this.extension.displayName || this.extension.identifier.id
164
+ ))
165
+ : ( localizeWithPath(
166
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
167
+ 'install operation',
168
+ "Error while installing '{0}' extension.",
169
+ this.extension.displayName || this.extension.identifier.id
170
+ ));
171
+ let additionalMessage;
172
+ const promptChoices = [];
173
+ const downloadUrl = await this.getDownloadUrl();
174
+ if (downloadUrl) {
175
+ additionalMessage = ( localizeWithPath(
176
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
177
+ 'check logs',
178
+ "Please check the [log]({0}) for more details.",
179
+ `command:${showWindowLogActionId}`
180
+ ));
181
+ promptChoices.push({
182
+ label: ( localizeWithPath(
183
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
184
+ 'download',
185
+ "Try Downloading Manually..."
186
+ )),
187
+ run: () => this.openerService.open(downloadUrl).then(() => {
188
+ this.notificationService.prompt(Severity.Info, ( localizeWithPath(
189
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
190
+ 'install vsix',
191
+ 'Once downloaded, please manually install the downloaded VSIX of \'{0}\'.',
192
+ this.extension.identifier.id
193
+ )), [{
194
+ label: ( localizeWithPath(
195
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
196
+ 'installVSIX',
197
+ "Install from VSIX..."
198
+ )),
199
+ run: () => this.commandService.executeCommand(SELECT_INSTALL_VSIX_EXTENSION_COMMAND_ID)
200
+ }]);
201
+ })
202
+ });
203
+ }
204
+ const message = `${operationMessage}${additionalMessage ? ` ${additionalMessage}` : ''}`;
205
+ this.notificationService.prompt(Severity.Error, message, promptChoices);
206
+ }
207
+ async getDownloadUrl() {
208
+ if (isIOS) {
209
+ return undefined;
210
+ }
211
+ if (!this.extension.gallery) {
212
+ return undefined;
213
+ }
214
+ if (!this.productService.extensionsGallery) {
215
+ return undefined;
216
+ }
217
+ if (!this.extensionManagementServerService.localExtensionManagementServer && !this.extensionManagementServerService.remoteExtensionManagementServer) {
218
+ return undefined;
219
+ }
220
+ let targetPlatform = this.extension.gallery.properties.targetPlatform;
221
+ if (targetPlatform !== "universal" && targetPlatform !== "undefined" && this.extensionManagementServerService.remoteExtensionManagementServer) {
222
+ try {
223
+ const manifest = await this.galleryService.getManifest(this.extension.gallery, CancellationToken.None);
224
+ if (manifest && this.extensionManifestPropertiesService.prefersExecuteOnWorkspace(manifest)) {
225
+ targetPlatform = await this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.getTargetPlatform();
226
+ }
227
+ }
228
+ catch (error) {
229
+ this.logService.error(error);
230
+ return undefined;
231
+ }
232
+ }
233
+ if (targetPlatform === "unknown" ) {
234
+ return undefined;
235
+ }
236
+ return ( URI.parse(
237
+ `${this.productService.extensionsGallery.serviceUrl}/publishers/${this.extension.publisher}/vsextensions/${this.extension.name}/${this.version}/vspackage${targetPlatform !== "undefined" ? `?targetPlatform=${targetPlatform}` : ''}`
238
+ ));
239
+ }
240
+ };
241
+ PromptExtensionInstallFailureAction = ( __decorate([
242
+ ( __param(4, IProductService)),
243
+ ( __param(5, IOpenerService)),
244
+ ( __param(6, INotificationService)),
245
+ ( __param(7, IDialogService)),
246
+ ( __param(8, ICommandService)),
247
+ ( __param(9, ILogService)),
248
+ ( __param(10, IExtensionManagementServerService)),
249
+ ( __param(11, IInstantiationService)),
250
+ ( __param(12, IExtensionGalleryService)),
251
+ ( __param(13, IExtensionManifestPropertiesService))
252
+ ], PromptExtensionInstallFailureAction));
253
+ class ExtensionAction extends Action {
254
+ constructor() {
255
+ super(...arguments);
256
+ this._extension = null;
257
+ }
258
+ static { this.EXTENSION_ACTION_CLASS = 'extension-action'; }
259
+ static { this.TEXT_ACTION_CLASS = `${ExtensionAction.EXTENSION_ACTION_CLASS} text`; }
260
+ static { this.LABEL_ACTION_CLASS = `${ExtensionAction.EXTENSION_ACTION_CLASS} label`; }
261
+ static { this.ICON_ACTION_CLASS = `${ExtensionAction.EXTENSION_ACTION_CLASS} icon`; }
262
+ get extension() { return this._extension; }
263
+ set extension(extension) { this._extension = extension; this.update(); }
264
+ }
265
+ class ActionWithDropDownAction extends ExtensionAction {
266
+ get menuActions() { return [...this._menuActions]; }
267
+ get extension() {
268
+ return super.extension;
269
+ }
270
+ set extension(extension) {
271
+ this.extensionActions.forEach(a => a.extension = extension);
272
+ super.extension = extension;
273
+ }
274
+ constructor(id, label, actionsGroups) {
275
+ super(id, label);
276
+ this.actionsGroups = actionsGroups;
277
+ this._menuActions = [];
278
+ this.extensionActions = flatten(actionsGroups);
279
+ this.update();
280
+ this._register(Event.any(...( this.extensionActions.map(a => a.onDidChange)))(() => this.update(true)));
281
+ this.extensionActions.forEach(a => this._register(a));
282
+ }
283
+ update(donotUpdateActions) {
284
+ if (!donotUpdateActions) {
285
+ this.extensionActions.forEach(a => a.update());
286
+ }
287
+ const enabledActionsGroups = ( this.actionsGroups.map(actionsGroup => actionsGroup.filter(a => a.enabled)));
288
+ let actions = [];
289
+ for (const enabledActions of enabledActionsGroups) {
290
+ if (enabledActions.length) {
291
+ actions = [...actions, ...enabledActions, ( new Separator())];
292
+ }
293
+ }
294
+ actions = actions.length ? actions.slice(0, actions.length - 1) : actions;
295
+ this.action = actions[0];
296
+ this._menuActions = actions.length > 1 ? actions : [];
297
+ this.enabled = !!this.action;
298
+ if (this.action) {
299
+ this.label = this.getLabel(this.action);
300
+ this.tooltip = this.action.tooltip;
301
+ }
302
+ let clazz = (this.action || this.extensionActions[0])?.class || '';
303
+ clazz = clazz ? `${clazz} action-dropdown` : 'action-dropdown';
304
+ if (this._menuActions.length === 0) {
305
+ clazz += ' action-dropdown';
306
+ }
307
+ this.class = clazz;
308
+ }
309
+ run() {
310
+ const enabledActions = this.extensionActions.filter(a => a.enabled);
311
+ return enabledActions[0].run();
312
+ }
313
+ getLabel(action) {
314
+ return action.label;
315
+ }
316
+ }
317
+ let InstallAction = class InstallAction extends ExtensionAction {
318
+ static { InstallAction_1 = this; }
319
+ static { this.Class = `${ExtensionAction.LABEL_ACTION_CLASS} prominent install`; }
320
+ set manifest(manifest) {
321
+ this._manifest = manifest;
322
+ this.updateLabel();
323
+ }
324
+ constructor(options, extensionsWorkbenchService, instantiationService, runtimeExtensionService, workbenchThemeService, labelService, dialogService, preferencesService, telemetryService) {
325
+ super('extensions.install', ( localizeWithPath(
326
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
327
+ 'install',
328
+ "Install"
329
+ )), InstallAction_1.Class, false);
330
+ this.extensionsWorkbenchService = extensionsWorkbenchService;
331
+ this.instantiationService = instantiationService;
332
+ this.runtimeExtensionService = runtimeExtensionService;
333
+ this.workbenchThemeService = workbenchThemeService;
334
+ this.labelService = labelService;
335
+ this.dialogService = dialogService;
336
+ this.preferencesService = preferencesService;
337
+ this.telemetryService = telemetryService;
338
+ this._manifest = null;
339
+ this.updateThrottler = ( new Throttler());
340
+ this.options = { ...options, isMachineScoped: false };
341
+ this.update();
342
+ this._register(this.labelService.onDidChangeFormatters(() => this.updateLabel(), this));
343
+ }
344
+ update() {
345
+ this.updateThrottler.queue(() => this.computeAndUpdateEnablement());
346
+ }
347
+ async computeAndUpdateEnablement() {
348
+ this.enabled = false;
349
+ if (!this.extension) {
350
+ return;
351
+ }
352
+ if (this.extension.isBuiltin) {
353
+ return;
354
+ }
355
+ if (this.extensionsWorkbenchService.canSetLanguage(this.extension)) {
356
+ return;
357
+ }
358
+ if (this.extension.state === 3 && (await this.extensionsWorkbenchService.canInstall(this.extension))) {
359
+ this.enabled = this.options.installPreReleaseVersion ? this.extension.hasPreReleaseVersion : this.extension.hasReleaseVersion;
360
+ this.updateLabel();
361
+ }
362
+ }
363
+ async run() {
364
+ if (!this.extension) {
365
+ return;
366
+ }
367
+ if (this.extension.deprecationInfo) {
368
+ let detail = ( localizeWithPath(
369
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
370
+ 'deprecated message',
371
+ "This extension is deprecated as it is no longer being maintained."
372
+ ));
373
+ let DeprecationChoice;
374
+ ( (function(DeprecationChoice) {
375
+ DeprecationChoice[DeprecationChoice["InstallAnyway"] = 0] = "InstallAnyway";
376
+ DeprecationChoice[DeprecationChoice["ShowAlternateExtension"] = 1] = "ShowAlternateExtension";
377
+ DeprecationChoice[DeprecationChoice["ConfigureSettings"] = 2] = "ConfigureSettings";
378
+ DeprecationChoice[DeprecationChoice["Cancel"] = 3] = "Cancel";
379
+ })(DeprecationChoice || (DeprecationChoice = {})));
380
+ const buttons = [
381
+ {
382
+ label: ( localizeWithPath(
383
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
384
+ 'install anyway',
385
+ "Install Anyway"
386
+ )),
387
+ run: () => DeprecationChoice.InstallAnyway
388
+ }
389
+ ];
390
+ if (this.extension.deprecationInfo.extension) {
391
+ detail = ( localizeWithPath(
392
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
393
+ 'deprecated with alternate extension message',
394
+ "This extension is deprecated. Use the {0} extension instead.",
395
+ this.extension.deprecationInfo.extension.displayName
396
+ ));
397
+ const alternateExtension = this.extension.deprecationInfo.extension;
398
+ buttons.push({
399
+ label: ( localizeWithPath(
400
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
401
+ { key: 'Show alternate extension', comment: ['&& denotes a mnemonic'] },
402
+ "&&Open {0}",
403
+ this.extension.deprecationInfo.extension.displayName
404
+ )),
405
+ run: async () => {
406
+ const [extension] = await this.extensionsWorkbenchService.getExtensions([{ id: alternateExtension.id, preRelease: alternateExtension.preRelease }], CancellationToken.None);
407
+ await this.extensionsWorkbenchService.open(extension);
408
+ return DeprecationChoice.ShowAlternateExtension;
409
+ }
410
+ });
411
+ }
412
+ else if (this.extension.deprecationInfo.settings) {
413
+ detail = ( localizeWithPath(
414
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
415
+ 'deprecated with alternate settings message',
416
+ "This extension is deprecated as this functionality is now built-in to VS Code."
417
+ ));
418
+ const settings = this.extension.deprecationInfo.settings;
419
+ buttons.push({
420
+ label: ( localizeWithPath(
421
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
422
+ { key: 'configure in settings', comment: ['&& denotes a mnemonic'] },
423
+ "&&Configure Settings"
424
+ )),
425
+ run: async () => {
426
+ await this.preferencesService.openSettings({ query: ( settings.map(setting => `@id:${setting}`)).join(' ') });
427
+ return DeprecationChoice.ConfigureSettings;
428
+ }
429
+ });
430
+ }
431
+ else if (this.extension.deprecationInfo.additionalInfo) {
432
+ detail = ( new MarkdownString(`${detail} ${this.extension.deprecationInfo.additionalInfo}`));
433
+ }
434
+ const { result } = await this.dialogService.prompt({
435
+ type: Severity.Warning,
436
+ message: ( localizeWithPath(
437
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
438
+ 'install confirmation',
439
+ "Are you sure you want to install '{0}'?",
440
+ this.extension.displayName
441
+ )),
442
+ detail: isString(detail) ? detail : undefined,
443
+ custom: isString(detail) ? undefined : {
444
+ markdownDetails: [{
445
+ markdown: detail
446
+ }]
447
+ },
448
+ buttons,
449
+ cancelButton: {
450
+ run: () => DeprecationChoice.Cancel
451
+ }
452
+ });
453
+ if (result !== DeprecationChoice.InstallAnyway) {
454
+ return;
455
+ }
456
+ }
457
+ this.extensionsWorkbenchService.open(this.extension, { showPreReleaseVersion: this.options.installPreReleaseVersion });
458
+ alert(( localizeWithPath(
459
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
460
+ 'installExtensionStart',
461
+ "Installing extension {0} started. An editor is now open with more details on this extension",
462
+ this.extension.displayName
463
+ )));
464
+ this.telemetryService.publicLog('extensions:action:install', { ...this.extension.telemetryData, actionId: this.id });
465
+ const extension = await this.install(this.extension);
466
+ if (extension?.local) {
467
+ alert(( localizeWithPath(
468
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
469
+ 'installExtensionComplete',
470
+ "Installing extension {0} is completed.",
471
+ this.extension.displayName
472
+ )));
473
+ const runningExtension = await this.getRunningExtension(extension.local);
474
+ if (runningExtension && !(runningExtension.activationEvents && ( runningExtension.activationEvents.some(activationEent => activationEent.startsWith('onLanguage'))))) {
475
+ const action = await this.getThemeAction(extension);
476
+ if (action) {
477
+ action.extension = extension;
478
+ try {
479
+ return action.run({ showCurrentTheme: true, ignoreFocusLost: true });
480
+ }
481
+ finally {
482
+ action.dispose();
483
+ }
484
+ }
485
+ }
486
+ }
487
+ }
488
+ async getThemeAction(extension) {
489
+ const colorThemes = await this.workbenchThemeService.getColorThemes();
490
+ if (( colorThemes.some(theme => isThemeFromExtension(theme, extension)))) {
491
+ return this.instantiationService.createInstance(SetColorThemeAction);
492
+ }
493
+ const fileIconThemes = await this.workbenchThemeService.getFileIconThemes();
494
+ if (( fileIconThemes.some(theme => isThemeFromExtension(theme, extension)))) {
495
+ return this.instantiationService.createInstance(SetFileIconThemeAction);
496
+ }
497
+ const productIconThemes = await this.workbenchThemeService.getProductIconThemes();
498
+ if (( productIconThemes.some(theme => isThemeFromExtension(theme, extension)))) {
499
+ return this.instantiationService.createInstance(SetProductIconThemeAction);
500
+ }
501
+ return undefined;
502
+ }
503
+ async install(extension) {
504
+ try {
505
+ return await this.extensionsWorkbenchService.install(extension, this.options);
506
+ }
507
+ catch (error) {
508
+ await this.instantiationService.createInstance(PromptExtensionInstallFailureAction, extension, extension.latestVersion, 2 , error).run();
509
+ return undefined;
510
+ }
511
+ }
512
+ async getRunningExtension(extension) {
513
+ const runningExtension = await this.runtimeExtensionService.getExtension(extension.identifier.id);
514
+ if (runningExtension) {
515
+ return runningExtension;
516
+ }
517
+ if (this.runtimeExtensionService.canAddExtension(toExtensionDescription(extension))) {
518
+ return ( new Promise((c, e) => {
519
+ const disposable = this.runtimeExtensionService.onDidChangeExtensions(async () => {
520
+ const runningExtension = await this.runtimeExtensionService.getExtension(extension.identifier.id);
521
+ if (runningExtension) {
522
+ disposable.dispose();
523
+ c(runningExtension);
524
+ }
525
+ });
526
+ }));
527
+ }
528
+ return null;
529
+ }
530
+ updateLabel() {
531
+ this.label = this.getLabel();
532
+ }
533
+ getLabel(primary) {
534
+ if (this.options.installPreReleaseVersion && this.extension?.hasPreReleaseVersion) {
535
+ return primary ? ( localizeWithPath(
536
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
537
+ 'install pre-release',
538
+ "Install Pre-Release"
539
+ )) : ( localizeWithPath(
540
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
541
+ 'install pre-release version',
542
+ "Install Pre-Release Version"
543
+ ));
544
+ }
545
+ if (this.extension?.hasPreReleaseVersion) {
546
+ return primary ? ( localizeWithPath(
547
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
548
+ 'install',
549
+ "Install"
550
+ )) : ( localizeWithPath(
551
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
552
+ 'install release version',
553
+ "Install Release Version"
554
+ ));
555
+ }
556
+ return ( localizeWithPath(
557
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
558
+ 'install',
559
+ "Install"
560
+ ));
561
+ }
562
+ };
563
+ InstallAction = InstallAction_1 = ( __decorate([
564
+ ( __param(1, IExtensionsWorkbenchService)),
565
+ ( __param(2, IInstantiationService)),
566
+ ( __param(3, IExtensionService)),
567
+ ( __param(4, IWorkbenchThemeService)),
568
+ ( __param(5, ILabelService)),
569
+ ( __param(6, IDialogService)),
570
+ ( __param(7, IPreferencesService)),
571
+ ( __param(8, ITelemetryService))
572
+ ], InstallAction));
573
+ let InstallDropdownAction = class InstallDropdownAction extends ActionWithDropDownAction {
574
+ set manifest(manifest) {
575
+ this.extensionActions.forEach(a => a.manifest = manifest);
576
+ this.update();
577
+ }
578
+ constructor(instantiationService, extensionsWorkbenchService) {
579
+ super(`extensions.installActions`, '', [
580
+ [
581
+ instantiationService.createInstance(InstallAction, { installPreReleaseVersion: extensionsWorkbenchService.preferPreReleases }),
582
+ instantiationService.createInstance(InstallAction, { installPreReleaseVersion: !extensionsWorkbenchService.preferPreReleases }),
583
+ ]
584
+ ]);
585
+ }
586
+ getLabel(action) {
587
+ return action.getLabel(true);
588
+ }
589
+ };
590
+ InstallDropdownAction = ( __decorate([
591
+ ( __param(0, IInstantiationService)),
592
+ ( __param(1, IExtensionsWorkbenchService))
593
+ ], InstallDropdownAction));
594
+ class InstallingLabelAction extends ExtensionAction {
595
+ static { this.LABEL = ( localizeWithPath(
596
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
597
+ 'installing',
598
+ "Installing"
599
+ )); }
600
+ static { this.CLASS = `${ExtensionAction.LABEL_ACTION_CLASS} install installing`; }
601
+ constructor() {
602
+ super('extension.installing', InstallingLabelAction.LABEL, InstallingLabelAction.CLASS, false);
603
+ }
604
+ update() {
605
+ this.class = `${InstallingLabelAction.CLASS}${this.extension && this.extension.state === 0 ? '' : ' hide'}`;
606
+ }
607
+ }
608
+ let InstallInOtherServerAction = class InstallInOtherServerAction extends ExtensionAction {
609
+ static { InstallInOtherServerAction_1 = this; }
610
+ static { this.INSTALL_LABEL = ( localizeWithPath(
611
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
612
+ 'install',
613
+ "Install"
614
+ )); }
615
+ static { this.INSTALLING_LABEL = ( localizeWithPath(
616
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
617
+ 'installing',
618
+ "Installing"
619
+ )); }
620
+ static { this.Class = `${ExtensionAction.LABEL_ACTION_CLASS} prominent install`; }
621
+ static { this.InstallingClass = `${ExtensionAction.LABEL_ACTION_CLASS} install installing`; }
622
+ constructor(id, server, canInstallAnyWhere, extensionsWorkbenchService, extensionManagementServerService, extensionManifestPropertiesService) {
623
+ super(id, InstallInOtherServerAction_1.INSTALL_LABEL, InstallInOtherServerAction_1.Class, false);
624
+ this.server = server;
625
+ this.canInstallAnyWhere = canInstallAnyWhere;
626
+ this.extensionsWorkbenchService = extensionsWorkbenchService;
627
+ this.extensionManagementServerService = extensionManagementServerService;
628
+ this.extensionManifestPropertiesService = extensionManifestPropertiesService;
629
+ this.updateWhenCounterExtensionChanges = true;
630
+ this.update();
631
+ }
632
+ update() {
633
+ this.enabled = false;
634
+ this.class = InstallInOtherServerAction_1.Class;
635
+ if (this.canInstall()) {
636
+ const extensionInOtherServer = this.extensionsWorkbenchService.installed.filter(e => areSameExtensions(e.identifier, this.extension.identifier) && e.server === this.server)[0];
637
+ if (extensionInOtherServer) {
638
+ if (extensionInOtherServer.state === 0 && !extensionInOtherServer.local) {
639
+ this.enabled = true;
640
+ this.label = InstallInOtherServerAction_1.INSTALLING_LABEL;
641
+ this.class = InstallInOtherServerAction_1.InstallingClass;
642
+ }
643
+ }
644
+ else {
645
+ this.enabled = true;
646
+ this.label = this.getInstallLabel();
647
+ }
648
+ }
649
+ }
650
+ canInstall() {
651
+ if (!this.extension
652
+ || !this.server
653
+ || !this.extension.local
654
+ || this.extension.state !== 1
655
+ || this.extension.type !== 1
656
+ || this.extension.enablementState === 2 || this.extension.enablementState === 0 || this.extension.enablementState === 4 ) {
657
+ return false;
658
+ }
659
+ if (isLanguagePackExtension(this.extension.local.manifest)) {
660
+ return true;
661
+ }
662
+ if (this.server === this.extensionManagementServerService.localExtensionManagementServer && this.extensionManifestPropertiesService.prefersExecuteOnUI(this.extension.local.manifest)) {
663
+ return true;
664
+ }
665
+ if (this.server === this.extensionManagementServerService.remoteExtensionManagementServer && this.extensionManifestPropertiesService.prefersExecuteOnWorkspace(this.extension.local.manifest)) {
666
+ return true;
667
+ }
668
+ if (this.server === this.extensionManagementServerService.webExtensionManagementServer && this.extensionManifestPropertiesService.prefersExecuteOnWeb(this.extension.local.manifest)) {
669
+ return true;
670
+ }
671
+ if (this.canInstallAnyWhere) {
672
+ if (this.server === this.extensionManagementServerService.localExtensionManagementServer && this.extensionManifestPropertiesService.canExecuteOnUI(this.extension.local.manifest)) {
673
+ return true;
674
+ }
675
+ if (this.server === this.extensionManagementServerService.remoteExtensionManagementServer && this.extensionManifestPropertiesService.canExecuteOnWorkspace(this.extension.local.manifest)) {
676
+ return true;
677
+ }
678
+ }
679
+ return false;
680
+ }
681
+ async run() {
682
+ if (!this.extension?.local) {
683
+ return;
684
+ }
685
+ if (!this.extension?.server) {
686
+ return;
687
+ }
688
+ if (!this.server) {
689
+ return;
690
+ }
691
+ this.extensionsWorkbenchService.open(this.extension);
692
+ alert(( localizeWithPath(
693
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
694
+ 'installExtensionStart',
695
+ "Installing extension {0} started. An editor is now open with more details on this extension",
696
+ this.extension.displayName
697
+ )));
698
+ return this.extensionsWorkbenchService.installInServer(this.extension, this.server);
699
+ }
700
+ };
701
+ InstallInOtherServerAction = InstallInOtherServerAction_1 = ( __decorate([
702
+ ( __param(3, IExtensionsWorkbenchService)),
703
+ ( __param(4, IExtensionManagementServerService)),
704
+ ( __param(5, IExtensionManifestPropertiesService))
705
+ ], InstallInOtherServerAction));
706
+ let RemoteInstallAction = class RemoteInstallAction extends InstallInOtherServerAction {
707
+ constructor(canInstallAnyWhere, extensionsWorkbenchService, extensionManagementServerService, extensionManifestPropertiesService) {
708
+ super(`extensions.remoteinstall`, extensionManagementServerService.remoteExtensionManagementServer, canInstallAnyWhere, extensionsWorkbenchService, extensionManagementServerService, extensionManifestPropertiesService);
709
+ }
710
+ getInstallLabel() {
711
+ return this.extensionManagementServerService.remoteExtensionManagementServer
712
+ ? ( localizeWithPath(
713
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
714
+ { key: 'install in remote', comment: ['This is the name of the action to install an extension in remote server. Placeholder is for the name of remote server.'] },
715
+ "Install in {0}",
716
+ this.extensionManagementServerService.remoteExtensionManagementServer.label
717
+ ))
718
+ : InstallInOtherServerAction.INSTALL_LABEL;
719
+ }
720
+ };
721
+ RemoteInstallAction = ( __decorate([
722
+ ( __param(1, IExtensionsWorkbenchService)),
723
+ ( __param(2, IExtensionManagementServerService)),
724
+ ( __param(3, IExtensionManifestPropertiesService))
725
+ ], RemoteInstallAction));
726
+ let LocalInstallAction = class LocalInstallAction extends InstallInOtherServerAction {
727
+ constructor(extensionsWorkbenchService, extensionManagementServerService, extensionManifestPropertiesService) {
728
+ super(`extensions.localinstall`, extensionManagementServerService.localExtensionManagementServer, false, extensionsWorkbenchService, extensionManagementServerService, extensionManifestPropertiesService);
729
+ }
730
+ getInstallLabel() {
731
+ return ( localizeWithPath(
732
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
733
+ 'install locally',
734
+ "Install Locally"
735
+ ));
736
+ }
737
+ };
738
+ LocalInstallAction = ( __decorate([
739
+ ( __param(0, IExtensionsWorkbenchService)),
740
+ ( __param(1, IExtensionManagementServerService)),
741
+ ( __param(2, IExtensionManifestPropertiesService))
742
+ ], LocalInstallAction));
743
+ let WebInstallAction = class WebInstallAction extends InstallInOtherServerAction {
744
+ constructor(extensionsWorkbenchService, extensionManagementServerService, extensionManifestPropertiesService) {
745
+ super(`extensions.webInstall`, extensionManagementServerService.webExtensionManagementServer, false, extensionsWorkbenchService, extensionManagementServerService, extensionManifestPropertiesService);
746
+ }
747
+ getInstallLabel() {
748
+ return ( localizeWithPath(
749
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
750
+ 'install browser',
751
+ "Install in Browser"
752
+ ));
753
+ }
754
+ };
755
+ WebInstallAction = ( __decorate([
756
+ ( __param(0, IExtensionsWorkbenchService)),
757
+ ( __param(1, IExtensionManagementServerService)),
758
+ ( __param(2, IExtensionManifestPropertiesService))
759
+ ], WebInstallAction));
760
+ let UninstallAction = class UninstallAction extends ExtensionAction {
761
+ static { UninstallAction_1 = this; }
762
+ static { this.UninstallLabel = ( localizeWithPath(
763
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
764
+ 'uninstallAction',
765
+ "Uninstall"
766
+ )); }
767
+ static { this.UninstallingLabel = ( localizeWithPath(
768
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
769
+ 'Uninstalling',
770
+ "Uninstalling"
771
+ )); }
772
+ static { this.UninstallClass = `${ExtensionAction.LABEL_ACTION_CLASS} uninstall`; }
773
+ static { this.UnInstallingClass = `${ExtensionAction.LABEL_ACTION_CLASS} uninstall uninstalling`; }
774
+ constructor(extensionsWorkbenchService) {
775
+ super('extensions.uninstall', UninstallAction_1.UninstallLabel, UninstallAction_1.UninstallClass, false);
776
+ this.extensionsWorkbenchService = extensionsWorkbenchService;
777
+ this.update();
778
+ }
779
+ update() {
780
+ if (!this.extension) {
781
+ this.enabled = false;
782
+ return;
783
+ }
784
+ const state = this.extension.state;
785
+ if (state === 2 ) {
786
+ this.label = UninstallAction_1.UninstallingLabel;
787
+ this.class = UninstallAction_1.UnInstallingClass;
788
+ this.enabled = false;
789
+ return;
790
+ }
791
+ this.label = UninstallAction_1.UninstallLabel;
792
+ this.class = UninstallAction_1.UninstallClass;
793
+ this.tooltip = UninstallAction_1.UninstallLabel;
794
+ if (state !== 1 ) {
795
+ this.enabled = false;
796
+ return;
797
+ }
798
+ if (this.extension.isBuiltin) {
799
+ this.enabled = false;
800
+ return;
801
+ }
802
+ this.enabled = true;
803
+ }
804
+ async run() {
805
+ if (!this.extension) {
806
+ return;
807
+ }
808
+ alert(( localizeWithPath(
809
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
810
+ 'uninstallExtensionStart',
811
+ "Uninstalling extension {0} started.",
812
+ this.extension.displayName
813
+ )));
814
+ return this.extensionsWorkbenchService.uninstall(this.extension).then(() => {
815
+ alert(( localizeWithPath(
816
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
817
+ 'uninstallExtensionComplete',
818
+ "Please reload Visual Studio Code to complete the uninstallation of the extension {0}.",
819
+ this.extension.displayName
820
+ )));
821
+ });
822
+ }
823
+ };
824
+ UninstallAction = UninstallAction_1 = ( __decorate([
825
+ ( __param(0, IExtensionsWorkbenchService))
826
+ ], UninstallAction));
827
+ class AbstractUpdateAction extends ExtensionAction {
828
+ static { this.EnabledClass = `${ExtensionAction.LABEL_ACTION_CLASS} prominent update`; }
829
+ static { this.DisabledClass = `${AbstractUpdateAction.EnabledClass} disabled`; }
830
+ constructor(id, label, extensionsWorkbenchService) {
831
+ super(id, label, AbstractUpdateAction.DisabledClass, false);
832
+ this.extensionsWorkbenchService = extensionsWorkbenchService;
833
+ this.updateThrottler = ( new Throttler());
834
+ this.update();
835
+ }
836
+ update() {
837
+ this.updateThrottler.queue(() => this.computeAndUpdateEnablement());
838
+ }
839
+ async computeAndUpdateEnablement() {
840
+ this.enabled = false;
841
+ this.class = UpdateAction.DisabledClass;
842
+ if (!this.extension) {
843
+ return;
844
+ }
845
+ if (this.extension.deprecationInfo) {
846
+ return;
847
+ }
848
+ const canInstall = await this.extensionsWorkbenchService.canInstall(this.extension);
849
+ const isInstalled = this.extension.state === 1 ;
850
+ this.enabled = canInstall && isInstalled && this.extension.outdated;
851
+ this.class = this.enabled ? AbstractUpdateAction.EnabledClass : AbstractUpdateAction.DisabledClass;
852
+ }
853
+ }
854
+ let UpdateAction = class UpdateAction extends AbstractUpdateAction {
855
+ constructor(verbose, extensionsWorkbenchService, instantiationService) {
856
+ super(`extensions.update`, ( localizeWithPath(
857
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
858
+ 'update',
859
+ "Update"
860
+ )), extensionsWorkbenchService);
861
+ this.verbose = verbose;
862
+ this.instantiationService = instantiationService;
863
+ }
864
+ update() {
865
+ super.update();
866
+ if (this.extension) {
867
+ this.label = this.verbose ? ( localizeWithPath(
868
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
869
+ 'update to',
870
+ "Update to v{0}",
871
+ this.extension.latestVersion
872
+ )) : ( localizeWithPath(
873
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
874
+ 'update',
875
+ "Update"
876
+ ));
877
+ }
878
+ }
879
+ async run() {
880
+ if (!this.extension) {
881
+ return;
882
+ }
883
+ alert(( localizeWithPath(
884
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
885
+ 'updateExtensionStart',
886
+ "Updating extension {0} to version {1} started.",
887
+ this.extension.displayName,
888
+ this.extension.latestVersion
889
+ )));
890
+ return this.install(this.extension);
891
+ }
892
+ async install(extension) {
893
+ try {
894
+ await this.extensionsWorkbenchService.install(extension, extension.local?.preRelease ? { installPreReleaseVersion: true } : undefined);
895
+ alert(( localizeWithPath(
896
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
897
+ 'updateExtensionComplete',
898
+ "Updating extension {0} to version {1} completed.",
899
+ extension.displayName,
900
+ extension.latestVersion
901
+ )));
902
+ }
903
+ catch (err) {
904
+ this.instantiationService.createInstance(PromptExtensionInstallFailureAction, extension, extension.latestVersion, 3 , err).run();
905
+ }
906
+ }
907
+ };
908
+ UpdateAction = ( __decorate([
909
+ ( __param(1, IExtensionsWorkbenchService)),
910
+ ( __param(2, IInstantiationService))
911
+ ], UpdateAction));
912
+ let SkipUpdateAction = class SkipUpdateAction extends AbstractUpdateAction {
913
+ constructor(extensionsWorkbenchService) {
914
+ super(`extensions.ignoreUpdates`, ( localizeWithPath(
915
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
916
+ 'ignoreUpdates',
917
+ "Ignore Updates"
918
+ )), extensionsWorkbenchService);
919
+ }
920
+ update() {
921
+ if (!this.extension) {
922
+ return;
923
+ }
924
+ if (this.extension.isBuiltin) {
925
+ this.enabled = false;
926
+ return;
927
+ }
928
+ super.update();
929
+ this._checked = this.extension.pinned;
930
+ }
931
+ async run() {
932
+ if (!this.extension) {
933
+ return;
934
+ }
935
+ alert(( localizeWithPath(
936
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
937
+ 'ignoreExtensionUpdate',
938
+ "Ignoring {0} updates",
939
+ this.extension.displayName
940
+ )));
941
+ const newIgnoresAutoUpdates = !this.extension.pinned;
942
+ await this.extensionsWorkbenchService.pinExtension(this.extension, newIgnoresAutoUpdates);
943
+ }
944
+ };
945
+ SkipUpdateAction = ( __decorate([
946
+ ( __param(0, IExtensionsWorkbenchService))
947
+ ], SkipUpdateAction));
948
+ let MigrateDeprecatedExtensionAction = class MigrateDeprecatedExtensionAction extends ExtensionAction {
949
+ static { MigrateDeprecatedExtensionAction_1 = this; }
950
+ static { this.EnabledClass = `${ExtensionAction.LABEL_ACTION_CLASS} migrate`; }
951
+ static { this.DisabledClass = `${MigrateDeprecatedExtensionAction_1.EnabledClass} disabled`; }
952
+ constructor(small, extensionsWorkbenchService) {
953
+ super('extensionsAction.migrateDeprecatedExtension', ( localizeWithPath(
954
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
955
+ 'migrateExtension',
956
+ "Migrate"
957
+ )), MigrateDeprecatedExtensionAction_1.DisabledClass, false);
958
+ this.small = small;
959
+ this.extensionsWorkbenchService = extensionsWorkbenchService;
960
+ this.update();
961
+ }
962
+ update() {
963
+ this.enabled = false;
964
+ this.class = MigrateDeprecatedExtensionAction_1.DisabledClass;
965
+ if (!this.extension?.local) {
966
+ return;
967
+ }
968
+ if (this.extension.state !== 1 ) {
969
+ return;
970
+ }
971
+ if (!this.extension.deprecationInfo?.extension) {
972
+ return;
973
+ }
974
+ const id = this.extension.deprecationInfo.extension.id;
975
+ if (( this.extensionsWorkbenchService.local.some(e => areSameExtensions(e.identifier, { id })))) {
976
+ return;
977
+ }
978
+ this.enabled = true;
979
+ this.class = MigrateDeprecatedExtensionAction_1.EnabledClass;
980
+ this.tooltip = ( localizeWithPath(
981
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
982
+ 'migrate to',
983
+ "Migrate to {0}",
984
+ this.extension.deprecationInfo.extension.displayName
985
+ ));
986
+ this.label = this.small ? ( localizeWithPath(
987
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
988
+ 'migrate',
989
+ "Migrate"
990
+ )) : this.tooltip;
991
+ }
992
+ async run() {
993
+ if (!this.extension?.deprecationInfo?.extension) {
994
+ return;
995
+ }
996
+ const local = this.extension.local;
997
+ await this.extensionsWorkbenchService.uninstall(this.extension);
998
+ const [extension] = await this.extensionsWorkbenchService.getExtensions([{ id: this.extension.deprecationInfo.extension.id, preRelease: this.extension.deprecationInfo?.extension?.preRelease }], CancellationToken.None);
999
+ await this.extensionsWorkbenchService.install(extension, { isMachineScoped: local?.isMachineScoped });
1000
+ }
1001
+ };
1002
+ MigrateDeprecatedExtensionAction = MigrateDeprecatedExtensionAction_1 = ( __decorate([
1003
+ ( __param(1, IExtensionsWorkbenchService))
1004
+ ], MigrateDeprecatedExtensionAction));
1005
+ class ExtensionActionWithDropdownActionViewItem extends ActionWithDropdownActionViewItem {
1006
+ constructor(action, options, contextMenuProvider) {
1007
+ super(null, action, options, contextMenuProvider);
1008
+ }
1009
+ render(container) {
1010
+ super.render(container);
1011
+ this.updateClass();
1012
+ }
1013
+ updateClass() {
1014
+ super.updateClass();
1015
+ if (this.element && this.dropdownMenuActionViewItem && this.dropdownMenuActionViewItem.element) {
1016
+ this.element.classList.toggle('empty', this._action.menuActions.length === 0);
1017
+ this.dropdownMenuActionViewItem.element.classList.toggle('hide', this._action.menuActions.length === 0);
1018
+ }
1019
+ }
1020
+ }
1021
+ let ExtensionDropDownAction = class ExtensionDropDownAction extends ExtensionAction {
1022
+ constructor(id, label, cssClass, enabled, instantiationService) {
1023
+ super(id, label, cssClass, enabled);
1024
+ this.instantiationService = instantiationService;
1025
+ this._actionViewItem = null;
1026
+ }
1027
+ createActionViewItem() {
1028
+ this._actionViewItem = this.instantiationService.createInstance(DropDownMenuActionViewItem, this);
1029
+ return this._actionViewItem;
1030
+ }
1031
+ run({ actionGroups, disposeActionsOnHide }) {
1032
+ this._actionViewItem?.showMenu(actionGroups, disposeActionsOnHide);
1033
+ return Promise.resolve();
1034
+ }
1035
+ };
1036
+ ExtensionDropDownAction = ( __decorate([
1037
+ ( __param(4, IInstantiationService))
1038
+ ], ExtensionDropDownAction));
1039
+ let DropDownMenuActionViewItem = class DropDownMenuActionViewItem extends ActionViewItem {
1040
+ constructor(action, contextMenuService) {
1041
+ super(null, action, { icon: true, label: true });
1042
+ this.contextMenuService = contextMenuService;
1043
+ }
1044
+ showMenu(menuActionGroups, disposeActionsOnHide) {
1045
+ if (this.element) {
1046
+ const actions = this.getActions(menuActionGroups);
1047
+ const elementPosition = dom.getDomNodePagePosition(this.element);
1048
+ const anchor = { x: elementPosition.left, y: elementPosition.top + elementPosition.height + 10 };
1049
+ this.contextMenuService.showContextMenu({
1050
+ getAnchor: () => anchor,
1051
+ getActions: () => actions,
1052
+ actionRunner: this.actionRunner,
1053
+ onHide: () => { if (disposeActionsOnHide) {
1054
+ disposeIfDisposable(actions);
1055
+ } }
1056
+ });
1057
+ }
1058
+ }
1059
+ getActions(menuActionGroups) {
1060
+ let actions = [];
1061
+ for (const menuActions of menuActionGroups) {
1062
+ actions = [...actions, ...menuActions, ( new Separator())];
1063
+ }
1064
+ return actions.length ? actions.slice(0, actions.length - 1) : actions;
1065
+ }
1066
+ };
1067
+ DropDownMenuActionViewItem = ( __decorate([
1068
+ ( __param(1, IContextMenuService))
1069
+ ], DropDownMenuActionViewItem));
1070
+ async function getContextMenuActionsGroups(extension, contextKeyService, instantiationService) {
1071
+ return instantiationService.invokeFunction(async (accessor) => {
1072
+ const extensionsWorkbenchService = accessor.get(IExtensionsWorkbenchService);
1073
+ const menuService = accessor.get(IMenuService);
1074
+ const extensionRecommendationsService = accessor.get(IExtensionRecommendationsService);
1075
+ const extensionIgnoredRecommendationsService = accessor.get(IExtensionIgnoredRecommendationsService);
1076
+ const workbenchThemeService = accessor.get(IWorkbenchThemeService);
1077
+ const cksOverlay = [];
1078
+ if (extension) {
1079
+ cksOverlay.push(['extension', extension.identifier.id]);
1080
+ cksOverlay.push(['isBuiltinExtension', extension.isBuiltin]);
1081
+ cksOverlay.push(['isDefaultApplicationScopedExtension', extension.local && isApplicationScopedExtension(extension.local.manifest)]);
1082
+ cksOverlay.push(['isApplicationScopedExtension', extension.local && extension.local.isApplicationScoped]);
1083
+ cksOverlay.push(['extensionHasConfiguration', extension.local && !!extension.local.manifest.contributes && !!extension.local.manifest.contributes.configuration]);
1084
+ cksOverlay.push(['extensionHasKeybindings', extension.local && !!extension.local.manifest.contributes && !!extension.local.manifest.contributes.keybindings]);
1085
+ cksOverlay.push(['extensionHasCommands', extension.local && !!extension.local.manifest.contributes && !!extension.local.manifest.contributes?.commands]);
1086
+ cksOverlay.push(['isExtensionRecommended', !!extensionRecommendationsService.getAllRecommendationsWithReason()[extension.identifier.id.toLowerCase()]]);
1087
+ cksOverlay.push(['isExtensionWorkspaceRecommended', extensionRecommendationsService.getAllRecommendationsWithReason()[extension.identifier.id.toLowerCase()]?.reasonId === 0 ]);
1088
+ cksOverlay.push(['isUserIgnoredRecommendation', ( extensionIgnoredRecommendationsService.globalIgnoredRecommendations.some(e => e === extension.identifier.id.toLowerCase()))]);
1089
+ if (extension.state === 1 ) {
1090
+ cksOverlay.push(['extensionStatus', 'installed']);
1091
+ }
1092
+ cksOverlay.push(['installedExtensionIsPreReleaseVersion', !!extension.local?.isPreReleaseVersion]);
1093
+ cksOverlay.push(['installedExtensionIsOptedTpPreRelease', !!extension.local?.preRelease]);
1094
+ cksOverlay.push(['galleryExtensionIsPreReleaseVersion', !!extension.gallery?.properties.isPreReleaseVersion]);
1095
+ cksOverlay.push(['extensionHasPreReleaseVersion', extension.hasPreReleaseVersion]);
1096
+ cksOverlay.push(['extensionHasReleaseVersion', extension.hasReleaseVersion]);
1097
+ const [colorThemes, fileIconThemes, productIconThemes] = await Promise.all([workbenchThemeService.getColorThemes(), workbenchThemeService.getFileIconThemes(), workbenchThemeService.getProductIconThemes()]);
1098
+ cksOverlay.push(['extensionHasColorThemes', ( colorThemes.some(theme => isThemeFromExtension(theme, extension)))]);
1099
+ cksOverlay.push(['extensionHasFileIconThemes', ( fileIconThemes.some(theme => isThemeFromExtension(theme, extension)))]);
1100
+ cksOverlay.push(['extensionHasProductIconThemes', ( productIconThemes.some(theme => isThemeFromExtension(theme, extension)))]);
1101
+ cksOverlay.push(['canSetLanguage', extensionsWorkbenchService.canSetLanguage(extension)]);
1102
+ cksOverlay.push(['isActiveLanguagePackExtension', extension.gallery && language === getLocale(extension.gallery)]);
1103
+ }
1104
+ const menu = menuService.createMenu(MenuId.ExtensionContext, contextKeyService.createOverlay(cksOverlay));
1105
+ const actionsGroups = menu.getActions({ shouldForwardArgs: true });
1106
+ menu.dispose();
1107
+ return actionsGroups;
1108
+ });
1109
+ }
1110
+ function toActions(actionsGroups, instantiationService) {
1111
+ const result = [];
1112
+ for (const [, actions] of actionsGroups) {
1113
+ result.push(( actions.map(action => {
1114
+ if (action instanceof SubmenuAction) {
1115
+ return action;
1116
+ }
1117
+ return instantiationService.createInstance(MenuItemExtensionAction, action);
1118
+ })));
1119
+ }
1120
+ return result;
1121
+ }
1122
+ async function getContextMenuActions(extension, contextKeyService, instantiationService) {
1123
+ const actionsGroups = await getContextMenuActionsGroups(extension, contextKeyService, instantiationService);
1124
+ return toActions(actionsGroups, instantiationService);
1125
+ }
1126
+ let ManageExtensionAction = class ManageExtensionAction extends ExtensionDropDownAction {
1127
+ static { ManageExtensionAction_1 = this; }
1128
+ static { this.ID = 'extensions.manage'; }
1129
+ static { this.Class = `${ExtensionAction.ICON_ACTION_CLASS} manage ` + ThemeIcon.asClassName(manageExtensionIcon); }
1130
+ static { this.HideManageExtensionClass = `${ManageExtensionAction_1.Class} hide`; }
1131
+ constructor(instantiationService, extensionService, contextKeyService) {
1132
+ super(ManageExtensionAction_1.ID, '', '', true, instantiationService);
1133
+ this.extensionService = extensionService;
1134
+ this.contextKeyService = contextKeyService;
1135
+ this.tooltip = ( localizeWithPath(
1136
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
1137
+ 'manage',
1138
+ "Manage"
1139
+ ));
1140
+ this.update();
1141
+ }
1142
+ async getActionGroups() {
1143
+ const groups = [];
1144
+ const contextMenuActionsGroups = await getContextMenuActionsGroups(this.extension, this.contextKeyService, this.instantiationService);
1145
+ const themeActions = [], installActions = [], otherActionGroups = [];
1146
+ for (const [group, actions] of contextMenuActionsGroups) {
1147
+ if (group === INSTALL_ACTIONS_GROUP) {
1148
+ installActions.push(...toActions([[group, actions]], this.instantiationService)[0]);
1149
+ }
1150
+ else if (group === THEME_ACTIONS_GROUP) {
1151
+ themeActions.push(...toActions([[group, actions]], this.instantiationService)[0]);
1152
+ }
1153
+ else {
1154
+ otherActionGroups.push(...toActions([[group, actions]], this.instantiationService));
1155
+ }
1156
+ }
1157
+ if (themeActions.length) {
1158
+ groups.push(themeActions);
1159
+ }
1160
+ groups.push([
1161
+ this.instantiationService.createInstance(EnableGloballyAction),
1162
+ this.instantiationService.createInstance(EnableForWorkspaceAction)
1163
+ ]);
1164
+ groups.push([
1165
+ this.instantiationService.createInstance(DisableGloballyAction),
1166
+ this.instantiationService.createInstance(DisableForWorkspaceAction)
1167
+ ]);
1168
+ groups.push([
1169
+ ...(installActions.length ? installActions : []),
1170
+ this.instantiationService.createInstance(InstallAnotherVersionAction),
1171
+ this.instantiationService.createInstance(UninstallAction),
1172
+ ]);
1173
+ otherActionGroups.forEach(actions => groups.push(actions));
1174
+ groups.forEach(group => group.forEach(extensionAction => {
1175
+ if (extensionAction instanceof ExtensionAction) {
1176
+ extensionAction.extension = this.extension;
1177
+ }
1178
+ }));
1179
+ return groups;
1180
+ }
1181
+ async run() {
1182
+ await this.extensionService.whenInstalledExtensionsRegistered();
1183
+ return super.run({ actionGroups: await this.getActionGroups(), disposeActionsOnHide: true });
1184
+ }
1185
+ update() {
1186
+ this.class = ManageExtensionAction_1.HideManageExtensionClass;
1187
+ this.enabled = false;
1188
+ if (this.extension) {
1189
+ const state = this.extension.state;
1190
+ this.enabled = state === 1 ;
1191
+ this.class = this.enabled || state === 2 ? ManageExtensionAction_1.Class : ManageExtensionAction_1.HideManageExtensionClass;
1192
+ }
1193
+ }
1194
+ };
1195
+ ManageExtensionAction = ManageExtensionAction_1 = ( __decorate([
1196
+ ( __param(0, IInstantiationService)),
1197
+ ( __param(1, IExtensionService)),
1198
+ ( __param(2, IContextKeyService))
1199
+ ], ManageExtensionAction));
1200
+ class ExtensionEditorManageExtensionAction extends ExtensionDropDownAction {
1201
+ constructor(contextKeyService, instantiationService) {
1202
+ super('extensionEditor.manageExtension', '', `${ExtensionAction.ICON_ACTION_CLASS} manage ${ThemeIcon.asClassName(manageExtensionIcon)}`, true, instantiationService);
1203
+ this.contextKeyService = contextKeyService;
1204
+ this.tooltip = ( localizeWithPath(
1205
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
1206
+ 'manage',
1207
+ "Manage"
1208
+ ));
1209
+ }
1210
+ update() { }
1211
+ async run() {
1212
+ const actionGroups = [];
1213
+ (await getContextMenuActions(this.extension, this.contextKeyService, this.instantiationService)).forEach(actions => actionGroups.push(actions));
1214
+ actionGroups.forEach(group => group.forEach(extensionAction => {
1215
+ if (extensionAction instanceof ExtensionAction) {
1216
+ extensionAction.extension = this.extension;
1217
+ }
1218
+ }));
1219
+ return super.run({ actionGroups, disposeActionsOnHide: true });
1220
+ }
1221
+ }
1222
+ let MenuItemExtensionAction = class MenuItemExtensionAction extends ExtensionAction {
1223
+ constructor(action, extensionsWorkbenchService) {
1224
+ super(action.id, action.label);
1225
+ this.action = action;
1226
+ this.extensionsWorkbenchService = extensionsWorkbenchService;
1227
+ }
1228
+ update() {
1229
+ if (!this.extension) {
1230
+ return;
1231
+ }
1232
+ if (this.action.id === TOGGLE_IGNORE_EXTENSION_ACTION_ID) {
1233
+ this.checked = !this.extensionsWorkbenchService.isExtensionIgnoredToSync(this.extension);
1234
+ }
1235
+ else {
1236
+ this.checked = this.action.checked;
1237
+ }
1238
+ }
1239
+ async run() {
1240
+ if (this.extension) {
1241
+ await this.action.run(this.extension.local ? getExtensionId(this.extension.local.manifest.publisher, this.extension.local.manifest.name)
1242
+ : this.extension.gallery ? getExtensionId(this.extension.gallery.publisher, this.extension.gallery.name)
1243
+ : this.extension.identifier.id);
1244
+ }
1245
+ }
1246
+ };
1247
+ MenuItemExtensionAction = ( __decorate([
1248
+ ( __param(1, IExtensionsWorkbenchService))
1249
+ ], MenuItemExtensionAction));
1250
+ let SwitchToPreReleaseVersionAction = class SwitchToPreReleaseVersionAction extends ExtensionAction {
1251
+ static { SwitchToPreReleaseVersionAction_1 = this; }
1252
+ static { this.ID = 'workbench.extensions.action.switchToPreReleaseVersion'; }
1253
+ static { this.TITLE = { value: ( localizeWithPath(
1254
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
1255
+ 'switch to pre-release version',
1256
+ "Switch to Pre-Release Version"
1257
+ )), original: 'Switch to Pre-Release Version' }; }
1258
+ constructor(icon, commandService) {
1259
+ super(SwitchToPreReleaseVersionAction_1.ID, icon ? '' : SwitchToPreReleaseVersionAction_1.TITLE.value, `${icon ? ExtensionAction.ICON_ACTION_CLASS + ' ' + ThemeIcon.asClassName(preReleaseIcon) : ExtensionAction.LABEL_ACTION_CLASS} hide-when-disabled switch-to-prerelease`, true);
1260
+ this.commandService = commandService;
1261
+ this.tooltip = ( localizeWithPath(
1262
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
1263
+ 'switch to pre-release version tooltip',
1264
+ "Switch to Pre-Release version of this extension"
1265
+ ));
1266
+ this.update();
1267
+ }
1268
+ update() {
1269
+ this.enabled = !!this.extension && !this.extension.isBuiltin && !this.extension.local?.isPreReleaseVersion && !this.extension.local?.preRelease && this.extension.hasPreReleaseVersion && this.extension.state === 1 ;
1270
+ }
1271
+ async run() {
1272
+ if (!this.enabled) {
1273
+ return;
1274
+ }
1275
+ return this.commandService.executeCommand(SwitchToPreReleaseVersionAction_1.ID, this.extension?.identifier.id);
1276
+ }
1277
+ };
1278
+ SwitchToPreReleaseVersionAction = SwitchToPreReleaseVersionAction_1 = ( __decorate([
1279
+ ( __param(1, ICommandService))
1280
+ ], SwitchToPreReleaseVersionAction));
1281
+ let SwitchToReleasedVersionAction = class SwitchToReleasedVersionAction extends ExtensionAction {
1282
+ static { SwitchToReleasedVersionAction_1 = this; }
1283
+ static { this.ID = 'workbench.extensions.action.switchToReleaseVersion'; }
1284
+ static { this.TITLE = { value: ( localizeWithPath(
1285
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
1286
+ 'switch to release version',
1287
+ "Switch to Release Version"
1288
+ )), original: 'Switch to Release Version' }; }
1289
+ constructor(icon, commandService) {
1290
+ super(SwitchToReleasedVersionAction_1.ID, icon ? '' : SwitchToReleasedVersionAction_1.TITLE.value, `${icon ? ExtensionAction.ICON_ACTION_CLASS + ' ' + ThemeIcon.asClassName(preReleaseIcon) : ExtensionAction.LABEL_ACTION_CLASS} hide-when-disabled switch-to-released`);
1291
+ this.commandService = commandService;
1292
+ this.tooltip = ( localizeWithPath(
1293
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
1294
+ 'switch to release version tooltip',
1295
+ "Switch to Release version of this extension"
1296
+ ));
1297
+ this.update();
1298
+ }
1299
+ update() {
1300
+ this.enabled = !!this.extension && !this.extension.isBuiltin && this.extension.state === 1 && !!this.extension.local?.isPreReleaseVersion && !!this.extension.hasReleaseVersion;
1301
+ }
1302
+ async run() {
1303
+ if (!this.enabled) {
1304
+ return;
1305
+ }
1306
+ return this.commandService.executeCommand(SwitchToReleasedVersionAction_1.ID, this.extension?.identifier.id);
1307
+ }
1308
+ };
1309
+ SwitchToReleasedVersionAction = SwitchToReleasedVersionAction_1 = ( __decorate([
1310
+ ( __param(1, ICommandService))
1311
+ ], SwitchToReleasedVersionAction));
1312
+ let InstallAnotherVersionAction = class InstallAnotherVersionAction extends ExtensionAction {
1313
+ static { InstallAnotherVersionAction_1 = this; }
1314
+ static { this.ID = 'workbench.extensions.action.install.anotherVersion'; }
1315
+ static { this.LABEL = ( localizeWithPath(
1316
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
1317
+ 'install another version',
1318
+ "Install Another Version..."
1319
+ )); }
1320
+ constructor(extensionsWorkbenchService, extensionGalleryService, quickInputService, instantiationService, dialogService) {
1321
+ super(InstallAnotherVersionAction_1.ID, InstallAnotherVersionAction_1.LABEL, ExtensionAction.LABEL_ACTION_CLASS);
1322
+ this.extensionsWorkbenchService = extensionsWorkbenchService;
1323
+ this.extensionGalleryService = extensionGalleryService;
1324
+ this.quickInputService = quickInputService;
1325
+ this.instantiationService = instantiationService;
1326
+ this.dialogService = dialogService;
1327
+ this.update();
1328
+ }
1329
+ update() {
1330
+ this.enabled = !!this.extension && !this.extension.isBuiltin && !!this.extension.gallery && !!this.extension.local && !!this.extension.server && this.extension.state === 1 && !this.extension.deprecationInfo;
1331
+ }
1332
+ async run() {
1333
+ if (!this.enabled) {
1334
+ return;
1335
+ }
1336
+ const targetPlatform = await this.extension.server.extensionManagementService.getTargetPlatform();
1337
+ const allVersions = await this.extensionGalleryService.getAllCompatibleVersions(this.extension.gallery, this.extension.local.preRelease, targetPlatform);
1338
+ if (!allVersions.length) {
1339
+ await this.dialogService.info(( localizeWithPath(
1340
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
1341
+ 'no versions',
1342
+ "This extension has no other versions."
1343
+ )));
1344
+ return;
1345
+ }
1346
+ const picks = ( allVersions.map((v, i) => {
1347
+ return {
1348
+ id: v.version,
1349
+ label: v.version,
1350
+ description: `${fromNow(( new Date(Date.parse(v.date))), true)}${v.isPreReleaseVersion ? ` (${( localizeWithPath(
1351
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
1352
+ 'pre-release',
1353
+ "pre-release"
1354
+ ))})` : ''}${v.version === this.extension.version ? ` (${( localizeWithPath(
1355
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
1356
+ 'current',
1357
+ "current"
1358
+ ))})` : ''}`,
1359
+ latest: i === 0,
1360
+ ariaLabel: `${v.isPreReleaseVersion ? 'Pre-Release version' : 'Release version'} ${v.version}`,
1361
+ isPreReleaseVersion: v.isPreReleaseVersion
1362
+ };
1363
+ }));
1364
+ const pick = await this.quickInputService.pick(picks, {
1365
+ placeHolder: ( localizeWithPath(
1366
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
1367
+ 'selectVersion',
1368
+ "Select Version to Install"
1369
+ )),
1370
+ matchOnDetail: true
1371
+ });
1372
+ if (pick) {
1373
+ if (this.extension.version === pick.id) {
1374
+ return;
1375
+ }
1376
+ try {
1377
+ if (pick.latest) {
1378
+ await this.extensionsWorkbenchService.install(this.extension, { installPreReleaseVersion: pick.isPreReleaseVersion });
1379
+ }
1380
+ else {
1381
+ await this.extensionsWorkbenchService.installVersion(this.extension, pick.id, { installPreReleaseVersion: pick.isPreReleaseVersion });
1382
+ }
1383
+ }
1384
+ catch (error) {
1385
+ this.instantiationService.createInstance(PromptExtensionInstallFailureAction, this.extension, pick.latest ? this.extension.latestVersion : pick.id, 2 , error).run();
1386
+ }
1387
+ }
1388
+ return null;
1389
+ }
1390
+ };
1391
+ InstallAnotherVersionAction = InstallAnotherVersionAction_1 = ( __decorate([
1392
+ ( __param(0, IExtensionsWorkbenchService)),
1393
+ ( __param(1, IExtensionGalleryService)),
1394
+ ( __param(2, IQuickInputService)),
1395
+ ( __param(3, IInstantiationService)),
1396
+ ( __param(4, IDialogService))
1397
+ ], InstallAnotherVersionAction));
1398
+ let EnableForWorkspaceAction = class EnableForWorkspaceAction extends ExtensionAction {
1399
+ static { EnableForWorkspaceAction_1 = this; }
1400
+ static { this.ID = 'extensions.enableForWorkspace'; }
1401
+ static { this.LABEL = ( localizeWithPath(
1402
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
1403
+ 'enableForWorkspaceAction',
1404
+ "Enable (Workspace)"
1405
+ )); }
1406
+ constructor(extensionsWorkbenchService, extensionEnablementService) {
1407
+ super(EnableForWorkspaceAction_1.ID, EnableForWorkspaceAction_1.LABEL, ExtensionAction.LABEL_ACTION_CLASS);
1408
+ this.extensionsWorkbenchService = extensionsWorkbenchService;
1409
+ this.extensionEnablementService = extensionEnablementService;
1410
+ this.tooltip = ( localizeWithPath(
1411
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
1412
+ 'enableForWorkspaceActionToolTip',
1413
+ "Enable this extension only in this workspace"
1414
+ ));
1415
+ this.update();
1416
+ }
1417
+ update() {
1418
+ this.enabled = false;
1419
+ if (this.extension && this.extension.local) {
1420
+ this.enabled = this.extension.state === 1
1421
+ && !this.extensionEnablementService.isEnabled(this.extension.local)
1422
+ && this.extensionEnablementService.canChangeWorkspaceEnablement(this.extension.local);
1423
+ }
1424
+ }
1425
+ async run() {
1426
+ if (!this.extension) {
1427
+ return;
1428
+ }
1429
+ return this.extensionsWorkbenchService.setEnablement(this.extension, 9 );
1430
+ }
1431
+ };
1432
+ EnableForWorkspaceAction = EnableForWorkspaceAction_1 = ( __decorate([
1433
+ ( __param(0, IExtensionsWorkbenchService)),
1434
+ ( __param(1, IWorkbenchExtensionEnablementService))
1435
+ ], EnableForWorkspaceAction));
1436
+ let EnableGloballyAction = class EnableGloballyAction extends ExtensionAction {
1437
+ static { EnableGloballyAction_1 = this; }
1438
+ static { this.ID = 'extensions.enableGlobally'; }
1439
+ static { this.LABEL = ( localizeWithPath(
1440
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
1441
+ 'enableGloballyAction',
1442
+ "Enable"
1443
+ )); }
1444
+ constructor(extensionsWorkbenchService, extensionEnablementService) {
1445
+ super(EnableGloballyAction_1.ID, EnableGloballyAction_1.LABEL, ExtensionAction.LABEL_ACTION_CLASS);
1446
+ this.extensionsWorkbenchService = extensionsWorkbenchService;
1447
+ this.extensionEnablementService = extensionEnablementService;
1448
+ this.tooltip = ( localizeWithPath(
1449
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
1450
+ 'enableGloballyActionToolTip',
1451
+ "Enable this extension"
1452
+ ));
1453
+ this.update();
1454
+ }
1455
+ update() {
1456
+ this.enabled = false;
1457
+ if (this.extension && this.extension.local) {
1458
+ this.enabled = this.extension.state === 1
1459
+ && this.extensionEnablementService.isDisabledGlobally(this.extension.local)
1460
+ && this.extensionEnablementService.canChangeEnablement(this.extension.local);
1461
+ }
1462
+ }
1463
+ async run() {
1464
+ if (!this.extension) {
1465
+ return;
1466
+ }
1467
+ return this.extensionsWorkbenchService.setEnablement(this.extension, 8 );
1468
+ }
1469
+ };
1470
+ EnableGloballyAction = EnableGloballyAction_1 = ( __decorate([
1471
+ ( __param(0, IExtensionsWorkbenchService)),
1472
+ ( __param(1, IWorkbenchExtensionEnablementService))
1473
+ ], EnableGloballyAction));
1474
+ let DisableForWorkspaceAction = class DisableForWorkspaceAction extends ExtensionAction {
1475
+ static { DisableForWorkspaceAction_1 = this; }
1476
+ static { this.ID = 'extensions.disableForWorkspace'; }
1477
+ static { this.LABEL = ( localizeWithPath(
1478
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
1479
+ 'disableForWorkspaceAction',
1480
+ "Disable (Workspace)"
1481
+ )); }
1482
+ constructor(workspaceContextService, extensionsWorkbenchService, extensionEnablementService, extensionService) {
1483
+ super(DisableForWorkspaceAction_1.ID, DisableForWorkspaceAction_1.LABEL, ExtensionAction.LABEL_ACTION_CLASS);
1484
+ this.workspaceContextService = workspaceContextService;
1485
+ this.extensionsWorkbenchService = extensionsWorkbenchService;
1486
+ this.extensionEnablementService = extensionEnablementService;
1487
+ this.extensionService = extensionService;
1488
+ this.tooltip = ( localizeWithPath(
1489
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
1490
+ 'disableForWorkspaceActionToolTip',
1491
+ "Disable this extension only in this workspace"
1492
+ ));
1493
+ this.update();
1494
+ this._register(this.extensionService.onDidChangeExtensions(() => this.update()));
1495
+ }
1496
+ update() {
1497
+ this.enabled = false;
1498
+ if (this.extension && this.extension.local && ( this.extensionService.extensions.some(
1499
+ e => areSameExtensions({ id: e.identifier.value, uuid: e.uuid }, this.extension.identifier) && this.workspaceContextService.getWorkbenchState() !== 1
1500
+ ))) {
1501
+ this.enabled = this.extension.state === 1
1502
+ && ((this.extension.enablementState === 8 || this.extension.enablementState === 9) )
1503
+ && this.extensionEnablementService.canChangeWorkspaceEnablement(this.extension.local);
1504
+ }
1505
+ }
1506
+ async run() {
1507
+ if (!this.extension) {
1508
+ return;
1509
+ }
1510
+ return this.extensionsWorkbenchService.setEnablement(this.extension, 7 );
1511
+ }
1512
+ };
1513
+ DisableForWorkspaceAction = DisableForWorkspaceAction_1 = ( __decorate([
1514
+ ( __param(0, IWorkspaceContextService)),
1515
+ ( __param(1, IExtensionsWorkbenchService)),
1516
+ ( __param(2, IWorkbenchExtensionEnablementService)),
1517
+ ( __param(3, IExtensionService))
1518
+ ], DisableForWorkspaceAction));
1519
+ let DisableGloballyAction = class DisableGloballyAction extends ExtensionAction {
1520
+ static { DisableGloballyAction_1 = this; }
1521
+ static { this.ID = 'extensions.disableGlobally'; }
1522
+ static { this.LABEL = ( localizeWithPath(
1523
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
1524
+ 'disableGloballyAction',
1525
+ "Disable"
1526
+ )); }
1527
+ constructor(extensionsWorkbenchService, extensionEnablementService, extensionService) {
1528
+ super(DisableGloballyAction_1.ID, DisableGloballyAction_1.LABEL, ExtensionAction.LABEL_ACTION_CLASS);
1529
+ this.extensionsWorkbenchService = extensionsWorkbenchService;
1530
+ this.extensionEnablementService = extensionEnablementService;
1531
+ this.extensionService = extensionService;
1532
+ this.tooltip = ( localizeWithPath(
1533
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
1534
+ 'disableGloballyActionToolTip',
1535
+ "Disable this extension"
1536
+ ));
1537
+ this.update();
1538
+ this._register(this.extensionService.onDidChangeExtensions(() => this.update()));
1539
+ }
1540
+ update() {
1541
+ this.enabled = false;
1542
+ if (this.extension && this.extension.local && ( this.extensionService.extensions.some(
1543
+ e => areSameExtensions({ id: e.identifier.value, uuid: e.uuid }, this.extension.identifier)
1544
+ ))) {
1545
+ this.enabled = this.extension.state === 1
1546
+ && ((this.extension.enablementState === 8 || this.extension.enablementState === 9) )
1547
+ && this.extensionEnablementService.canChangeEnablement(this.extension.local);
1548
+ }
1549
+ }
1550
+ async run() {
1551
+ if (!this.extension) {
1552
+ return;
1553
+ }
1554
+ return this.extensionsWorkbenchService.setEnablement(this.extension, 6 );
1555
+ }
1556
+ };
1557
+ DisableGloballyAction = DisableGloballyAction_1 = ( __decorate([
1558
+ ( __param(0, IExtensionsWorkbenchService)),
1559
+ ( __param(1, IWorkbenchExtensionEnablementService)),
1560
+ ( __param(2, IExtensionService))
1561
+ ], DisableGloballyAction));
1562
+ let EnableDropDownAction = class EnableDropDownAction extends ActionWithDropDownAction {
1563
+ constructor(instantiationService) {
1564
+ super('extensions.enable', ( localizeWithPath(
1565
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
1566
+ 'enableAction',
1567
+ "Enable"
1568
+ )), [
1569
+ [
1570
+ instantiationService.createInstance(EnableGloballyAction),
1571
+ instantiationService.createInstance(EnableForWorkspaceAction)
1572
+ ]
1573
+ ]);
1574
+ }
1575
+ };
1576
+ EnableDropDownAction = ( __decorate([
1577
+ ( __param(0, IInstantiationService))
1578
+ ], EnableDropDownAction));
1579
+ let DisableDropDownAction = class DisableDropDownAction extends ActionWithDropDownAction {
1580
+ constructor(instantiationService) {
1581
+ super('extensions.disable', ( localizeWithPath(
1582
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
1583
+ 'disableAction',
1584
+ "Disable"
1585
+ )), [[
1586
+ instantiationService.createInstance(DisableGloballyAction),
1587
+ instantiationService.createInstance(DisableForWorkspaceAction)
1588
+ ]]);
1589
+ }
1590
+ };
1591
+ DisableDropDownAction = ( __decorate([
1592
+ ( __param(0, IInstantiationService))
1593
+ ], DisableDropDownAction));
1594
+ let ReloadAction = class ReloadAction extends ExtensionAction {
1595
+ static { ReloadAction_1 = this; }
1596
+ static { this.EnabledClass = `${ExtensionAction.LABEL_ACTION_CLASS} reload`; }
1597
+ static { this.DisabledClass = `${ReloadAction_1.EnabledClass} disabled`; }
1598
+ constructor(hostService, extensionService) {
1599
+ super('extensions.reload', ( localizeWithPath(
1600
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
1601
+ 'reloadAction',
1602
+ "Reload"
1603
+ )), ReloadAction_1.DisabledClass, false);
1604
+ this.hostService = hostService;
1605
+ this.extensionService = extensionService;
1606
+ this.updateWhenCounterExtensionChanges = true;
1607
+ this._register(this.extensionService.onDidChangeExtensions(() => this.update()));
1608
+ this.update();
1609
+ }
1610
+ update() {
1611
+ this.enabled = false;
1612
+ this.tooltip = '';
1613
+ if (!this.extension) {
1614
+ return;
1615
+ }
1616
+ const state = this.extension.state;
1617
+ if (state === 0 || state === 2 ) {
1618
+ return;
1619
+ }
1620
+ if (this.extension.local && this.extension.local.manifest && this.extension.local.manifest.contributes && this.extension.local.manifest.contributes.localizations && this.extension.local.manifest.contributes.localizations.length > 0) {
1621
+ return;
1622
+ }
1623
+ const reloadTooltip = this.extension.reloadRequiredStatus;
1624
+ this.enabled = reloadTooltip !== undefined;
1625
+ this.label = reloadTooltip !== undefined ? ( localizeWithPath(
1626
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
1627
+ 'reload required',
1628
+ 'Reload Required'
1629
+ )) : '';
1630
+ this.tooltip = reloadTooltip !== undefined ? reloadTooltip : '';
1631
+ this.class = this.enabled ? ReloadAction_1.EnabledClass : ReloadAction_1.DisabledClass;
1632
+ }
1633
+ run() {
1634
+ return Promise.resolve(this.hostService.reload());
1635
+ }
1636
+ };
1637
+ ReloadAction = ReloadAction_1 = ( __decorate([
1638
+ ( __param(0, IHostService)),
1639
+ ( __param(1, IExtensionService))
1640
+ ], ReloadAction));
1641
+ function isThemeFromExtension(theme, extension) {
1642
+ return !!(extension && theme.extensionData && ExtensionIdentifier.equals(theme.extensionData.extensionId, extension.identifier.id));
1643
+ }
1644
+ function getQuickPickEntries(themes, currentTheme, extension, showCurrentTheme) {
1645
+ const picks = [];
1646
+ for (const theme of themes) {
1647
+ if (isThemeFromExtension(theme, extension) && !(showCurrentTheme && theme === currentTheme)) {
1648
+ picks.push({ label: theme.label, id: theme.id });
1649
+ }
1650
+ }
1651
+ if (showCurrentTheme) {
1652
+ picks.push({ type: 'separator', label: ( localizeWithPath(
1653
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
1654
+ 'current',
1655
+ "current"
1656
+ )) });
1657
+ picks.push({ label: currentTheme.label, id: currentTheme.id });
1658
+ }
1659
+ return picks;
1660
+ }
1661
+ let SetColorThemeAction = class SetColorThemeAction extends ExtensionAction {
1662
+ static { SetColorThemeAction_1 = this; }
1663
+ static { this.ID = 'workbench.extensions.action.setColorTheme'; }
1664
+ static { this.TITLE = { value: ( localizeWithPath(
1665
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
1666
+ 'workbench.extensions.action.setColorTheme',
1667
+ "Set Color Theme"
1668
+ )), original: 'Set Color Theme' }; }
1669
+ static { this.EnabledClass = `${ExtensionAction.LABEL_ACTION_CLASS} theme`; }
1670
+ static { this.DisabledClass = `${SetColorThemeAction_1.EnabledClass} disabled`; }
1671
+ constructor(extensionService, workbenchThemeService, quickInputService, extensionEnablementService) {
1672
+ super(SetColorThemeAction_1.ID, SetColorThemeAction_1.TITLE.value, SetColorThemeAction_1.DisabledClass, false);
1673
+ this.workbenchThemeService = workbenchThemeService;
1674
+ this.quickInputService = quickInputService;
1675
+ this.extensionEnablementService = extensionEnablementService;
1676
+ this._register(Event.any(extensionService.onDidChangeExtensions, workbenchThemeService.onDidColorThemeChange)(() => this.update(), this));
1677
+ this.update();
1678
+ }
1679
+ update() {
1680
+ this.workbenchThemeService.getColorThemes().then(colorThemes => {
1681
+ this.enabled = this.computeEnablement(colorThemes);
1682
+ this.class = this.enabled ? SetColorThemeAction_1.EnabledClass : SetColorThemeAction_1.DisabledClass;
1683
+ });
1684
+ }
1685
+ computeEnablement(colorThemes) {
1686
+ return !!this.extension && this.extension.state === 1 && this.extensionEnablementService.isEnabledEnablementState(this.extension.enablementState) && ( colorThemes.some(th => isThemeFromExtension(th, this.extension)));
1687
+ }
1688
+ async run({ showCurrentTheme, ignoreFocusLost } = { showCurrentTheme: false, ignoreFocusLost: false }) {
1689
+ const colorThemes = await this.workbenchThemeService.getColorThemes();
1690
+ if (!this.computeEnablement(colorThemes)) {
1691
+ return;
1692
+ }
1693
+ const currentTheme = this.workbenchThemeService.getColorTheme();
1694
+ const delayer = ( new Delayer(100));
1695
+ const picks = getQuickPickEntries(colorThemes, currentTheme, this.extension, showCurrentTheme);
1696
+ const pickedTheme = await this.quickInputService.pick(picks, {
1697
+ placeHolder: ( localizeWithPath(
1698
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
1699
+ 'select color theme',
1700
+ "Select Color Theme"
1701
+ )),
1702
+ onDidFocus: item => delayer.trigger(() => this.workbenchThemeService.setColorTheme(item.id, undefined)),
1703
+ ignoreFocusLost
1704
+ });
1705
+ return this.workbenchThemeService.setColorTheme(pickedTheme ? pickedTheme.id : currentTheme.id, 'auto');
1706
+ }
1707
+ };
1708
+ SetColorThemeAction = SetColorThemeAction_1 = ( __decorate([
1709
+ ( __param(0, IExtensionService)),
1710
+ ( __param(1, IWorkbenchThemeService)),
1711
+ ( __param(2, IQuickInputService)),
1712
+ ( __param(3, IWorkbenchExtensionEnablementService))
1713
+ ], SetColorThemeAction));
1714
+ let SetFileIconThemeAction = class SetFileIconThemeAction extends ExtensionAction {
1715
+ static { SetFileIconThemeAction_1 = this; }
1716
+ static { this.ID = 'workbench.extensions.action.setFileIconTheme'; }
1717
+ static { this.TITLE = { value: ( localizeWithPath(
1718
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
1719
+ 'workbench.extensions.action.setFileIconTheme',
1720
+ "Set File Icon Theme"
1721
+ )), original: 'Set File Icon Theme' }; }
1722
+ static { this.EnabledClass = `${ExtensionAction.LABEL_ACTION_CLASS} theme`; }
1723
+ static { this.DisabledClass = `${SetFileIconThemeAction_1.EnabledClass} disabled`; }
1724
+ constructor(extensionService, workbenchThemeService, quickInputService, extensionEnablementService) {
1725
+ super(SetFileIconThemeAction_1.ID, SetFileIconThemeAction_1.TITLE.value, SetFileIconThemeAction_1.DisabledClass, false);
1726
+ this.workbenchThemeService = workbenchThemeService;
1727
+ this.quickInputService = quickInputService;
1728
+ this.extensionEnablementService = extensionEnablementService;
1729
+ this._register(Event.any(extensionService.onDidChangeExtensions, workbenchThemeService.onDidFileIconThemeChange)(() => this.update(), this));
1730
+ this.update();
1731
+ }
1732
+ update() {
1733
+ this.workbenchThemeService.getFileIconThemes().then(fileIconThemes => {
1734
+ this.enabled = this.computeEnablement(fileIconThemes);
1735
+ this.class = this.enabled ? SetFileIconThemeAction_1.EnabledClass : SetFileIconThemeAction_1.DisabledClass;
1736
+ });
1737
+ }
1738
+ computeEnablement(colorThemfileIconThemess) {
1739
+ return !!this.extension && this.extension.state === 1 && this.extensionEnablementService.isEnabledEnablementState(this.extension.enablementState) && ( colorThemfileIconThemess.some(th => isThemeFromExtension(th, this.extension)));
1740
+ }
1741
+ async run({ showCurrentTheme, ignoreFocusLost } = { showCurrentTheme: false, ignoreFocusLost: false }) {
1742
+ const fileIconThemes = await this.workbenchThemeService.getFileIconThemes();
1743
+ if (!this.computeEnablement(fileIconThemes)) {
1744
+ return;
1745
+ }
1746
+ const currentTheme = this.workbenchThemeService.getFileIconTheme();
1747
+ const delayer = ( new Delayer(100));
1748
+ const picks = getQuickPickEntries(fileIconThemes, currentTheme, this.extension, showCurrentTheme);
1749
+ const pickedTheme = await this.quickInputService.pick(picks, {
1750
+ placeHolder: ( localizeWithPath(
1751
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
1752
+ 'select file icon theme',
1753
+ "Select File Icon Theme"
1754
+ )),
1755
+ onDidFocus: item => delayer.trigger(() => this.workbenchThemeService.setFileIconTheme(item.id, undefined)),
1756
+ ignoreFocusLost
1757
+ });
1758
+ return this.workbenchThemeService.setFileIconTheme(pickedTheme ? pickedTheme.id : currentTheme.id, 'auto');
1759
+ }
1760
+ };
1761
+ SetFileIconThemeAction = SetFileIconThemeAction_1 = ( __decorate([
1762
+ ( __param(0, IExtensionService)),
1763
+ ( __param(1, IWorkbenchThemeService)),
1764
+ ( __param(2, IQuickInputService)),
1765
+ ( __param(3, IWorkbenchExtensionEnablementService))
1766
+ ], SetFileIconThemeAction));
1767
+ let SetProductIconThemeAction = class SetProductIconThemeAction extends ExtensionAction {
1768
+ static { SetProductIconThemeAction_1 = this; }
1769
+ static { this.ID = 'workbench.extensions.action.setProductIconTheme'; }
1770
+ static { this.TITLE = { value: ( localizeWithPath(
1771
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
1772
+ 'workbench.extensions.action.setProductIconTheme',
1773
+ "Set Product Icon Theme"
1774
+ )), original: 'Set Product Icon Theme' }; }
1775
+ static { this.EnabledClass = `${ExtensionAction.LABEL_ACTION_CLASS} theme`; }
1776
+ static { this.DisabledClass = `${SetProductIconThemeAction_1.EnabledClass} disabled`; }
1777
+ constructor(extensionService, workbenchThemeService, quickInputService, extensionEnablementService) {
1778
+ super(SetProductIconThemeAction_1.ID, SetProductIconThemeAction_1.TITLE.value, SetProductIconThemeAction_1.DisabledClass, false);
1779
+ this.workbenchThemeService = workbenchThemeService;
1780
+ this.quickInputService = quickInputService;
1781
+ this.extensionEnablementService = extensionEnablementService;
1782
+ this._register(Event.any(extensionService.onDidChangeExtensions, workbenchThemeService.onDidProductIconThemeChange)(() => this.update(), this));
1783
+ this.update();
1784
+ }
1785
+ update() {
1786
+ this.workbenchThemeService.getProductIconThemes().then(productIconThemes => {
1787
+ this.enabled = this.computeEnablement(productIconThemes);
1788
+ this.class = this.enabled ? SetProductIconThemeAction_1.EnabledClass : SetProductIconThemeAction_1.DisabledClass;
1789
+ });
1790
+ }
1791
+ computeEnablement(productIconThemes) {
1792
+ return !!this.extension && this.extension.state === 1 && this.extensionEnablementService.isEnabledEnablementState(this.extension.enablementState) && ( productIconThemes.some(th => isThemeFromExtension(th, this.extension)));
1793
+ }
1794
+ async run({ showCurrentTheme, ignoreFocusLost } = { showCurrentTheme: false, ignoreFocusLost: false }) {
1795
+ const productIconThemes = await this.workbenchThemeService.getProductIconThemes();
1796
+ if (!this.computeEnablement(productIconThemes)) {
1797
+ return;
1798
+ }
1799
+ const currentTheme = this.workbenchThemeService.getProductIconTheme();
1800
+ const delayer = ( new Delayer(100));
1801
+ const picks = getQuickPickEntries(productIconThemes, currentTheme, this.extension, showCurrentTheme);
1802
+ const pickedTheme = await this.quickInputService.pick(picks, {
1803
+ placeHolder: ( localizeWithPath(
1804
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
1805
+ 'select product icon theme',
1806
+ "Select Product Icon Theme"
1807
+ )),
1808
+ onDidFocus: item => delayer.trigger(() => this.workbenchThemeService.setProductIconTheme(item.id, undefined)),
1809
+ ignoreFocusLost
1810
+ });
1811
+ return this.workbenchThemeService.setProductIconTheme(pickedTheme ? pickedTheme.id : currentTheme.id, 'auto');
1812
+ }
1813
+ };
1814
+ SetProductIconThemeAction = SetProductIconThemeAction_1 = ( __decorate([
1815
+ ( __param(0, IExtensionService)),
1816
+ ( __param(1, IWorkbenchThemeService)),
1817
+ ( __param(2, IQuickInputService)),
1818
+ ( __param(3, IWorkbenchExtensionEnablementService))
1819
+ ], SetProductIconThemeAction));
1820
+ let SetLanguageAction = class SetLanguageAction extends ExtensionAction {
1821
+ static { SetLanguageAction_1 = this; }
1822
+ static { this.ID = 'workbench.extensions.action.setDisplayLanguage'; }
1823
+ static { this.TITLE = { value: ( localizeWithPath(
1824
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
1825
+ 'workbench.extensions.action.setDisplayLanguage',
1826
+ "Set Display Language"
1827
+ )), original: 'Set Display Language' }; }
1828
+ static { this.EnabledClass = `${ExtensionAction.LABEL_ACTION_CLASS} language`; }
1829
+ static { this.DisabledClass = `${SetLanguageAction_1.EnabledClass} disabled`; }
1830
+ constructor(extensionsWorkbenchService) {
1831
+ super(SetLanguageAction_1.ID, SetLanguageAction_1.TITLE.value, SetLanguageAction_1.DisabledClass, false);
1832
+ this.extensionsWorkbenchService = extensionsWorkbenchService;
1833
+ this.update();
1834
+ }
1835
+ update() {
1836
+ this.enabled = false;
1837
+ this.class = SetLanguageAction_1.DisabledClass;
1838
+ if (!this.extension) {
1839
+ return;
1840
+ }
1841
+ if (!this.extensionsWorkbenchService.canSetLanguage(this.extension)) {
1842
+ return;
1843
+ }
1844
+ if (this.extension.gallery && language === getLocale(this.extension.gallery)) {
1845
+ return;
1846
+ }
1847
+ this.enabled = true;
1848
+ this.class = SetLanguageAction_1.EnabledClass;
1849
+ }
1850
+ async run() {
1851
+ return this.extension && this.extensionsWorkbenchService.setLanguage(this.extension);
1852
+ }
1853
+ };
1854
+ SetLanguageAction = SetLanguageAction_1 = ( __decorate([
1855
+ ( __param(0, IExtensionsWorkbenchService))
1856
+ ], SetLanguageAction));
1857
+ let ClearLanguageAction = class ClearLanguageAction extends ExtensionAction {
1858
+ static { ClearLanguageAction_1 = this; }
1859
+ static { this.ID = 'workbench.extensions.action.clearLanguage'; }
1860
+ static { this.TITLE = { value: ( localizeWithPath(
1861
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
1862
+ 'workbench.extensions.action.clearLanguage',
1863
+ "Clear Display Language"
1864
+ )), original: 'Clear Display Language' }; }
1865
+ static { this.EnabledClass = `${ExtensionAction.LABEL_ACTION_CLASS} language`; }
1866
+ static { this.DisabledClass = `${ClearLanguageAction_1.EnabledClass} disabled`; }
1867
+ constructor(extensionsWorkbenchService, localeService) {
1868
+ super(ClearLanguageAction_1.ID, ClearLanguageAction_1.TITLE.value, ClearLanguageAction_1.DisabledClass, false);
1869
+ this.extensionsWorkbenchService = extensionsWorkbenchService;
1870
+ this.localeService = localeService;
1871
+ this.update();
1872
+ }
1873
+ update() {
1874
+ this.enabled = false;
1875
+ this.class = ClearLanguageAction_1.DisabledClass;
1876
+ if (!this.extension) {
1877
+ return;
1878
+ }
1879
+ if (!this.extensionsWorkbenchService.canSetLanguage(this.extension)) {
1880
+ return;
1881
+ }
1882
+ if (this.extension.gallery && language !== getLocale(this.extension.gallery)) {
1883
+ return;
1884
+ }
1885
+ this.enabled = true;
1886
+ this.class = ClearLanguageAction_1.EnabledClass;
1887
+ }
1888
+ async run() {
1889
+ return this.extension && this.localeService.clearLocalePreference();
1890
+ }
1891
+ };
1892
+ ClearLanguageAction = ClearLanguageAction_1 = ( __decorate([
1893
+ ( __param(0, IExtensionsWorkbenchService)),
1894
+ ( __param(1, ILocaleService))
1895
+ ], ClearLanguageAction));
1896
+ let ShowRecommendedExtensionAction = class ShowRecommendedExtensionAction extends Action {
1897
+ static { ShowRecommendedExtensionAction_1 = this; }
1898
+ static { this.ID = 'workbench.extensions.action.showRecommendedExtension'; }
1899
+ static { this.LABEL = ( localizeWithPath(
1900
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
1901
+ 'showRecommendedExtension',
1902
+ "Show Recommended Extension"
1903
+ )); }
1904
+ constructor(extensionId, paneCompositeService, extensionWorkbenchService) {
1905
+ super(ShowRecommendedExtensionAction_1.ID, ShowRecommendedExtensionAction_1.LABEL, undefined, false);
1906
+ this.paneCompositeService = paneCompositeService;
1907
+ this.extensionWorkbenchService = extensionWorkbenchService;
1908
+ this.extensionId = extensionId;
1909
+ }
1910
+ async run() {
1911
+ const paneComposite = await this.paneCompositeService.openPaneComposite(VIEWLET_ID, 0 , true);
1912
+ const paneContainer = paneComposite?.getViewPaneContainer();
1913
+ paneContainer.search(`@id:${this.extensionId}`);
1914
+ paneContainer.focus();
1915
+ const [extension] = await this.extensionWorkbenchService.getExtensions([{ id: this.extensionId }], { source: 'install-recommendation' }, CancellationToken.None);
1916
+ if (extension) {
1917
+ return this.extensionWorkbenchService.open(extension);
1918
+ }
1919
+ return null;
1920
+ }
1921
+ };
1922
+ ShowRecommendedExtensionAction = ShowRecommendedExtensionAction_1 = ( __decorate([
1923
+ ( __param(1, IPaneCompositePartService)),
1924
+ ( __param(2, IExtensionsWorkbenchService))
1925
+ ], ShowRecommendedExtensionAction));
1926
+ let InstallRecommendedExtensionAction = class InstallRecommendedExtensionAction extends Action {
1927
+ static { InstallRecommendedExtensionAction_1 = this; }
1928
+ static { this.ID = 'workbench.extensions.action.installRecommendedExtension'; }
1929
+ static { this.LABEL = ( localizeWithPath(
1930
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
1931
+ 'installRecommendedExtension',
1932
+ "Install Recommended Extension"
1933
+ )); }
1934
+ constructor(extensionId, paneCompositeService, instantiationService, extensionWorkbenchService) {
1935
+ super(InstallRecommendedExtensionAction_1.ID, InstallRecommendedExtensionAction_1.LABEL, undefined, false);
1936
+ this.paneCompositeService = paneCompositeService;
1937
+ this.instantiationService = instantiationService;
1938
+ this.extensionWorkbenchService = extensionWorkbenchService;
1939
+ this.extensionId = extensionId;
1940
+ }
1941
+ async run() {
1942
+ const viewlet = await this.paneCompositeService.openPaneComposite(VIEWLET_ID, 0 , true);
1943
+ const viewPaneContainer = viewlet?.getViewPaneContainer();
1944
+ viewPaneContainer.search(`@id:${this.extensionId}`);
1945
+ viewPaneContainer.focus();
1946
+ const [extension] = await this.extensionWorkbenchService.getExtensions([{ id: this.extensionId }], { source: 'install-recommendation' }, CancellationToken.None);
1947
+ if (extension) {
1948
+ await this.extensionWorkbenchService.open(extension);
1949
+ try {
1950
+ await this.extensionWorkbenchService.install(extension);
1951
+ }
1952
+ catch (err) {
1953
+ this.instantiationService.createInstance(PromptExtensionInstallFailureAction, extension, extension.latestVersion, 2 , err).run();
1954
+ }
1955
+ }
1956
+ }
1957
+ };
1958
+ InstallRecommendedExtensionAction = InstallRecommendedExtensionAction_1 = ( __decorate([
1959
+ ( __param(1, IPaneCompositePartService)),
1960
+ ( __param(2, IInstantiationService)),
1961
+ ( __param(3, IExtensionsWorkbenchService))
1962
+ ], InstallRecommendedExtensionAction));
1963
+ let IgnoreExtensionRecommendationAction = class IgnoreExtensionRecommendationAction extends Action {
1964
+ static { IgnoreExtensionRecommendationAction_1 = this; }
1965
+ static { this.ID = 'extensions.ignore'; }
1966
+ static { this.Class = `${ExtensionAction.LABEL_ACTION_CLASS} ignore`; }
1967
+ constructor(extension, extensionRecommendationsManagementService) {
1968
+ super(IgnoreExtensionRecommendationAction_1.ID, 'Ignore Recommendation');
1969
+ this.extension = extension;
1970
+ this.extensionRecommendationsManagementService = extensionRecommendationsManagementService;
1971
+ this.class = IgnoreExtensionRecommendationAction_1.Class;
1972
+ this.tooltip = ( localizeWithPath(
1973
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
1974
+ 'ignoreExtensionRecommendation',
1975
+ "Do not recommend this extension again"
1976
+ ));
1977
+ this.enabled = true;
1978
+ }
1979
+ run() {
1980
+ this.extensionRecommendationsManagementService.toggleGlobalIgnoredRecommendation(this.extension.identifier.id, true);
1981
+ return Promise.resolve();
1982
+ }
1983
+ };
1984
+ IgnoreExtensionRecommendationAction = IgnoreExtensionRecommendationAction_1 = ( __decorate([
1985
+ ( __param(1, IExtensionIgnoredRecommendationsService))
1986
+ ], IgnoreExtensionRecommendationAction));
1987
+ let UndoIgnoreExtensionRecommendationAction = class UndoIgnoreExtensionRecommendationAction extends Action {
1988
+ static { UndoIgnoreExtensionRecommendationAction_1 = this; }
1989
+ static { this.ID = 'extensions.ignore'; }
1990
+ static { this.Class = `${ExtensionAction.LABEL_ACTION_CLASS} undo-ignore`; }
1991
+ constructor(extension, extensionRecommendationsManagementService) {
1992
+ super(UndoIgnoreExtensionRecommendationAction_1.ID, 'Undo');
1993
+ this.extension = extension;
1994
+ this.extensionRecommendationsManagementService = extensionRecommendationsManagementService;
1995
+ this.class = UndoIgnoreExtensionRecommendationAction_1.Class;
1996
+ this.tooltip = ( localizeWithPath(
1997
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
1998
+ 'undo',
1999
+ "Undo"
2000
+ ));
2001
+ this.enabled = true;
2002
+ }
2003
+ run() {
2004
+ this.extensionRecommendationsManagementService.toggleGlobalIgnoredRecommendation(this.extension.identifier.id, false);
2005
+ return Promise.resolve();
2006
+ }
2007
+ };
2008
+ UndoIgnoreExtensionRecommendationAction = UndoIgnoreExtensionRecommendationAction_1 = ( __decorate([
2009
+ ( __param(1, IExtensionIgnoredRecommendationsService))
2010
+ ], UndoIgnoreExtensionRecommendationAction));
2011
+ let SearchExtensionsAction = class SearchExtensionsAction extends Action {
2012
+ constructor(searchValue, paneCompositeService) {
2013
+ super('extensions.searchExtensions', ( localizeWithPath(
2014
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2015
+ 'search recommendations',
2016
+ "Search Extensions"
2017
+ )), undefined, true);
2018
+ this.searchValue = searchValue;
2019
+ this.paneCompositeService = paneCompositeService;
2020
+ }
2021
+ async run() {
2022
+ const viewPaneContainer = (await this.paneCompositeService.openPaneComposite(VIEWLET_ID, 0 , true))?.getViewPaneContainer();
2023
+ viewPaneContainer.search(this.searchValue);
2024
+ viewPaneContainer.focus();
2025
+ }
2026
+ };
2027
+ SearchExtensionsAction = ( __decorate([
2028
+ ( __param(1, IPaneCompositePartService))
2029
+ ], SearchExtensionsAction));
2030
+ let AbstractConfigureRecommendedExtensionsAction = class AbstractConfigureRecommendedExtensionsAction extends Action {
2031
+ constructor(id, label, contextService, fileService, textFileService, editorService, jsonEditingService, textModelResolverService) {
2032
+ super(id, label);
2033
+ this.contextService = contextService;
2034
+ this.fileService = fileService;
2035
+ this.textFileService = textFileService;
2036
+ this.editorService = editorService;
2037
+ this.jsonEditingService = jsonEditingService;
2038
+ this.textModelResolverService = textModelResolverService;
2039
+ }
2040
+ openExtensionsFile(extensionsFileResource) {
2041
+ return this.getOrCreateExtensionsFile(extensionsFileResource)
2042
+ .then(({ created, content }) => this.getSelectionPosition(content, extensionsFileResource, ['recommendations'])
2043
+ .then(selection => this.editorService.openEditor({
2044
+ resource: extensionsFileResource,
2045
+ options: {
2046
+ pinned: created,
2047
+ selection
2048
+ }
2049
+ })), error => Promise.reject(( new Error(( localizeWithPath(
2050
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2051
+ 'OpenExtensionsFile.failed',
2052
+ "Unable to create 'extensions.json' file inside the '.vscode' folder ({0}).",
2053
+ error
2054
+ ))))));
2055
+ }
2056
+ openWorkspaceConfigurationFile(workspaceConfigurationFile) {
2057
+ return this.getOrUpdateWorkspaceConfigurationFile(workspaceConfigurationFile)
2058
+ .then(content => this.getSelectionPosition(( content.value.toString()), content.resource, ['extensions', 'recommendations']))
2059
+ .then(selection => this.editorService.openEditor({
2060
+ resource: workspaceConfigurationFile,
2061
+ options: {
2062
+ selection,
2063
+ forceReload: true
2064
+ }
2065
+ }));
2066
+ }
2067
+ getOrUpdateWorkspaceConfigurationFile(workspaceConfigurationFile) {
2068
+ return Promise.resolve(this.fileService.readFile(workspaceConfigurationFile))
2069
+ .then(content => {
2070
+ const workspaceRecommendations = json.parse(( content.value.toString()))['extensions'];
2071
+ if (!workspaceRecommendations || !workspaceRecommendations.recommendations) {
2072
+ return this.jsonEditingService.write(workspaceConfigurationFile, [{ path: ['extensions'], value: { recommendations: [] } }], true)
2073
+ .then(() => this.fileService.readFile(workspaceConfigurationFile));
2074
+ }
2075
+ return content;
2076
+ });
2077
+ }
2078
+ getSelectionPosition(content, resource, path) {
2079
+ const tree = json.parseTree(content);
2080
+ const node = json.findNodeAtLocation(tree, path);
2081
+ if (node && node.parent && node.parent.children) {
2082
+ const recommendationsValueNode = node.parent.children[1];
2083
+ const lastExtensionNode = recommendationsValueNode.children && recommendationsValueNode.children.length ? recommendationsValueNode.children[recommendationsValueNode.children.length - 1] : null;
2084
+ const offset = lastExtensionNode ? lastExtensionNode.offset + lastExtensionNode.length : recommendationsValueNode.offset + 1;
2085
+ return Promise.resolve(this.textModelResolverService.createModelReference(resource))
2086
+ .then(reference => {
2087
+ const position = reference.object.textEditorModel.getPositionAt(offset);
2088
+ reference.dispose();
2089
+ return {
2090
+ startLineNumber: position.lineNumber,
2091
+ startColumn: position.column,
2092
+ endLineNumber: position.lineNumber,
2093
+ endColumn: position.column,
2094
+ };
2095
+ });
2096
+ }
2097
+ return Promise.resolve(undefined);
2098
+ }
2099
+ getOrCreateExtensionsFile(extensionsFileResource) {
2100
+ return Promise.resolve(this.fileService.readFile(extensionsFileResource)).then(content => {
2101
+ return { created: false, extensionsFileResource, content: ( content.value.toString()) };
2102
+ }, err => {
2103
+ return this.textFileService.write(extensionsFileResource, ExtensionsConfigurationInitialContent).then(() => {
2104
+ return { created: true, extensionsFileResource, content: ExtensionsConfigurationInitialContent };
2105
+ });
2106
+ });
2107
+ }
2108
+ };
2109
+ AbstractConfigureRecommendedExtensionsAction = ( __decorate([
2110
+ ( __param(2, IWorkspaceContextService)),
2111
+ ( __param(3, IFileService)),
2112
+ ( __param(4, ITextFileService)),
2113
+ ( __param(5, IEditorService)),
2114
+ ( __param(6, IJSONEditingService)),
2115
+ ( __param(7, ITextModelService))
2116
+ ], AbstractConfigureRecommendedExtensionsAction));
2117
+ let ConfigureWorkspaceRecommendedExtensionsAction = class ConfigureWorkspaceRecommendedExtensionsAction extends AbstractConfigureRecommendedExtensionsAction {
2118
+ static { this.ID = 'workbench.extensions.action.configureWorkspaceRecommendedExtensions'; }
2119
+ static { this.LABEL = ( localizeWithPath(
2120
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2121
+ 'configureWorkspaceRecommendedExtensions',
2122
+ "Configure Recommended Extensions (Workspace)"
2123
+ )); }
2124
+ constructor(id, label, fileService, textFileService, contextService, editorService, jsonEditingService, textModelResolverService) {
2125
+ super(id, label, contextService, fileService, textFileService, editorService, jsonEditingService, textModelResolverService);
2126
+ this._register(this.contextService.onDidChangeWorkbenchState(() => this.update(), this));
2127
+ this.update();
2128
+ }
2129
+ update() {
2130
+ this.enabled = this.contextService.getWorkbenchState() !== 1 ;
2131
+ }
2132
+ run() {
2133
+ switch (this.contextService.getWorkbenchState()) {
2134
+ case 2 :
2135
+ return this.openExtensionsFile(this.contextService.getWorkspace().folders[0].toResource(EXTENSIONS_CONFIG));
2136
+ case 3 :
2137
+ return this.openWorkspaceConfigurationFile(this.contextService.getWorkspace().configuration);
2138
+ }
2139
+ return Promise.resolve();
2140
+ }
2141
+ };
2142
+ ConfigureWorkspaceRecommendedExtensionsAction = ( __decorate([
2143
+ ( __param(2, IFileService)),
2144
+ ( __param(3, ITextFileService)),
2145
+ ( __param(4, IWorkspaceContextService)),
2146
+ ( __param(5, IEditorService)),
2147
+ ( __param(6, IJSONEditingService)),
2148
+ ( __param(7, ITextModelService))
2149
+ ], ConfigureWorkspaceRecommendedExtensionsAction));
2150
+ let ConfigureWorkspaceFolderRecommendedExtensionsAction = class ConfigureWorkspaceFolderRecommendedExtensionsAction extends AbstractConfigureRecommendedExtensionsAction {
2151
+ static { this.ID = 'workbench.extensions.action.configureWorkspaceFolderRecommendedExtensions'; }
2152
+ static { this.LABEL = ( localizeWithPath(
2153
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2154
+ 'configureWorkspaceFolderRecommendedExtensions',
2155
+ "Configure Recommended Extensions (Workspace Folder)"
2156
+ )); }
2157
+ constructor(id, label, fileService, textFileService, contextService, editorService, jsonEditingService, textModelResolverService, commandService) {
2158
+ super(id, label, contextService, fileService, textFileService, editorService, jsonEditingService, textModelResolverService);
2159
+ this.commandService = commandService;
2160
+ }
2161
+ run() {
2162
+ const folderCount = this.contextService.getWorkspace().folders.length;
2163
+ const pickFolderPromise = folderCount === 1 ? Promise.resolve(this.contextService.getWorkspace().folders[0]) : this.commandService.executeCommand(PICK_WORKSPACE_FOLDER_COMMAND_ID);
2164
+ return Promise.resolve(pickFolderPromise)
2165
+ .then(workspaceFolder => {
2166
+ if (workspaceFolder) {
2167
+ return this.openExtensionsFile(workspaceFolder.toResource(EXTENSIONS_CONFIG));
2168
+ }
2169
+ return null;
2170
+ });
2171
+ }
2172
+ };
2173
+ ConfigureWorkspaceFolderRecommendedExtensionsAction = ( __decorate([
2174
+ ( __param(2, IFileService)),
2175
+ ( __param(3, ITextFileService)),
2176
+ ( __param(4, IWorkspaceContextService)),
2177
+ ( __param(5, IEditorService)),
2178
+ ( __param(6, IJSONEditingService)),
2179
+ ( __param(7, ITextModelService)),
2180
+ ( __param(8, ICommandService))
2181
+ ], ConfigureWorkspaceFolderRecommendedExtensionsAction));
2182
+ let ExtensionStatusLabelAction = class ExtensionStatusLabelAction extends Action {
2183
+ static { ExtensionStatusLabelAction_1 = this; }
2184
+ static { this.ENABLED_CLASS = `${ExtensionAction.TEXT_ACTION_CLASS} extension-status-label`; }
2185
+ static { this.DISABLED_CLASS = `${ExtensionStatusLabelAction_1.ENABLED_CLASS} hide`; }
2186
+ get extension() { return this._extension; }
2187
+ set extension(extension) {
2188
+ if (!(this._extension && extension && areSameExtensions(this._extension.identifier, extension.identifier))) {
2189
+ this.initialStatus = null;
2190
+ this.status = null;
2191
+ this.enablementState = null;
2192
+ }
2193
+ this._extension = extension;
2194
+ this.update();
2195
+ }
2196
+ constructor(extensionService, extensionManagementServerService, extensionEnablementService) {
2197
+ super('extensions.action.statusLabel', '', ExtensionStatusLabelAction_1.DISABLED_CLASS, false);
2198
+ this.extensionService = extensionService;
2199
+ this.extensionManagementServerService = extensionManagementServerService;
2200
+ this.extensionEnablementService = extensionEnablementService;
2201
+ this.initialStatus = null;
2202
+ this.status = null;
2203
+ this.version = null;
2204
+ this.enablementState = null;
2205
+ this._extension = null;
2206
+ }
2207
+ update() {
2208
+ const label = this.computeLabel();
2209
+ this.label = label || '';
2210
+ this.class = label ? ExtensionStatusLabelAction_1.ENABLED_CLASS : ExtensionStatusLabelAction_1.DISABLED_CLASS;
2211
+ }
2212
+ computeLabel() {
2213
+ if (!this.extension) {
2214
+ return null;
2215
+ }
2216
+ const currentStatus = this.status;
2217
+ const currentVersion = this.version;
2218
+ const currentEnablementState = this.enablementState;
2219
+ this.status = this.extension.state;
2220
+ this.version = this.extension.version;
2221
+ if (this.initialStatus === null) {
2222
+ this.initialStatus = this.status;
2223
+ }
2224
+ this.enablementState = this.extension.enablementState;
2225
+ const canAddExtension = () => {
2226
+ const runningExtension = this.extensionService.extensions.filter(e => areSameExtensions({ id: e.identifier.value, uuid: e.uuid }, this.extension.identifier))[0];
2227
+ if (this.extension.local) {
2228
+ if (runningExtension && this.extension.version === runningExtension.version) {
2229
+ return true;
2230
+ }
2231
+ return this.extensionService.canAddExtension(toExtensionDescription(this.extension.local));
2232
+ }
2233
+ return false;
2234
+ };
2235
+ const canRemoveExtension = () => {
2236
+ if (this.extension.local) {
2237
+ if (this.extensionService.extensions.every(e => !(areSameExtensions({ id: e.identifier.value, uuid: e.uuid }, this.extension.identifier) && this.extension.server === this.extensionManagementServerService.getExtensionManagementServer(toExtension(e))))) {
2238
+ return true;
2239
+ }
2240
+ return this.extensionService.canRemoveExtension(toExtensionDescription(this.extension.local));
2241
+ }
2242
+ return false;
2243
+ };
2244
+ if (currentStatus !== null) {
2245
+ if (currentStatus === 0 && this.status === 1 ) {
2246
+ return canAddExtension() ? this.initialStatus === 1 && this.version !== currentVersion ? ( localizeWithPath(
2247
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2248
+ 'updated',
2249
+ "Updated"
2250
+ )) : ( localizeWithPath(
2251
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2252
+ 'installed',
2253
+ "Installed"
2254
+ )) : null;
2255
+ }
2256
+ if (currentStatus === 2 && this.status === 3 ) {
2257
+ this.initialStatus = this.status;
2258
+ return canRemoveExtension() ? ( localizeWithPath(
2259
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2260
+ 'uninstalled',
2261
+ "Uninstalled"
2262
+ )) : null;
2263
+ }
2264
+ }
2265
+ if (currentEnablementState !== null) {
2266
+ const currentlyEnabled = this.extensionEnablementService.isEnabledEnablementState(currentEnablementState);
2267
+ const enabled = this.extensionEnablementService.isEnabledEnablementState(this.enablementState);
2268
+ if (!currentlyEnabled && enabled) {
2269
+ return canAddExtension() ? ( localizeWithPath(
2270
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2271
+ 'enabled',
2272
+ "Enabled"
2273
+ )) : null;
2274
+ }
2275
+ if (currentlyEnabled && !enabled) {
2276
+ return canRemoveExtension() ? ( localizeWithPath(
2277
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2278
+ 'disabled',
2279
+ "Disabled"
2280
+ )) : null;
2281
+ }
2282
+ }
2283
+ return null;
2284
+ }
2285
+ run() {
2286
+ return Promise.resolve();
2287
+ }
2288
+ };
2289
+ ExtensionStatusLabelAction = ExtensionStatusLabelAction_1 = ( __decorate([
2290
+ ( __param(0, IExtensionService)),
2291
+ ( __param(1, IExtensionManagementServerService)),
2292
+ ( __param(2, IWorkbenchExtensionEnablementService))
2293
+ ], ExtensionStatusLabelAction));
2294
+ let ToggleSyncExtensionAction = class ToggleSyncExtensionAction extends ExtensionDropDownAction {
2295
+ static { ToggleSyncExtensionAction_1 = this; }
2296
+ static { this.IGNORED_SYNC_CLASS = `${ExtensionAction.ICON_ACTION_CLASS} extension-sync ${ThemeIcon.asClassName(syncIgnoredIcon)}`; }
2297
+ static { this.SYNC_CLASS = `${ToggleSyncExtensionAction_1.ICON_ACTION_CLASS} extension-sync ${ThemeIcon.asClassName(syncEnabledIcon)}`; }
2298
+ constructor(configurationService, extensionsWorkbenchService, userDataSyncEnablementService, instantiationService) {
2299
+ super('extensions.sync', '', ToggleSyncExtensionAction_1.SYNC_CLASS, false, instantiationService);
2300
+ this.configurationService = configurationService;
2301
+ this.extensionsWorkbenchService = extensionsWorkbenchService;
2302
+ this.userDataSyncEnablementService = userDataSyncEnablementService;
2303
+ this._register(Event.filter(this.configurationService.onDidChangeConfiguration, e => e.affectsConfiguration('settingsSync.ignoredExtensions'))(() => this.update()));
2304
+ this._register(userDataSyncEnablementService.onDidChangeEnablement(() => this.update()));
2305
+ this.update();
2306
+ }
2307
+ update() {
2308
+ this.enabled = !!this.extension && this.userDataSyncEnablementService.isEnabled() && this.extension.state === 1 ;
2309
+ if (this.extension) {
2310
+ const isIgnored = this.extensionsWorkbenchService.isExtensionIgnoredToSync(this.extension);
2311
+ this.class = isIgnored ? ToggleSyncExtensionAction_1.IGNORED_SYNC_CLASS : ToggleSyncExtensionAction_1.SYNC_CLASS;
2312
+ this.tooltip = isIgnored ? ( localizeWithPath(
2313
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2314
+ 'ignored',
2315
+ "This extension is ignored during sync"
2316
+ )) : ( localizeWithPath(
2317
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2318
+ 'synced',
2319
+ "This extension is synced"
2320
+ ));
2321
+ }
2322
+ }
2323
+ async run() {
2324
+ return super.run({
2325
+ actionGroups: [
2326
+ [
2327
+ ( new Action(
2328
+ 'extensions.syncignore',
2329
+ this.extensionsWorkbenchService.isExtensionIgnoredToSync(this.extension) ? ( localizeWithPath(
2330
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2331
+ 'sync',
2332
+ "Sync this extension"
2333
+ )) : ( localizeWithPath(
2334
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2335
+ 'do not sync',
2336
+ "Do not sync this extension"
2337
+ )),
2338
+ undefined,
2339
+ true,
2340
+ () => this.extensionsWorkbenchService.toggleExtensionIgnoredToSync(this.extension)
2341
+ ))
2342
+ ]
2343
+ ], disposeActionsOnHide: true
2344
+ });
2345
+ }
2346
+ };
2347
+ ToggleSyncExtensionAction = ToggleSyncExtensionAction_1 = ( __decorate([
2348
+ ( __param(0, IConfigurationService)),
2349
+ ( __param(1, IExtensionsWorkbenchService)),
2350
+ ( __param(2, IUserDataSyncEnablementService)),
2351
+ ( __param(3, IInstantiationService))
2352
+ ], ToggleSyncExtensionAction));
2353
+ let ExtensionStatusAction = class ExtensionStatusAction extends ExtensionAction {
2354
+ static { ExtensionStatusAction_1 = this; }
2355
+ static { this.CLASS = `${ExtensionAction.ICON_ACTION_CLASS} extension-status`; }
2356
+ get status() { return this._status; }
2357
+ constructor(extensionManagementServerService, labelService, commandService, workspaceTrustEnablementService, workspaceTrustService, extensionsWorkbenchService, extensionService, extensionManifestPropertiesService, contextService, productService, workbenchExtensionEnablementService) {
2358
+ super('extensions.status', '', `${ExtensionStatusAction_1.CLASS} hide`, false);
2359
+ this.extensionManagementServerService = extensionManagementServerService;
2360
+ this.labelService = labelService;
2361
+ this.commandService = commandService;
2362
+ this.workspaceTrustEnablementService = workspaceTrustEnablementService;
2363
+ this.workspaceTrustService = workspaceTrustService;
2364
+ this.extensionsWorkbenchService = extensionsWorkbenchService;
2365
+ this.extensionService = extensionService;
2366
+ this.extensionManifestPropertiesService = extensionManifestPropertiesService;
2367
+ this.contextService = contextService;
2368
+ this.productService = productService;
2369
+ this.workbenchExtensionEnablementService = workbenchExtensionEnablementService;
2370
+ this.updateWhenCounterExtensionChanges = true;
2371
+ this._onDidChangeStatus = this._register(( new Emitter()));
2372
+ this.onDidChangeStatus = this._onDidChangeStatus.event;
2373
+ this.updateThrottler = ( new Throttler());
2374
+ this._register(this.labelService.onDidChangeFormatters(() => this.update(), this));
2375
+ this._register(this.extensionService.onDidChangeExtensions(() => this.update()));
2376
+ this.update();
2377
+ }
2378
+ update() {
2379
+ this.updateThrottler.queue(() => this.computeAndUpdateStatus());
2380
+ }
2381
+ async computeAndUpdateStatus() {
2382
+ this.updateStatus(undefined, true);
2383
+ this.enabled = false;
2384
+ if (!this.extension) {
2385
+ return;
2386
+ }
2387
+ if (this.extension.isMalicious) {
2388
+ this.updateStatus({ icon: warningIcon, message: ( new MarkdownString(( localizeWithPath(
2389
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2390
+ 'malicious tooltip',
2391
+ "This extension was reported to be problematic."
2392
+ )))) }, true);
2393
+ return;
2394
+ }
2395
+ if (this.extension.deprecationInfo) {
2396
+ if (this.extension.deprecationInfo.extension) {
2397
+ const link = `[${this.extension.deprecationInfo.extension.displayName}](${( URI.parse(
2398
+ `command:extension.open?${encodeURIComponent(JSON.stringify([this.extension.deprecationInfo.extension.id]))}`
2399
+ ))})`;
2400
+ this.updateStatus({ icon: warningIcon, message: ( new MarkdownString(( localizeWithPath(
2401
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2402
+ 'deprecated with alternate extension tooltip',
2403
+ "This extension is deprecated. Use the {0} extension instead.",
2404
+ link
2405
+ )))) }, true);
2406
+ }
2407
+ else if (this.extension.deprecationInfo.settings) {
2408
+ const link = `[${( localizeWithPath(
2409
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2410
+ 'settings',
2411
+ "settings"
2412
+ ))}](${( URI.parse(
2413
+ `command:workbench.action.openSettings?${encodeURIComponent(JSON.stringify([( this.extension.deprecationInfo.settings.map(setting => `@id:${setting}`)).join(' ')]))}`
2414
+ ))})`;
2415
+ this.updateStatus({ icon: warningIcon, message: ( new MarkdownString(( localizeWithPath(
2416
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2417
+ 'deprecated with alternate settings tooltip',
2418
+ "This extension is deprecated as this functionality is now built-in to VS Code. Configure these {0} to use this functionality.",
2419
+ link
2420
+ )))) }, true);
2421
+ }
2422
+ else {
2423
+ const message = ( new MarkdownString(( localizeWithPath(
2424
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2425
+ 'deprecated tooltip',
2426
+ "This extension is deprecated as it is no longer being maintained."
2427
+ ))));
2428
+ if (this.extension.deprecationInfo.additionalInfo) {
2429
+ message.appendMarkdown(` ${this.extension.deprecationInfo.additionalInfo}`);
2430
+ }
2431
+ this.updateStatus({ icon: warningIcon, message }, true);
2432
+ }
2433
+ return;
2434
+ }
2435
+ if (this.extensionsWorkbenchService.canSetLanguage(this.extension)) {
2436
+ return;
2437
+ }
2438
+ if (this.extension.gallery && this.extension.state === 3 && !(await this.extensionsWorkbenchService.canInstall(this.extension))) {
2439
+ if (this.extensionManagementServerService.localExtensionManagementServer || this.extensionManagementServerService.remoteExtensionManagementServer) {
2440
+ const targetPlatform = await (this.extensionManagementServerService.localExtensionManagementServer ? this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.getTargetPlatform() : this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.getTargetPlatform());
2441
+ const message = ( new MarkdownString(`${( localizeWithPath(
2442
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2443
+ 'incompatible platform',
2444
+ "The '{0}' extension is not available in {1} for {2}.",
2445
+ this.extension.displayName || this.extension.identifier.id,
2446
+ this.productService.nameLong,
2447
+ TargetPlatformToString(targetPlatform)
2448
+ ))} [${( localizeWithPath(
2449
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2450
+ 'learn more',
2451
+ "Learn More"
2452
+ ))}](https://aka.ms/vscode-platform-specific-extensions)`));
2453
+ this.updateStatus({ icon: warningIcon, message }, true);
2454
+ return;
2455
+ }
2456
+ if (this.extensionManagementServerService.webExtensionManagementServer) {
2457
+ const productName = ( localizeWithPath(
2458
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2459
+ 'VS Code for Web',
2460
+ "{0} for the Web",
2461
+ this.productService.nameLong
2462
+ ));
2463
+ const message = ( new MarkdownString(`${( localizeWithPath(
2464
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2465
+ 'not web tooltip',
2466
+ "The '{0}' extension is not available in {1}.",
2467
+ this.extension.displayName || this.extension.identifier.id,
2468
+ productName
2469
+ ))} [${( localizeWithPath(
2470
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2471
+ 'learn why',
2472
+ "Learn Why"
2473
+ ))}](https://aka.ms/vscode-web-extensions-guide)`));
2474
+ this.updateStatus({ icon: warningIcon, message }, true);
2475
+ return;
2476
+ }
2477
+ }
2478
+ if (!this.extension.local ||
2479
+ !this.extension.server ||
2480
+ this.extension.state !== 1 ) {
2481
+ return;
2482
+ }
2483
+ if (this.extension.enablementState === 2 ) {
2484
+ this.updateStatus({ message: ( new MarkdownString(( localizeWithPath(
2485
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2486
+ 'disabled by environment',
2487
+ "This extension is disabled by the environment."
2488
+ )))) }, true);
2489
+ return;
2490
+ }
2491
+ if (this.extension.enablementState === 3 ) {
2492
+ this.updateStatus({ message: ( new MarkdownString(( localizeWithPath(
2493
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2494
+ 'enabled by environment',
2495
+ "This extension is enabled because it is required in the current environment."
2496
+ )))) }, true);
2497
+ return;
2498
+ }
2499
+ if (this.extension.enablementState === 4 ) {
2500
+ const details = getWorkspaceSupportTypeMessage(this.extension.local.manifest.capabilities?.virtualWorkspaces);
2501
+ this.updateStatus({ icon: infoIcon, message: ( new MarkdownString(details ? escapeMarkdownSyntaxTokens(details) : ( localizeWithPath(
2502
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2503
+ 'disabled because of virtual workspace',
2504
+ "This extension has been disabled because it does not support virtual workspaces."
2505
+ )))) }, true);
2506
+ return;
2507
+ }
2508
+ if (isVirtualWorkspace(this.contextService.getWorkspace())) {
2509
+ const virtualSupportType = this.extensionManifestPropertiesService.getExtensionVirtualWorkspaceSupportType(this.extension.local.manifest);
2510
+ const details = getWorkspaceSupportTypeMessage(this.extension.local.manifest.capabilities?.virtualWorkspaces);
2511
+ if (virtualSupportType === 'limited' || details) {
2512
+ this.updateStatus({ icon: warningIcon, message: ( new MarkdownString(details ? escapeMarkdownSyntaxTokens(details) : ( localizeWithPath(
2513
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2514
+ 'extension limited because of virtual workspace',
2515
+ "This extension has limited features because the current workspace is virtual."
2516
+ )))) }, true);
2517
+ return;
2518
+ }
2519
+ }
2520
+ if (this.extension.enablementState === 0 ||
2521
+ (this.extension.enablementState === 5 && this.workbenchExtensionEnablementService.getDependenciesEnablementStates(this.extension.local).every(([, enablementState]) => this.workbenchExtensionEnablementService.isEnabledEnablementState(enablementState) || enablementState === 0 ))) {
2522
+ this.enabled = true;
2523
+ const untrustedDetails = getWorkspaceSupportTypeMessage(this.extension.local.manifest.capabilities?.untrustedWorkspaces);
2524
+ this.updateStatus({ icon: trustIcon, message: ( new MarkdownString(
2525
+ untrustedDetails ? escapeMarkdownSyntaxTokens(untrustedDetails) : ( localizeWithPath(
2526
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2527
+ 'extension disabled because of trust requirement',
2528
+ "This extension has been disabled because the current workspace is not trusted."
2529
+ ))
2530
+ )) }, true);
2531
+ return;
2532
+ }
2533
+ if (this.workspaceTrustEnablementService.isWorkspaceTrustEnabled() && !this.workspaceTrustService.isWorkspaceTrusted()) {
2534
+ const untrustedSupportType = this.extensionManifestPropertiesService.getExtensionUntrustedWorkspaceSupportType(this.extension.local.manifest);
2535
+ const untrustedDetails = getWorkspaceSupportTypeMessage(this.extension.local.manifest.capabilities?.untrustedWorkspaces);
2536
+ if (untrustedSupportType === 'limited' || untrustedDetails) {
2537
+ this.enabled = true;
2538
+ this.updateStatus({ icon: trustIcon, message: ( new MarkdownString(
2539
+ untrustedDetails ? escapeMarkdownSyntaxTokens(untrustedDetails) : ( localizeWithPath(
2540
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2541
+ 'extension limited because of trust requirement',
2542
+ "This extension has limited features because the current workspace is not trusted."
2543
+ ))
2544
+ )) }, true);
2545
+ return;
2546
+ }
2547
+ }
2548
+ if (this.extension.enablementState === 1 ) {
2549
+ if (!( this.extensionsWorkbenchService.installed.some(
2550
+ e => areSameExtensions(e.identifier, this.extension.identifier) && e.server !== this.extension.server
2551
+ ))) {
2552
+ let message;
2553
+ if (this.extensionManagementServerService.localExtensionManagementServer === this.extension.server) {
2554
+ if (this.extensionManifestPropertiesService.prefersExecuteOnWorkspace(this.extension.local.manifest)) {
2555
+ if (this.extensionManagementServerService.remoteExtensionManagementServer) {
2556
+ message = ( new MarkdownString(`${( localizeWithPath(
2557
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2558
+ 'Install in remote server to enable',
2559
+ "This extension is disabled in this workspace because it is defined to run in the Remote Extension Host. Please install the extension in '{0}' to enable.",
2560
+ this.extensionManagementServerService.remoteExtensionManagementServer.label
2561
+ ))} [${( localizeWithPath(
2562
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2563
+ 'learn more',
2564
+ "Learn More"
2565
+ ))}](https://aka.ms/vscode-remote/developing-extensions/architecture)`));
2566
+ }
2567
+ }
2568
+ }
2569
+ else if (this.extensionManagementServerService.remoteExtensionManagementServer === this.extension.server) {
2570
+ if (this.extensionManifestPropertiesService.prefersExecuteOnUI(this.extension.local.manifest)) {
2571
+ if (this.extensionManagementServerService.localExtensionManagementServer) {
2572
+ message = ( new MarkdownString(`${( localizeWithPath(
2573
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2574
+ 'Install in local server to enable',
2575
+ "This extension is disabled in this workspace because it is defined to run in the Local Extension Host. Please install the extension locally to enable.",
2576
+ this.extensionManagementServerService.remoteExtensionManagementServer.label
2577
+ ))} [${( localizeWithPath(
2578
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2579
+ 'learn more',
2580
+ "Learn More"
2581
+ ))}](https://aka.ms/vscode-remote/developing-extensions/architecture)`));
2582
+ }
2583
+ else if (isWeb) {
2584
+ message = ( new MarkdownString(`${( localizeWithPath(
2585
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2586
+ 'Defined to run in desktop',
2587
+ "This extension is disabled because it is defined to run only in {0} for the Desktop.",
2588
+ this.productService.nameLong
2589
+ ))} [${( localizeWithPath(
2590
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2591
+ 'learn more',
2592
+ "Learn More"
2593
+ ))}](https://aka.ms/vscode-remote/developing-extensions/architecture)`));
2594
+ }
2595
+ }
2596
+ }
2597
+ else if (this.extensionManagementServerService.webExtensionManagementServer === this.extension.server) {
2598
+ message = ( new MarkdownString(`${( localizeWithPath(
2599
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2600
+ 'Cannot be enabled',
2601
+ "This extension is disabled because it is not supported in {0} for the Web.",
2602
+ this.productService.nameLong
2603
+ ))} [${( localizeWithPath(
2604
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2605
+ 'learn more',
2606
+ "Learn More"
2607
+ ))}](https://aka.ms/vscode-remote/developing-extensions/architecture)`));
2608
+ }
2609
+ if (message) {
2610
+ this.updateStatus({ icon: warningIcon, message }, true);
2611
+ }
2612
+ return;
2613
+ }
2614
+ }
2615
+ if (this.extensionManagementServerService.remoteExtensionManagementServer) {
2616
+ if (isLanguagePackExtension(this.extension.local.manifest)) {
2617
+ if (!( this.extensionsWorkbenchService.installed.some(
2618
+ e => areSameExtensions(e.identifier, this.extension.identifier) && e.server !== this.extension.server
2619
+ ))) {
2620
+ const message = this.extension.server === this.extensionManagementServerService.localExtensionManagementServer
2621
+ ? ( new MarkdownString(( localizeWithPath(
2622
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2623
+ 'Install language pack also in remote server',
2624
+ "Install the language pack extension on '{0}' to enable it there also.",
2625
+ this.extensionManagementServerService.remoteExtensionManagementServer.label
2626
+ ))))
2627
+ : ( new MarkdownString(( localizeWithPath(
2628
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2629
+ 'Install language pack also locally',
2630
+ "Install the language pack extension locally to enable it there also."
2631
+ ))));
2632
+ this.updateStatus({ icon: infoIcon, message }, true);
2633
+ }
2634
+ return;
2635
+ }
2636
+ const runningExtension = this.extensionService.extensions.filter(e => areSameExtensions({ id: e.identifier.value, uuid: e.uuid }, this.extension.identifier))[0];
2637
+ const runningExtensionServer = runningExtension ? this.extensionManagementServerService.getExtensionManagementServer(toExtension(runningExtension)) : null;
2638
+ if (this.extension.server === this.extensionManagementServerService.localExtensionManagementServer && runningExtensionServer === this.extensionManagementServerService.remoteExtensionManagementServer) {
2639
+ if (this.extensionManifestPropertiesService.prefersExecuteOnWorkspace(this.extension.local.manifest)) {
2640
+ this.updateStatus({ icon: infoIcon, message: ( new MarkdownString(`${( localizeWithPath(
2641
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2642
+ 'enabled remotely',
2643
+ "This extension is enabled in the Remote Extension Host because it prefers to run there."
2644
+ ))} [${( localizeWithPath(
2645
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2646
+ 'learn more',
2647
+ "Learn More"
2648
+ ))}](https://aka.ms/vscode-remote/developing-extensions/architecture)`)) }, true);
2649
+ }
2650
+ return;
2651
+ }
2652
+ if (this.extension.server === this.extensionManagementServerService.remoteExtensionManagementServer && runningExtensionServer === this.extensionManagementServerService.localExtensionManagementServer) {
2653
+ if (this.extensionManifestPropertiesService.prefersExecuteOnUI(this.extension.local.manifest)) {
2654
+ this.updateStatus({ icon: infoIcon, message: ( new MarkdownString(`${( localizeWithPath(
2655
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2656
+ 'enabled locally',
2657
+ "This extension is enabled in the Local Extension Host because it prefers to run there."
2658
+ ))} [${( localizeWithPath(
2659
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2660
+ 'learn more',
2661
+ "Learn More"
2662
+ ))}](https://aka.ms/vscode-remote/developing-extensions/architecture)`)) }, true);
2663
+ }
2664
+ return;
2665
+ }
2666
+ if (this.extension.server === this.extensionManagementServerService.remoteExtensionManagementServer && runningExtensionServer === this.extensionManagementServerService.webExtensionManagementServer) {
2667
+ if (this.extensionManifestPropertiesService.canExecuteOnWeb(this.extension.local.manifest)) {
2668
+ this.updateStatus({ icon: infoIcon, message: ( new MarkdownString(`${( localizeWithPath(
2669
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2670
+ 'enabled in web worker',
2671
+ "This extension is enabled in the Web Worker Extension Host because it prefers to run there."
2672
+ ))} [${( localizeWithPath(
2673
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2674
+ 'learn more',
2675
+ "Learn More"
2676
+ ))}](https://aka.ms/vscode-remote/developing-extensions/architecture)`)) }, true);
2677
+ }
2678
+ return;
2679
+ }
2680
+ }
2681
+ if (this.extension.enablementState === 5 ) {
2682
+ this.updateStatus({ icon: warningIcon, message: ( new MarkdownString(( localizeWithPath(
2683
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2684
+ 'extension disabled because of dependency',
2685
+ "This extension has been disabled because it depends on an extension that is disabled."
2686
+ )))) }, true);
2687
+ return;
2688
+ }
2689
+ const isEnabled = this.workbenchExtensionEnablementService.isEnabled(this.extension.local);
2690
+ const isRunning = ( this.extensionService.extensions.some(
2691
+ e => areSameExtensions({ id: e.identifier.value, uuid: e.uuid }, this.extension.identifier)
2692
+ ));
2693
+ if (isEnabled && isRunning) {
2694
+ if (this.extension.enablementState === 9 ) {
2695
+ this.updateStatus({ message: ( new MarkdownString(( localizeWithPath(
2696
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2697
+ 'workspace enabled',
2698
+ "This extension is enabled for this workspace by the user."
2699
+ )))) }, true);
2700
+ return;
2701
+ }
2702
+ if (this.extensionManagementServerService.localExtensionManagementServer && this.extensionManagementServerService.remoteExtensionManagementServer) {
2703
+ if (this.extension.server === this.extensionManagementServerService.remoteExtensionManagementServer) {
2704
+ this.updateStatus({ message: ( new MarkdownString(( localizeWithPath(
2705
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2706
+ 'extension enabled on remote',
2707
+ "Extension is enabled on '{0}'",
2708
+ this.extension.server.label
2709
+ )))) }, true);
2710
+ return;
2711
+ }
2712
+ }
2713
+ if (this.extension.enablementState === 8 ) {
2714
+ this.updateStatus({ message: ( new MarkdownString(( localizeWithPath(
2715
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2716
+ 'globally enabled',
2717
+ "This extension is enabled globally."
2718
+ )))) }, true);
2719
+ return;
2720
+ }
2721
+ }
2722
+ if (!isEnabled && !isRunning) {
2723
+ if (this.extension.enablementState === 6 ) {
2724
+ this.updateStatus({ message: ( new MarkdownString(( localizeWithPath(
2725
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2726
+ 'globally disabled',
2727
+ "This extension is disabled globally by the user."
2728
+ )))) }, true);
2729
+ return;
2730
+ }
2731
+ if (this.extension.enablementState === 7 ) {
2732
+ this.updateStatus({ message: ( new MarkdownString(( localizeWithPath(
2733
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2734
+ 'workspace disabled',
2735
+ "This extension is disabled for this workspace by the user."
2736
+ )))) }, true);
2737
+ return;
2738
+ }
2739
+ }
2740
+ if (isEnabled && !isRunning && !this.extension.local.isValid) {
2741
+ const errors = ( this.extension.local.validations.filter(([severity]) => severity === Severity.Error).map(([, message]) => message));
2742
+ this.updateStatus({ icon: errorIcon, message: ( new MarkdownString(errors.join(' ').trim())) }, true);
2743
+ }
2744
+ }
2745
+ updateStatus(status, updateClass) {
2746
+ if (this._status === status) {
2747
+ return;
2748
+ }
2749
+ if (this._status && status && this._status.message === status.message && this._status.icon?.id === status.icon?.id) {
2750
+ return;
2751
+ }
2752
+ this._status = status;
2753
+ if (updateClass) {
2754
+ if (this._status?.icon === errorIcon) {
2755
+ this.class = `${ExtensionStatusAction_1.CLASS} extension-status-error ${ThemeIcon.asClassName(errorIcon)}`;
2756
+ }
2757
+ else if (this._status?.icon === warningIcon) {
2758
+ this.class = `${ExtensionStatusAction_1.CLASS} extension-status-warning ${ThemeIcon.asClassName(warningIcon)}`;
2759
+ }
2760
+ else if (this._status?.icon === infoIcon) {
2761
+ this.class = `${ExtensionStatusAction_1.CLASS} extension-status-info ${ThemeIcon.asClassName(infoIcon)}`;
2762
+ }
2763
+ else if (this._status?.icon === trustIcon) {
2764
+ this.class = `${ExtensionStatusAction_1.CLASS} ${ThemeIcon.asClassName(trustIcon)}`;
2765
+ }
2766
+ else {
2767
+ this.class = `${ExtensionStatusAction_1.CLASS} hide`;
2768
+ }
2769
+ }
2770
+ this._onDidChangeStatus.fire();
2771
+ }
2772
+ async run() {
2773
+ if (this._status?.icon === trustIcon) {
2774
+ return this.commandService.executeCommand('workbench.trust.manage');
2775
+ }
2776
+ }
2777
+ };
2778
+ ExtensionStatusAction = ExtensionStatusAction_1 = ( __decorate([
2779
+ ( __param(0, IExtensionManagementServerService)),
2780
+ ( __param(1, ILabelService)),
2781
+ ( __param(2, ICommandService)),
2782
+ ( __param(3, IWorkspaceTrustEnablementService)),
2783
+ ( __param(4, IWorkspaceTrustManagementService)),
2784
+ ( __param(5, IExtensionsWorkbenchService)),
2785
+ ( __param(6, IExtensionService)),
2786
+ ( __param(7, IExtensionManifestPropertiesService)),
2787
+ ( __param(8, IWorkspaceContextService)),
2788
+ ( __param(9, IProductService)),
2789
+ ( __param(10, IWorkbenchExtensionEnablementService))
2790
+ ], ExtensionStatusAction));
2791
+ let ReinstallAction = class ReinstallAction extends Action {
2792
+ static { ReinstallAction_1 = this; }
2793
+ static { this.ID = 'workbench.extensions.action.reinstall'; }
2794
+ static { this.LABEL = ( localizeWithPath(
2795
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2796
+ 'reinstall',
2797
+ "Reinstall Extension..."
2798
+ )); }
2799
+ constructor(id = ReinstallAction_1.ID, label = ReinstallAction_1.LABEL, extensionsWorkbenchService, extensionManagementServerService, quickInputService, notificationService, hostService, instantiationService, extensionService) {
2800
+ super(id, label);
2801
+ this.extensionsWorkbenchService = extensionsWorkbenchService;
2802
+ this.extensionManagementServerService = extensionManagementServerService;
2803
+ this.quickInputService = quickInputService;
2804
+ this.notificationService = notificationService;
2805
+ this.hostService = hostService;
2806
+ this.instantiationService = instantiationService;
2807
+ this.extensionService = extensionService;
2808
+ }
2809
+ get enabled() {
2810
+ return this.extensionsWorkbenchService.local.filter(l => !l.isBuiltin && l.local).length > 0;
2811
+ }
2812
+ run() {
2813
+ return this.quickInputService.pick(this.getEntries(), { placeHolder: ( localizeWithPath(
2814
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2815
+ 'selectExtensionToReinstall',
2816
+ "Select Extension to Reinstall"
2817
+ )) })
2818
+ .then(pick => pick && this.reinstallExtension(pick.extension));
2819
+ }
2820
+ getEntries() {
2821
+ return this.extensionsWorkbenchService.queryLocal()
2822
+ .then(local => {
2823
+ const entries = ( local
2824
+ .filter(extension => !extension.isBuiltin && extension.server !== this.extensionManagementServerService.webExtensionManagementServer)
2825
+ .map(extension => {
2826
+ return {
2827
+ id: extension.identifier.id,
2828
+ label: extension.displayName,
2829
+ description: extension.identifier.id,
2830
+ extension,
2831
+ };
2832
+ }));
2833
+ return entries;
2834
+ });
2835
+ }
2836
+ reinstallExtension(extension) {
2837
+ return this.instantiationService.createInstance(SearchExtensionsAction, '@installed ').run()
2838
+ .then(() => {
2839
+ return this.extensionsWorkbenchService.reinstall(extension)
2840
+ .then(extension => {
2841
+ const requireReload = !(extension.local && this.extensionService.canAddExtension(toExtensionDescription(extension.local)));
2842
+ const message = requireReload ? ( localizeWithPath(
2843
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2844
+ 'ReinstallAction.successReload',
2845
+ "Please reload Visual Studio Code to complete reinstalling the extension {0}.",
2846
+ extension.identifier.id
2847
+ ))
2848
+ : ( localizeWithPath(
2849
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2850
+ 'ReinstallAction.success',
2851
+ "Reinstalling the extension {0} is completed.",
2852
+ extension.identifier.id
2853
+ ));
2854
+ const actions = requireReload ? [{
2855
+ label: ( localizeWithPath(
2856
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2857
+ 'InstallVSIXAction.reloadNow',
2858
+ "Reload Now"
2859
+ )),
2860
+ run: () => this.hostService.reload()
2861
+ }] : [];
2862
+ this.notificationService.prompt(Severity.Info, message, actions, { sticky: true });
2863
+ }, error => this.notificationService.error(error));
2864
+ });
2865
+ }
2866
+ };
2867
+ ReinstallAction = ReinstallAction_1 = ( __decorate([
2868
+ ( __param(2, IExtensionsWorkbenchService)),
2869
+ ( __param(3, IExtensionManagementServerService)),
2870
+ ( __param(4, IQuickInputService)),
2871
+ ( __param(5, INotificationService)),
2872
+ ( __param(6, IHostService)),
2873
+ ( __param(7, IInstantiationService)),
2874
+ ( __param(8, IExtensionService))
2875
+ ], ReinstallAction));
2876
+ let InstallSpecificVersionOfExtensionAction = class InstallSpecificVersionOfExtensionAction extends Action {
2877
+ static { InstallSpecificVersionOfExtensionAction_1 = this; }
2878
+ static { this.ID = 'workbench.extensions.action.install.specificVersion'; }
2879
+ static { this.LABEL = ( localizeWithPath(
2880
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2881
+ 'install previous version',
2882
+ "Install Specific Version of Extension..."
2883
+ )); }
2884
+ constructor(id = InstallSpecificVersionOfExtensionAction_1.ID, label = InstallSpecificVersionOfExtensionAction_1.LABEL, extensionsWorkbenchService, quickInputService, instantiationService, extensionEnablementService) {
2885
+ super(id, label);
2886
+ this.extensionsWorkbenchService = extensionsWorkbenchService;
2887
+ this.quickInputService = quickInputService;
2888
+ this.instantiationService = instantiationService;
2889
+ this.extensionEnablementService = extensionEnablementService;
2890
+ }
2891
+ get enabled() {
2892
+ return ( this.extensionsWorkbenchService.local.some(l => this.isEnabled(l)));
2893
+ }
2894
+ async run() {
2895
+ const extensionPick = await this.quickInputService.pick(this.getExtensionEntries(), { placeHolder: ( localizeWithPath(
2896
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2897
+ 'selectExtension',
2898
+ "Select Extension"
2899
+ )), matchOnDetail: true });
2900
+ if (extensionPick && extensionPick.extension) {
2901
+ const action = this.instantiationService.createInstance(InstallAnotherVersionAction);
2902
+ action.extension = extensionPick.extension;
2903
+ await action.run();
2904
+ await this.instantiationService.createInstance(SearchExtensionsAction, extensionPick.extension.identifier.id).run();
2905
+ }
2906
+ }
2907
+ isEnabled(extension) {
2908
+ const action = this.instantiationService.createInstance(InstallAnotherVersionAction);
2909
+ action.extension = extension;
2910
+ return action.enabled && !!extension.local && this.extensionEnablementService.isEnabled(extension.local);
2911
+ }
2912
+ async getExtensionEntries() {
2913
+ const installed = await this.extensionsWorkbenchService.queryLocal();
2914
+ const entries = [];
2915
+ for (const extension of installed) {
2916
+ if (this.isEnabled(extension)) {
2917
+ entries.push({
2918
+ id: extension.identifier.id,
2919
+ label: extension.displayName || extension.identifier.id,
2920
+ description: extension.identifier.id,
2921
+ extension,
2922
+ });
2923
+ }
2924
+ }
2925
+ return entries.sort((e1, e2) => e1.extension.displayName.localeCompare(e2.extension.displayName));
2926
+ }
2927
+ };
2928
+ InstallSpecificVersionOfExtensionAction = InstallSpecificVersionOfExtensionAction_1 = ( __decorate([
2929
+ ( __param(2, IExtensionsWorkbenchService)),
2930
+ ( __param(3, IQuickInputService)),
2931
+ ( __param(4, IInstantiationService)),
2932
+ ( __param(5, IWorkbenchExtensionEnablementService))
2933
+ ], InstallSpecificVersionOfExtensionAction));
2934
+ let AbstractInstallExtensionsInServerAction = class AbstractInstallExtensionsInServerAction extends Action {
2935
+ constructor(id, extensionsWorkbenchService, quickInputService, notificationService, progressService) {
2936
+ super(id);
2937
+ this.extensionsWorkbenchService = extensionsWorkbenchService;
2938
+ this.quickInputService = quickInputService;
2939
+ this.notificationService = notificationService;
2940
+ this.progressService = progressService;
2941
+ this.extensions = undefined;
2942
+ this.update();
2943
+ this.extensionsWorkbenchService.queryLocal().then(() => this.updateExtensions());
2944
+ this._register(this.extensionsWorkbenchService.onChange(() => {
2945
+ if (this.extensions) {
2946
+ this.updateExtensions();
2947
+ }
2948
+ }));
2949
+ }
2950
+ updateExtensions() {
2951
+ this.extensions = this.extensionsWorkbenchService.local;
2952
+ this.update();
2953
+ }
2954
+ update() {
2955
+ this.enabled = !!this.extensions && this.getExtensionsToInstall(this.extensions).length > 0;
2956
+ this.tooltip = this.label;
2957
+ }
2958
+ async run() {
2959
+ return this.selectAndInstallExtensions();
2960
+ }
2961
+ async queryExtensionsToInstall() {
2962
+ const local = await this.extensionsWorkbenchService.queryLocal();
2963
+ return this.getExtensionsToInstall(local);
2964
+ }
2965
+ async selectAndInstallExtensions() {
2966
+ const quickPick = this.quickInputService.createQuickPick();
2967
+ quickPick.busy = true;
2968
+ const disposable = quickPick.onDidAccept(() => {
2969
+ disposable.dispose();
2970
+ quickPick.hide();
2971
+ quickPick.dispose();
2972
+ this.onDidAccept(quickPick.selectedItems);
2973
+ });
2974
+ quickPick.show();
2975
+ const localExtensionsToInstall = await this.queryExtensionsToInstall();
2976
+ quickPick.busy = false;
2977
+ if (localExtensionsToInstall.length) {
2978
+ quickPick.title = this.getQuickPickTitle();
2979
+ quickPick.placeholder = ( localizeWithPath(
2980
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2981
+ 'select extensions to install',
2982
+ "Select extensions to install"
2983
+ ));
2984
+ quickPick.canSelectMany = true;
2985
+ localExtensionsToInstall.sort((e1, e2) => e1.displayName.localeCompare(e2.displayName));
2986
+ quickPick.items = ( localExtensionsToInstall.map(
2987
+ extension => ({ extension, label: extension.displayName, description: extension.version })
2988
+ ));
2989
+ }
2990
+ else {
2991
+ quickPick.hide();
2992
+ quickPick.dispose();
2993
+ this.notificationService.notify({
2994
+ severity: Severity.Info,
2995
+ message: ( localizeWithPath(
2996
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
2997
+ 'no local extensions',
2998
+ "There are no extensions to install."
2999
+ ))
3000
+ });
3001
+ }
3002
+ }
3003
+ async onDidAccept(selectedItems) {
3004
+ if (selectedItems.length) {
3005
+ const localExtensionsToInstall = ( selectedItems.filter(r => !!r.extension).map(r => r.extension));
3006
+ if (localExtensionsToInstall.length) {
3007
+ await this.progressService.withProgress({
3008
+ location: 15 ,
3009
+ title: ( localizeWithPath(
3010
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
3011
+ 'installing extensions',
3012
+ "Installing Extensions..."
3013
+ ))
3014
+ }, () => this.installExtensions(localExtensionsToInstall));
3015
+ this.notificationService.info(( localizeWithPath(
3016
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
3017
+ 'finished installing',
3018
+ "Successfully installed extensions."
3019
+ )));
3020
+ }
3021
+ }
3022
+ }
3023
+ };
3024
+ AbstractInstallExtensionsInServerAction = ( __decorate([
3025
+ ( __param(1, IExtensionsWorkbenchService)),
3026
+ ( __param(2, IQuickInputService)),
3027
+ ( __param(3, INotificationService)),
3028
+ ( __param(4, IProgressService))
3029
+ ], AbstractInstallExtensionsInServerAction));
3030
+ let InstallLocalExtensionsInRemoteAction = class InstallLocalExtensionsInRemoteAction extends AbstractInstallExtensionsInServerAction {
3031
+ constructor(extensionsWorkbenchService, quickInputService, progressService, notificationService, extensionManagementServerService, extensionGalleryService, instantiationService, fileService, logService) {
3032
+ super('workbench.extensions.actions.installLocalExtensionsInRemote', extensionsWorkbenchService, quickInputService, notificationService, progressService);
3033
+ this.extensionManagementServerService = extensionManagementServerService;
3034
+ this.extensionGalleryService = extensionGalleryService;
3035
+ this.instantiationService = instantiationService;
3036
+ this.fileService = fileService;
3037
+ this.logService = logService;
3038
+ }
3039
+ get label() {
3040
+ if (this.extensionManagementServerService && this.extensionManagementServerService.remoteExtensionManagementServer) {
3041
+ return ( localizeWithPath(
3042
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
3043
+ 'select and install local extensions',
3044
+ "Install Local Extensions in '{0}'...",
3045
+ this.extensionManagementServerService.remoteExtensionManagementServer.label
3046
+ ));
3047
+ }
3048
+ return '';
3049
+ }
3050
+ getQuickPickTitle() {
3051
+ return ( localizeWithPath(
3052
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
3053
+ 'install local extensions title',
3054
+ "Install Local Extensions in '{0}'",
3055
+ this.extensionManagementServerService.remoteExtensionManagementServer.label
3056
+ ));
3057
+ }
3058
+ getExtensionsToInstall(local) {
3059
+ return local.filter(extension => {
3060
+ const action = this.instantiationService.createInstance(RemoteInstallAction, true);
3061
+ action.extension = extension;
3062
+ return action.enabled;
3063
+ });
3064
+ }
3065
+ async installExtensions(localExtensionsToInstall) {
3066
+ const galleryExtensions = [];
3067
+ const vsixs = [];
3068
+ const targetPlatform = await this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.getTargetPlatform();
3069
+ await Promises.settled(( localExtensionsToInstall.map(async (extension) => {
3070
+ if (this.extensionGalleryService.isEnabled()) {
3071
+ const gallery = (await this.extensionGalleryService.getExtensions([{ ...extension.identifier, preRelease: !!extension.local?.preRelease }], { targetPlatform, compatible: true }, CancellationToken.None))[0];
3072
+ if (gallery) {
3073
+ galleryExtensions.push(gallery);
3074
+ return;
3075
+ }
3076
+ }
3077
+ const vsix = await this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.zip(extension.local);
3078
+ vsixs.push(vsix);
3079
+ })));
3080
+ await Promises.settled(( galleryExtensions.map(
3081
+ gallery => this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.installFromGallery(gallery)
3082
+ )));
3083
+ try {
3084
+ await Promises.settled(( vsixs.map(
3085
+ vsix => this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.install(vsix)
3086
+ )));
3087
+ }
3088
+ finally {
3089
+ try {
3090
+ await Promise.allSettled(( vsixs.map(vsix => this.fileService.del(vsix))));
3091
+ }
3092
+ catch (error) {
3093
+ this.logService.error(error);
3094
+ }
3095
+ }
3096
+ }
3097
+ };
3098
+ InstallLocalExtensionsInRemoteAction = ( __decorate([
3099
+ ( __param(0, IExtensionsWorkbenchService)),
3100
+ ( __param(1, IQuickInputService)),
3101
+ ( __param(2, IProgressService)),
3102
+ ( __param(3, INotificationService)),
3103
+ ( __param(4, IExtensionManagementServerService)),
3104
+ ( __param(5, IExtensionGalleryService)),
3105
+ ( __param(6, IInstantiationService)),
3106
+ ( __param(7, IFileService)),
3107
+ ( __param(8, ILogService))
3108
+ ], InstallLocalExtensionsInRemoteAction));
3109
+ let InstallRemoteExtensionsInLocalAction = class InstallRemoteExtensionsInLocalAction extends AbstractInstallExtensionsInServerAction {
3110
+ constructor(id, extensionsWorkbenchService, quickInputService, progressService, notificationService, extensionManagementServerService, extensionGalleryService, fileService, logService) {
3111
+ super(id, extensionsWorkbenchService, quickInputService, notificationService, progressService);
3112
+ this.extensionManagementServerService = extensionManagementServerService;
3113
+ this.extensionGalleryService = extensionGalleryService;
3114
+ this.fileService = fileService;
3115
+ this.logService = logService;
3116
+ }
3117
+ get label() {
3118
+ return ( localizeWithPath(
3119
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
3120
+ 'select and install remote extensions',
3121
+ "Install Remote Extensions Locally..."
3122
+ ));
3123
+ }
3124
+ getQuickPickTitle() {
3125
+ return ( localizeWithPath(
3126
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
3127
+ 'install remote extensions',
3128
+ "Install Remote Extensions Locally"
3129
+ ));
3130
+ }
3131
+ getExtensionsToInstall(local) {
3132
+ return local.filter(extension => extension.type === 1 && extension.server !== this.extensionManagementServerService.localExtensionManagementServer
3133
+ && !( this.extensionsWorkbenchService.installed.some(
3134
+ e => e.server === this.extensionManagementServerService.localExtensionManagementServer && areSameExtensions(e.identifier, extension.identifier)
3135
+ )));
3136
+ }
3137
+ async installExtensions(extensions) {
3138
+ const galleryExtensions = [];
3139
+ const vsixs = [];
3140
+ const targetPlatform = await this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.getTargetPlatform();
3141
+ await Promises.settled(( extensions.map(async (extension) => {
3142
+ if (this.extensionGalleryService.isEnabled()) {
3143
+ const gallery = (await this.extensionGalleryService.getExtensions([{ ...extension.identifier, preRelease: !!extension.local?.preRelease }], { targetPlatform, compatible: true }, CancellationToken.None))[0];
3144
+ if (gallery) {
3145
+ galleryExtensions.push(gallery);
3146
+ return;
3147
+ }
3148
+ }
3149
+ const vsix = await this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.zip(extension.local);
3150
+ vsixs.push(vsix);
3151
+ })));
3152
+ await Promises.settled(( galleryExtensions.map(
3153
+ gallery => this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.installFromGallery(gallery)
3154
+ )));
3155
+ try {
3156
+ await Promises.settled(( vsixs.map(
3157
+ vsix => this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.install(vsix)
3158
+ )));
3159
+ }
3160
+ finally {
3161
+ try {
3162
+ await Promise.allSettled(( vsixs.map(vsix => this.fileService.del(vsix))));
3163
+ }
3164
+ catch (error) {
3165
+ this.logService.error(error);
3166
+ }
3167
+ }
3168
+ }
3169
+ };
3170
+ InstallRemoteExtensionsInLocalAction = ( __decorate([
3171
+ ( __param(1, IExtensionsWorkbenchService)),
3172
+ ( __param(2, IQuickInputService)),
3173
+ ( __param(3, IProgressService)),
3174
+ ( __param(4, INotificationService)),
3175
+ ( __param(5, IExtensionManagementServerService)),
3176
+ ( __param(6, IExtensionGalleryService)),
3177
+ ( __param(7, IFileService)),
3178
+ ( __param(8, ILogService))
3179
+ ], InstallRemoteExtensionsInLocalAction));
3180
+ CommandsRegistry.registerCommand('workbench.extensions.action.showExtensionsForLanguage', function (accessor, fileExtension) {
3181
+ const paneCompositeService = accessor.get(IPaneCompositePartService);
3182
+ return paneCompositeService.openPaneComposite(VIEWLET_ID, 0 , true)
3183
+ .then(viewlet => viewlet?.getViewPaneContainer())
3184
+ .then(viewlet => {
3185
+ viewlet.search(`ext:${fileExtension.replace(/^\./, '')}`);
3186
+ viewlet.focus();
3187
+ });
3188
+ });
3189
+ CommandsRegistry.registerCommand('workbench.extensions.action.showExtensionsWithIds', function (accessor, extensionIds) {
3190
+ const paneCompositeService = accessor.get(IPaneCompositePartService);
3191
+ return paneCompositeService.openPaneComposite(VIEWLET_ID, 0 , true)
3192
+ .then(viewlet => viewlet?.getViewPaneContainer())
3193
+ .then(viewlet => {
3194
+ const query = ( extensionIds
3195
+ .map(id => `@id:${id}`))
3196
+ .join(' ');
3197
+ viewlet.search(query);
3198
+ viewlet.focus();
3199
+ });
3200
+ });
3201
+ registerColor('extensionButton.background', {
3202
+ dark: buttonBackground,
3203
+ light: buttonBackground,
3204
+ hcDark: null,
3205
+ hcLight: null
3206
+ }, ( localizeWithPath(
3207
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
3208
+ 'extensionButtonBackground',
3209
+ "Button background color for extension actions."
3210
+ )));
3211
+ registerColor('extensionButton.foreground', {
3212
+ dark: buttonForeground,
3213
+ light: buttonForeground,
3214
+ hcDark: null,
3215
+ hcLight: null
3216
+ }, ( localizeWithPath(
3217
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
3218
+ 'extensionButtonForeground',
3219
+ "Button foreground color for extension actions."
3220
+ )));
3221
+ registerColor('extensionButton.hoverBackground', {
3222
+ dark: buttonHoverBackground,
3223
+ light: buttonHoverBackground,
3224
+ hcDark: null,
3225
+ hcLight: null
3226
+ }, ( localizeWithPath(
3227
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
3228
+ 'extensionButtonHoverBackground',
3229
+ "Button background hover color for extension actions."
3230
+ )));
3231
+ registerColor('extensionButton.separator', {
3232
+ dark: buttonSeparator,
3233
+ light: buttonSeparator,
3234
+ hcDark: buttonSeparator,
3235
+ hcLight: buttonSeparator
3236
+ }, ( localizeWithPath(
3237
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
3238
+ 'extensionButtonSeparator',
3239
+ "Button separator color for extension actions"
3240
+ )));
3241
+ const extensionButtonProminentBackground = registerColor('extensionButton.prominentBackground', {
3242
+ dark: buttonBackground,
3243
+ light: buttonBackground,
3244
+ hcDark: null,
3245
+ hcLight: null
3246
+ }, ( localizeWithPath(
3247
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
3248
+ 'extensionButtonProminentBackground',
3249
+ "Button background color for extension actions that stand out (e.g. install button)."
3250
+ )));
3251
+ registerColor('extensionButton.prominentForeground', {
3252
+ dark: buttonForeground,
3253
+ light: buttonForeground,
3254
+ hcDark: null,
3255
+ hcLight: null
3256
+ }, ( localizeWithPath(
3257
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
3258
+ 'extensionButtonProminentForeground',
3259
+ "Button foreground color for extension actions that stand out (e.g. install button)."
3260
+ )));
3261
+ registerColor('extensionButton.prominentHoverBackground', {
3262
+ dark: buttonHoverBackground,
3263
+ light: buttonHoverBackground,
3264
+ hcDark: null,
3265
+ hcLight: null
3266
+ }, ( localizeWithPath(
3267
+ 'vs/workbench/contrib/extensions/browser/extensionsActions',
3268
+ 'extensionButtonProminentHoverBackground',
3269
+ "Button background hover color for extension actions that stand out (e.g. install button)."
3270
+ )));
3271
+ registerThemingParticipant((theme, collector) => {
3272
+ const errorColor = theme.getColor(editorErrorForeground);
3273
+ if (errorColor) {
3274
+ collector.addRule(`.extension-editor .header .actions-status-container > .status ${ThemeIcon.asCSSSelector(errorIcon)} { color: ${errorColor}; }`);
3275
+ collector.addRule(`.extension-editor .body .subcontent .runtime-status ${ThemeIcon.asCSSSelector(errorIcon)} { color: ${errorColor}; }`);
3276
+ collector.addRule(`.monaco-hover.extension-hover .markdown-hover .hover-contents ${ThemeIcon.asCSSSelector(errorIcon)} { color: ${errorColor}; }`);
3277
+ }
3278
+ const warningColor = theme.getColor(editorWarningForeground);
3279
+ if (warningColor) {
3280
+ collector.addRule(`.extension-editor .header .actions-status-container > .status ${ThemeIcon.asCSSSelector(warningIcon)} { color: ${warningColor}; }`);
3281
+ collector.addRule(`.extension-editor .body .subcontent .runtime-status ${ThemeIcon.asCSSSelector(warningIcon)} { color: ${warningColor}; }`);
3282
+ collector.addRule(`.monaco-hover.extension-hover .markdown-hover .hover-contents ${ThemeIcon.asCSSSelector(warningIcon)} { color: ${warningColor}; }`);
3283
+ }
3284
+ const infoColor = theme.getColor(editorInfoForeground);
3285
+ if (infoColor) {
3286
+ collector.addRule(`.extension-editor .header .actions-status-container > .status ${ThemeIcon.asCSSSelector(infoIcon)} { color: ${infoColor}; }`);
3287
+ collector.addRule(`.extension-editor .body .subcontent .runtime-status ${ThemeIcon.asCSSSelector(infoIcon)} { color: ${infoColor}; }`);
3288
+ collector.addRule(`.monaco-hover.extension-hover .markdown-hover .hover-contents ${ThemeIcon.asCSSSelector(infoIcon)} { color: ${infoColor}; }`);
3289
+ }
3290
+ });
3291
+ export { AbstractConfigureRecommendedExtensionsAction, AbstractInstallExtensionsInServerAction, ActionWithDropDownAction, ClearLanguageAction, ConfigureWorkspaceFolderRecommendedExtensionsAction, ConfigureWorkspaceRecommendedExtensionsAction, DisableDropDownAction, DisableForWorkspaceAction, DisableGloballyAction, DropDownMenuActionViewItem, EnableDropDownAction, EnableForWorkspaceAction, EnableGloballyAction, ExtensionAction, ExtensionActionWithDropdownActionViewItem, ExtensionDropDownAction, ExtensionEditorManageExtensionAction, ExtensionStatusAction, ExtensionStatusLabelAction, IgnoreExtensionRecommendationAction, InstallAction, InstallAnotherVersionAction, InstallDropdownAction, InstallInOtherServerAction, InstallLocalExtensionsInRemoteAction, InstallRecommendedExtensionAction, InstallRemoteExtensionsInLocalAction, InstallSpecificVersionOfExtensionAction, InstallingLabelAction, LocalInstallAction, ManageExtensionAction, MenuItemExtensionAction, MigrateDeprecatedExtensionAction, PromptExtensionInstallFailureAction, ReinstallAction, ReloadAction, RemoteInstallAction, SearchExtensionsAction, SetColorThemeAction, SetFileIconThemeAction, SetLanguageAction, SetProductIconThemeAction, ShowRecommendedExtensionAction, SkipUpdateAction, SwitchToPreReleaseVersionAction, SwitchToReleasedVersionAction, ToggleSyncExtensionAction, UndoIgnoreExtensionRecommendationAction, UninstallAction, UpdateAction, WebInstallAction, extensionButtonProminentBackground, getContextMenuActions };