@codingame/monaco-vscode-api 1.79.1 → 1.79.2-next.1

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 (467) hide show
  1. package/README.md +11 -2
  2. package/dist/api.js +10 -8
  3. package/dist/composite.d.ts +65 -0
  4. package/dist/configurationRegistry.d.ts +212 -0
  5. package/dist/contextkey.d.ts +1 -1
  6. package/dist/default-extensions/json.js +1 -0
  7. package/dist/default-extensions/theme-defaults.js +2 -2
  8. package/dist/editorBrowser.d.ts +272 -3
  9. package/dist/event.d.ts +6 -1
  10. package/dist/{extension-tools-0c4c1ad7.js → extension-tools-3c2bf0a4.js} +698 -507
  11. package/dist/extensions.d.ts +3 -2
  12. package/dist/extensions.d2.ts +6 -17
  13. package/dist/extensionsRegistry.d.ts +15 -9
  14. package/dist/files.d.ts +71 -7
  15. package/dist/jsonSchema.d.ts +1 -1
  16. package/dist/keybinding.d.ts +2 -2
  17. package/dist/languageFeatures.d.ts +703 -61
  18. package/dist/monaco.d.ts +5 -4
  19. package/dist/override/vs/workbench/contrib/notebook/browser/contrib/find/findMatchDecorationModel.js +2 -0
  20. package/dist/override/vs/workbench/contrib/notebook/browser/notebookEditor.js +2 -0
  21. package/dist/override/vs/workbench/contrib/notebook/browser/notebookEditorWidget.js +2 -0
  22. package/dist/override/vs/workbench/contrib/notebook/common/notebookEditorInput.js +2 -1
  23. package/dist/platform.d.ts +11 -0
  24. package/dist/rollup-extension-directory-plugin.js +1 -1
  25. package/dist/rollup-vsix-plugin.js +2 -2
  26. package/dist/service-override/configuration.d.ts +5 -206
  27. package/dist/service-override/dialogs.js +16 -1
  28. package/dist/service-override/files.d.ts +2 -2
  29. package/dist/service-override/files.js +1 -1
  30. package/dist/service-override/markers.d.ts +7 -0
  31. package/dist/service-override/markers.js +6 -0
  32. package/dist/service-override/output.d.ts +7 -0
  33. package/dist/service-override/output.js +22 -0
  34. package/dist/service-override/preferences.js +7 -1
  35. package/dist/service-override/quickaccess.js +0 -9
  36. package/dist/service-override/search.d.ts +7 -0
  37. package/dist/service-override/search.js +19 -0
  38. package/dist/service-override/terminal.d.ts +607 -0
  39. package/dist/service-override/terminal.js +98 -0
  40. package/dist/service-override/tools/editor.js +1 -1
  41. package/dist/service-override/views.d.ts +561 -335
  42. package/dist/service-override/views.js +51 -11
  43. package/dist/services.d.ts +2627 -108
  44. package/dist/services.js +3 -0
  45. package/dist/severity.d.ts +16 -0
  46. package/dist/uri.d.ts +22 -11
  47. package/dist/views.d.ts +270 -0
  48. package/dist/vscode/vs/base/common/processes.js +24 -0
  49. package/dist/vscode/vs/editor/browser/widget/diffEditorWidget2/decorations.js +20 -0
  50. package/dist/vscode/vs/editor/browser/widget/diffEditorWidget2/delegatingEditorImpl.js +106 -0
  51. package/dist/vscode/vs/editor/browser/widget/diffEditorWidget2/diffEditorSash.js +59 -0
  52. package/dist/vscode/vs/editor/browser/widget/diffEditorWidget2/diffEditorWidget2.contribution.js +41 -0
  53. package/dist/vscode/vs/editor/browser/widget/diffEditorWidget2/diffEditorWidget2.js +369 -0
  54. package/dist/vscode/vs/editor/browser/widget/diffEditorWidget2/diffModel.js +247 -0
  55. package/dist/vscode/vs/editor/browser/widget/diffEditorWidget2/lineAlignment.js +179 -0
  56. package/dist/vscode/vs/editor/browser/widget/diffEditorWidget2/overviewRulerPart.js +121 -0
  57. package/dist/vscode/vs/editor/browser/widget/diffEditorWidget2/style.css.js +4 -0
  58. package/dist/vscode/vs/editor/browser/widget/diffEditorWidget2/unchangedRanges.js +184 -0
  59. package/dist/vscode/vs/editor/browser/widget/diffEditorWidget2/utils.js +88 -0
  60. package/dist/vscode/vs/platform/extensionManagement/common/extensionManagement.js +38 -1
  61. package/dist/vscode/vs/platform/extensionManagement/common/extensionManagementUtil.js +5 -1
  62. package/dist/vscode/vs/platform/extensionResourceLoader/common/extensionResourceLoader.js +13 -5
  63. package/dist/vscode/vs/platform/files/common/fileService.js +43 -5
  64. package/dist/vscode/vs/platform/files/common/files.js +3 -1
  65. package/dist/vscode/vs/platform/languagePacks/common/languagePacks.js +4 -1
  66. package/dist/vscode/vs/platform/log/common/bufferLog.js +34 -0
  67. package/dist/vscode/vs/platform/log/common/fileLog.js +105 -0
  68. package/dist/vscode/vs/platform/quickinput/browser/quickPickPin.js +1 -1
  69. package/dist/vscode/vs/platform/remote/common/remoteAuthorityResolver.js +20 -1
  70. package/dist/vscode/vs/platform/request/browser/requestService.js +1 -1
  71. package/dist/vscode/vs/platform/request/common/request.js +3 -3
  72. package/dist/vscode/vs/platform/storage/common/storage.js +3 -0
  73. package/dist/vscode/vs/platform/terminal/common/capabilities/bufferMarkCapability.js +39 -0
  74. package/dist/vscode/vs/platform/terminal/common/capabilities/commandDetectionCapability.js +565 -0
  75. package/dist/vscode/vs/platform/terminal/common/capabilities/cwdDetectionCapability.js +27 -0
  76. package/dist/vscode/vs/platform/terminal/common/capabilities/naiveCwdDetectionCapability.js +22 -0
  77. package/dist/vscode/vs/platform/terminal/common/capabilities/partialCommandDetectionCapability.js +46 -0
  78. package/dist/vscode/vs/platform/terminal/common/capabilities/terminalCapabilityStore.js +80 -0
  79. package/dist/vscode/vs/platform/terminal/common/environmentVariable.js +7 -0
  80. package/dist/vscode/vs/platform/terminal/common/environmentVariableCollection.js +196 -0
  81. package/dist/vscode/vs/platform/terminal/common/environmentVariableShared.js +23 -0
  82. package/dist/vscode/vs/platform/terminal/common/terminal.js +21 -1
  83. package/dist/vscode/vs/platform/terminal/common/terminalDataBuffering.js +45 -0
  84. package/dist/vscode/vs/platform/terminal/common/terminalEnvironment.js +37 -0
  85. package/dist/vscode/vs/platform/terminal/common/terminalPlatformConfiguration.js +622 -0
  86. package/dist/vscode/vs/platform/terminal/common/terminalProfiles.js +107 -0
  87. package/dist/vscode/vs/platform/terminal/common/terminalRecorder.js +66 -0
  88. package/dist/vscode/vs/platform/terminal/common/terminalStrings.js +16 -0
  89. package/dist/vscode/vs/platform/terminal/common/xterm/shellIntegrationAddon.js +321 -0
  90. package/dist/vscode/vs/platform/userDataSync/common/settingsMerge.js +39 -1
  91. package/dist/vscode/vs/platform/userDataSync/common/userDataSync.js +19 -0
  92. package/dist/vscode/vs/platform/window/common/window.js +7 -1
  93. package/dist/vscode/vs/platform/workspace/common/canonicalUri.js +3 -0
  94. package/dist/vscode/vs/platform/workspace/common/virtualWorkspace.js +4 -1
  95. package/dist/vscode/vs/platform/workspaces/common/workspaces.js +2 -2
  96. package/dist/vscode/vs/workbench/api/browser/mainThreadCommands.js +2 -3
  97. package/dist/vscode/vs/workbench/api/browser/mainThreadEditorTabs.js +473 -0
  98. package/dist/vscode/vs/workbench/api/browser/mainThreadLanguageFeatures.js +45 -38
  99. package/dist/vscode/vs/workbench/api/browser/mainThreadSearch.js +146 -0
  100. package/dist/vscode/vs/workbench/api/browser/mainThreadStatusBar.js +33 -52
  101. package/dist/vscode/vs/workbench/api/browser/mainThreadTerminalService.js +395 -0
  102. package/dist/vscode/vs/workbench/api/browser/mainThreadTheming.js +22 -0
  103. package/dist/vscode/vs/workbench/api/browser/mainThreadTreeViews.js +10 -5
  104. package/dist/vscode/vs/workbench/api/browser/mainThreadWindow.js +11 -4
  105. package/dist/vscode/vs/workbench/api/browser/mainThreadWorkspace.js +34 -11
  106. package/dist/vscode/vs/workbench/api/browser/statusBarExtensionPoint.js +81 -0
  107. package/dist/vscode/vs/workbench/api/common/extHost.protocol.js +7 -2
  108. package/dist/vscode/vs/workbench/api/common/extHostDebugService.js +4 -13
  109. package/dist/vscode/vs/workbench/api/common/extHostExtensionService.js +30 -15
  110. package/dist/vscode/vs/workbench/api/common/extHostFileSystemConsumer.js +20 -6
  111. package/dist/vscode/vs/workbench/api/common/extHostLanguageFeatures.js +41 -8
  112. package/dist/vscode/vs/workbench/api/common/extHostManagedSockets.js +3 -0
  113. package/dist/vscode/vs/workbench/api/common/extHostSearch.js +109 -0
  114. package/dist/vscode/vs/workbench/api/common/extHostStatusBar.js +33 -6
  115. package/dist/vscode/vs/workbench/api/common/extHostTerminalService.js +879 -1
  116. package/dist/vscode/vs/workbench/api/common/extHostTheming.js +38 -0
  117. package/dist/vscode/vs/workbench/api/common/extHostTreeViews.js +8 -5
  118. package/dist/vscode/vs/workbench/api/common/extHostTypeConverters.js +15 -17
  119. package/dist/vscode/vs/workbench/api/common/extHostTypes.js +117 -4
  120. package/dist/vscode/vs/workbench/api/common/extHostWindow.js +28 -6
  121. package/dist/vscode/vs/workbench/api/common/extHostWorkspace.js +28 -0
  122. package/dist/vscode/vs/workbench/api/common/shared/dataTransferCache.js +11 -14
  123. package/dist/vscode/vs/workbench/api/node/extHostTerminalService.js +22 -0
  124. package/dist/vscode/vs/workbench/browser/actions/layoutActions.js +2 -1
  125. package/dist/vscode/vs/workbench/browser/actions/windowActions.js +2 -2
  126. package/dist/vscode/vs/workbench/browser/dnd.js +56 -2
  127. package/dist/vscode/vs/workbench/browser/parts/compositePart.js +1 -1
  128. package/dist/vscode/vs/workbench/browser/parts/dialogs/dialogHandler.js +2 -2
  129. package/dist/vscode/vs/workbench/browser/parts/editor/editor.contribution.js +1 -0
  130. package/dist/vscode/vs/workbench/browser/parts/editor/editor.js +1 -0
  131. package/dist/vscode/vs/workbench/browser/parts/editor/editorCommands.js +9 -10
  132. package/dist/vscode/vs/workbench/browser/parts/editor/editorGroupView.js +15 -9
  133. package/dist/vscode/vs/workbench/browser/parts/editor/editorGroupWatermark.js +13 -17
  134. package/dist/vscode/vs/workbench/browser/parts/editor/editorStatus.js +1 -1
  135. package/dist/vscode/vs/workbench/browser/parts/editor/editorsObserver.js +2 -2
  136. package/dist/vscode/vs/workbench/browser/parts/editor/media/editorgroupview.css.js +1 -1
  137. package/dist/vscode/vs/workbench/browser/parts/editor/media/tabstitlecontrol.css.js +1 -1
  138. package/dist/vscode/vs/workbench/browser/parts/editor/noTabsTitleControl.js +3 -1
  139. package/dist/vscode/vs/workbench/browser/parts/editor/tabsTitleControl.js +60 -11
  140. package/dist/vscode/vs/workbench/browser/parts/editor/textDiffEditor.js +16 -10
  141. package/dist/vscode/vs/workbench/browser/parts/editor/textResourceEditor.js +1 -1
  142. package/dist/vscode/vs/workbench/browser/parts/statusbar/media/statusbarpart.css.js +1 -1
  143. package/dist/vscode/vs/workbench/browser/parts/views/checkbox.js +10 -0
  144. package/dist/vscode/vs/workbench/browser/parts/views/treeView.js +78 -14
  145. package/dist/vscode/vs/workbench/browser/parts/views/viewPaneContainer.js +1 -1
  146. package/dist/vscode/vs/workbench/browser/workbench.contribution.js +65 -6
  147. package/dist/vscode/vs/workbench/common/configuration.js +8 -1
  148. package/dist/vscode/vs/workbench/common/contextkeys.js +9 -1
  149. package/dist/vscode/vs/workbench/common/editor/editorGroupModel.js +5 -1
  150. package/dist/vscode/vs/workbench/common/editor/resourceEditorInput.js +6 -3
  151. package/dist/vscode/vs/workbench/common/editor/textResourceEditorInput.js +9 -6
  152. package/dist/vscode/vs/workbench/common/editor.js +1 -5
  153. package/dist/vscode/vs/workbench/common/resources.js +111 -34
  154. package/dist/vscode/vs/workbench/contrib/bulkEdit/browser/bulkEditService.js +1 -1
  155. package/dist/vscode/vs/workbench/contrib/bulkEdit/browser/bulkTextEdits.js +1 -1
  156. package/dist/vscode/vs/workbench/contrib/chat/browser/chat.js +3 -0
  157. package/dist/vscode/vs/workbench/contrib/chat/common/chatService.js +3 -0
  158. package/dist/vscode/vs/workbench/contrib/codeEditor/browser/languageConfigurationExtensionPoint.js +6 -4
  159. package/dist/vscode/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.css.js +4 -0
  160. package/dist/vscode/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.js +250 -0
  161. package/dist/vscode/vs/workbench/contrib/customEditor/browser/customEditorInput.js +290 -0
  162. package/dist/vscode/vs/workbench/contrib/customEditor/common/customEditor.js +3 -0
  163. package/dist/vscode/vs/workbench/contrib/debug/browser/debugActionViewItems.js +1 -0
  164. package/dist/vscode/vs/workbench/contrib/debug/browser/debugCommands.js +2 -1
  165. package/dist/vscode/vs/workbench/contrib/debug/browser/debugConfigurationManager.js +20 -20
  166. package/dist/vscode/vs/workbench/contrib/debug/browser/debugEditorActions.js +5 -3
  167. package/dist/vscode/vs/workbench/contrib/debug/browser/debugEditorContribution.js +5 -2
  168. package/dist/vscode/vs/workbench/contrib/debug/browser/debugHover.js +33 -6
  169. package/dist/vscode/vs/workbench/contrib/debug/browser/debugSession.js +1 -1
  170. package/dist/vscode/vs/workbench/contrib/debug/browser/debugTaskRunner.js +1 -1
  171. package/dist/vscode/vs/workbench/contrib/debug/browser/repl.js +3 -3
  172. package/dist/vscode/vs/workbench/contrib/debug/common/debugModel.js +29 -17
  173. package/dist/vscode/vs/workbench/contrib/debug/common/debugStorage.js +11 -10
  174. package/dist/vscode/vs/workbench/contrib/debug/common/debugger.js +10 -6
  175. package/dist/vscode/vs/workbench/contrib/extensions/browser/extensionsActions.js +2514 -0
  176. package/dist/vscode/vs/workbench/contrib/extensions/browser/extensionsIcons.js +82 -0
  177. package/dist/vscode/vs/workbench/contrib/extensions/browser/media/extensionActions.css.js +4 -0
  178. package/dist/vscode/vs/workbench/contrib/extensions/common/extensions.js +6 -1
  179. package/dist/vscode/vs/workbench/contrib/extensions/common/extensionsFileTemplate.js +16 -0
  180. package/dist/vscode/vs/workbench/contrib/files/browser/editors/fileEditorInput.js +2 -3
  181. package/dist/vscode/vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler.js +2 -0
  182. package/dist/vscode/vs/workbench/contrib/files/browser/explorerService.js +10 -6
  183. package/dist/vscode/vs/workbench/contrib/files/browser/explorerViewlet.js +3 -18
  184. package/dist/vscode/vs/workbench/contrib/files/browser/fileActions.contribution.js +37 -2
  185. package/dist/vscode/vs/workbench/contrib/files/browser/fileActions.js +65 -3
  186. package/dist/vscode/vs/workbench/contrib/files/browser/fileCommands.js +3 -3
  187. package/dist/vscode/vs/workbench/contrib/files/browser/fileConstants.js +3 -1
  188. package/dist/vscode/vs/workbench/contrib/files/browser/files.contribution.js +41 -6
  189. package/dist/vscode/vs/workbench/contrib/files/browser/files.js +1 -0
  190. package/dist/vscode/vs/workbench/contrib/files/browser/views/explorerView.js +3 -3
  191. package/dist/vscode/vs/workbench/contrib/files/browser/views/explorerViewer.js +6 -2
  192. package/dist/vscode/vs/workbench/contrib/files/common/explorerModel.js +16 -9
  193. package/dist/vscode/vs/workbench/contrib/files/common/files.js +1 -6
  194. package/dist/vscode/vs/workbench/contrib/interactive/browser/interactiveDocumentService.js +3 -0
  195. package/dist/vscode/vs/workbench/contrib/interactive/browser/interactiveEditorInput.js +200 -0
  196. package/dist/vscode/vs/workbench/contrib/interactive/browser/interactiveHistoryService.js +3 -0
  197. package/dist/vscode/vs/workbench/contrib/markers/browser/markers.contribution.js +586 -0
  198. package/dist/vscode/vs/workbench/contrib/markers/browser/markersFilterOptions.js +75 -0
  199. package/dist/vscode/vs/workbench/contrib/markers/browser/markersModel.js +201 -0
  200. package/dist/vscode/vs/workbench/contrib/markers/browser/markersTable.js +451 -0
  201. package/dist/vscode/vs/workbench/contrib/markers/browser/markersTreeViewer.js +670 -0
  202. package/dist/vscode/vs/workbench/contrib/markers/browser/markersView.js +857 -0
  203. package/dist/vscode/vs/workbench/contrib/markers/browser/markersViewActions.css.js +4 -0
  204. package/dist/vscode/vs/workbench/contrib/markers/browser/markersViewActions.js +132 -0
  205. package/dist/vscode/vs/workbench/contrib/markers/browser/media/markers.css.js +4 -0
  206. package/dist/vscode/vs/workbench/contrib/markers/browser/messages.js +171 -0
  207. package/dist/vscode/vs/workbench/contrib/markers/common/markers.js +15 -1
  208. package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput.js +135 -0
  209. package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +421 -0
  210. package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/mergeMarkers/mergeMarkersController.js +5 -0
  211. package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/model/diffComputer.js +55 -0
  212. package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/model/editing.js +54 -0
  213. package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/model/lineRange.js +108 -0
  214. package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/model/mapping.js +334 -0
  215. package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel.js +606 -0
  216. package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/model/modifiedBaseRange.js +307 -0
  217. package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/model/rangeUtils.js +36 -0
  218. package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/model/textModelDiffs.js +165 -0
  219. package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/telemetry.js +78 -0
  220. package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/utils.js +68 -0
  221. package/dist/vscode/vs/workbench/contrib/mergeEditor/common/mergeEditor.js +2 -0
  222. package/dist/vscode/vs/workbench/contrib/notebook/browser/contrib/find/findFilters.js +70 -0
  223. package/dist/vscode/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.css.js +4 -0
  224. package/dist/vscode/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.js +158 -0
  225. package/dist/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser.js +6 -1
  226. package/dist/vscode/vs/workbench/contrib/notebook/browser/services/notebookEditorService.js +3 -0
  227. package/dist/vscode/vs/workbench/contrib/notebook/common/notebookCommon.js +16 -1
  228. package/dist/vscode/vs/workbench/contrib/notebook/common/notebookService.js +3 -0
  229. package/dist/vscode/vs/workbench/contrib/output/browser/logViewer.js +64 -0
  230. package/dist/vscode/vs/workbench/contrib/output/browser/output.contribution.js +378 -0
  231. package/dist/vscode/vs/workbench/contrib/output/browser/outputServices.js +39 -3
  232. package/dist/vscode/vs/workbench/contrib/output/browser/outputView.js +220 -0
  233. package/dist/vscode/vs/workbench/contrib/output/common/outputChannelModel.js +12 -3
  234. package/dist/vscode/vs/workbench/contrib/output/common/outputLinkComputer.js +129 -0
  235. package/dist/vscode/vs/workbench/contrib/preferences/browser/keybindingWidgets.js +270 -0
  236. package/dist/vscode/vs/workbench/contrib/preferences/browser/keybindingsEditor.js +1080 -0
  237. package/dist/vscode/vs/workbench/contrib/preferences/browser/media/keybindings.css.js +4 -0
  238. package/dist/vscode/vs/workbench/contrib/preferences/browser/media/keybindingsEditor.css.js +4 -0
  239. package/dist/vscode/vs/workbench/contrib/preferences/browser/media/preferences.css.js +4 -0
  240. package/dist/vscode/vs/workbench/contrib/preferences/browser/media/settingsEditor2.css.js +4 -0
  241. package/dist/vscode/vs/workbench/contrib/preferences/browser/media/settingsWidgets.css.js +4 -0
  242. package/dist/vscode/vs/workbench/contrib/preferences/browser/preferences.contribution.js +1154 -0
  243. package/dist/vscode/vs/workbench/contrib/preferences/browser/preferencesActions.js +94 -0
  244. package/dist/vscode/vs/workbench/contrib/preferences/browser/preferencesEditor.js +47 -0
  245. package/dist/vscode/vs/workbench/contrib/preferences/browser/preferencesIcons.js +37 -0
  246. package/dist/vscode/vs/workbench/contrib/preferences/browser/preferencesRenderers.js +731 -0
  247. package/dist/vscode/vs/workbench/contrib/preferences/browser/preferencesSearch.js +271 -0
  248. package/dist/vscode/vs/workbench/contrib/preferences/browser/preferencesWidgets.js +479 -0
  249. package/dist/vscode/vs/workbench/contrib/preferences/browser/settingsEditor2.js +1465 -0
  250. package/dist/vscode/vs/workbench/contrib/preferences/browser/settingsEditorSettingIndicators.js +506 -0
  251. package/dist/vscode/vs/workbench/contrib/preferences/browser/settingsLayout.js +296 -0
  252. package/dist/vscode/vs/workbench/contrib/preferences/browser/settingsSearchMenu.js +79 -0
  253. package/dist/vscode/vs/workbench/contrib/preferences/browser/settingsTree.js +1984 -0
  254. package/dist/vscode/vs/workbench/contrib/preferences/browser/settingsTreeModels.js +759 -0
  255. package/dist/vscode/vs/workbench/contrib/preferences/browser/settingsWidgets.js +1008 -0
  256. package/dist/vscode/vs/workbench/contrib/preferences/browser/tocTree.js +196 -0
  257. package/dist/vscode/vs/workbench/contrib/preferences/common/preferences.js +68 -0
  258. package/dist/vscode/vs/workbench/contrib/preferences/common/preferencesContribution.js +157 -0
  259. package/dist/vscode/vs/workbench/contrib/preferences/common/settingsEditorColorRegistry.js +67 -0
  260. package/dist/vscode/vs/workbench/contrib/quickaccess/browser/commandsQuickAccess.js +16 -16
  261. package/dist/vscode/vs/workbench/contrib/quickaccess/browser/quickAccess.contribution.js +1 -2
  262. package/dist/vscode/vs/workbench/contrib/remote/browser/remoteExplorer.js +23 -2
  263. package/dist/vscode/vs/workbench/contrib/remote/browser/tunnelView.js +5 -5
  264. package/dist/vscode/vs/workbench/contrib/search/browser/media/searchview.css.js +4 -0
  265. package/dist/vscode/vs/workbench/contrib/search/browser/patternInputWidget.js +217 -0
  266. package/dist/vscode/vs/workbench/contrib/search/browser/replace.js +3 -0
  267. package/dist/vscode/vs/workbench/contrib/search/browser/replaceContributions.js +7 -0
  268. package/dist/vscode/vs/workbench/contrib/search/browser/replaceService.js +222 -0
  269. package/dist/vscode/vs/workbench/contrib/search/browser/search.contribution.js +54 -15
  270. package/dist/vscode/vs/workbench/contrib/search/browser/searchActionsBase.js +17 -0
  271. package/dist/vscode/vs/workbench/contrib/search/browser/searchFindInput.js +41 -0
  272. package/dist/vscode/vs/workbench/contrib/search/browser/searchIcons.js +35 -0
  273. package/dist/vscode/vs/workbench/contrib/search/browser/searchMessage.js +58 -0
  274. package/dist/vscode/vs/workbench/contrib/search/browser/searchModel.js +1842 -0
  275. package/dist/vscode/vs/workbench/contrib/search/browser/searchNotebookHelpers.js +49 -0
  276. package/dist/vscode/vs/workbench/contrib/search/browser/searchResultsView.js +379 -0
  277. package/dist/vscode/vs/workbench/contrib/search/browser/searchView.js +1867 -0
  278. package/dist/vscode/vs/workbench/contrib/search/browser/searchWidget.js +628 -0
  279. package/dist/vscode/vs/workbench/contrib/search/common/constants.js +30 -1
  280. package/dist/vscode/vs/workbench/contrib/search/common/search.js +9 -1
  281. package/dist/vscode/vs/workbench/contrib/search/common/searchHistoryService.js +42 -0
  282. package/dist/vscode/vs/workbench/contrib/searchEditor/browser/constants.js +11 -0
  283. package/dist/vscode/vs/workbench/contrib/searchEditor/browser/media/searchEditor.css.js +4 -0
  284. package/dist/vscode/vs/workbench/contrib/searchEditor/browser/searchEditor.contribution.js +477 -0
  285. package/dist/vscode/vs/workbench/contrib/searchEditor/browser/searchEditor.js +697 -0
  286. package/dist/vscode/vs/workbench/contrib/searchEditor/browser/searchEditorActions.js +188 -0
  287. package/dist/vscode/vs/workbench/contrib/searchEditor/browser/searchEditorInput.js +295 -0
  288. package/dist/vscode/vs/workbench/contrib/searchEditor/browser/searchEditorModel.js +135 -0
  289. package/dist/vscode/vs/workbench/contrib/searchEditor/browser/searchEditorSerialization.js +268 -0
  290. package/dist/vscode/vs/workbench/contrib/snippets/browser/tabCompletion.js +2 -2
  291. package/dist/vscode/vs/workbench/contrib/tasks/common/taskService.js +16 -1
  292. package/dist/vscode/vs/workbench/contrib/terminal/browser/environmentVariableInfo.js +119 -0
  293. package/dist/vscode/vs/workbench/contrib/terminal/browser/media/scrollbar.css.js +4 -0
  294. package/dist/vscode/vs/workbench/contrib/terminal/browser/media/terminal.css.js +4 -0
  295. package/dist/vscode/vs/workbench/contrib/terminal/browser/media/widgets.css.js +4 -0
  296. package/dist/vscode/vs/workbench/contrib/terminal/browser/media/xterm.css.js +4 -0
  297. package/dist/vscode/vs/workbench/contrib/terminal/browser/terminal.contribution.js +238 -0
  298. package/dist/vscode/vs/workbench/contrib/terminal/browser/terminal.js +4 -1
  299. package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalActions.js +1930 -0
  300. package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalCommands.js +22 -0
  301. package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalConfigHelper.js +213 -0
  302. package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalContextMenu.js +17 -0
  303. package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalEditor.js +186 -0
  304. package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalEditorInput.js +199 -0
  305. package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalEditorService.js +239 -0
  306. package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalExtensions.js +22 -0
  307. package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalGroup.js +482 -0
  308. package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalGroupService.js +372 -0
  309. package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalIcon.js +60 -1
  310. package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalIcons.js +37 -0
  311. package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalInstance.js +2123 -0
  312. package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalInstanceService.js +79 -0
  313. package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalMainContribution.js +82 -0
  314. package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalMenus.js +850 -0
  315. package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalProcessExtHostProxy.js +142 -0
  316. package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalProcessManager.js +618 -0
  317. package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalProfileQuickpick.js +278 -0
  318. package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalProfileResolverService.js +417 -0
  319. package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalProfileService.js +213 -0
  320. package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalQuickAccess.js +144 -0
  321. package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalRunRecentQuickPick.js +267 -0
  322. package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalService.js +1063 -0
  323. package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalStatusList.js +108 -0
  324. package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalTabbedView.js +417 -0
  325. package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalTabsList.js +680 -0
  326. package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalTooltip.js +72 -0
  327. package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalUri.js +39 -0
  328. package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalView.js +535 -0
  329. package/dist/vscode/vs/workbench/contrib/terminal/browser/widgets/widgetManager.js +36 -0
  330. package/dist/vscode/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.js +469 -0
  331. package/dist/vscode/vs/workbench/contrib/terminal/browser/xterm/decorationStyles.js +97 -0
  332. package/dist/vscode/vs/workbench/contrib/terminal/browser/xterm/lineDataEventAddon.js +56 -0
  333. package/dist/vscode/vs/workbench/contrib/terminal/browser/xterm/markNavigationAddon.js +416 -0
  334. package/dist/vscode/vs/workbench/contrib/terminal/browser/xterm/suggestAddon.js +390 -0
  335. package/dist/vscode/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.js +587 -0
  336. package/dist/vscode/vs/workbench/contrib/terminal/common/environmentVariable.js +3 -0
  337. package/dist/vscode/vs/workbench/contrib/terminal/common/environmentVariableService.js +94 -0
  338. package/dist/vscode/vs/workbench/contrib/terminal/common/history.js +356 -0
  339. package/dist/vscode/vs/workbench/contrib/terminal/common/terminal.js +266 -0
  340. package/dist/vscode/vs/workbench/contrib/terminal/common/terminalColorRegistry.js +23 -16
  341. package/dist/vscode/vs/workbench/contrib/terminal/common/terminalConfiguration.js +965 -0
  342. package/dist/vscode/vs/workbench/contrib/terminal/common/terminalContextKey.js +157 -0
  343. package/dist/vscode/vs/workbench/contrib/terminal/common/terminalEnvironment.js +272 -0
  344. package/dist/vscode/vs/workbench/contrib/terminal/common/terminalExtensionPoints.js +27 -0
  345. package/dist/vscode/vs/workbench/contrib/terminal/common/terminalStrings.js +86 -0
  346. package/dist/vscode/vs/workbench/contrib/terminal/electron-sandbox/terminalProfileResolverService.js +46 -0
  347. package/dist/vscode/vs/workbench/contrib/terminalContrib/links/browser/links.js +3 -0
  348. package/dist/vscode/vs/workbench/contrib/terminalContrib/links/browser/terminalLinkProviderService.js +26 -0
  349. package/dist/vscode/vs/workbench/contrib/terminalContrib/quickFix/browser/quickFix.js +3 -0
  350. package/dist/vscode/vs/workbench/contrib/terminalContrib/quickFix/browser/terminalQuickFixService.js +143 -0
  351. package/dist/vscode/vs/workbench/contrib/webviewPanel/browser/webviewEditorInput.js +85 -0
  352. package/dist/vscode/vs/workbench/contrib/webviewPanel/browser/webviewWorkbenchService.js +52 -0
  353. package/dist/vscode/vs/workbench/services/actions/common/menusExtensionPoint.js +14 -6
  354. package/dist/vscode/vs/workbench/services/assignment/common/assignmentService.js +3 -0
  355. package/dist/vscode/vs/workbench/services/configuration/browser/configurationService.js +13 -13
  356. package/dist/vscode/vs/workbench/services/configuration/common/configuration.js +2 -1
  357. package/dist/vscode/vs/workbench/services/configuration/common/configurationEditing.js +2 -2
  358. package/dist/vscode/vs/workbench/services/configuration/common/jsonEditingService.js +2 -2
  359. package/dist/vscode/vs/workbench/services/dialogs/browser/abstractFileDialogService.js +302 -0
  360. package/dist/vscode/vs/workbench/services/dialogs/browser/simpleFileDialog.js +971 -0
  361. package/dist/vscode/vs/workbench/services/extensionManagement/common/extensionManagement.js +3 -2
  362. package/dist/vscode/vs/workbench/services/extensionRecommendations/common/extensionRecommendations.js +4 -0
  363. package/dist/vscode/vs/workbench/services/extensionRecommendations/common/workspaceExtensionsConfig.js +2 -0
  364. package/dist/vscode/vs/workbench/services/extensions/common/extensionManifestPropertiesService.js +3 -0
  365. package/dist/vscode/vs/workbench/services/extensions/common/extensions.js +14 -2
  366. package/dist/vscode/vs/workbench/services/extensions/common/extensionsApiProposals.js +10 -1
  367. package/dist/vscode/vs/workbench/services/filesConfiguration/common/filesConfigurationService.js +70 -3
  368. package/dist/vscode/vs/workbench/services/hover/browser/hoverService.js +1 -1
  369. package/dist/vscode/vs/workbench/services/hover/browser/hoverWidget.js +2 -1
  370. package/dist/vscode/vs/workbench/services/hover/browser/media/hover.css.js +1 -1
  371. package/dist/vscode/vs/workbench/services/keybinding/common/keybindingEditing.js +275 -0
  372. package/dist/vscode/vs/workbench/services/localization/common/locale.js +3 -0
  373. package/dist/vscode/vs/workbench/services/log/common/logConstants.js +2 -0
  374. package/dist/vscode/vs/workbench/services/output/common/output.js +4 -1
  375. package/dist/vscode/vs/workbench/services/preferences/common/preferences.js +22 -1
  376. package/dist/vscode/vs/workbench/services/preferences/common/preferencesModels.js +6 -0
  377. package/dist/vscode/vs/workbench/services/preferences/common/preferencesValidation.js +37 -1
  378. package/dist/vscode/vs/workbench/services/remote/common/remoteAgentService.js +69 -0
  379. package/dist/vscode/vs/workbench/services/remote/common/remoteExplorerService.js +66 -27
  380. package/dist/vscode/vs/workbench/services/search/common/fileSearchManager.js +265 -0
  381. package/dist/vscode/vs/workbench/services/search/common/queryBuilder.js +6 -0
  382. package/dist/vscode/vs/workbench/services/search/common/replace.js +203 -0
  383. package/dist/vscode/vs/workbench/services/search/common/search.js +227 -1
  384. package/dist/vscode/vs/workbench/services/search/common/searchExtTypes.js +6 -0
  385. package/dist/vscode/vs/workbench/services/search/common/searchHelpers.js +72 -0
  386. package/dist/vscode/vs/workbench/services/search/common/searchService.js +355 -0
  387. package/dist/vscode/vs/workbench/services/search/common/textSearchManager.js +309 -0
  388. package/dist/vscode/vs/workbench/services/suggest/browser/media/suggest.css.js +4 -0
  389. package/dist/vscode/vs/workbench/services/suggest/browser/simpleCompletionItem.js +10 -0
  390. package/dist/vscode/vs/workbench/services/suggest/browser/simpleCompletionModel.js +98 -0
  391. package/dist/vscode/vs/workbench/services/suggest/browser/simpleSuggestWidget.js +399 -0
  392. package/dist/vscode/vs/workbench/services/suggest/browser/simpleSuggestWidgetRenderer.js +83 -0
  393. package/dist/vscode/vs/workbench/services/terminal/common/embedderTerminalService.js +3 -0
  394. package/dist/vscode/vs/workbench/services/textfile/browser/textFileService.js +1 -1
  395. package/dist/vscode/vs/workbench/services/textfile/common/textFileEditorModel.js +10 -3
  396. package/dist/vscode/vs/workbench/services/themes/browser/fileIconThemeData.js +3 -3
  397. package/dist/vscode/vs/workbench/services/themes/browser/productIconThemeData.js +3 -3
  398. package/dist/vscode/vs/workbench/services/themes/common/colorThemeData.js +3 -3
  399. package/dist/vscode/vs/workbench/services/untitled/common/untitledTextEditorInput.js +6 -4
  400. package/dist/vscode/vs/workbench/services/untitled/common/untitledTextEditorModel.js +3 -0
  401. package/dist/vscode/vs/workbench/services/untitled/common/untitledTextEditorService.js +4 -0
  402. package/dist/vscode/vs/workbench/services/userActivity/common/userActivityRegistry.js +15 -0
  403. package/dist/vscode/vs/workbench/services/userActivity/common/userActivityService.js +37 -0
  404. package/dist/vscode/vs/workbench/services/userDataSync/common/userDataSync.js +7 -0
  405. package/dist/vscode/vs/workbench/services/workingCopy/common/workingCopyEditorService.js +40 -0
  406. package/dist/vscode/vs/workbench/services/workingCopy/common/workingCopyService.js +12 -0
  407. package/dist/vscode/vs/workbench/services/workspaces/common/canonicalUriService.js +19 -0
  408. package/dist/vscode-default-extensions/css/syntaxes/css.tmLanguage.json.extensionResource.js +1 -1
  409. package/dist/vscode-default-extensions/json/package.json.js +1 -1
  410. package/dist/vscode-default-extensions/json/syntaxes/JSONC.tmLanguage.json.extensionResource.js +1 -1
  411. package/dist/vscode-default-extensions/json/syntaxes/JSONL.tmLanguage.json.extensionResource.js +2 -0
  412. package/dist/vscode-default-extensions/latex/syntaxes/Bibtex.tmLanguage.json.extensionResource.js +1 -1
  413. package/dist/vscode-default-extensions/latex/syntaxes/LaTeX.tmLanguage.json.extensionResource.js +1 -1
  414. package/dist/vscode-default-extensions/latex/syntaxes/TeX.tmLanguage.json.extensionResource.js +1 -1
  415. package/dist/vscode-default-extensions/latex/syntaxes/cpp-grammar-bailout.tmLanguage.json.extensionResource.js +1 -1
  416. package/dist/vscode-default-extensions/latex/syntaxes/markdown-latex-combined.tmLanguage.json.extensionResource.js +1 -1
  417. package/dist/vscode-default-extensions/lua/syntaxes/lua.tmLanguage.json.extensionResource.js +1 -1
  418. package/dist/vscode-default-extensions/perl/package.json.js +1 -1
  419. package/dist/vscode-default-extensions/php/snippets/php.code-snippets.extensionResource.js +1 -1
  420. package/dist/vscode-default-extensions/sql/language-configuration.json.extensionResource.js +1 -1
  421. package/dist/vscode-default-extensions/theme-abyss/themes/abyss-color-theme.json.extensionResource.js +1 -1
  422. package/dist/vscode-default-extensions/theme-defaults/package.json.js +1 -1
  423. package/dist/vscode-default-extensions/theme-defaults/themes/dark_modern.json.extensionResource.js +2 -0
  424. package/dist/vscode-default-extensions/theme-defaults/themes/dark_vs.json.extensionResource.js +1 -1
  425. package/dist/vscode-default-extensions/theme-defaults/themes/hc_black.json.extensionResource.js +1 -1
  426. package/dist/vscode-default-extensions/theme-defaults/themes/hc_light.json.extensionResource.js +1 -1
  427. package/dist/vscode-default-extensions/theme-defaults/themes/light_modern.json.extensionResource.js +2 -0
  428. package/dist/vscode-default-extensions/theme-defaults/themes/light_vs.json.extensionResource.js +1 -1
  429. package/dist/vscode-default-extensions/theme-kimbie-dark/themes/kimbie-dark-color-theme.json.extensionResource.js +1 -1
  430. package/dist/vscode-default-extensions/theme-monokai/themes/monokai-color-theme.json.extensionResource.js +1 -1
  431. package/dist/vscode-default-extensions/theme-monokai-dimmed/themes/dimmed-monokai-color-theme.json.extensionResource.js +1 -1
  432. package/dist/vscode-default-extensions/theme-quietlight/themes/quietlight-color-theme.json.extensionResource.js +1 -1
  433. package/dist/vscode-default-extensions/theme-red/themes/Red-color-theme.json.extensionResource.js +1 -1
  434. package/dist/vscode-default-extensions/theme-seti/icons/vs-seti-icon-theme.json.extensionResource.js +1 -1
  435. package/dist/vscode-default-extensions/theme-solarized-dark/themes/solarized-dark-color-theme.json.extensionResource.js +1 -1
  436. package/dist/vscode-default-extensions/theme-solarized-light/themes/solarized-light-color-theme.json.extensionResource.js +1 -1
  437. package/dist/vscode-default-extensions/theme-tomorrow-night-blue/themes/tomorrow-night-blue-color-theme.json.extensionResource.js +1 -1
  438. package/dist/vscode-default-extensions/vb/language-configuration.json.extensionResource.js +1 -1
  439. package/dist/vscode-services/env.js +4 -2
  440. package/dist/vscode-services/extHost.js +32 -48
  441. package/dist/vscode-services/missing-services.js +407 -29
  442. package/dist/vscode-services/window.js +59 -65
  443. package/dist/vscode-services/workspace.js +19 -5
  444. package/dist/workers/outputLinkComputer.worker.d.ts +2 -0
  445. package/dist/workers/outputLinkComputer.worker.js +3 -0
  446. package/dist/workspace.d.ts +1 -1
  447. package/monaco-editor-treemending.patch +1305 -1184
  448. package/package.json +65 -19
  449. package/dist/activity.d.ts +0 -2802
  450. package/dist/collections.d.ts +0 -7
  451. package/dist/colorRegistry.d.ts +0 -710
  452. package/dist/vscode/vs/platform/product/common/product.js +0 -48
  453. package/dist/vscode/vs/workbench/contrib/interactiveSession/browser/interactiveSessionFollowups.js +0 -30
  454. package/dist/vscode/vs/workbench/contrib/interactiveSession/browser/interactiveSessionInputPart.js +0 -196
  455. package/dist/vscode/vs/workbench/contrib/interactiveSession/browser/interactiveSessionListRenderer.js +0 -622
  456. package/dist/vscode/vs/workbench/contrib/interactiveSession/browser/interactiveSessionOptions.js +0 -77
  457. package/dist/vscode/vs/workbench/contrib/interactiveSession/browser/interactiveSessionWidget.js +0 -311
  458. package/dist/vscode/vs/workbench/contrib/interactiveSession/browser/media/interactiveSession.css.js +0 -4
  459. package/dist/vscode/vs/workbench/contrib/interactiveSession/common/interactiveSessionContextKeys.js +0 -56
  460. package/dist/vscode/vs/workbench/contrib/interactiveSession/common/interactiveSessionModel.js +0 -305
  461. package/dist/vscode/vs/workbench/contrib/interactiveSession/common/interactiveSessionService.js +0 -13
  462. package/dist/vscode/vs/workbench/contrib/interactiveSession/common/interactiveSessionServiceImpl.js +0 -379
  463. package/dist/vscode/vs/workbench/contrib/interactiveSession/common/interactiveSessionViewModel.js +0 -207
  464. package/dist/vscode/vs/workbench/contrib/interactiveSession/common/interactiveSessionWidgetHistoryService.js +0 -3
  465. package/dist/vscode/vs/workbench/contrib/interactiveSession/common/interactiveSessionWordCounter.js +0 -25
  466. package/dist/vscode-default-extensions/theme-defaults/themes/dark_plus_experimental.json.extensionResource.js +0 -2
  467. package/dist/vscode-default-extensions/theme-defaults/themes/light_plus_experimental.json.extensionResource.js +0 -2
@@ -0,0 +1,2514 @@
1
+ import { __decorate, __param } from '../../../../../../node_modules/tslib/tslib.es6.js';
2
+ import './media/extensionActions.css.js';
3
+ import { localize } from 'monaco-editor/esm/vs/nls.js';
4
+ import { Action, Separator, SubmenuAction } from 'monaco-editor/esm/vs/base/common/actions.js';
5
+ import { Throttler, Delayer } 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 { VIEWLET_ID, INSTALL_ACTIONS_GROUP, THEME_ACTIONS_GROUP, IExtensionsWorkbenchService, SELECT_INSTALL_VSIX_EXTENSION_COMMAND_ID, TOGGLE_IGNORE_EXTENSION_ACTION_ID } from '../common/extensions.js';
12
+ import { ExtensionsConfigurationInitialContent } from '../common/extensionsFileTemplate.js';
13
+ import { TargetPlatformToString, ExtensionManagementErrorCode, IExtensionGalleryService } from '../../../../platform/extensionManagement/common/extensionManagement.js';
14
+ import { IExtensionManagementServerService, IWorkbenchExtensionManagementService, 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 } 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 { IDialogService } from 'monaco-editor/esm/vs/platform/dialogs/common/dialogs.js';
45
+ import { ActionViewItem } from 'monaco-editor/esm/vs/base/browser/ui/actionbar/actionViewItems.js';
46
+ import { EXTENSIONS_CONFIG } from '../../../services/extensionRecommendations/common/workspaceExtensionsConfig.js';
47
+ import { isCancellationError, getErrorMessage } from 'monaco-editor/esm/vs/base/common/errors.js';
48
+ import { IUserDataSyncEnablementService } from '../../../../platform/userDataSync/common/userDataSync.js';
49
+ import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
50
+ import { manageExtensionIcon, syncIgnoredIcon, syncEnabledIcon, errorIcon, warningIcon, infoIcon, preReleaseIcon, trustIcon } from './extensionsIcons.js';
51
+ import { language, isWeb, isIOS } from 'monaco-editor/esm/vs/base/common/platform.js';
52
+ import { IExtensionManifestPropertiesService } from '../../../services/extensions/common/extensionManifestPropertiesService.js';
53
+ import { IWorkspaceTrustEnablementService, IWorkspaceTrustManagementService } from 'monaco-editor/esm/vs/platform/workspace/common/workspaceTrust.js';
54
+ import { isVirtualWorkspace } from '../../../../platform/workspace/common/virtualWorkspace.js';
55
+ import { MarkdownString, escapeMarkdownSyntaxTokens } from 'monaco-editor/esm/vs/base/common/htmlContent.js';
56
+ import { IPaneCompositePartService } from '../../../services/panecomposite/browser/panecomposite.js';
57
+ import { fromNow } from '../../../../base/common/date.js';
58
+ import { IPreferencesService } from '../../../services/preferences/common/preferences.js';
59
+ import { getLocale } from '../../../../platform/languagePacks/common/languagePacks.js';
60
+ import { ILocaleService } from '../../../services/localization/common/locale.js';
61
+ import { isString } from 'monaco-editor/esm/vs/base/common/types.js';
62
+ import { showWindowLogActionId } from '../../../services/log/common/logConstants.js';
63
+ import { ITelemetryService } from 'monaco-editor/esm/vs/platform/telemetry/common/telemetry.js';
64
+ let PromptExtensionInstallFailureAction = class PromptExtensionInstallFailureAction extends Action {
65
+ constructor(extension, version, installOperation, installOptions, error, productService, openerService, notificationService, dialogService, commandService, logService, extensionManagementServerService, instantiationService, galleryService, extensionManifestPropertiesService) {
66
+ super('extension.promptExtensionInstallFailure');
67
+ this.extension = extension;
68
+ this.version = version;
69
+ this.installOperation = installOperation;
70
+ this.installOptions = installOptions;
71
+ this.error = error;
72
+ this.productService = productService;
73
+ this.openerService = openerService;
74
+ this.notificationService = notificationService;
75
+ this.dialogService = dialogService;
76
+ this.commandService = commandService;
77
+ this.logService = logService;
78
+ this.extensionManagementServerService = extensionManagementServerService;
79
+ this.instantiationService = instantiationService;
80
+ this.galleryService = galleryService;
81
+ this.extensionManifestPropertiesService = extensionManifestPropertiesService;
82
+ }
83
+ async run() {
84
+ if (isCancellationError(this.error)) {
85
+ return;
86
+ }
87
+ this.logService.error(this.error);
88
+ if (this.error.name === ExtensionManagementErrorCode.Unsupported) {
89
+ const productName = isWeb ? ( (localize('VS Code for Web', "{0} for the Web", this.productService.nameLong))) : this.productService.nameLong;
90
+ const message = ( (localize(
91
+ 'cannot be installed',
92
+ "The '{0}' extension is not available in {1}. Click 'More Information' to learn more.",
93
+ this.extension.displayName || this.extension.identifier.id,
94
+ productName
95
+ )));
96
+ const { confirmed } = await this.dialogService.confirm({
97
+ type: Severity.Info,
98
+ message,
99
+ primaryButton: ( (localize(
100
+ { key: 'more information', comment: ['&& denotes a mnemonic'] },
101
+ "&&More Information"
102
+ ))),
103
+ cancelButton: ( (localize('close', "Close")))
104
+ });
105
+ if (confirmed) {
106
+ this.openerService.open(isWeb ? ( (URI.parse('https://aka.ms/vscode-web-extensions-guide'))) : ( (URI.parse('https://aka.ms/vscode-remote'))));
107
+ }
108
+ return;
109
+ }
110
+ if ([ExtensionManagementErrorCode.Incompatible, ExtensionManagementErrorCode.IncompatibleTargetPlatform, ExtensionManagementErrorCode.Malicious, ExtensionManagementErrorCode.ReleaseVersionNotFound, ExtensionManagementErrorCode.Deprecated].includes(this.error.name)) {
111
+ await this.dialogService.info(getErrorMessage(this.error));
112
+ return;
113
+ }
114
+ if (ExtensionManagementErrorCode.Signature === this.error.name) {
115
+ await this.dialogService.prompt({
116
+ type: 'error',
117
+ message: ( (localize(
118
+ 'signature verification failed',
119
+ "{0} cannot verify the '{1}' extension. Are you sure you want to install it?",
120
+ this.productService.nameLong,
121
+ this.extension.displayName || this.extension.identifier.id
122
+ ))),
123
+ buttons: [{
124
+ label: ( (localize('install anyway', "Install Anyway"))),
125
+ run: () => {
126
+ const installAction = this.installOptions?.isMachineScoped ? this.instantiationService.createInstance(InstallAction, { donotVerifySignature: true }) : this.instantiationService.createInstance(InstallAndSyncAction, { donotVerifySignature: true });
127
+ installAction.extension = this.extension;
128
+ return installAction.run();
129
+ }
130
+ }],
131
+ cancelButton: ( (localize('cancel', "Cancel")))
132
+ });
133
+ return;
134
+ }
135
+ let operationMessage = this.installOperation === 3 ? ( (localize(
136
+ 'update operation',
137
+ "Error while updating '{0}' extension.",
138
+ this.extension.displayName || this.extension.identifier.id
139
+ )))
140
+ : ( (localize(
141
+ 'install operation',
142
+ "Error while installing '{0}' extension.",
143
+ this.extension.displayName || this.extension.identifier.id
144
+ )));
145
+ let additionalMessage;
146
+ const promptChoices = [];
147
+ if (ExtensionManagementErrorCode.IncompatiblePreRelease === this.error.name) {
148
+ operationMessage = getErrorMessage(this.error);
149
+ additionalMessage = ( (localize(
150
+ 'install release version message',
151
+ "Would you like to install the release version?"
152
+ )));
153
+ promptChoices.push({
154
+ label: ( (localize('install release version', "Install Release Version"))),
155
+ run: () => {
156
+ const installAction = this.installOptions?.isMachineScoped ? this.instantiationService.createInstance(InstallAction, { installPreReleaseVersion: !!this.installOptions.installPreReleaseVersion }) : this.instantiationService.createInstance(InstallAndSyncAction, { installPreReleaseVersion: !!this.installOptions?.installPreReleaseVersion });
157
+ installAction.extension = this.extension;
158
+ return installAction.run();
159
+ }
160
+ });
161
+ }
162
+ else {
163
+ const downloadUrl = await this.getDownloadUrl();
164
+ if (downloadUrl) {
165
+ additionalMessage = ( (localize(
166
+ 'check logs',
167
+ "Please check the [log]({0}) for more details.",
168
+ `command:${showWindowLogActionId}`
169
+ )));
170
+ promptChoices.push({
171
+ label: ( (localize('download', "Try Downloading Manually..."))),
172
+ run: () => this.openerService.open(downloadUrl).then(() => {
173
+ this.notificationService.prompt(Severity.Info, ( (localize(
174
+ 'install vsix',
175
+ 'Once downloaded, please manually install the downloaded VSIX of \'{0}\'.',
176
+ this.extension.identifier.id
177
+ ))), [{
178
+ label: ( (localize('installVSIX', "Install from VSIX..."))),
179
+ run: () => this.commandService.executeCommand(SELECT_INSTALL_VSIX_EXTENSION_COMMAND_ID)
180
+ }]);
181
+ })
182
+ });
183
+ }
184
+ }
185
+ const message = `${operationMessage}${additionalMessage ? ` ${additionalMessage}` : ''}`;
186
+ this.notificationService.prompt(Severity.Error, message, promptChoices);
187
+ }
188
+ async getDownloadUrl() {
189
+ if (isIOS) {
190
+ return undefined;
191
+ }
192
+ if (!this.extension.gallery) {
193
+ return undefined;
194
+ }
195
+ if (!this.productService.extensionsGallery) {
196
+ return undefined;
197
+ }
198
+ if (!this.extensionManagementServerService.localExtensionManagementServer && !this.extensionManagementServerService.remoteExtensionManagementServer) {
199
+ return undefined;
200
+ }
201
+ let targetPlatform = this.extension.gallery.properties.targetPlatform;
202
+ if (targetPlatform !== "universal" && targetPlatform !== "undefined" && this.extensionManagementServerService.remoteExtensionManagementServer) {
203
+ try {
204
+ const manifest = await this.galleryService.getManifest(this.extension.gallery, CancellationToken.None);
205
+ if (manifest && this.extensionManifestPropertiesService.prefersExecuteOnWorkspace(manifest)) {
206
+ targetPlatform = await this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.getTargetPlatform();
207
+ }
208
+ }
209
+ catch (error) {
210
+ this.logService.error(error);
211
+ return undefined;
212
+ }
213
+ }
214
+ if (targetPlatform === "unknown" ) {
215
+ return undefined;
216
+ }
217
+ return (
218
+ (URI.parse(
219
+ `${this.productService.extensionsGallery.serviceUrl}/publishers/${this.extension.publisher}/vsextensions/${this.extension.name}/${this.version}/vspackage${targetPlatform !== "undefined" ? `?targetPlatform=${targetPlatform}` : ''}`
220
+ ))
221
+ );
222
+ }
223
+ };
224
+ PromptExtensionInstallFailureAction = ( (__decorate([
225
+ ( (__param(5, IProductService))),
226
+ ( (__param(6, IOpenerService))),
227
+ ( (__param(7, INotificationService))),
228
+ ( (__param(8, IDialogService))),
229
+ ( (__param(9, ICommandService))),
230
+ ( (__param(10, ILogService))),
231
+ ( (__param(11, IExtensionManagementServerService))),
232
+ ( (__param(12, IInstantiationService))),
233
+ ( (__param(13, IExtensionGalleryService))),
234
+ ( (__param(14, IExtensionManifestPropertiesService)))
235
+ ], PromptExtensionInstallFailureAction)));
236
+ class ExtensionAction extends Action {
237
+ constructor() {
238
+ super(...arguments);
239
+ this._extension = null;
240
+ }
241
+ get extension() { return this._extension; }
242
+ set extension(extension) { this._extension = extension; this.update(); }
243
+ }
244
+ ExtensionAction.EXTENSION_ACTION_CLASS = 'extension-action';
245
+ ExtensionAction.TEXT_ACTION_CLASS = `${ExtensionAction.EXTENSION_ACTION_CLASS} text`;
246
+ ExtensionAction.LABEL_ACTION_CLASS = `${ExtensionAction.EXTENSION_ACTION_CLASS} label`;
247
+ ExtensionAction.ICON_ACTION_CLASS = `${ExtensionAction.EXTENSION_ACTION_CLASS} icon`;
248
+ let AbstractInstallAction = class AbstractInstallAction extends ExtensionAction {
249
+ set manifest(manifest) {
250
+ this._manifest = manifest;
251
+ this.updateLabel();
252
+ }
253
+ constructor(id, options, cssClass, extensionsWorkbenchService, instantiationService, runtimeExtensionService, workbenchThemeService, labelService, dialogService, preferencesService, telemetryService) {
254
+ super(id, ( (localize('install', "Install"))), cssClass, false);
255
+ this.options = options;
256
+ this.extensionsWorkbenchService = extensionsWorkbenchService;
257
+ this.instantiationService = instantiationService;
258
+ this.runtimeExtensionService = runtimeExtensionService;
259
+ this.workbenchThemeService = workbenchThemeService;
260
+ this.labelService = labelService;
261
+ this.dialogService = dialogService;
262
+ this.preferencesService = preferencesService;
263
+ this.telemetryService = telemetryService;
264
+ this._manifest = null;
265
+ this.updateThrottler = ( (new Throttler()));
266
+ this.update();
267
+ this._register(this.labelService.onDidChangeFormatters(() => this.updateLabel(), this));
268
+ }
269
+ update() {
270
+ this.updateThrottler.queue(() => this.computeAndUpdateEnablement());
271
+ }
272
+ async computeAndUpdateEnablement() {
273
+ this.enabled = false;
274
+ if (!this.extension) {
275
+ return;
276
+ }
277
+ if (this.extension.isBuiltin) {
278
+ return;
279
+ }
280
+ if (this.extensionsWorkbenchService.canSetLanguage(this.extension)) {
281
+ return;
282
+ }
283
+ if (this.extension.state === 3 && (await this.extensionsWorkbenchService.canInstall(this.extension))) {
284
+ this.enabled = this.options.installPreReleaseVersion ? this.extension.hasPreReleaseVersion : this.extension.hasReleaseVersion;
285
+ this.updateLabel();
286
+ }
287
+ }
288
+ async run() {
289
+ if (!this.extension) {
290
+ return;
291
+ }
292
+ if (this.extension.deprecationInfo) {
293
+ let detail = ( (localize(
294
+ 'deprecated message',
295
+ "This extension is deprecated as it is no longer being maintained."
296
+ )));
297
+ let DeprecationChoice;
298
+ ( ((function(DeprecationChoice) {
299
+ DeprecationChoice[DeprecationChoice["InstallAnyway"] = 0] = "InstallAnyway";
300
+ DeprecationChoice[DeprecationChoice["ShowAlternateExtension"] = 1] = "ShowAlternateExtension";
301
+ DeprecationChoice[DeprecationChoice["ConfigureSettings"] = 2] = "ConfigureSettings";
302
+ DeprecationChoice[DeprecationChoice["Cancel"] = 3] = "Cancel";
303
+ })(DeprecationChoice || (DeprecationChoice = {}))));
304
+ const buttons = [
305
+ {
306
+ label: ( (localize('install anyway', "Install Anyway"))),
307
+ run: () => DeprecationChoice.InstallAnyway
308
+ }
309
+ ];
310
+ if (this.extension.deprecationInfo.extension) {
311
+ detail = ( (localize(
312
+ 'deprecated with alternate extension message',
313
+ "This extension is deprecated. Use the {0} extension instead.",
314
+ this.extension.deprecationInfo.extension.displayName
315
+ )));
316
+ const alternateExtension = this.extension.deprecationInfo.extension;
317
+ buttons.push({
318
+ label: ( (localize(
319
+ { key: 'Show alternate extension', comment: ['&& denotes a mnemonic'] },
320
+ "&&Open {0}",
321
+ this.extension.deprecationInfo.extension.displayName
322
+ ))),
323
+ run: async () => {
324
+ const [extension] = await this.extensionsWorkbenchService.getExtensions([{ id: alternateExtension.id, preRelease: alternateExtension.preRelease }], CancellationToken.None);
325
+ await this.extensionsWorkbenchService.open(extension);
326
+ return DeprecationChoice.ShowAlternateExtension;
327
+ }
328
+ });
329
+ }
330
+ else if (this.extension.deprecationInfo.settings) {
331
+ detail = ( (localize(
332
+ 'deprecated with alternate settings message',
333
+ "This extension is deprecated as this functionality is now built-in to VS Code."
334
+ )));
335
+ const settings = this.extension.deprecationInfo.settings;
336
+ buttons.push({
337
+ label: ( (localize(
338
+ { key: 'configure in settings', comment: ['&& denotes a mnemonic'] },
339
+ "&&Configure Settings"
340
+ ))),
341
+ run: async () => {
342
+ await this.preferencesService.openSettings({ query: ( (settings.map(setting => `@id:${setting}`))).join(' ') });
343
+ return DeprecationChoice.ConfigureSettings;
344
+ }
345
+ });
346
+ }
347
+ else if (this.extension.deprecationInfo.additionalInfo) {
348
+ detail = ( (new MarkdownString(`${detail} ${this.extension.deprecationInfo.additionalInfo}`)));
349
+ }
350
+ const { result } = await this.dialogService.prompt({
351
+ type: Severity.Warning,
352
+ message: ( (localize(
353
+ 'install confirmation',
354
+ "Are you sure you want to install '{0}'?",
355
+ this.extension.displayName
356
+ ))),
357
+ detail: isString(detail) ? detail : undefined,
358
+ custom: isString(detail) ? undefined : {
359
+ markdownDetails: [{
360
+ markdown: detail
361
+ }]
362
+ },
363
+ buttons,
364
+ cancelButton: {
365
+ run: () => DeprecationChoice.Cancel
366
+ }
367
+ });
368
+ if (result !== DeprecationChoice.InstallAnyway) {
369
+ return;
370
+ }
371
+ }
372
+ this.extensionsWorkbenchService.open(this.extension, { showPreReleaseVersion: this.options.installPreReleaseVersion });
373
+ alert(( (localize(
374
+ 'installExtensionStart',
375
+ "Installing extension {0} started. An editor is now open with more details on this extension",
376
+ this.extension.displayName
377
+ ))));
378
+ this.telemetryService.publicLog('extensions:action:install', { ...this.extension.telemetryData, actionId: this.id });
379
+ const extension = await this.install(this.extension);
380
+ if (extension?.local) {
381
+ alert(( (localize(
382
+ 'installExtensionComplete',
383
+ "Installing extension {0} is completed.",
384
+ this.extension.displayName
385
+ ))));
386
+ const runningExtension = await this.getRunningExtension(extension.local);
387
+ if (runningExtension && !(runningExtension.activationEvents && ( (runningExtension.activationEvents.some(activationEent => activationEent.startsWith('onLanguage')))))) {
388
+ const action = await this.getThemeAction(extension);
389
+ if (action) {
390
+ action.extension = extension;
391
+ try {
392
+ return action.run({ showCurrentTheme: true, ignoreFocusLost: true });
393
+ }
394
+ finally {
395
+ action.dispose();
396
+ }
397
+ }
398
+ }
399
+ }
400
+ }
401
+ async getThemeAction(extension) {
402
+ const colorThemes = await this.workbenchThemeService.getColorThemes();
403
+ if (( (colorThemes.some(theme => isThemeFromExtension(theme, extension))))) {
404
+ return this.instantiationService.createInstance(SetColorThemeAction);
405
+ }
406
+ const fileIconThemes = await this.workbenchThemeService.getFileIconThemes();
407
+ if (( (fileIconThemes.some(theme => isThemeFromExtension(theme, extension))))) {
408
+ return this.instantiationService.createInstance(SetFileIconThemeAction);
409
+ }
410
+ const productIconThemes = await this.workbenchThemeService.getProductIconThemes();
411
+ if (( (productIconThemes.some(theme => isThemeFromExtension(theme, extension))))) {
412
+ return this.instantiationService.createInstance(SetProductIconThemeAction);
413
+ }
414
+ return undefined;
415
+ }
416
+ async install(extension) {
417
+ const installOptions = this.getInstallOptions();
418
+ try {
419
+ return await this.extensionsWorkbenchService.install(extension, installOptions);
420
+ }
421
+ catch (error) {
422
+ await this.instantiationService.createInstance(PromptExtensionInstallFailureAction, extension, extension.latestVersion, 2 , installOptions, error).run();
423
+ return undefined;
424
+ }
425
+ }
426
+ async getRunningExtension(extension) {
427
+ const runningExtension = await this.runtimeExtensionService.getExtension(extension.identifier.id);
428
+ if (runningExtension) {
429
+ return runningExtension;
430
+ }
431
+ if (this.runtimeExtensionService.canAddExtension(toExtensionDescription(extension))) {
432
+ return (
433
+ (new Promise((c, e) => {
434
+ const disposable = this.runtimeExtensionService.onDidChangeExtensions(async () => {
435
+ const runningExtension = await this.runtimeExtensionService.getExtension(extension.identifier.id);
436
+ if (runningExtension) {
437
+ disposable.dispose();
438
+ c(runningExtension);
439
+ }
440
+ });
441
+ }))
442
+ );
443
+ }
444
+ return null;
445
+ }
446
+ updateLabel() {
447
+ this.label = this.getLabel();
448
+ }
449
+ getLabel(primary) {
450
+ if (this.options.installPreReleaseVersion && this.extension?.hasPreReleaseVersion) {
451
+ return primary ? ( (localize('install pre-release', "Install Pre-Release"))) : ( (localize('install pre-release version', "Install Pre-Release Version")));
452
+ }
453
+ if (this.extension?.hasPreReleaseVersion) {
454
+ return primary ? ( (localize('install', "Install"))) : ( (localize('install release version', "Install Release Version")));
455
+ }
456
+ return (
457
+ (localize('install', "Install"))
458
+ );
459
+ }
460
+ getInstallOptions() {
461
+ return this.options;
462
+ }
463
+ };
464
+ AbstractInstallAction.Class = `${ExtensionAction.LABEL_ACTION_CLASS} prominent install`;
465
+ AbstractInstallAction = ( (__decorate([
466
+ ( (__param(3, IExtensionsWorkbenchService))),
467
+ ( (__param(4, IInstantiationService))),
468
+ ( (__param(5, IExtensionService))),
469
+ ( (__param(6, IWorkbenchThemeService))),
470
+ ( (__param(7, ILabelService))),
471
+ ( (__param(8, IDialogService))),
472
+ ( (__param(9, IPreferencesService))),
473
+ ( (__param(10, ITelemetryService)))
474
+ ], AbstractInstallAction)));
475
+ let InstallAction = class InstallAction extends AbstractInstallAction {
476
+ constructor(options, extensionsWorkbenchService, instantiationService, runtimeExtensionService, workbenchThemeService, labelService, dialogService, preferencesService, extensionManagementServerService, workbenchExtensionManagementService, userDataSyncEnablementService, telemetryService) {
477
+ super(`extensions.install`, options, InstallAction.Class, extensionsWorkbenchService, instantiationService, runtimeExtensionService, workbenchThemeService, labelService, dialogService, preferencesService, telemetryService);
478
+ this.extensionManagementServerService = extensionManagementServerService;
479
+ this.workbenchExtensionManagementService = workbenchExtensionManagementService;
480
+ this.userDataSyncEnablementService = userDataSyncEnablementService;
481
+ this.updateLabel();
482
+ this._register(labelService.onDidChangeFormatters(() => this.updateLabel(), this));
483
+ this._register(Event.any(userDataSyncEnablementService.onDidChangeEnablement, Event.filter(userDataSyncEnablementService.onDidChangeResourceEnablement, e => e[0] === "extensions" ))(() => this.update()));
484
+ }
485
+ getLabel(primary) {
486
+ const baseLabel = super.getLabel(primary);
487
+ const donotSyncLabel = ( (localize('do no sync', "Do not sync")));
488
+ const isMachineScoped = this.getInstallOptions().isMachineScoped;
489
+ if (this._manifest && this.extensionManagementServerService.remoteExtensionManagementServer) {
490
+ const server = this.workbenchExtensionManagementService.getExtensionManagementServerToInstall(this._manifest);
491
+ if (server === this.extensionManagementServerService.remoteExtensionManagementServer) {
492
+ const host = this.extensionManagementServerService.remoteExtensionManagementServer.label;
493
+ return isMachineScoped
494
+ ? ( (localize({
495
+ key: 'install extension in remote and do not sync',
496
+ comment: [
497
+ 'First placeholder is install action label.',
498
+ 'Second placeholder is the name of the action to install an extension in remote server and do not sync it. Placeholder is for the name of remote server.',
499
+ 'Third placeholder is do not sync label.',
500
+ ]
501
+ }, "{0} in {1} ({2})", baseLabel, host, donotSyncLabel)))
502
+ : ( (localize({
503
+ key: 'install extension in remote',
504
+ comment: [
505
+ 'First placeholder is install action label.',
506
+ 'Second placeholder is the name of the action to install an extension in remote server and do not sync it. Placeholder is for the name of remote server.',
507
+ ]
508
+ }, "{0} in {1}", baseLabel, host)));
509
+ }
510
+ return isMachineScoped ?
511
+ ( (localize(
512
+ 'install extension locally and do not sync',
513
+ "{0} Locally ({1})",
514
+ baseLabel,
515
+ donotSyncLabel
516
+ ))) : ( (localize('install extension locally', "{0} Locally", baseLabel)));
517
+ }
518
+ return isMachineScoped ? `${baseLabel} (${donotSyncLabel})` : baseLabel;
519
+ }
520
+ getInstallOptions() {
521
+ return { ...super.getInstallOptions(), isMachineScoped: this.userDataSyncEnablementService.isEnabled() && this.userDataSyncEnablementService.isResourceEnabled("extensions" ) };
522
+ }
523
+ };
524
+ InstallAction = ( (__decorate([
525
+ ( (__param(1, IExtensionsWorkbenchService))),
526
+ ( (__param(2, IInstantiationService))),
527
+ ( (__param(3, IExtensionService))),
528
+ ( (__param(4, IWorkbenchThemeService))),
529
+ ( (__param(5, ILabelService))),
530
+ ( (__param(6, IDialogService))),
531
+ ( (__param(7, IPreferencesService))),
532
+ ( (__param(8, IExtensionManagementServerService))),
533
+ ( (__param(9, IWorkbenchExtensionManagementService))),
534
+ ( (__param(10, IUserDataSyncEnablementService))),
535
+ ( (__param(11, ITelemetryService)))
536
+ ], InstallAction)));
537
+ let InstallAndSyncAction = class InstallAndSyncAction extends AbstractInstallAction {
538
+ constructor(options, extensionsWorkbenchService, instantiationService, runtimeExtensionService, workbenchThemeService, labelService, dialogService, preferencesService, productService, userDataSyncEnablementService, telemetryService) {
539
+ super('extensions.installAndSync', options, AbstractInstallAction.Class, extensionsWorkbenchService, instantiationService, runtimeExtensionService, workbenchThemeService, labelService, dialogService, preferencesService, telemetryService);
540
+ this.userDataSyncEnablementService = userDataSyncEnablementService;
541
+ this.tooltip = ( (localize(
542
+ { key: 'install everywhere tooltip', comment: ['Placeholder is the name of the product. Eg: Visual Studio Code or Visual Studio Code - Insiders'] },
543
+ "Install this extension in all your synced {0} instances",
544
+ productService.nameLong
545
+ )));
546
+ this._register(Event.any(userDataSyncEnablementService.onDidChangeEnablement, Event.filter(userDataSyncEnablementService.onDidChangeResourceEnablement, e => e[0] === "extensions" ))(() => this.update()));
547
+ }
548
+ async computeAndUpdateEnablement() {
549
+ await super.computeAndUpdateEnablement();
550
+ if (this.enabled) {
551
+ this.enabled = this.userDataSyncEnablementService.isEnabled() && this.userDataSyncEnablementService.isResourceEnabled("extensions" );
552
+ }
553
+ }
554
+ getInstallOptions() {
555
+ return { ...super.getInstallOptions(), isMachineScoped: false };
556
+ }
557
+ };
558
+ InstallAndSyncAction = ( (__decorate([
559
+ ( (__param(1, IExtensionsWorkbenchService))),
560
+ ( (__param(2, IInstantiationService))),
561
+ ( (__param(3, IExtensionService))),
562
+ ( (__param(4, IWorkbenchThemeService))),
563
+ ( (__param(5, ILabelService))),
564
+ ( (__param(6, IDialogService))),
565
+ ( (__param(7, IPreferencesService))),
566
+ ( (__param(8, IProductService))),
567
+ ( (__param(9, IUserDataSyncEnablementService))),
568
+ ( (__param(10, ITelemetryService)))
569
+ ], InstallAndSyncAction)));
570
+ class InstallingLabelAction extends ExtensionAction {
571
+ constructor() {
572
+ super('extension.installing', InstallingLabelAction.LABEL, InstallingLabelAction.CLASS, false);
573
+ }
574
+ update() {
575
+ this.class = `${InstallingLabelAction.CLASS}${this.extension && this.extension.state === 0 ? '' : ' hide'}`;
576
+ }
577
+ }
578
+ InstallingLabelAction.LABEL = ( (localize('installing', "Installing")));
579
+ InstallingLabelAction.CLASS = `${ExtensionAction.LABEL_ACTION_CLASS} install installing`;
580
+ let InstallInOtherServerAction = class InstallInOtherServerAction extends ExtensionAction {
581
+ constructor(id, server, canInstallAnyWhere, extensionsWorkbenchService, extensionManagementServerService, extensionManifestPropertiesService) {
582
+ super(id, InstallInOtherServerAction.INSTALL_LABEL, InstallInOtherServerAction.Class, false);
583
+ this.server = server;
584
+ this.canInstallAnyWhere = canInstallAnyWhere;
585
+ this.extensionsWorkbenchService = extensionsWorkbenchService;
586
+ this.extensionManagementServerService = extensionManagementServerService;
587
+ this.extensionManifestPropertiesService = extensionManifestPropertiesService;
588
+ this.updateWhenCounterExtensionChanges = true;
589
+ this.update();
590
+ }
591
+ update() {
592
+ this.enabled = false;
593
+ this.class = InstallInOtherServerAction.Class;
594
+ if (this.canInstall()) {
595
+ const extensionInOtherServer = this.extensionsWorkbenchService.installed.filter(e => areSameExtensions(e.identifier, this.extension.identifier) && e.server === this.server)[0];
596
+ if (extensionInOtherServer) {
597
+ if (extensionInOtherServer.state === 0 && !extensionInOtherServer.local) {
598
+ this.enabled = true;
599
+ this.label = InstallInOtherServerAction.INSTALLING_LABEL;
600
+ this.class = InstallInOtherServerAction.InstallingClass;
601
+ }
602
+ }
603
+ else {
604
+ this.enabled = true;
605
+ this.label = this.getInstallLabel();
606
+ }
607
+ }
608
+ }
609
+ canInstall() {
610
+ if (!this.extension
611
+ || !this.server
612
+ || !this.extension.local
613
+ || this.extension.state !== 1
614
+ || this.extension.type !== 1
615
+ || this.extension.enablementState === 2 || this.extension.enablementState === 0 || this.extension.enablementState === 4 ) {
616
+ return false;
617
+ }
618
+ if (isLanguagePackExtension(this.extension.local.manifest)) {
619
+ return true;
620
+ }
621
+ if (this.server === this.extensionManagementServerService.localExtensionManagementServer && this.extensionManifestPropertiesService.prefersExecuteOnUI(this.extension.local.manifest)) {
622
+ return true;
623
+ }
624
+ if (this.server === this.extensionManagementServerService.remoteExtensionManagementServer && this.extensionManifestPropertiesService.prefersExecuteOnWorkspace(this.extension.local.manifest)) {
625
+ return true;
626
+ }
627
+ if (this.server === this.extensionManagementServerService.webExtensionManagementServer && this.extensionManifestPropertiesService.prefersExecuteOnWeb(this.extension.local.manifest)) {
628
+ return true;
629
+ }
630
+ if (this.canInstallAnyWhere) {
631
+ if (this.server === this.extensionManagementServerService.localExtensionManagementServer && this.extensionManifestPropertiesService.canExecuteOnUI(this.extension.local.manifest)) {
632
+ return true;
633
+ }
634
+ if (this.server === this.extensionManagementServerService.remoteExtensionManagementServer && this.extensionManifestPropertiesService.canExecuteOnWorkspace(this.extension.local.manifest)) {
635
+ return true;
636
+ }
637
+ }
638
+ return false;
639
+ }
640
+ async run() {
641
+ if (!this.extension?.local) {
642
+ return;
643
+ }
644
+ if (!this.extension?.server) {
645
+ return;
646
+ }
647
+ if (!this.server) {
648
+ return;
649
+ }
650
+ this.extensionsWorkbenchService.open(this.extension);
651
+ alert(( (localize(
652
+ 'installExtensionStart',
653
+ "Installing extension {0} started. An editor is now open with more details on this extension",
654
+ this.extension.displayName
655
+ ))));
656
+ return this.extensionsWorkbenchService.installInServer(this.extension, this.server);
657
+ }
658
+ };
659
+ InstallInOtherServerAction.INSTALL_LABEL = ( (localize('install', "Install")));
660
+ InstallInOtherServerAction.INSTALLING_LABEL = ( (localize('installing', "Installing")));
661
+ InstallInOtherServerAction.Class = `${ExtensionAction.LABEL_ACTION_CLASS} prominent install`;
662
+ InstallInOtherServerAction.InstallingClass = `${ExtensionAction.LABEL_ACTION_CLASS} install installing`;
663
+ InstallInOtherServerAction = ( (__decorate([
664
+ ( (__param(3, IExtensionsWorkbenchService))),
665
+ ( (__param(4, IExtensionManagementServerService))),
666
+ ( (__param(5, IExtensionManifestPropertiesService)))
667
+ ], InstallInOtherServerAction)));
668
+ let UninstallAction = class UninstallAction extends ExtensionAction {
669
+ constructor(extensionsWorkbenchService) {
670
+ super('extensions.uninstall', UninstallAction.UninstallLabel, UninstallAction.UninstallClass, false);
671
+ this.extensionsWorkbenchService = extensionsWorkbenchService;
672
+ this.update();
673
+ }
674
+ update() {
675
+ if (!this.extension) {
676
+ this.enabled = false;
677
+ return;
678
+ }
679
+ const state = this.extension.state;
680
+ if (state === 2 ) {
681
+ this.label = UninstallAction.UninstallingLabel;
682
+ this.class = UninstallAction.UnInstallingClass;
683
+ this.enabled = false;
684
+ return;
685
+ }
686
+ this.label = UninstallAction.UninstallLabel;
687
+ this.class = UninstallAction.UninstallClass;
688
+ this.tooltip = UninstallAction.UninstallLabel;
689
+ if (state !== 1 ) {
690
+ this.enabled = false;
691
+ return;
692
+ }
693
+ if (this.extension.isBuiltin) {
694
+ this.enabled = false;
695
+ return;
696
+ }
697
+ this.enabled = true;
698
+ }
699
+ async run() {
700
+ if (!this.extension) {
701
+ return;
702
+ }
703
+ alert(( (localize(
704
+ 'uninstallExtensionStart',
705
+ "Uninstalling extension {0} started.",
706
+ this.extension.displayName
707
+ ))));
708
+ return this.extensionsWorkbenchService.uninstall(this.extension).then(() => {
709
+ alert(( (localize(
710
+ 'uninstallExtensionComplete',
711
+ "Please reload Visual Studio Code to complete the uninstallation of the extension {0}.",
712
+ this.extension.displayName
713
+ ))));
714
+ });
715
+ }
716
+ };
717
+ UninstallAction.UninstallLabel = ( (localize('uninstallAction', "Uninstall")));
718
+ UninstallAction.UninstallingLabel = ( (localize('Uninstalling', "Uninstalling")));
719
+ UninstallAction.UninstallClass = `${ExtensionAction.LABEL_ACTION_CLASS} uninstall`;
720
+ UninstallAction.UnInstallingClass = `${ExtensionAction.LABEL_ACTION_CLASS} uninstall uninstalling`;
721
+ UninstallAction = ( (__decorate([
722
+ ( (__param(0, IExtensionsWorkbenchService)))
723
+ ], UninstallAction)));
724
+ class AbstractUpdateAction extends ExtensionAction {
725
+ constructor(id, label, extensionsWorkbenchService) {
726
+ super(id, label, AbstractUpdateAction.DisabledClass, false);
727
+ this.extensionsWorkbenchService = extensionsWorkbenchService;
728
+ this.updateThrottler = ( (new Throttler()));
729
+ this.update();
730
+ }
731
+ update() {
732
+ this.updateThrottler.queue(() => this.computeAndUpdateEnablement());
733
+ }
734
+ async computeAndUpdateEnablement() {
735
+ this.enabled = false;
736
+ this.class = UpdateAction.DisabledClass;
737
+ if (!this.extension) {
738
+ return;
739
+ }
740
+ if (this.extension.deprecationInfo) {
741
+ return;
742
+ }
743
+ const canInstall = await this.extensionsWorkbenchService.canInstall(this.extension);
744
+ const isInstalled = this.extension.state === 1 ;
745
+ this.enabled = canInstall && isInstalled && this.extension.outdated;
746
+ this.class = this.enabled ? AbstractUpdateAction.EnabledClass : AbstractUpdateAction.DisabledClass;
747
+ }
748
+ }
749
+ AbstractUpdateAction.EnabledClass = `${ExtensionAction.LABEL_ACTION_CLASS} prominent update`;
750
+ AbstractUpdateAction.DisabledClass = `${AbstractUpdateAction.EnabledClass} disabled`;
751
+ let UpdateAction = class UpdateAction extends AbstractUpdateAction {
752
+ constructor(verbose, extensionsWorkbenchService, instantiationService) {
753
+ super(`extensions.update`, ( (localize('update', "Update"))), extensionsWorkbenchService);
754
+ this.verbose = verbose;
755
+ this.instantiationService = instantiationService;
756
+ }
757
+ update() {
758
+ super.update();
759
+ if (this.extension) {
760
+ this.label = this.verbose ? ( (localize('update to', "Update to v{0}", this.extension.latestVersion))) : ( (localize('update', "Update")));
761
+ }
762
+ }
763
+ async run() {
764
+ if (!this.extension) {
765
+ return;
766
+ }
767
+ alert(( (localize(
768
+ 'updateExtensionStart',
769
+ "Updating extension {0} to version {1} started.",
770
+ this.extension.displayName,
771
+ this.extension.latestVersion
772
+ ))));
773
+ return this.install(this.extension);
774
+ }
775
+ async install(extension) {
776
+ try {
777
+ await this.extensionsWorkbenchService.install(extension, extension.local?.preRelease ? { installPreReleaseVersion: true } : undefined);
778
+ alert(( (localize(
779
+ 'updateExtensionComplete',
780
+ "Updating extension {0} to version {1} completed.",
781
+ extension.displayName,
782
+ extension.latestVersion
783
+ ))));
784
+ }
785
+ catch (err) {
786
+ this.instantiationService.createInstance(PromptExtensionInstallFailureAction, extension, extension.latestVersion, 3 , undefined, err).run();
787
+ }
788
+ }
789
+ };
790
+ UpdateAction = ( (__decorate([
791
+ ( (__param(1, IExtensionsWorkbenchService))),
792
+ ( (__param(2, IInstantiationService)))
793
+ ], UpdateAction)));
794
+ let MigrateDeprecatedExtensionAction = class MigrateDeprecatedExtensionAction extends ExtensionAction {
795
+ constructor(small, extensionsWorkbenchService) {
796
+ super('extensionsAction.migrateDeprecatedExtension', ( (localize('migrateExtension', "Migrate"))), MigrateDeprecatedExtensionAction.DisabledClass, false);
797
+ this.small = small;
798
+ this.extensionsWorkbenchService = extensionsWorkbenchService;
799
+ this.update();
800
+ }
801
+ update() {
802
+ this.enabled = false;
803
+ this.class = MigrateDeprecatedExtensionAction.DisabledClass;
804
+ if (!this.extension?.local) {
805
+ return;
806
+ }
807
+ if (this.extension.state !== 1 ) {
808
+ return;
809
+ }
810
+ if (!this.extension.deprecationInfo?.extension) {
811
+ return;
812
+ }
813
+ const id = this.extension.deprecationInfo.extension.id;
814
+ if (( (this.extensionsWorkbenchService.local.some(e => areSameExtensions(e.identifier, { id }))))) {
815
+ return;
816
+ }
817
+ this.enabled = true;
818
+ this.class = MigrateDeprecatedExtensionAction.EnabledClass;
819
+ this.tooltip = ( (localize(
820
+ 'migrate to',
821
+ "Migrate to {0}",
822
+ this.extension.deprecationInfo.extension.displayName
823
+ )));
824
+ this.label = this.small ? ( (localize('migrate', "Migrate"))) : this.tooltip;
825
+ }
826
+ async run() {
827
+ if (!this.extension?.deprecationInfo?.extension) {
828
+ return;
829
+ }
830
+ const local = this.extension.local;
831
+ await this.extensionsWorkbenchService.uninstall(this.extension);
832
+ const [extension] = await this.extensionsWorkbenchService.getExtensions([{ id: this.extension.deprecationInfo.extension.id, preRelease: this.extension.deprecationInfo?.extension?.preRelease }], CancellationToken.None);
833
+ await this.extensionsWorkbenchService.install(extension, { isMachineScoped: local?.isMachineScoped });
834
+ }
835
+ };
836
+ MigrateDeprecatedExtensionAction.EnabledClass = `${ExtensionAction.LABEL_ACTION_CLASS} migrate`;
837
+ MigrateDeprecatedExtensionAction.DisabledClass = `${MigrateDeprecatedExtensionAction.EnabledClass} disabled`;
838
+ MigrateDeprecatedExtensionAction = ( (__decorate([
839
+ ( (__param(1, IExtensionsWorkbenchService)))
840
+ ], MigrateDeprecatedExtensionAction)));
841
+ let ExtensionDropDownAction = class ExtensionDropDownAction extends ExtensionAction {
842
+ constructor(id, label, cssClass, enabled, instantiationService) {
843
+ super(id, label, cssClass, enabled);
844
+ this.instantiationService = instantiationService;
845
+ this._actionViewItem = null;
846
+ }
847
+ createActionViewItem() {
848
+ this._actionViewItem = this.instantiationService.createInstance(DropDownMenuActionViewItem, this);
849
+ return this._actionViewItem;
850
+ }
851
+ run({ actionGroups, disposeActionsOnHide }) {
852
+ this._actionViewItem?.showMenu(actionGroups, disposeActionsOnHide);
853
+ return Promise.resolve();
854
+ }
855
+ };
856
+ ExtensionDropDownAction = ( (__decorate([
857
+ ( (__param(4, IInstantiationService)))
858
+ ], ExtensionDropDownAction)));
859
+ let DropDownMenuActionViewItem = class DropDownMenuActionViewItem extends ActionViewItem {
860
+ constructor(action, contextMenuService) {
861
+ super(null, action, { icon: true, label: true });
862
+ this.contextMenuService = contextMenuService;
863
+ }
864
+ showMenu(menuActionGroups, disposeActionsOnHide) {
865
+ if (this.element) {
866
+ const actions = this.getActions(menuActionGroups);
867
+ const elementPosition = dom.getDomNodePagePosition(this.element);
868
+ const anchor = { x: elementPosition.left, y: elementPosition.top + elementPosition.height + 10 };
869
+ this.contextMenuService.showContextMenu({
870
+ getAnchor: () => anchor,
871
+ getActions: () => actions,
872
+ actionRunner: this.actionRunner,
873
+ onHide: () => { if (disposeActionsOnHide) {
874
+ disposeIfDisposable(actions);
875
+ } }
876
+ });
877
+ }
878
+ }
879
+ getActions(menuActionGroups) {
880
+ let actions = [];
881
+ for (const menuActions of menuActionGroups) {
882
+ actions = [...actions, ...menuActions, ( (new Separator()))];
883
+ }
884
+ return actions.length ? actions.slice(0, actions.length - 1) : actions;
885
+ }
886
+ };
887
+ DropDownMenuActionViewItem = ( (__decorate([
888
+ ( (__param(1, IContextMenuService)))
889
+ ], DropDownMenuActionViewItem)));
890
+ async function getContextMenuActionsGroups(extension, contextKeyService, instantiationService) {
891
+ return instantiationService.invokeFunction(async (accessor) => {
892
+ const extensionsWorkbenchService = accessor.get(IExtensionsWorkbenchService);
893
+ const menuService = accessor.get(IMenuService);
894
+ const extensionRecommendationsService = accessor.get(IExtensionRecommendationsService);
895
+ const extensionIgnoredRecommendationsService = accessor.get(IExtensionIgnoredRecommendationsService);
896
+ const workbenchThemeService = accessor.get(IWorkbenchThemeService);
897
+ const cksOverlay = [];
898
+ if (extension) {
899
+ cksOverlay.push(['extension', extension.identifier.id]);
900
+ cksOverlay.push(['isBuiltinExtension', extension.isBuiltin]);
901
+ cksOverlay.push(['extensionHasConfiguration', extension.local && !!extension.local.manifest.contributes && !!extension.local.manifest.contributes.configuration]);
902
+ cksOverlay.push(['extensionHasKeybindings', extension.local && !!extension.local.manifest.contributes && !!extension.local.manifest.contributes.keybindings]);
903
+ cksOverlay.push(['extensionHasCommands', extension.local && !!extension.local.manifest.contributes && !!extension.local.manifest.contributes?.commands]);
904
+ cksOverlay.push(['isExtensionRecommended', !!extensionRecommendationsService.getAllRecommendationsWithReason()[extension.identifier.id.toLowerCase()]]);
905
+ cksOverlay.push(['isExtensionWorkspaceRecommended', extensionRecommendationsService.getAllRecommendationsWithReason()[extension.identifier.id.toLowerCase()]?.reasonId === 0 ]);
906
+ cksOverlay.push(['isUserIgnoredRecommendation', ( (extensionIgnoredRecommendationsService.globalIgnoredRecommendations.some(e => e === extension.identifier.id.toLowerCase())))]);
907
+ if (extension.state === 1 ) {
908
+ cksOverlay.push(['extensionStatus', 'installed']);
909
+ }
910
+ cksOverlay.push(['installedExtensionIsPreReleaseVersion', !!extension.local?.isPreReleaseVersion]);
911
+ cksOverlay.push(['galleryExtensionIsPreReleaseVersion', !!extension.gallery?.properties.isPreReleaseVersion]);
912
+ cksOverlay.push(['extensionHasPreReleaseVersion', extension.hasPreReleaseVersion]);
913
+ cksOverlay.push(['extensionHasReleaseVersion', extension.hasReleaseVersion]);
914
+ const [colorThemes, fileIconThemes, productIconThemes] = await Promise.all([workbenchThemeService.getColorThemes(), workbenchThemeService.getFileIconThemes(), workbenchThemeService.getProductIconThemes()]);
915
+ cksOverlay.push(['extensionHasColorThemes', ( (colorThemes.some(theme => isThemeFromExtension(theme, extension))))]);
916
+ cksOverlay.push(['extensionHasFileIconThemes', ( (fileIconThemes.some(theme => isThemeFromExtension(theme, extension))))]);
917
+ cksOverlay.push(['extensionHasProductIconThemes', ( (productIconThemes.some(theme => isThemeFromExtension(theme, extension))))]);
918
+ cksOverlay.push(['canSetLanguage', extensionsWorkbenchService.canSetLanguage(extension)]);
919
+ cksOverlay.push(['isActiveLanguagePackExtension', extension.gallery && language === getLocale(extension.gallery)]);
920
+ }
921
+ const menu = menuService.createMenu(MenuId.ExtensionContext, contextKeyService.createOverlay(cksOverlay));
922
+ const actionsGroups = menu.getActions({ shouldForwardArgs: true });
923
+ menu.dispose();
924
+ return actionsGroups;
925
+ });
926
+ }
927
+ function toActions(actionsGroups, instantiationService) {
928
+ const result = [];
929
+ for (const [, actions] of actionsGroups) {
930
+ result.push(( (actions.map(action => {
931
+ if (action instanceof SubmenuAction) {
932
+ return action;
933
+ }
934
+ return instantiationService.createInstance(MenuItemExtensionAction, action);
935
+ }))));
936
+ }
937
+ return result;
938
+ }
939
+ let ManageExtensionAction = class ManageExtensionAction extends ExtensionDropDownAction {
940
+ constructor(instantiationService, extensionService, contextKeyService) {
941
+ super(ManageExtensionAction.ID, '', '', true, instantiationService);
942
+ this.extensionService = extensionService;
943
+ this.contextKeyService = contextKeyService;
944
+ this.tooltip = ( (localize('manage', "Manage")));
945
+ this.update();
946
+ }
947
+ async getActionGroups() {
948
+ const groups = [];
949
+ const contextMenuActionsGroups = await getContextMenuActionsGroups(this.extension, this.contextKeyService, this.instantiationService);
950
+ const themeActions = [], installActions = [], otherActionGroups = [];
951
+ for (const [group, actions] of contextMenuActionsGroups) {
952
+ if (group === INSTALL_ACTIONS_GROUP) {
953
+ installActions.push(...toActions([[group, actions]], this.instantiationService)[0]);
954
+ }
955
+ else if (group === THEME_ACTIONS_GROUP) {
956
+ themeActions.push(...toActions([[group, actions]], this.instantiationService)[0]);
957
+ }
958
+ else {
959
+ otherActionGroups.push(...toActions([[group, actions]], this.instantiationService));
960
+ }
961
+ }
962
+ if (themeActions.length) {
963
+ groups.push(themeActions);
964
+ }
965
+ groups.push([
966
+ this.instantiationService.createInstance(EnableGloballyAction),
967
+ this.instantiationService.createInstance(EnableForWorkspaceAction)
968
+ ]);
969
+ groups.push([
970
+ this.instantiationService.createInstance(DisableGloballyAction),
971
+ this.instantiationService.createInstance(DisableForWorkspaceAction)
972
+ ]);
973
+ groups.push([
974
+ ...(installActions.length ? installActions : []),
975
+ this.instantiationService.createInstance(InstallAnotherVersionAction),
976
+ this.instantiationService.createInstance(UninstallAction),
977
+ ]);
978
+ otherActionGroups.forEach(actions => groups.push(actions));
979
+ groups.forEach(group => group.forEach(extensionAction => {
980
+ if (extensionAction instanceof ExtensionAction) {
981
+ extensionAction.extension = this.extension;
982
+ }
983
+ }));
984
+ return groups;
985
+ }
986
+ async run() {
987
+ await this.extensionService.whenInstalledExtensionsRegistered();
988
+ return super.run({ actionGroups: await this.getActionGroups(), disposeActionsOnHide: true });
989
+ }
990
+ update() {
991
+ this.class = ManageExtensionAction.HideManageExtensionClass;
992
+ this.enabled = false;
993
+ if (this.extension) {
994
+ const state = this.extension.state;
995
+ this.enabled = state === 1 ;
996
+ this.class = this.enabled || state === 2 ? ManageExtensionAction.Class : ManageExtensionAction.HideManageExtensionClass;
997
+ this.tooltip = state === 2 ? ( (localize('ManageExtensionAction.uninstallingTooltip', "Uninstalling"))) : '';
998
+ }
999
+ }
1000
+ };
1001
+ ManageExtensionAction.ID = 'extensions.manage';
1002
+ ManageExtensionAction.Class = `${ExtensionAction.ICON_ACTION_CLASS} manage ` + ThemeIcon.asClassName(manageExtensionIcon);
1003
+ ManageExtensionAction.HideManageExtensionClass = `${ManageExtensionAction.Class} hide`;
1004
+ ManageExtensionAction = ( (__decorate([
1005
+ ( (__param(0, IInstantiationService))),
1006
+ ( (__param(1, IExtensionService))),
1007
+ ( (__param(2, IContextKeyService)))
1008
+ ], ManageExtensionAction)));
1009
+ let MenuItemExtensionAction = class MenuItemExtensionAction extends ExtensionAction {
1010
+ constructor(action, extensionsWorkbenchService) {
1011
+ super(action.id, action.label);
1012
+ this.action = action;
1013
+ this.extensionsWorkbenchService = extensionsWorkbenchService;
1014
+ }
1015
+ update() {
1016
+ if (!this.extension) {
1017
+ return;
1018
+ }
1019
+ if (this.action.id === TOGGLE_IGNORE_EXTENSION_ACTION_ID) {
1020
+ this.checked = !this.extensionsWorkbenchService.isExtensionIgnoredToSync(this.extension);
1021
+ }
1022
+ }
1023
+ async run() {
1024
+ if (this.extension) {
1025
+ await this.action.run(this.extension.local ? getExtensionId(this.extension.local.manifest.publisher, this.extension.local.manifest.name)
1026
+ : this.extension.gallery ? getExtensionId(this.extension.gallery.publisher, this.extension.gallery.name)
1027
+ : this.extension.identifier.id);
1028
+ }
1029
+ }
1030
+ };
1031
+ MenuItemExtensionAction = ( (__decorate([
1032
+ ( (__param(1, IExtensionsWorkbenchService)))
1033
+ ], MenuItemExtensionAction)));
1034
+ let SwitchToPreReleaseVersionAction = class SwitchToPreReleaseVersionAction extends ExtensionAction {
1035
+ constructor(icon, commandService) {
1036
+ super(SwitchToPreReleaseVersionAction.ID, icon ? '' : SwitchToPreReleaseVersionAction.TITLE.value, `${icon ? ExtensionAction.ICON_ACTION_CLASS + ' ' + ThemeIcon.asClassName(preReleaseIcon) : ExtensionAction.LABEL_ACTION_CLASS} hide-when-disabled switch-to-prerelease`, true);
1037
+ this.commandService = commandService;
1038
+ this.tooltip = ( (localize(
1039
+ 'switch to pre-release version tooltip',
1040
+ "Switch to Pre-Release version of this extension"
1041
+ )));
1042
+ this.update();
1043
+ }
1044
+ update() {
1045
+ this.enabled = !!this.extension && !this.extension.isBuiltin && !this.extension.local?.isPreReleaseVersion && this.extension.hasPreReleaseVersion && this.extension.state === 1 ;
1046
+ }
1047
+ async run() {
1048
+ if (!this.enabled) {
1049
+ return;
1050
+ }
1051
+ return this.commandService.executeCommand(SwitchToPreReleaseVersionAction.ID, this.extension?.identifier.id);
1052
+ }
1053
+ };
1054
+ SwitchToPreReleaseVersionAction.ID = 'workbench.extensions.action.switchToPreReleaseVersion';
1055
+ SwitchToPreReleaseVersionAction.TITLE = { value: ( (localize('switch to pre-release version', "Switch to Pre-Release Version"))), original: 'Switch to Pre-Release Version' };
1056
+ SwitchToPreReleaseVersionAction = ( (__decorate([
1057
+ ( (__param(1, ICommandService)))
1058
+ ], SwitchToPreReleaseVersionAction)));
1059
+ let SwitchToReleasedVersionAction = class SwitchToReleasedVersionAction extends ExtensionAction {
1060
+ constructor(icon, commandService) {
1061
+ super(SwitchToReleasedVersionAction.ID, icon ? '' : SwitchToReleasedVersionAction.TITLE.value, `${icon ? ExtensionAction.ICON_ACTION_CLASS + ' ' + ThemeIcon.asClassName(preReleaseIcon) : ExtensionAction.LABEL_ACTION_CLASS} hide-when-disabled switch-to-released`);
1062
+ this.commandService = commandService;
1063
+ this.tooltip = ( (localize(
1064
+ 'switch to release version tooltip',
1065
+ "Switch to Release version of this extension"
1066
+ )));
1067
+ this.update();
1068
+ }
1069
+ update() {
1070
+ this.enabled = !!this.extension && !this.extension.isBuiltin && this.extension.state === 1 && !!this.extension.local?.isPreReleaseVersion && !!this.extension.hasReleaseVersion;
1071
+ }
1072
+ async run() {
1073
+ if (!this.enabled) {
1074
+ return;
1075
+ }
1076
+ return this.commandService.executeCommand(SwitchToReleasedVersionAction.ID, this.extension?.identifier.id);
1077
+ }
1078
+ };
1079
+ SwitchToReleasedVersionAction.ID = 'workbench.extensions.action.switchToReleaseVersion';
1080
+ SwitchToReleasedVersionAction.TITLE = { value: ( (localize('switch to release version', "Switch to Release Version"))), original: 'Switch to Release Version' };
1081
+ SwitchToReleasedVersionAction = ( (__decorate([
1082
+ ( (__param(1, ICommandService)))
1083
+ ], SwitchToReleasedVersionAction)));
1084
+ let InstallAnotherVersionAction = class InstallAnotherVersionAction extends ExtensionAction {
1085
+ constructor(extensionsWorkbenchService, extensionGalleryService, quickInputService, instantiationService, dialogService) {
1086
+ super(InstallAnotherVersionAction.ID, InstallAnotherVersionAction.LABEL, ExtensionAction.LABEL_ACTION_CLASS);
1087
+ this.extensionsWorkbenchService = extensionsWorkbenchService;
1088
+ this.extensionGalleryService = extensionGalleryService;
1089
+ this.quickInputService = quickInputService;
1090
+ this.instantiationService = instantiationService;
1091
+ this.dialogService = dialogService;
1092
+ this.update();
1093
+ }
1094
+ update() {
1095
+ this.enabled = !!this.extension && !this.extension.isBuiltin && !!this.extension.gallery && !!this.extension.local && !!this.extension.server && this.extension.state === 1 && !this.extension.deprecationInfo;
1096
+ }
1097
+ async run() {
1098
+ if (!this.enabled) {
1099
+ return;
1100
+ }
1101
+ const targetPlatform = await this.extension.server.extensionManagementService.getTargetPlatform();
1102
+ const allVersions = await this.extensionGalleryService.getAllCompatibleVersions(this.extension.gallery, this.extension.local.preRelease, targetPlatform);
1103
+ if (!allVersions.length) {
1104
+ await this.dialogService.info(( (localize('no versions', "This extension has no other versions."))));
1105
+ return;
1106
+ }
1107
+ const picks = ( (allVersions.map((v, i) => {
1108
+ return {
1109
+ id: v.version,
1110
+ label: v.version,
1111
+ description: `${fromNow(( new Date(Date.parse(v.date))), true)}${v.isPreReleaseVersion ? ` (${( ( localize('pre-release', "pre-release")))})` : ''}${v.version === this.extension.version ? ` (${( ( localize('current', "current")))})` : ''}`,
1112
+ latest: i === 0,
1113
+ ariaLabel: `${v.isPreReleaseVersion ? 'Pre-Release version' : 'Release version'} ${v.version}`,
1114
+ isPreReleaseVersion: v.isPreReleaseVersion
1115
+ };
1116
+ })));
1117
+ const pick = await this.quickInputService.pick(picks, {
1118
+ placeHolder: ( (localize('selectVersion', "Select Version to Install"))),
1119
+ matchOnDetail: true
1120
+ });
1121
+ if (pick) {
1122
+ if (this.extension.version === pick.id) {
1123
+ return;
1124
+ }
1125
+ try {
1126
+ if (pick.latest) {
1127
+ await this.extensionsWorkbenchService.install(this.extension, { installPreReleaseVersion: pick.isPreReleaseVersion });
1128
+ }
1129
+ else {
1130
+ await this.extensionsWorkbenchService.installVersion(this.extension, pick.id, { installPreReleaseVersion: pick.isPreReleaseVersion });
1131
+ }
1132
+ }
1133
+ catch (error) {
1134
+ this.instantiationService.createInstance(PromptExtensionInstallFailureAction, this.extension, pick.latest ? this.extension.latestVersion : pick.id, 2 , undefined, error).run();
1135
+ }
1136
+ }
1137
+ return null;
1138
+ }
1139
+ };
1140
+ InstallAnotherVersionAction.ID = 'workbench.extensions.action.install.anotherVersion';
1141
+ InstallAnotherVersionAction.LABEL = ( (localize('install another version', "Install Another Version...")));
1142
+ InstallAnotherVersionAction = ( (__decorate([
1143
+ ( (__param(0, IExtensionsWorkbenchService))),
1144
+ ( (__param(1, IExtensionGalleryService))),
1145
+ ( (__param(2, IQuickInputService))),
1146
+ ( (__param(3, IInstantiationService))),
1147
+ ( (__param(4, IDialogService)))
1148
+ ], InstallAnotherVersionAction)));
1149
+ let EnableForWorkspaceAction = class EnableForWorkspaceAction extends ExtensionAction {
1150
+ constructor(extensionsWorkbenchService, extensionEnablementService) {
1151
+ super(EnableForWorkspaceAction.ID, EnableForWorkspaceAction.LABEL, ExtensionAction.LABEL_ACTION_CLASS);
1152
+ this.extensionsWorkbenchService = extensionsWorkbenchService;
1153
+ this.extensionEnablementService = extensionEnablementService;
1154
+ this.tooltip = ( (localize(
1155
+ 'enableForWorkspaceActionToolTip',
1156
+ "Enable this extension only in this workspace"
1157
+ )));
1158
+ this.update();
1159
+ }
1160
+ update() {
1161
+ this.enabled = false;
1162
+ if (this.extension && this.extension.local) {
1163
+ this.enabled = this.extension.state === 1
1164
+ && !this.extensionEnablementService.isEnabled(this.extension.local)
1165
+ && this.extensionEnablementService.canChangeWorkspaceEnablement(this.extension.local);
1166
+ }
1167
+ }
1168
+ async run() {
1169
+ if (!this.extension) {
1170
+ return;
1171
+ }
1172
+ return this.extensionsWorkbenchService.setEnablement(this.extension, 9 );
1173
+ }
1174
+ };
1175
+ EnableForWorkspaceAction.ID = 'extensions.enableForWorkspace';
1176
+ EnableForWorkspaceAction.LABEL = ( (localize('enableForWorkspaceAction', "Enable (Workspace)")));
1177
+ EnableForWorkspaceAction = ( (__decorate([
1178
+ ( (__param(0, IExtensionsWorkbenchService))),
1179
+ ( (__param(1, IWorkbenchExtensionEnablementService)))
1180
+ ], EnableForWorkspaceAction)));
1181
+ let EnableGloballyAction = class EnableGloballyAction extends ExtensionAction {
1182
+ constructor(extensionsWorkbenchService, extensionEnablementService) {
1183
+ super(EnableGloballyAction.ID, EnableGloballyAction.LABEL, ExtensionAction.LABEL_ACTION_CLASS);
1184
+ this.extensionsWorkbenchService = extensionsWorkbenchService;
1185
+ this.extensionEnablementService = extensionEnablementService;
1186
+ this.tooltip = ( (localize('enableGloballyActionToolTip', "Enable this extension")));
1187
+ this.update();
1188
+ }
1189
+ update() {
1190
+ this.enabled = false;
1191
+ if (this.extension && this.extension.local) {
1192
+ this.enabled = this.extension.state === 1
1193
+ && this.extensionEnablementService.isDisabledGlobally(this.extension.local)
1194
+ && this.extensionEnablementService.canChangeEnablement(this.extension.local);
1195
+ }
1196
+ }
1197
+ async run() {
1198
+ if (!this.extension) {
1199
+ return;
1200
+ }
1201
+ return this.extensionsWorkbenchService.setEnablement(this.extension, 8 );
1202
+ }
1203
+ };
1204
+ EnableGloballyAction.ID = 'extensions.enableGlobally';
1205
+ EnableGloballyAction.LABEL = ( (localize('enableGloballyAction', "Enable")));
1206
+ EnableGloballyAction = ( (__decorate([
1207
+ ( (__param(0, IExtensionsWorkbenchService))),
1208
+ ( (__param(1, IWorkbenchExtensionEnablementService)))
1209
+ ], EnableGloballyAction)));
1210
+ let DisableForWorkspaceAction = class DisableForWorkspaceAction extends ExtensionAction {
1211
+ constructor(workspaceContextService, extensionsWorkbenchService, extensionEnablementService, extensionService) {
1212
+ super(DisableForWorkspaceAction.ID, DisableForWorkspaceAction.LABEL, ExtensionAction.LABEL_ACTION_CLASS);
1213
+ this.workspaceContextService = workspaceContextService;
1214
+ this.extensionsWorkbenchService = extensionsWorkbenchService;
1215
+ this.extensionEnablementService = extensionEnablementService;
1216
+ this.extensionService = extensionService;
1217
+ this.tooltip = ( (localize(
1218
+ 'disableForWorkspaceActionToolTip',
1219
+ "Disable this extension only in this workspace"
1220
+ )));
1221
+ this.update();
1222
+ this._register(this.extensionService.onDidChangeExtensions(() => this.update()));
1223
+ }
1224
+ update() {
1225
+ this.enabled = false;
1226
+ if (this.extension && this.extension.local && ( (this.extensionService.extensions.some(
1227
+ e => areSameExtensions({ id: e.identifier.value, uuid: e.uuid }, this.extension.identifier) && this.workspaceContextService.getWorkbenchState() !== 1
1228
+ )))) {
1229
+ this.enabled = this.extension.state === 1
1230
+ && ((this.extension.enablementState === 8 || this.extension.enablementState === 9) )
1231
+ && this.extensionEnablementService.canChangeWorkspaceEnablement(this.extension.local);
1232
+ }
1233
+ }
1234
+ async run() {
1235
+ if (!this.extension) {
1236
+ return;
1237
+ }
1238
+ return this.extensionsWorkbenchService.setEnablement(this.extension, 7 );
1239
+ }
1240
+ };
1241
+ DisableForWorkspaceAction.ID = 'extensions.disableForWorkspace';
1242
+ DisableForWorkspaceAction.LABEL = ( (localize('disableForWorkspaceAction', "Disable (Workspace)")));
1243
+ DisableForWorkspaceAction = ( (__decorate([
1244
+ ( (__param(0, IWorkspaceContextService))),
1245
+ ( (__param(1, IExtensionsWorkbenchService))),
1246
+ ( (__param(2, IWorkbenchExtensionEnablementService))),
1247
+ ( (__param(3, IExtensionService)))
1248
+ ], DisableForWorkspaceAction)));
1249
+ let DisableGloballyAction = class DisableGloballyAction extends ExtensionAction {
1250
+ constructor(extensionsWorkbenchService, extensionEnablementService, extensionService) {
1251
+ super(DisableGloballyAction.ID, DisableGloballyAction.LABEL, ExtensionAction.LABEL_ACTION_CLASS);
1252
+ this.extensionsWorkbenchService = extensionsWorkbenchService;
1253
+ this.extensionEnablementService = extensionEnablementService;
1254
+ this.extensionService = extensionService;
1255
+ this.tooltip = ( (localize('disableGloballyActionToolTip', "Disable this extension")));
1256
+ this.update();
1257
+ this._register(this.extensionService.onDidChangeExtensions(() => this.update()));
1258
+ }
1259
+ update() {
1260
+ this.enabled = false;
1261
+ if (this.extension && this.extension.local && ( (this.extensionService.extensions.some(
1262
+ e => areSameExtensions({ id: e.identifier.value, uuid: e.uuid }, this.extension.identifier)
1263
+ )))) {
1264
+ this.enabled = this.extension.state === 1
1265
+ && ((this.extension.enablementState === 8 || this.extension.enablementState === 9) )
1266
+ && this.extensionEnablementService.canChangeEnablement(this.extension.local);
1267
+ }
1268
+ }
1269
+ async run() {
1270
+ if (!this.extension) {
1271
+ return;
1272
+ }
1273
+ return this.extensionsWorkbenchService.setEnablement(this.extension, 6 );
1274
+ }
1275
+ };
1276
+ DisableGloballyAction.ID = 'extensions.disableGlobally';
1277
+ DisableGloballyAction.LABEL = ( (localize('disableGloballyAction', "Disable")));
1278
+ DisableGloballyAction = ( (__decorate([
1279
+ ( (__param(0, IExtensionsWorkbenchService))),
1280
+ ( (__param(1, IWorkbenchExtensionEnablementService))),
1281
+ ( (__param(2, IExtensionService)))
1282
+ ], DisableGloballyAction)));
1283
+ let ReloadAction = class ReloadAction extends ExtensionAction {
1284
+ constructor(hostService, extensionService) {
1285
+ super('extensions.reload', ( (localize('reloadAction', "Reload"))), ReloadAction.DisabledClass, false);
1286
+ this.hostService = hostService;
1287
+ this.extensionService = extensionService;
1288
+ this.updateWhenCounterExtensionChanges = true;
1289
+ this._register(this.extensionService.onDidChangeExtensions(() => this.update()));
1290
+ this.update();
1291
+ }
1292
+ update() {
1293
+ this.enabled = false;
1294
+ this.tooltip = '';
1295
+ if (!this.extension) {
1296
+ return;
1297
+ }
1298
+ const state = this.extension.state;
1299
+ if (state === 0 || state === 2 ) {
1300
+ return;
1301
+ }
1302
+ 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) {
1303
+ return;
1304
+ }
1305
+ const reloadTooltip = this.extension.reloadRequiredStatus;
1306
+ this.enabled = reloadTooltip !== undefined;
1307
+ this.label = reloadTooltip !== undefined ? ( (localize('reload required', 'Reload Required'))) : '';
1308
+ this.tooltip = reloadTooltip !== undefined ? reloadTooltip : '';
1309
+ this.class = this.enabled ? ReloadAction.EnabledClass : ReloadAction.DisabledClass;
1310
+ }
1311
+ run() {
1312
+ return Promise.resolve(this.hostService.reload());
1313
+ }
1314
+ };
1315
+ ReloadAction.EnabledClass = `${ExtensionAction.LABEL_ACTION_CLASS} reload`;
1316
+ ReloadAction.DisabledClass = `${ReloadAction.EnabledClass} disabled`;
1317
+ ReloadAction = ( (__decorate([
1318
+ ( (__param(0, IHostService))),
1319
+ ( (__param(1, IExtensionService)))
1320
+ ], ReloadAction)));
1321
+ function isThemeFromExtension(theme, extension) {
1322
+ return !!(extension && theme.extensionData && ExtensionIdentifier.equals(theme.extensionData.extensionId, extension.identifier.id));
1323
+ }
1324
+ function getQuickPickEntries(themes, currentTheme, extension, showCurrentTheme) {
1325
+ const picks = [];
1326
+ for (const theme of themes) {
1327
+ if (isThemeFromExtension(theme, extension) && !(showCurrentTheme && theme === currentTheme)) {
1328
+ picks.push({ label: theme.label, id: theme.id });
1329
+ }
1330
+ }
1331
+ if (showCurrentTheme) {
1332
+ picks.push({ type: 'separator', label: ( (localize('current', "current"))) });
1333
+ picks.push({ label: currentTheme.label, id: currentTheme.id });
1334
+ }
1335
+ return picks;
1336
+ }
1337
+ let SetColorThemeAction = class SetColorThemeAction extends ExtensionAction {
1338
+ constructor(extensionService, workbenchThemeService, quickInputService, extensionEnablementService) {
1339
+ super(SetColorThemeAction.ID, SetColorThemeAction.TITLE.value, SetColorThemeAction.DisabledClass, false);
1340
+ this.workbenchThemeService = workbenchThemeService;
1341
+ this.quickInputService = quickInputService;
1342
+ this.extensionEnablementService = extensionEnablementService;
1343
+ this._register(Event.any(extensionService.onDidChangeExtensions, workbenchThemeService.onDidColorThemeChange)(() => this.update(), this));
1344
+ this.update();
1345
+ }
1346
+ update() {
1347
+ this.workbenchThemeService.getColorThemes().then(colorThemes => {
1348
+ this.enabled = this.computeEnablement(colorThemes);
1349
+ this.class = this.enabled ? SetColorThemeAction.EnabledClass : SetColorThemeAction.DisabledClass;
1350
+ });
1351
+ }
1352
+ computeEnablement(colorThemes) {
1353
+ return !!this.extension && this.extension.state === 1 && this.extensionEnablementService.isEnabledEnablementState(this.extension.enablementState) && ( (colorThemes.some(th => isThemeFromExtension(th, this.extension))));
1354
+ }
1355
+ async run({ showCurrentTheme, ignoreFocusLost } = { showCurrentTheme: false, ignoreFocusLost: false }) {
1356
+ const colorThemes = await this.workbenchThemeService.getColorThemes();
1357
+ if (!this.computeEnablement(colorThemes)) {
1358
+ return;
1359
+ }
1360
+ const currentTheme = this.workbenchThemeService.getColorTheme();
1361
+ const delayer = ( (new Delayer(100)));
1362
+ const picks = getQuickPickEntries(colorThemes, currentTheme, this.extension, showCurrentTheme);
1363
+ const pickedTheme = await this.quickInputService.pick(picks, {
1364
+ placeHolder: ( (localize('select color theme', "Select Color Theme"))),
1365
+ onDidFocus: item => delayer.trigger(() => this.workbenchThemeService.setColorTheme(item.id, undefined)),
1366
+ ignoreFocusLost
1367
+ });
1368
+ return this.workbenchThemeService.setColorTheme(pickedTheme ? pickedTheme.id : currentTheme.id, 'auto');
1369
+ }
1370
+ };
1371
+ SetColorThemeAction.ID = 'workbench.extensions.action.setColorTheme';
1372
+ SetColorThemeAction.TITLE = { value: ( (localize('workbench.extensions.action.setColorTheme', "Set Color Theme"))), original: 'Set Color Theme' };
1373
+ SetColorThemeAction.EnabledClass = `${ExtensionAction.LABEL_ACTION_CLASS} theme`;
1374
+ SetColorThemeAction.DisabledClass = `${SetColorThemeAction.EnabledClass} disabled`;
1375
+ SetColorThemeAction = ( (__decorate([
1376
+ ( (__param(0, IExtensionService))),
1377
+ ( (__param(1, IWorkbenchThemeService))),
1378
+ ( (__param(2, IQuickInputService))),
1379
+ ( (__param(3, IWorkbenchExtensionEnablementService)))
1380
+ ], SetColorThemeAction)));
1381
+ let SetFileIconThemeAction = class SetFileIconThemeAction extends ExtensionAction {
1382
+ constructor(extensionService, workbenchThemeService, quickInputService, extensionEnablementService) {
1383
+ super(SetFileIconThemeAction.ID, SetFileIconThemeAction.TITLE.value, SetFileIconThemeAction.DisabledClass, false);
1384
+ this.workbenchThemeService = workbenchThemeService;
1385
+ this.quickInputService = quickInputService;
1386
+ this.extensionEnablementService = extensionEnablementService;
1387
+ this._register(Event.any(extensionService.onDidChangeExtensions, workbenchThemeService.onDidFileIconThemeChange)(() => this.update(), this));
1388
+ this.update();
1389
+ }
1390
+ update() {
1391
+ this.workbenchThemeService.getFileIconThemes().then(fileIconThemes => {
1392
+ this.enabled = this.computeEnablement(fileIconThemes);
1393
+ this.class = this.enabled ? SetFileIconThemeAction.EnabledClass : SetFileIconThemeAction.DisabledClass;
1394
+ });
1395
+ }
1396
+ computeEnablement(colorThemfileIconThemess) {
1397
+ return !!this.extension && this.extension.state === 1 && this.extensionEnablementService.isEnabledEnablementState(this.extension.enablementState) && ( (colorThemfileIconThemess.some(th => isThemeFromExtension(th, this.extension))));
1398
+ }
1399
+ async run({ showCurrentTheme, ignoreFocusLost } = { showCurrentTheme: false, ignoreFocusLost: false }) {
1400
+ const fileIconThemes = await this.workbenchThemeService.getFileIconThemes();
1401
+ if (!this.computeEnablement(fileIconThemes)) {
1402
+ return;
1403
+ }
1404
+ const currentTheme = this.workbenchThemeService.getFileIconTheme();
1405
+ const delayer = ( (new Delayer(100)));
1406
+ const picks = getQuickPickEntries(fileIconThemes, currentTheme, this.extension, showCurrentTheme);
1407
+ const pickedTheme = await this.quickInputService.pick(picks, {
1408
+ placeHolder: ( (localize('select file icon theme', "Select File Icon Theme"))),
1409
+ onDidFocus: item => delayer.trigger(() => this.workbenchThemeService.setFileIconTheme(item.id, undefined)),
1410
+ ignoreFocusLost
1411
+ });
1412
+ return this.workbenchThemeService.setFileIconTheme(pickedTheme ? pickedTheme.id : currentTheme.id, 'auto');
1413
+ }
1414
+ };
1415
+ SetFileIconThemeAction.ID = 'workbench.extensions.action.setFileIconTheme';
1416
+ SetFileIconThemeAction.TITLE = { value: ( (localize('workbench.extensions.action.setFileIconTheme', "Set File Icon Theme"))), original: 'Set File Icon Theme' };
1417
+ SetFileIconThemeAction.EnabledClass = `${ExtensionAction.LABEL_ACTION_CLASS} theme`;
1418
+ SetFileIconThemeAction.DisabledClass = `${SetFileIconThemeAction.EnabledClass} disabled`;
1419
+ SetFileIconThemeAction = ( (__decorate([
1420
+ ( (__param(0, IExtensionService))),
1421
+ ( (__param(1, IWorkbenchThemeService))),
1422
+ ( (__param(2, IQuickInputService))),
1423
+ ( (__param(3, IWorkbenchExtensionEnablementService)))
1424
+ ], SetFileIconThemeAction)));
1425
+ let SetProductIconThemeAction = class SetProductIconThemeAction extends ExtensionAction {
1426
+ constructor(extensionService, workbenchThemeService, quickInputService, extensionEnablementService) {
1427
+ super(SetProductIconThemeAction.ID, SetProductIconThemeAction.TITLE.value, SetProductIconThemeAction.DisabledClass, false);
1428
+ this.workbenchThemeService = workbenchThemeService;
1429
+ this.quickInputService = quickInputService;
1430
+ this.extensionEnablementService = extensionEnablementService;
1431
+ this._register(Event.any(extensionService.onDidChangeExtensions, workbenchThemeService.onDidProductIconThemeChange)(() => this.update(), this));
1432
+ this.update();
1433
+ }
1434
+ update() {
1435
+ this.workbenchThemeService.getProductIconThemes().then(productIconThemes => {
1436
+ this.enabled = this.computeEnablement(productIconThemes);
1437
+ this.class = this.enabled ? SetProductIconThemeAction.EnabledClass : SetProductIconThemeAction.DisabledClass;
1438
+ });
1439
+ }
1440
+ computeEnablement(productIconThemes) {
1441
+ return !!this.extension && this.extension.state === 1 && this.extensionEnablementService.isEnabledEnablementState(this.extension.enablementState) && ( (productIconThemes.some(th => isThemeFromExtension(th, this.extension))));
1442
+ }
1443
+ async run({ showCurrentTheme, ignoreFocusLost } = { showCurrentTheme: false, ignoreFocusLost: false }) {
1444
+ const productIconThemes = await this.workbenchThemeService.getProductIconThemes();
1445
+ if (!this.computeEnablement(productIconThemes)) {
1446
+ return;
1447
+ }
1448
+ const currentTheme = this.workbenchThemeService.getProductIconTheme();
1449
+ const delayer = ( (new Delayer(100)));
1450
+ const picks = getQuickPickEntries(productIconThemes, currentTheme, this.extension, showCurrentTheme);
1451
+ const pickedTheme = await this.quickInputService.pick(picks, {
1452
+ placeHolder: ( (localize('select product icon theme', "Select Product Icon Theme"))),
1453
+ onDidFocus: item => delayer.trigger(() => this.workbenchThemeService.setProductIconTheme(item.id, undefined)),
1454
+ ignoreFocusLost
1455
+ });
1456
+ return this.workbenchThemeService.setProductIconTheme(pickedTheme ? pickedTheme.id : currentTheme.id, 'auto');
1457
+ }
1458
+ };
1459
+ SetProductIconThemeAction.ID = 'workbench.extensions.action.setProductIconTheme';
1460
+ SetProductIconThemeAction.TITLE = { value: ( (localize(
1461
+ 'workbench.extensions.action.setProductIconTheme',
1462
+ "Set Product Icon Theme"
1463
+ ))), original: 'Set Product Icon Theme' };
1464
+ SetProductIconThemeAction.EnabledClass = `${ExtensionAction.LABEL_ACTION_CLASS} theme`;
1465
+ SetProductIconThemeAction.DisabledClass = `${SetProductIconThemeAction.EnabledClass} disabled`;
1466
+ SetProductIconThemeAction = ( (__decorate([
1467
+ ( (__param(0, IExtensionService))),
1468
+ ( (__param(1, IWorkbenchThemeService))),
1469
+ ( (__param(2, IQuickInputService))),
1470
+ ( (__param(3, IWorkbenchExtensionEnablementService)))
1471
+ ], SetProductIconThemeAction)));
1472
+ let SetLanguageAction = class SetLanguageAction extends ExtensionAction {
1473
+ constructor(extensionsWorkbenchService) {
1474
+ super(SetLanguageAction.ID, SetLanguageAction.TITLE.value, SetLanguageAction.DisabledClass, false);
1475
+ this.extensionsWorkbenchService = extensionsWorkbenchService;
1476
+ this.update();
1477
+ }
1478
+ update() {
1479
+ this.enabled = false;
1480
+ this.class = SetLanguageAction.DisabledClass;
1481
+ if (!this.extension) {
1482
+ return;
1483
+ }
1484
+ if (!this.extensionsWorkbenchService.canSetLanguage(this.extension)) {
1485
+ return;
1486
+ }
1487
+ if (this.extension.gallery && language === getLocale(this.extension.gallery)) {
1488
+ return;
1489
+ }
1490
+ this.enabled = true;
1491
+ this.class = SetLanguageAction.EnabledClass;
1492
+ }
1493
+ async run() {
1494
+ return this.extension && this.extensionsWorkbenchService.setLanguage(this.extension);
1495
+ }
1496
+ };
1497
+ SetLanguageAction.ID = 'workbench.extensions.action.setDisplayLanguage';
1498
+ SetLanguageAction.TITLE = { value: ( (localize('workbench.extensions.action.setDisplayLanguage', "Set Display Language"))), original: 'Set Display Language' };
1499
+ SetLanguageAction.EnabledClass = `${ExtensionAction.LABEL_ACTION_CLASS} language`;
1500
+ SetLanguageAction.DisabledClass = `${SetLanguageAction.EnabledClass} disabled`;
1501
+ SetLanguageAction = ( (__decorate([
1502
+ ( (__param(0, IExtensionsWorkbenchService)))
1503
+ ], SetLanguageAction)));
1504
+ let ClearLanguageAction = class ClearLanguageAction extends ExtensionAction {
1505
+ constructor(extensionsWorkbenchService, localeService) {
1506
+ super(ClearLanguageAction.ID, ClearLanguageAction.TITLE.value, ClearLanguageAction.DisabledClass, false);
1507
+ this.extensionsWorkbenchService = extensionsWorkbenchService;
1508
+ this.localeService = localeService;
1509
+ this.update();
1510
+ }
1511
+ update() {
1512
+ this.enabled = false;
1513
+ this.class = ClearLanguageAction.DisabledClass;
1514
+ if (!this.extension) {
1515
+ return;
1516
+ }
1517
+ if (!this.extensionsWorkbenchService.canSetLanguage(this.extension)) {
1518
+ return;
1519
+ }
1520
+ if (this.extension.gallery && language !== getLocale(this.extension.gallery)) {
1521
+ return;
1522
+ }
1523
+ this.enabled = true;
1524
+ this.class = ClearLanguageAction.EnabledClass;
1525
+ }
1526
+ async run() {
1527
+ return this.extension && this.localeService.clearLocalePreference();
1528
+ }
1529
+ };
1530
+ ClearLanguageAction.ID = 'workbench.extensions.action.clearLanguage';
1531
+ ClearLanguageAction.TITLE = { value: ( (localize('workbench.extensions.action.clearLanguage', "Clear Display Language"))), original: 'Clear Display Language' };
1532
+ ClearLanguageAction.EnabledClass = `${ExtensionAction.LABEL_ACTION_CLASS} language`;
1533
+ ClearLanguageAction.DisabledClass = `${ClearLanguageAction.EnabledClass} disabled`;
1534
+ ClearLanguageAction = ( (__decorate([
1535
+ ( (__param(0, IExtensionsWorkbenchService))),
1536
+ ( (__param(1, ILocaleService)))
1537
+ ], ClearLanguageAction)));
1538
+ let ShowRecommendedExtensionAction = class ShowRecommendedExtensionAction extends Action {
1539
+ constructor(extensionId, paneCompositeService, extensionWorkbenchService) {
1540
+ super(ShowRecommendedExtensionAction.ID, ShowRecommendedExtensionAction.LABEL, undefined, false);
1541
+ this.paneCompositeService = paneCompositeService;
1542
+ this.extensionWorkbenchService = extensionWorkbenchService;
1543
+ this.extensionId = extensionId;
1544
+ }
1545
+ async run() {
1546
+ const paneComposite = await this.paneCompositeService.openPaneComposite(VIEWLET_ID, 0 , true);
1547
+ const paneContainer = paneComposite?.getViewPaneContainer();
1548
+ paneContainer.search(`@id:${this.extensionId}`);
1549
+ paneContainer.focus();
1550
+ const [extension] = await this.extensionWorkbenchService.getExtensions([{ id: this.extensionId }], { source: 'install-recommendation' }, CancellationToken.None);
1551
+ if (extension) {
1552
+ return this.extensionWorkbenchService.open(extension);
1553
+ }
1554
+ return null;
1555
+ }
1556
+ };
1557
+ ShowRecommendedExtensionAction.ID = 'workbench.extensions.action.showRecommendedExtension';
1558
+ ShowRecommendedExtensionAction.LABEL = ( (localize('showRecommendedExtension', "Show Recommended Extension")));
1559
+ ShowRecommendedExtensionAction = ( (__decorate([
1560
+ ( (__param(1, IPaneCompositePartService))),
1561
+ ( (__param(2, IExtensionsWorkbenchService)))
1562
+ ], ShowRecommendedExtensionAction)));
1563
+ let InstallRecommendedExtensionAction = class InstallRecommendedExtensionAction extends Action {
1564
+ constructor(extensionId, paneCompositeService, instantiationService, extensionWorkbenchService) {
1565
+ super(InstallRecommendedExtensionAction.ID, InstallRecommendedExtensionAction.LABEL, undefined, false);
1566
+ this.paneCompositeService = paneCompositeService;
1567
+ this.instantiationService = instantiationService;
1568
+ this.extensionWorkbenchService = extensionWorkbenchService;
1569
+ this.extensionId = extensionId;
1570
+ }
1571
+ async run() {
1572
+ const viewlet = await this.paneCompositeService.openPaneComposite(VIEWLET_ID, 0 , true);
1573
+ const viewPaneContainer = viewlet?.getViewPaneContainer();
1574
+ viewPaneContainer.search(`@id:${this.extensionId}`);
1575
+ viewPaneContainer.focus();
1576
+ const [extension] = await this.extensionWorkbenchService.getExtensions([{ id: this.extensionId }], { source: 'install-recommendation' }, CancellationToken.None);
1577
+ if (extension) {
1578
+ await this.extensionWorkbenchService.open(extension);
1579
+ try {
1580
+ await this.extensionWorkbenchService.install(extension);
1581
+ }
1582
+ catch (err) {
1583
+ this.instantiationService.createInstance(PromptExtensionInstallFailureAction, extension, extension.latestVersion, 2 , undefined, err).run();
1584
+ }
1585
+ }
1586
+ }
1587
+ };
1588
+ InstallRecommendedExtensionAction.ID = 'workbench.extensions.action.installRecommendedExtension';
1589
+ InstallRecommendedExtensionAction.LABEL = ( (localize('installRecommendedExtension', "Install Recommended Extension")));
1590
+ InstallRecommendedExtensionAction = ( (__decorate([
1591
+ ( (__param(1, IPaneCompositePartService))),
1592
+ ( (__param(2, IInstantiationService))),
1593
+ ( (__param(3, IExtensionsWorkbenchService)))
1594
+ ], InstallRecommendedExtensionAction)));
1595
+ let IgnoreExtensionRecommendationAction = class IgnoreExtensionRecommendationAction extends Action {
1596
+ constructor(extension, extensionRecommendationsManagementService) {
1597
+ super(IgnoreExtensionRecommendationAction.ID, 'Ignore Recommendation');
1598
+ this.extension = extension;
1599
+ this.extensionRecommendationsManagementService = extensionRecommendationsManagementService;
1600
+ this.class = IgnoreExtensionRecommendationAction.Class;
1601
+ this.tooltip = ( (localize('ignoreExtensionRecommendation', "Do not recommend this extension again")));
1602
+ this.enabled = true;
1603
+ }
1604
+ run() {
1605
+ this.extensionRecommendationsManagementService.toggleGlobalIgnoredRecommendation(this.extension.identifier.id, true);
1606
+ return Promise.resolve();
1607
+ }
1608
+ };
1609
+ IgnoreExtensionRecommendationAction.ID = 'extensions.ignore';
1610
+ IgnoreExtensionRecommendationAction.Class = `${ExtensionAction.LABEL_ACTION_CLASS} ignore`;
1611
+ IgnoreExtensionRecommendationAction = ( (__decorate([
1612
+ ( (__param(1, IExtensionIgnoredRecommendationsService)))
1613
+ ], IgnoreExtensionRecommendationAction)));
1614
+ let UndoIgnoreExtensionRecommendationAction = class UndoIgnoreExtensionRecommendationAction extends Action {
1615
+ constructor(extension, extensionRecommendationsManagementService) {
1616
+ super(UndoIgnoreExtensionRecommendationAction.ID, 'Undo');
1617
+ this.extension = extension;
1618
+ this.extensionRecommendationsManagementService = extensionRecommendationsManagementService;
1619
+ this.class = UndoIgnoreExtensionRecommendationAction.Class;
1620
+ this.tooltip = ( (localize('undo', "Undo")));
1621
+ this.enabled = true;
1622
+ }
1623
+ run() {
1624
+ this.extensionRecommendationsManagementService.toggleGlobalIgnoredRecommendation(this.extension.identifier.id, false);
1625
+ return Promise.resolve();
1626
+ }
1627
+ };
1628
+ UndoIgnoreExtensionRecommendationAction.ID = 'extensions.ignore';
1629
+ UndoIgnoreExtensionRecommendationAction.Class = `${ExtensionAction.LABEL_ACTION_CLASS} undo-ignore`;
1630
+ UndoIgnoreExtensionRecommendationAction = ( (__decorate([
1631
+ ( (__param(1, IExtensionIgnoredRecommendationsService)))
1632
+ ], UndoIgnoreExtensionRecommendationAction)));
1633
+ let SearchExtensionsAction = class SearchExtensionsAction extends Action {
1634
+ constructor(searchValue, paneCompositeService) {
1635
+ super('extensions.searchExtensions', ( (localize('search recommendations', "Search Extensions"))), undefined, true);
1636
+ this.searchValue = searchValue;
1637
+ this.paneCompositeService = paneCompositeService;
1638
+ }
1639
+ async run() {
1640
+ const viewPaneContainer = (await this.paneCompositeService.openPaneComposite(VIEWLET_ID, 0 , true))?.getViewPaneContainer();
1641
+ viewPaneContainer.search(this.searchValue);
1642
+ viewPaneContainer.focus();
1643
+ }
1644
+ };
1645
+ SearchExtensionsAction = ( (__decorate([
1646
+ ( (__param(1, IPaneCompositePartService)))
1647
+ ], SearchExtensionsAction)));
1648
+ let AbstractConfigureRecommendedExtensionsAction = class AbstractConfigureRecommendedExtensionsAction extends Action {
1649
+ constructor(id, label, contextService, fileService, textFileService, editorService, jsonEditingService, textModelResolverService) {
1650
+ super(id, label);
1651
+ this.contextService = contextService;
1652
+ this.fileService = fileService;
1653
+ this.textFileService = textFileService;
1654
+ this.editorService = editorService;
1655
+ this.jsonEditingService = jsonEditingService;
1656
+ this.textModelResolverService = textModelResolverService;
1657
+ }
1658
+ openExtensionsFile(extensionsFileResource) {
1659
+ return this.getOrCreateExtensionsFile(extensionsFileResource)
1660
+ .then(({ created, content }) => this.getSelectionPosition(content, extensionsFileResource, ['recommendations'])
1661
+ .then(selection => this.editorService.openEditor({
1662
+ resource: extensionsFileResource,
1663
+ options: {
1664
+ pinned: created,
1665
+ selection
1666
+ }
1667
+ })), error => Promise.reject(( (new Error( (localize(
1668
+ 'OpenExtensionsFile.failed',
1669
+ "Unable to create 'extensions.json' file inside the '.vscode' folder ({0}).",
1670
+ error
1671
+ )))))));
1672
+ }
1673
+ openWorkspaceConfigurationFile(workspaceConfigurationFile) {
1674
+ return this.getOrUpdateWorkspaceConfigurationFile(workspaceConfigurationFile)
1675
+ .then(content => this.getSelectionPosition(( (content.value.toString())), content.resource, ['extensions', 'recommendations']))
1676
+ .then(selection => this.editorService.openEditor({
1677
+ resource: workspaceConfigurationFile,
1678
+ options: {
1679
+ selection,
1680
+ forceReload: true
1681
+ }
1682
+ }));
1683
+ }
1684
+ getOrUpdateWorkspaceConfigurationFile(workspaceConfigurationFile) {
1685
+ return Promise.resolve(this.fileService.readFile(workspaceConfigurationFile))
1686
+ .then(content => {
1687
+ const workspaceRecommendations = json.parse(( (content.value.toString())))['extensions'];
1688
+ if (!workspaceRecommendations || !workspaceRecommendations.recommendations) {
1689
+ return this.jsonEditingService.write(workspaceConfigurationFile, [{ path: ['extensions'], value: { recommendations: [] } }], true)
1690
+ .then(() => this.fileService.readFile(workspaceConfigurationFile));
1691
+ }
1692
+ return content;
1693
+ });
1694
+ }
1695
+ getSelectionPosition(content, resource, path) {
1696
+ const tree = json.parseTree(content);
1697
+ const node = json.findNodeAtLocation(tree, path);
1698
+ if (node && node.parent && node.parent.children) {
1699
+ const recommendationsValueNode = node.parent.children[1];
1700
+ const lastExtensionNode = recommendationsValueNode.children && recommendationsValueNode.children.length ? recommendationsValueNode.children[recommendationsValueNode.children.length - 1] : null;
1701
+ const offset = lastExtensionNode ? lastExtensionNode.offset + lastExtensionNode.length : recommendationsValueNode.offset + 1;
1702
+ return Promise.resolve(this.textModelResolverService.createModelReference(resource))
1703
+ .then(reference => {
1704
+ const position = reference.object.textEditorModel.getPositionAt(offset);
1705
+ reference.dispose();
1706
+ return {
1707
+ startLineNumber: position.lineNumber,
1708
+ startColumn: position.column,
1709
+ endLineNumber: position.lineNumber,
1710
+ endColumn: position.column,
1711
+ };
1712
+ });
1713
+ }
1714
+ return Promise.resolve(undefined);
1715
+ }
1716
+ getOrCreateExtensionsFile(extensionsFileResource) {
1717
+ return Promise.resolve(this.fileService.readFile(extensionsFileResource)).then(content => {
1718
+ return { created: false, extensionsFileResource, content: ( (content.value.toString())) };
1719
+ }, err => {
1720
+ return this.textFileService.write(extensionsFileResource, ExtensionsConfigurationInitialContent).then(() => {
1721
+ return { created: true, extensionsFileResource, content: ExtensionsConfigurationInitialContent };
1722
+ });
1723
+ });
1724
+ }
1725
+ };
1726
+ AbstractConfigureRecommendedExtensionsAction = ( (__decorate([
1727
+ ( (__param(2, IWorkspaceContextService))),
1728
+ ( (__param(3, IFileService))),
1729
+ ( (__param(4, ITextFileService))),
1730
+ ( (__param(5, IEditorService))),
1731
+ ( (__param(6, IJSONEditingService))),
1732
+ ( (__param(7, ITextModelService)))
1733
+ ], AbstractConfigureRecommendedExtensionsAction)));
1734
+ let ConfigureWorkspaceRecommendedExtensionsAction = class ConfigureWorkspaceRecommendedExtensionsAction extends AbstractConfigureRecommendedExtensionsAction {
1735
+ constructor(id, label, fileService, textFileService, contextService, editorService, jsonEditingService, textModelResolverService) {
1736
+ super(id, label, contextService, fileService, textFileService, editorService, jsonEditingService, textModelResolverService);
1737
+ this._register(this.contextService.onDidChangeWorkbenchState(() => this.update(), this));
1738
+ this.update();
1739
+ }
1740
+ update() {
1741
+ this.enabled = this.contextService.getWorkbenchState() !== 1 ;
1742
+ }
1743
+ run() {
1744
+ switch (this.contextService.getWorkbenchState()) {
1745
+ case 2 :
1746
+ return this.openExtensionsFile(this.contextService.getWorkspace().folders[0].toResource(EXTENSIONS_CONFIG));
1747
+ case 3 :
1748
+ return this.openWorkspaceConfigurationFile(this.contextService.getWorkspace().configuration);
1749
+ }
1750
+ return Promise.resolve();
1751
+ }
1752
+ };
1753
+ ConfigureWorkspaceRecommendedExtensionsAction.ID = 'workbench.extensions.action.configureWorkspaceRecommendedExtensions';
1754
+ ConfigureWorkspaceRecommendedExtensionsAction.LABEL = ( (localize(
1755
+ 'configureWorkspaceRecommendedExtensions',
1756
+ "Configure Recommended Extensions (Workspace)"
1757
+ )));
1758
+ ConfigureWorkspaceRecommendedExtensionsAction = ( (__decorate([
1759
+ ( (__param(2, IFileService))),
1760
+ ( (__param(3, ITextFileService))),
1761
+ ( (__param(4, IWorkspaceContextService))),
1762
+ ( (__param(5, IEditorService))),
1763
+ ( (__param(6, IJSONEditingService))),
1764
+ ( (__param(7, ITextModelService)))
1765
+ ], ConfigureWorkspaceRecommendedExtensionsAction)));
1766
+ let ConfigureWorkspaceFolderRecommendedExtensionsAction = class ConfigureWorkspaceFolderRecommendedExtensionsAction extends AbstractConfigureRecommendedExtensionsAction {
1767
+ constructor(id, label, fileService, textFileService, contextService, editorService, jsonEditingService, textModelResolverService, commandService) {
1768
+ super(id, label, contextService, fileService, textFileService, editorService, jsonEditingService, textModelResolverService);
1769
+ this.commandService = commandService;
1770
+ }
1771
+ run() {
1772
+ const folderCount = this.contextService.getWorkspace().folders.length;
1773
+ const pickFolderPromise = folderCount === 1 ? Promise.resolve(this.contextService.getWorkspace().folders[0]) : this.commandService.executeCommand(PICK_WORKSPACE_FOLDER_COMMAND_ID);
1774
+ return Promise.resolve(pickFolderPromise)
1775
+ .then(workspaceFolder => {
1776
+ if (workspaceFolder) {
1777
+ return this.openExtensionsFile(workspaceFolder.toResource(EXTENSIONS_CONFIG));
1778
+ }
1779
+ return null;
1780
+ });
1781
+ }
1782
+ };
1783
+ ConfigureWorkspaceFolderRecommendedExtensionsAction.ID = 'workbench.extensions.action.configureWorkspaceFolderRecommendedExtensions';
1784
+ ConfigureWorkspaceFolderRecommendedExtensionsAction.LABEL = ( (localize(
1785
+ 'configureWorkspaceFolderRecommendedExtensions',
1786
+ "Configure Recommended Extensions (Workspace Folder)"
1787
+ )));
1788
+ ConfigureWorkspaceFolderRecommendedExtensionsAction = ( (__decorate([
1789
+ ( (__param(2, IFileService))),
1790
+ ( (__param(3, ITextFileService))),
1791
+ ( (__param(4, IWorkspaceContextService))),
1792
+ ( (__param(5, IEditorService))),
1793
+ ( (__param(6, IJSONEditingService))),
1794
+ ( (__param(7, ITextModelService))),
1795
+ ( (__param(8, ICommandService)))
1796
+ ], ConfigureWorkspaceFolderRecommendedExtensionsAction)));
1797
+ let ExtensionStatusLabelAction = class ExtensionStatusLabelAction extends Action {
1798
+ get extension() { return this._extension; }
1799
+ set extension(extension) {
1800
+ if (!(this._extension && extension && areSameExtensions(this._extension.identifier, extension.identifier))) {
1801
+ this.initialStatus = null;
1802
+ this.status = null;
1803
+ this.enablementState = null;
1804
+ }
1805
+ this._extension = extension;
1806
+ this.update();
1807
+ }
1808
+ constructor(extensionService, extensionManagementServerService, extensionEnablementService) {
1809
+ super('extensions.action.statusLabel', '', ExtensionStatusLabelAction.DISABLED_CLASS, false);
1810
+ this.extensionService = extensionService;
1811
+ this.extensionManagementServerService = extensionManagementServerService;
1812
+ this.extensionEnablementService = extensionEnablementService;
1813
+ this.initialStatus = null;
1814
+ this.status = null;
1815
+ this.version = null;
1816
+ this.enablementState = null;
1817
+ this._extension = null;
1818
+ }
1819
+ update() {
1820
+ const label = this.computeLabel();
1821
+ this.label = label || '';
1822
+ this.class = label ? ExtensionStatusLabelAction.ENABLED_CLASS : ExtensionStatusLabelAction.DISABLED_CLASS;
1823
+ }
1824
+ computeLabel() {
1825
+ if (!this.extension) {
1826
+ return null;
1827
+ }
1828
+ const currentStatus = this.status;
1829
+ const currentVersion = this.version;
1830
+ const currentEnablementState = this.enablementState;
1831
+ this.status = this.extension.state;
1832
+ this.version = this.extension.version;
1833
+ if (this.initialStatus === null) {
1834
+ this.initialStatus = this.status;
1835
+ }
1836
+ this.enablementState = this.extension.enablementState;
1837
+ const canAddExtension = () => {
1838
+ const runningExtension = this.extensionService.extensions.filter(e => areSameExtensions({ id: e.identifier.value, uuid: e.uuid }, this.extension.identifier))[0];
1839
+ if (this.extension.local) {
1840
+ if (runningExtension && this.extension.version === runningExtension.version) {
1841
+ return true;
1842
+ }
1843
+ return this.extensionService.canAddExtension(toExtensionDescription(this.extension.local));
1844
+ }
1845
+ return false;
1846
+ };
1847
+ const canRemoveExtension = () => {
1848
+ if (this.extension.local) {
1849
+ 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))))) {
1850
+ return true;
1851
+ }
1852
+ return this.extensionService.canRemoveExtension(toExtensionDescription(this.extension.local));
1853
+ }
1854
+ return false;
1855
+ };
1856
+ if (currentStatus !== null) {
1857
+ if (currentStatus === 0 && this.status === 1 ) {
1858
+ return canAddExtension() ? this.initialStatus === 1 && this.version !== currentVersion ? ( (localize('updated', "Updated"))) : ( (localize('installed', "Installed"))) : null;
1859
+ }
1860
+ if (currentStatus === 2 && this.status === 3 ) {
1861
+ this.initialStatus = this.status;
1862
+ return canRemoveExtension() ? ( (localize('uninstalled', "Uninstalled"))) : null;
1863
+ }
1864
+ }
1865
+ if (currentEnablementState !== null) {
1866
+ const currentlyEnabled = this.extensionEnablementService.isEnabledEnablementState(currentEnablementState);
1867
+ const enabled = this.extensionEnablementService.isEnabledEnablementState(this.enablementState);
1868
+ if (!currentlyEnabled && enabled) {
1869
+ return canAddExtension() ? ( (localize('enabled', "Enabled"))) : null;
1870
+ }
1871
+ if (currentlyEnabled && !enabled) {
1872
+ return canRemoveExtension() ? ( (localize('disabled', "Disabled"))) : null;
1873
+ }
1874
+ }
1875
+ return null;
1876
+ }
1877
+ run() {
1878
+ return Promise.resolve();
1879
+ }
1880
+ };
1881
+ ExtensionStatusLabelAction.ENABLED_CLASS = `${ExtensionAction.TEXT_ACTION_CLASS} extension-status-label`;
1882
+ ExtensionStatusLabelAction.DISABLED_CLASS = `${ExtensionStatusLabelAction.ENABLED_CLASS} hide`;
1883
+ ExtensionStatusLabelAction = ( (__decorate([
1884
+ ( (__param(0, IExtensionService))),
1885
+ ( (__param(1, IExtensionManagementServerService))),
1886
+ ( (__param(2, IWorkbenchExtensionEnablementService)))
1887
+ ], ExtensionStatusLabelAction)));
1888
+ let ToggleSyncExtensionAction = class ToggleSyncExtensionAction extends ExtensionDropDownAction {
1889
+ constructor(configurationService, extensionsWorkbenchService, userDataSyncEnablementService, instantiationService) {
1890
+ super('extensions.sync', '', ToggleSyncExtensionAction.SYNC_CLASS, false, instantiationService);
1891
+ this.configurationService = configurationService;
1892
+ this.extensionsWorkbenchService = extensionsWorkbenchService;
1893
+ this.userDataSyncEnablementService = userDataSyncEnablementService;
1894
+ this._register(Event.filter(this.configurationService.onDidChangeConfiguration, e => e.affectsConfiguration('settingsSync.ignoredExtensions'))(() => this.update()));
1895
+ this._register(userDataSyncEnablementService.onDidChangeEnablement(() => this.update()));
1896
+ this.update();
1897
+ }
1898
+ update() {
1899
+ this.enabled = !!this.extension && this.userDataSyncEnablementService.isEnabled() && this.extension.state === 1 ;
1900
+ if (this.extension) {
1901
+ const isIgnored = this.extensionsWorkbenchService.isExtensionIgnoredToSync(this.extension);
1902
+ this.class = isIgnored ? ToggleSyncExtensionAction.IGNORED_SYNC_CLASS : ToggleSyncExtensionAction.SYNC_CLASS;
1903
+ this.tooltip = isIgnored ? ( (localize('ignored', "This extension is ignored during sync"))) : ( (localize('synced', "This extension is synced")));
1904
+ }
1905
+ }
1906
+ async run() {
1907
+ return super.run({
1908
+ actionGroups: [
1909
+ [
1910
+ ( (new Action(
1911
+ 'extensions.syncignore',
1912
+ this.extensionsWorkbenchService.isExtensionIgnoredToSync(this.extension) ? ( (localize('sync', "Sync this extension"))) : ( (localize('do not sync', "Do not sync this extension"))),
1913
+ undefined,
1914
+ true,
1915
+ () => this.extensionsWorkbenchService.toggleExtensionIgnoredToSync(this.extension)
1916
+ )))
1917
+ ]
1918
+ ], disposeActionsOnHide: true
1919
+ });
1920
+ }
1921
+ };
1922
+ ToggleSyncExtensionAction.IGNORED_SYNC_CLASS = `${ExtensionAction.ICON_ACTION_CLASS} extension-sync ${ThemeIcon.asClassName(syncIgnoredIcon)}`;
1923
+ ToggleSyncExtensionAction.SYNC_CLASS = `${ToggleSyncExtensionAction.ICON_ACTION_CLASS} extension-sync ${ThemeIcon.asClassName(syncEnabledIcon)}`;
1924
+ ToggleSyncExtensionAction = ( (__decorate([
1925
+ ( (__param(0, IConfigurationService))),
1926
+ ( (__param(1, IExtensionsWorkbenchService))),
1927
+ ( (__param(2, IUserDataSyncEnablementService))),
1928
+ ( (__param(3, IInstantiationService)))
1929
+ ], ToggleSyncExtensionAction)));
1930
+ let ExtensionStatusAction = class ExtensionStatusAction extends ExtensionAction {
1931
+ get status() { return this._status; }
1932
+ constructor(extensionManagementServerService, labelService, commandService, workspaceTrustEnablementService, workspaceTrustService, extensionsWorkbenchService, extensionService, extensionManifestPropertiesService, contextService, productService, workbenchExtensionEnablementService) {
1933
+ super('extensions.status', '', `${ExtensionStatusAction.CLASS} hide`, false);
1934
+ this.extensionManagementServerService = extensionManagementServerService;
1935
+ this.labelService = labelService;
1936
+ this.commandService = commandService;
1937
+ this.workspaceTrustEnablementService = workspaceTrustEnablementService;
1938
+ this.workspaceTrustService = workspaceTrustService;
1939
+ this.extensionsWorkbenchService = extensionsWorkbenchService;
1940
+ this.extensionService = extensionService;
1941
+ this.extensionManifestPropertiesService = extensionManifestPropertiesService;
1942
+ this.contextService = contextService;
1943
+ this.productService = productService;
1944
+ this.workbenchExtensionEnablementService = workbenchExtensionEnablementService;
1945
+ this.updateWhenCounterExtensionChanges = true;
1946
+ this._onDidChangeStatus = this._register(( (new Emitter())));
1947
+ this.onDidChangeStatus = this._onDidChangeStatus.event;
1948
+ this.updateThrottler = ( (new Throttler()));
1949
+ this._register(this.labelService.onDidChangeFormatters(() => this.update(), this));
1950
+ this._register(this.extensionService.onDidChangeExtensions(() => this.update()));
1951
+ this.update();
1952
+ }
1953
+ update() {
1954
+ this.updateThrottler.queue(() => this.computeAndUpdateStatus());
1955
+ }
1956
+ async computeAndUpdateStatus() {
1957
+ this.updateStatus(undefined, true);
1958
+ this.enabled = false;
1959
+ if (!this.extension) {
1960
+ return;
1961
+ }
1962
+ if (this.extension.isMalicious) {
1963
+ this.updateStatus({ icon: warningIcon, message: ( (new MarkdownString(
1964
+ (localize('malicious tooltip', "This extension was reported to be problematic."))
1965
+ ))) }, true);
1966
+ return;
1967
+ }
1968
+ if (this.extension.deprecationInfo) {
1969
+ if (this.extension.deprecationInfo.extension) {
1970
+ const link = `[${this.extension.deprecationInfo.extension.displayName}](${( ( URI.parse(
1971
+ `command:extension.open?${encodeURIComponent(JSON.stringify([this.extension.deprecationInfo.extension.id]))}`
1972
+ )))})`;
1973
+ this.updateStatus({ icon: warningIcon, message: ( (new MarkdownString( (localize(
1974
+ 'deprecated with alternate extension tooltip',
1975
+ "This extension is deprecated. Use the {0} extension instead.",
1976
+ link
1977
+ ))))) }, true);
1978
+ }
1979
+ else if (this.extension.deprecationInfo.settings) {
1980
+ const link = `[${( ( localize('settings', "settings")))}](${( ( URI.parse(
1981
+ `command:workbench.action.openSettings?${encodeURIComponent(JSON.stringify([( ( this.extension.deprecationInfo.settings.map(setting => `@id:${setting}`))).join(' ')]))}`
1982
+ )))})`;
1983
+ this.updateStatus({ icon: warningIcon, message: ( (new MarkdownString( (localize(
1984
+ 'deprecated with alternate settings tooltip',
1985
+ "This extension is deprecated as this functionality is now built-in to VS Code. Configure these {0} to use this functionality.",
1986
+ link
1987
+ ))))) }, true);
1988
+ }
1989
+ else {
1990
+ const message = ( (new MarkdownString( (localize(
1991
+ 'deprecated tooltip',
1992
+ "This extension is deprecated as it is no longer being maintained."
1993
+ )))));
1994
+ if (this.extension.deprecationInfo.additionalInfo) {
1995
+ message.appendMarkdown(` ${this.extension.deprecationInfo.additionalInfo}`);
1996
+ }
1997
+ this.updateStatus({ icon: warningIcon, message }, true);
1998
+ }
1999
+ return;
2000
+ }
2001
+ if (this.extensionsWorkbenchService.canSetLanguage(this.extension)) {
2002
+ return;
2003
+ }
2004
+ if (this.extension.gallery && this.extension.state === 3 && !(await this.extensionsWorkbenchService.canInstall(this.extension))) {
2005
+ if (this.extensionManagementServerService.localExtensionManagementServer || this.extensionManagementServerService.remoteExtensionManagementServer) {
2006
+ const targetPlatform = await (this.extensionManagementServerService.localExtensionManagementServer ? this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.getTargetPlatform() : this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.getTargetPlatform());
2007
+ const message = ( (new MarkdownString(`${( ( localize(
2008
+ 'incompatible platform',
2009
+ "The '{0}' extension is not available in {1} for {2}.",
2010
+ this.extension.displayName || this.extension.identifier.id,
2011
+ this.productService.nameLong,
2012
+ TargetPlatformToString(targetPlatform)
2013
+ )))} [${( ( localize('learn more', "Learn More")))}](https://aka.ms/vscode-platform-specific-extensions)`)));
2014
+ this.updateStatus({ icon: warningIcon, message }, true);
2015
+ return;
2016
+ }
2017
+ if (this.extensionManagementServerService.webExtensionManagementServer) {
2018
+ const productName = ( (localize('VS Code for Web', "{0} for the Web", this.productService.nameLong)));
2019
+ const message = ( (new MarkdownString(`${( ( localize(
2020
+ 'not web tooltip',
2021
+ "The '{0}' extension is not available in {1}.",
2022
+ this.extension.displayName || this.extension.identifier.id,
2023
+ productName
2024
+ )))} [${( ( localize('learn why', "Learn Why")))}](https://aka.ms/vscode-web-extensions-guide)`)));
2025
+ this.updateStatus({ icon: warningIcon, message }, true);
2026
+ return;
2027
+ }
2028
+ }
2029
+ if (!this.extension.local ||
2030
+ !this.extension.server ||
2031
+ this.extension.state !== 1 ) {
2032
+ return;
2033
+ }
2034
+ if (this.extension.enablementState === 2 ) {
2035
+ this.updateStatus({ message: ( (new MarkdownString( (localize(
2036
+ 'disabled by environment',
2037
+ "This extension is disabled by the environment."
2038
+ ))))) }, true);
2039
+ return;
2040
+ }
2041
+ if (this.extension.enablementState === 3 ) {
2042
+ this.updateStatus({ message: ( (new MarkdownString( (localize(
2043
+ 'enabled by environment',
2044
+ "This extension is enabled because it is required in the current environment."
2045
+ ))))) }, true);
2046
+ return;
2047
+ }
2048
+ if (this.extension.enablementState === 4 ) {
2049
+ const details = getWorkspaceSupportTypeMessage(this.extension.local.manifest.capabilities?.virtualWorkspaces);
2050
+ this.updateStatus({ icon: infoIcon, message: ( (new MarkdownString(details ? escapeMarkdownSyntaxTokens(details) : ( (localize(
2051
+ 'disabled because of virtual workspace',
2052
+ "This extension has been disabled because it does not support virtual workspaces."
2053
+ )))))) }, true);
2054
+ return;
2055
+ }
2056
+ if (isVirtualWorkspace(this.contextService.getWorkspace())) {
2057
+ const virtualSupportType = this.extensionManifestPropertiesService.getExtensionVirtualWorkspaceSupportType(this.extension.local.manifest);
2058
+ const details = getWorkspaceSupportTypeMessage(this.extension.local.manifest.capabilities?.virtualWorkspaces);
2059
+ if (virtualSupportType === 'limited' || details) {
2060
+ this.updateStatus({ icon: warningIcon, message: ( (new MarkdownString(details ? escapeMarkdownSyntaxTokens(details) : ( (localize(
2061
+ 'extension limited because of virtual workspace',
2062
+ "This extension has limited features because the current workspace is virtual."
2063
+ )))))) }, true);
2064
+ return;
2065
+ }
2066
+ }
2067
+ if (this.extension.enablementState === 0 ||
2068
+ (this.extension.enablementState === 5 && this.workbenchExtensionEnablementService.getDependenciesEnablementStates(this.extension.local).every(([, enablementState]) => this.workbenchExtensionEnablementService.isEnabledEnablementState(enablementState) || enablementState === 0 ))) {
2069
+ this.enabled = true;
2070
+ const untrustedDetails = getWorkspaceSupportTypeMessage(this.extension.local.manifest.capabilities?.untrustedWorkspaces);
2071
+ this.updateStatus({ icon: trustIcon, message: ( (new MarkdownString(
2072
+ untrustedDetails ? escapeMarkdownSyntaxTokens(untrustedDetails) : ( (localize(
2073
+ 'extension disabled because of trust requirement',
2074
+ "This extension has been disabled because the current workspace is not trusted."
2075
+ )))
2076
+ ))) }, true);
2077
+ return;
2078
+ }
2079
+ if (this.workspaceTrustEnablementService.isWorkspaceTrustEnabled() && !this.workspaceTrustService.isWorkspaceTrusted()) {
2080
+ const untrustedSupportType = this.extensionManifestPropertiesService.getExtensionUntrustedWorkspaceSupportType(this.extension.local.manifest);
2081
+ const untrustedDetails = getWorkspaceSupportTypeMessage(this.extension.local.manifest.capabilities?.untrustedWorkspaces);
2082
+ if (untrustedSupportType === 'limited' || untrustedDetails) {
2083
+ this.enabled = true;
2084
+ this.updateStatus({ icon: trustIcon, message: ( (new MarkdownString(
2085
+ untrustedDetails ? escapeMarkdownSyntaxTokens(untrustedDetails) : ( (localize(
2086
+ 'extension limited because of trust requirement',
2087
+ "This extension has limited features because the current workspace is not trusted."
2088
+ )))
2089
+ ))) }, true);
2090
+ return;
2091
+ }
2092
+ }
2093
+ if (this.extension.enablementState === 1 ) {
2094
+ if (!( (this.extensionsWorkbenchService.installed.some(
2095
+ e => areSameExtensions(e.identifier, this.extension.identifier) && e.server !== this.extension.server
2096
+ )))) {
2097
+ let message;
2098
+ if (this.extensionManagementServerService.localExtensionManagementServer === this.extension.server) {
2099
+ if (this.extensionManifestPropertiesService.prefersExecuteOnWorkspace(this.extension.local.manifest)) {
2100
+ if (this.extensionManagementServerService.remoteExtensionManagementServer) {
2101
+ message = ( (new MarkdownString(`${( ( localize(
2102
+ 'Install in remote server to enable',
2103
+ "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.",
2104
+ this.extensionManagementServerService.remoteExtensionManagementServer.label
2105
+ )))} [${( ( localize('learn more', "Learn More")))}](https://aka.ms/vscode-remote/developing-extensions/architecture)`)));
2106
+ }
2107
+ }
2108
+ }
2109
+ else if (this.extensionManagementServerService.remoteExtensionManagementServer === this.extension.server) {
2110
+ if (this.extensionManifestPropertiesService.prefersExecuteOnUI(this.extension.local.manifest)) {
2111
+ if (this.extensionManagementServerService.localExtensionManagementServer) {
2112
+ message = ( (new MarkdownString(`${( ( localize(
2113
+ 'Install in local server to enable',
2114
+ "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.",
2115
+ this.extensionManagementServerService.remoteExtensionManagementServer.label
2116
+ )))} [${( ( localize('learn more', "Learn More")))}](https://aka.ms/vscode-remote/developing-extensions/architecture)`)));
2117
+ }
2118
+ else if (isWeb) {
2119
+ message = ( (new MarkdownString(`${( ( localize(
2120
+ 'Defined to run in desktop',
2121
+ "This extension is disabled because it is defined to run only in {0} for the Desktop.",
2122
+ this.productService.nameLong
2123
+ )))} [${( ( localize('learn more', "Learn More")))}](https://aka.ms/vscode-remote/developing-extensions/architecture)`)));
2124
+ }
2125
+ }
2126
+ }
2127
+ else if (this.extensionManagementServerService.webExtensionManagementServer === this.extension.server) {
2128
+ message = ( (new MarkdownString(`${( ( localize(
2129
+ 'Cannot be enabled',
2130
+ "This extension is disabled because it is not supported in {0} for the Web.",
2131
+ this.productService.nameLong
2132
+ )))} [${( ( localize('learn more', "Learn More")))}](https://aka.ms/vscode-remote/developing-extensions/architecture)`)));
2133
+ }
2134
+ if (message) {
2135
+ this.updateStatus({ icon: warningIcon, message }, true);
2136
+ }
2137
+ return;
2138
+ }
2139
+ }
2140
+ if (this.extensionManagementServerService.remoteExtensionManagementServer) {
2141
+ if (isLanguagePackExtension(this.extension.local.manifest)) {
2142
+ if (!( (this.extensionsWorkbenchService.installed.some(
2143
+ e => areSameExtensions(e.identifier, this.extension.identifier) && e.server !== this.extension.server
2144
+ )))) {
2145
+ const message = this.extension.server === this.extensionManagementServerService.localExtensionManagementServer
2146
+ ? ( (new MarkdownString( (localize(
2147
+ 'Install language pack also in remote server',
2148
+ "Install the language pack extension on '{0}' to enable it there also.",
2149
+ this.extensionManagementServerService.remoteExtensionManagementServer.label
2150
+ )))))
2151
+ : ( (new MarkdownString( (localize(
2152
+ 'Install language pack also locally',
2153
+ "Install the language pack extension locally to enable it there also."
2154
+ )))));
2155
+ this.updateStatus({ icon: infoIcon, message }, true);
2156
+ }
2157
+ return;
2158
+ }
2159
+ const runningExtension = this.extensionService.extensions.filter(e => areSameExtensions({ id: e.identifier.value, uuid: e.uuid }, this.extension.identifier))[0];
2160
+ const runningExtensionServer = runningExtension ? this.extensionManagementServerService.getExtensionManagementServer(toExtension(runningExtension)) : null;
2161
+ if (this.extension.server === this.extensionManagementServerService.localExtensionManagementServer && runningExtensionServer === this.extensionManagementServerService.remoteExtensionManagementServer) {
2162
+ if (this.extensionManifestPropertiesService.prefersExecuteOnWorkspace(this.extension.local.manifest)) {
2163
+ this.updateStatus({ icon: infoIcon, message: ( (new MarkdownString(`${( ( localize(
2164
+ 'enabled remotely',
2165
+ "This extension is enabled in the Remote Extension Host because it prefers to run there."
2166
+ )))} [${( ( localize('learn more', "Learn More")))}](https://aka.ms/vscode-remote/developing-extensions/architecture)`))) }, true);
2167
+ }
2168
+ return;
2169
+ }
2170
+ if (this.extension.server === this.extensionManagementServerService.remoteExtensionManagementServer && runningExtensionServer === this.extensionManagementServerService.localExtensionManagementServer) {
2171
+ if (this.extensionManifestPropertiesService.prefersExecuteOnUI(this.extension.local.manifest)) {
2172
+ this.updateStatus({ icon: infoIcon, message: ( (new MarkdownString(`${( ( localize(
2173
+ 'enabled locally',
2174
+ "This extension is enabled in the Local Extension Host because it prefers to run there."
2175
+ )))} [${( ( localize('learn more', "Learn More")))}](https://aka.ms/vscode-remote/developing-extensions/architecture)`))) }, true);
2176
+ }
2177
+ return;
2178
+ }
2179
+ if (this.extension.server === this.extensionManagementServerService.remoteExtensionManagementServer && runningExtensionServer === this.extensionManagementServerService.webExtensionManagementServer) {
2180
+ if (this.extensionManifestPropertiesService.canExecuteOnWeb(this.extension.local.manifest)) {
2181
+ this.updateStatus({ icon: infoIcon, message: ( (new MarkdownString(`${( ( localize(
2182
+ 'enabled in web worker',
2183
+ "This extension is enabled in the Web Worker Extension Host because it prefers to run there."
2184
+ )))} [${( ( localize('learn more', "Learn More")))}](https://aka.ms/vscode-remote/developing-extensions/architecture)`))) }, true);
2185
+ }
2186
+ return;
2187
+ }
2188
+ }
2189
+ if (this.extension.enablementState === 5 ) {
2190
+ this.updateStatus({ icon: warningIcon, message: ( (new MarkdownString( (localize(
2191
+ 'extension disabled because of dependency',
2192
+ "This extension has been disabled because it depends on an extension that is disabled."
2193
+ ))))) }, true);
2194
+ return;
2195
+ }
2196
+ const isEnabled = this.workbenchExtensionEnablementService.isEnabled(this.extension.local);
2197
+ const isRunning = ( (this.extensionService.extensions.some(
2198
+ e => areSameExtensions({ id: e.identifier.value, uuid: e.uuid }, this.extension.identifier)
2199
+ )));
2200
+ if (isEnabled && isRunning) {
2201
+ if (this.extensionManagementServerService.localExtensionManagementServer && this.extensionManagementServerService.remoteExtensionManagementServer) {
2202
+ if (this.extension.server === this.extensionManagementServerService.remoteExtensionManagementServer) {
2203
+ this.updateStatus({ message: ( (new MarkdownString( (localize(
2204
+ 'extension enabled on remote',
2205
+ "Extension is enabled on '{0}'",
2206
+ this.extension.server.label
2207
+ ))))) }, true);
2208
+ return;
2209
+ }
2210
+ }
2211
+ if (this.extension.enablementState === 8 ) {
2212
+ this.updateStatus({ message: ( (new MarkdownString(
2213
+ (localize('globally enabled', "This extension is enabled globally."))
2214
+ ))) }, true);
2215
+ return;
2216
+ }
2217
+ if (this.extension.enablementState === 9 ) {
2218
+ this.updateStatus({ message: ( (new MarkdownString( (localize(
2219
+ 'workspace enabled',
2220
+ "This extension is enabled for this workspace by the user."
2221
+ ))))) }, true);
2222
+ return;
2223
+ }
2224
+ }
2225
+ if (!isEnabled && !isRunning) {
2226
+ if (this.extension.enablementState === 6 ) {
2227
+ this.updateStatus({ message: ( (new MarkdownString(
2228
+ (localize('globally disabled', "This extension is disabled globally by the user."))
2229
+ ))) }, true);
2230
+ return;
2231
+ }
2232
+ if (this.extension.enablementState === 7 ) {
2233
+ this.updateStatus({ message: ( (new MarkdownString( (localize(
2234
+ 'workspace disabled',
2235
+ "This extension is disabled for this workspace by the user."
2236
+ ))))) }, true);
2237
+ return;
2238
+ }
2239
+ }
2240
+ if (isEnabled && !isRunning && !this.extension.local.isValid) {
2241
+ const errors = ( (this.extension.local.validations.filter(([severity]) => severity === Severity.Error).map(([, message]) => message)));
2242
+ this.updateStatus({ icon: errorIcon, message: ( (new MarkdownString(errors.join(' ').trim()))) }, true);
2243
+ }
2244
+ }
2245
+ updateStatus(status, updateClass) {
2246
+ if (this._status === status) {
2247
+ return;
2248
+ }
2249
+ if (this._status && status && this._status.message === status.message && this._status.icon?.id === status.icon?.id) {
2250
+ return;
2251
+ }
2252
+ this._status = status;
2253
+ if (updateClass) {
2254
+ if (this._status?.icon === errorIcon) {
2255
+ this.class = `${ExtensionStatusAction.CLASS} extension-status-error ${ThemeIcon.asClassName(errorIcon)}`;
2256
+ }
2257
+ else if (this._status?.icon === warningIcon) {
2258
+ this.class = `${ExtensionStatusAction.CLASS} extension-status-warning ${ThemeIcon.asClassName(warningIcon)}`;
2259
+ }
2260
+ else if (this._status?.icon === infoIcon) {
2261
+ this.class = `${ExtensionStatusAction.CLASS} extension-status-info ${ThemeIcon.asClassName(infoIcon)}`;
2262
+ }
2263
+ else if (this._status?.icon === trustIcon) {
2264
+ this.class = `${ExtensionStatusAction.CLASS} ${ThemeIcon.asClassName(trustIcon)}`;
2265
+ }
2266
+ else {
2267
+ this.class = `${ExtensionStatusAction.CLASS} hide`;
2268
+ }
2269
+ }
2270
+ this._onDidChangeStatus.fire();
2271
+ }
2272
+ async run() {
2273
+ if (this._status?.icon === trustIcon) {
2274
+ return this.commandService.executeCommand('workbench.trust.manage');
2275
+ }
2276
+ }
2277
+ };
2278
+ ExtensionStatusAction.CLASS = `${ExtensionAction.ICON_ACTION_CLASS} extension-status`;
2279
+ ExtensionStatusAction = ( (__decorate([
2280
+ ( (__param(0, IExtensionManagementServerService))),
2281
+ ( (__param(1, ILabelService))),
2282
+ ( (__param(2, ICommandService))),
2283
+ ( (__param(3, IWorkspaceTrustEnablementService))),
2284
+ ( (__param(4, IWorkspaceTrustManagementService))),
2285
+ ( (__param(5, IExtensionsWorkbenchService))),
2286
+ ( (__param(6, IExtensionService))),
2287
+ ( (__param(7, IExtensionManifestPropertiesService))),
2288
+ ( (__param(8, IWorkspaceContextService))),
2289
+ ( (__param(9, IProductService))),
2290
+ ( (__param(10, IWorkbenchExtensionEnablementService)))
2291
+ ], ExtensionStatusAction)));
2292
+ let ReinstallAction = class ReinstallAction extends Action {
2293
+ constructor(id = ReinstallAction.ID, label = ReinstallAction.LABEL, extensionsWorkbenchService, extensionManagementServerService, quickInputService, notificationService, hostService, instantiationService, extensionService) {
2294
+ super(id, label);
2295
+ this.extensionsWorkbenchService = extensionsWorkbenchService;
2296
+ this.extensionManagementServerService = extensionManagementServerService;
2297
+ this.quickInputService = quickInputService;
2298
+ this.notificationService = notificationService;
2299
+ this.hostService = hostService;
2300
+ this.instantiationService = instantiationService;
2301
+ this.extensionService = extensionService;
2302
+ }
2303
+ get enabled() {
2304
+ return this.extensionsWorkbenchService.local.filter(l => !l.isBuiltin && l.local).length > 0;
2305
+ }
2306
+ run() {
2307
+ return this.quickInputService.pick(this.getEntries(), { placeHolder: ( (localize('selectExtensionToReinstall', "Select Extension to Reinstall"))) })
2308
+ .then(pick => pick && this.reinstallExtension(pick.extension));
2309
+ }
2310
+ getEntries() {
2311
+ return this.extensionsWorkbenchService.queryLocal()
2312
+ .then(local => {
2313
+ const entries = ( (local
2314
+ .filter(extension => !extension.isBuiltin && extension.server !== this.extensionManagementServerService.webExtensionManagementServer)
2315
+ .map(extension => {
2316
+ return {
2317
+ id: extension.identifier.id,
2318
+ label: extension.displayName,
2319
+ description: extension.identifier.id,
2320
+ extension,
2321
+ };
2322
+ })));
2323
+ return entries;
2324
+ });
2325
+ }
2326
+ reinstallExtension(extension) {
2327
+ return this.instantiationService.createInstance(SearchExtensionsAction, '@installed ').run()
2328
+ .then(() => {
2329
+ return this.extensionsWorkbenchService.reinstall(extension)
2330
+ .then(extension => {
2331
+ const requireReload = !(extension.local && this.extensionService.canAddExtension(toExtensionDescription(extension.local)));
2332
+ const message = requireReload ? ( (localize(
2333
+ 'ReinstallAction.successReload',
2334
+ "Please reload Visual Studio Code to complete reinstalling the extension {0}.",
2335
+ extension.identifier.id
2336
+ )))
2337
+ : ( (localize(
2338
+ 'ReinstallAction.success',
2339
+ "Reinstalling the extension {0} is completed.",
2340
+ extension.identifier.id
2341
+ )));
2342
+ const actions = requireReload ? [{
2343
+ label: ( (localize('InstallVSIXAction.reloadNow', "Reload Now"))),
2344
+ run: () => this.hostService.reload()
2345
+ }] : [];
2346
+ this.notificationService.prompt(Severity.Info, message, actions, { sticky: true });
2347
+ }, error => this.notificationService.error(error));
2348
+ });
2349
+ }
2350
+ };
2351
+ ReinstallAction.ID = 'workbench.extensions.action.reinstall';
2352
+ ReinstallAction.LABEL = ( (localize('reinstall', "Reinstall Extension...")));
2353
+ ReinstallAction = ( (__decorate([
2354
+ ( (__param(2, IExtensionsWorkbenchService))),
2355
+ ( (__param(3, IExtensionManagementServerService))),
2356
+ ( (__param(4, IQuickInputService))),
2357
+ ( (__param(5, INotificationService))),
2358
+ ( (__param(6, IHostService))),
2359
+ ( (__param(7, IInstantiationService))),
2360
+ ( (__param(8, IExtensionService)))
2361
+ ], ReinstallAction)));
2362
+ let InstallSpecificVersionOfExtensionAction = class InstallSpecificVersionOfExtensionAction extends Action {
2363
+ constructor(id = InstallSpecificVersionOfExtensionAction.ID, label = InstallSpecificVersionOfExtensionAction.LABEL, extensionsWorkbenchService, quickInputService, instantiationService, extensionEnablementService) {
2364
+ super(id, label);
2365
+ this.extensionsWorkbenchService = extensionsWorkbenchService;
2366
+ this.quickInputService = quickInputService;
2367
+ this.instantiationService = instantiationService;
2368
+ this.extensionEnablementService = extensionEnablementService;
2369
+ }
2370
+ get enabled() {
2371
+ return (
2372
+ (this.extensionsWorkbenchService.local.some(l => this.isEnabled(l)))
2373
+ );
2374
+ }
2375
+ async run() {
2376
+ const extensionPick = await this.quickInputService.pick(this.getExtensionEntries(), { placeHolder: ( (localize('selectExtension', "Select Extension"))), matchOnDetail: true });
2377
+ if (extensionPick && extensionPick.extension) {
2378
+ const action = this.instantiationService.createInstance(InstallAnotherVersionAction);
2379
+ action.extension = extensionPick.extension;
2380
+ await action.run();
2381
+ await this.instantiationService.createInstance(SearchExtensionsAction, extensionPick.extension.identifier.id).run();
2382
+ }
2383
+ }
2384
+ isEnabled(extension) {
2385
+ const action = this.instantiationService.createInstance(InstallAnotherVersionAction);
2386
+ action.extension = extension;
2387
+ return action.enabled && !!extension.local && this.extensionEnablementService.isEnabled(extension.local);
2388
+ }
2389
+ async getExtensionEntries() {
2390
+ const installed = await this.extensionsWorkbenchService.queryLocal();
2391
+ const entries = [];
2392
+ for (const extension of installed) {
2393
+ if (this.isEnabled(extension)) {
2394
+ entries.push({
2395
+ id: extension.identifier.id,
2396
+ label: extension.displayName || extension.identifier.id,
2397
+ description: extension.identifier.id,
2398
+ extension,
2399
+ });
2400
+ }
2401
+ }
2402
+ return entries.sort((e1, e2) => e1.extension.displayName.localeCompare(e2.extension.displayName));
2403
+ }
2404
+ };
2405
+ InstallSpecificVersionOfExtensionAction.ID = 'workbench.extensions.action.install.specificVersion';
2406
+ InstallSpecificVersionOfExtensionAction.LABEL = ( (localize('install previous version', "Install Specific Version of Extension...")));
2407
+ InstallSpecificVersionOfExtensionAction = ( (__decorate([
2408
+ ( (__param(2, IExtensionsWorkbenchService))),
2409
+ ( (__param(3, IQuickInputService))),
2410
+ ( (__param(4, IInstantiationService))),
2411
+ ( (__param(5, IWorkbenchExtensionEnablementService)))
2412
+ ], InstallSpecificVersionOfExtensionAction)));
2413
+ CommandsRegistry.registerCommand('workbench.extensions.action.showExtensionsForLanguage', function (accessor, fileExtension) {
2414
+ const paneCompositeService = accessor.get(IPaneCompositePartService);
2415
+ return paneCompositeService.openPaneComposite(VIEWLET_ID, 0 , true)
2416
+ .then(viewlet => viewlet?.getViewPaneContainer())
2417
+ .then(viewlet => {
2418
+ viewlet.search(`ext:${fileExtension.replace(/^\./, '')}`);
2419
+ viewlet.focus();
2420
+ });
2421
+ });
2422
+ CommandsRegistry.registerCommand('workbench.extensions.action.showExtensionsWithIds', function (accessor, extensionIds) {
2423
+ const paneCompositeService = accessor.get(IPaneCompositePartService);
2424
+ return paneCompositeService.openPaneComposite(VIEWLET_ID, 0 , true)
2425
+ .then(viewlet => viewlet?.getViewPaneContainer())
2426
+ .then(viewlet => {
2427
+ const query = ( (extensionIds
2428
+ .map(id => `@id:${id}`)))
2429
+ .join(' ');
2430
+ viewlet.search(query);
2431
+ viewlet.focus();
2432
+ });
2433
+ });
2434
+ registerColor('extensionButton.background', {
2435
+ dark: buttonBackground,
2436
+ light: buttonBackground,
2437
+ hcDark: null,
2438
+ hcLight: null
2439
+ }, ( (localize(
2440
+ 'extensionButtonBackground',
2441
+ "Button background color for extension actions."
2442
+ ))));
2443
+ registerColor('extensionButton.foreground', {
2444
+ dark: buttonForeground,
2445
+ light: buttonForeground,
2446
+ hcDark: null,
2447
+ hcLight: null
2448
+ }, ( (localize(
2449
+ 'extensionButtonForeground',
2450
+ "Button foreground color for extension actions."
2451
+ ))));
2452
+ registerColor('extensionButton.hoverBackground', {
2453
+ dark: buttonHoverBackground,
2454
+ light: buttonHoverBackground,
2455
+ hcDark: null,
2456
+ hcLight: null
2457
+ }, ( (localize(
2458
+ 'extensionButtonHoverBackground',
2459
+ "Button background hover color for extension actions."
2460
+ ))));
2461
+ registerColor('extensionButton.separator', {
2462
+ dark: buttonSeparator,
2463
+ light: buttonSeparator,
2464
+ hcDark: buttonSeparator,
2465
+ hcLight: buttonSeparator
2466
+ }, ( (localize('extensionButtonSeparator', "Button separator color for extension actions"))));
2467
+ registerColor('extensionButton.prominentBackground', {
2468
+ dark: buttonBackground,
2469
+ light: buttonBackground,
2470
+ hcDark: null,
2471
+ hcLight: null
2472
+ }, ( (localize(
2473
+ 'extensionButtonProminentBackground',
2474
+ "Button background color for extension actions that stand out (e.g. install button)."
2475
+ ))));
2476
+ registerColor('extensionButton.prominentForeground', {
2477
+ dark: buttonForeground,
2478
+ light: buttonForeground,
2479
+ hcDark: null,
2480
+ hcLight: null
2481
+ }, ( (localize(
2482
+ 'extensionButtonProminentForeground',
2483
+ "Button foreground color for extension actions that stand out (e.g. install button)."
2484
+ ))));
2485
+ registerColor('extensionButton.prominentHoverBackground', {
2486
+ dark: buttonHoverBackground,
2487
+ light: buttonHoverBackground,
2488
+ hcDark: null,
2489
+ hcLight: null
2490
+ }, ( (localize(
2491
+ 'extensionButtonProminentHoverBackground',
2492
+ "Button background hover color for extension actions that stand out (e.g. install button)."
2493
+ ))));
2494
+ registerThemingParticipant((theme, collector) => {
2495
+ const errorColor = theme.getColor(editorErrorForeground);
2496
+ if (errorColor) {
2497
+ collector.addRule(`.extension-editor .header .actions-status-container > .status ${ThemeIcon.asCSSSelector(errorIcon)} { color: ${errorColor}; }`);
2498
+ collector.addRule(`.extension-editor .body .subcontent .runtime-status ${ThemeIcon.asCSSSelector(errorIcon)} { color: ${errorColor}; }`);
2499
+ collector.addRule(`.monaco-hover.extension-hover .markdown-hover .hover-contents ${ThemeIcon.asCSSSelector(errorIcon)} { color: ${errorColor}; }`);
2500
+ }
2501
+ const warningColor = theme.getColor(editorWarningForeground);
2502
+ if (warningColor) {
2503
+ collector.addRule(`.extension-editor .header .actions-status-container > .status ${ThemeIcon.asCSSSelector(warningIcon)} { color: ${warningColor}; }`);
2504
+ collector.addRule(`.extension-editor .body .subcontent .runtime-status ${ThemeIcon.asCSSSelector(warningIcon)} { color: ${warningColor}; }`);
2505
+ collector.addRule(`.monaco-hover.extension-hover .markdown-hover .hover-contents ${ThemeIcon.asCSSSelector(warningIcon)} { color: ${warningColor}; }`);
2506
+ }
2507
+ const infoColor = theme.getColor(editorInfoForeground);
2508
+ if (infoColor) {
2509
+ collector.addRule(`.extension-editor .header .actions-status-container > .status ${ThemeIcon.asCSSSelector(infoIcon)} { color: ${infoColor}; }`);
2510
+ collector.addRule(`.extension-editor .body .subcontent .runtime-status ${ThemeIcon.asCSSSelector(infoIcon)} { color: ${infoColor}; }`);
2511
+ collector.addRule(`.monaco-hover.extension-hover .markdown-hover .hover-contents ${ThemeIcon.asCSSSelector(infoIcon)} { color: ${infoColor}; }`);
2512
+ }
2513
+ });
2514
+ export { AbstractConfigureRecommendedExtensionsAction, AbstractInstallAction, ClearLanguageAction, ConfigureWorkspaceFolderRecommendedExtensionsAction, ConfigureWorkspaceRecommendedExtensionsAction, DisableForWorkspaceAction, DisableGloballyAction, DropDownMenuActionViewItem, EnableForWorkspaceAction, EnableGloballyAction, ExtensionAction, ExtensionDropDownAction, ExtensionStatusAction, ExtensionStatusLabelAction, IgnoreExtensionRecommendationAction, InstallAction, InstallAndSyncAction, InstallAnotherVersionAction, InstallInOtherServerAction, InstallRecommendedExtensionAction, InstallSpecificVersionOfExtensionAction, InstallingLabelAction, ManageExtensionAction, MenuItemExtensionAction, MigrateDeprecatedExtensionAction, PromptExtensionInstallFailureAction, ReinstallAction, ReloadAction, SearchExtensionsAction, SetColorThemeAction, SetFileIconThemeAction, SetLanguageAction, SetProductIconThemeAction, ShowRecommendedExtensionAction, SwitchToPreReleaseVersionAction, SwitchToReleasedVersionAction, ToggleSyncExtensionAction, UndoIgnoreExtensionRecommendationAction, UninstallAction, UpdateAction };