@theia/plugin-ext 1.60.2 → 1.61.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (346) hide show
  1. package/README.md +4 -3
  2. package/lib/common/plugin-api-rpc-model.d.ts +0 -1
  3. package/lib/common/plugin-api-rpc-model.d.ts.map +1 -1
  4. package/lib/common/plugin-api-rpc.d.ts +2 -2
  5. package/lib/common/plugin-api-rpc.d.ts.map +1 -1
  6. package/lib/common/plugin-protocol.d.ts +22 -17
  7. package/lib/common/plugin-protocol.d.ts.map +1 -1
  8. package/lib/common/plugin-protocol.js +0 -3
  9. package/lib/common/plugin-protocol.js.map +1 -1
  10. package/lib/hosted/common/hosted-plugin.d.ts.map +1 -1
  11. package/lib/hosted/common/hosted-plugin.js +5 -4
  12. package/lib/hosted/common/hosted-plugin.js.map +1 -1
  13. package/lib/hosted/node/hosted-plugin-process.d.ts +1 -9
  14. package/lib/hosted/node/hosted-plugin-process.d.ts.map +1 -1
  15. package/lib/hosted/node/hosted-plugin-process.js +0 -12
  16. package/lib/hosted/node/hosted-plugin-process.js.map +1 -1
  17. package/lib/hosted/node/hosted-plugin.d.ts +1 -9
  18. package/lib/hosted/node/hosted-plugin.d.ts.map +1 -1
  19. package/lib/hosted/node/hosted-plugin.js +0 -12
  20. package/lib/hosted/node/hosted-plugin.js.map +1 -1
  21. package/lib/hosted/node/metadata-scanner.d.ts +1 -1
  22. package/lib/hosted/node/metadata-scanner.d.ts.map +1 -1
  23. package/lib/hosted/node/metadata-scanner.js +3 -2
  24. package/lib/hosted/node/metadata-scanner.js.map +1 -1
  25. package/lib/hosted/node/{hosted-plugin-deployer-handler.d.ts → plugin-deployer-handler-impl.d.ts} +5 -2
  26. package/lib/hosted/node/plugin-deployer-handler-impl.d.ts.map +1 -0
  27. package/lib/hosted/node/{hosted-plugin-deployer-handler.js → plugin-deployer-handler-impl.js} +22 -13
  28. package/lib/hosted/node/plugin-deployer-handler-impl.js.map +1 -0
  29. package/lib/hosted/node/plugin-ext-hosted-backend-module.js +3 -3
  30. package/lib/hosted/node/plugin-ext-hosted-backend-module.js.map +1 -1
  31. package/lib/hosted/node/plugin-reader.d.ts +2 -1
  32. package/lib/hosted/node/plugin-reader.d.ts.map +1 -1
  33. package/lib/hosted/node/plugin-reader.js +2 -2
  34. package/lib/hosted/node/plugin-reader.js.map +1 -1
  35. package/lib/hosted/node/plugin-service.d.ts +12 -6
  36. package/lib/hosted/node/plugin-service.d.ts.map +1 -1
  37. package/lib/hosted/node/plugin-service.js +50 -41
  38. package/lib/hosted/node/plugin-service.js.map +1 -1
  39. package/lib/main/browser/authentication-main.d.ts +0 -1
  40. package/lib/main/browser/authentication-main.d.ts.map +1 -1
  41. package/lib/main/browser/command-registry-main.d.ts +0 -1
  42. package/lib/main/browser/command-registry-main.d.ts.map +1 -1
  43. package/lib/main/browser/custom-editors/custom-editors-main.d.ts +0 -1
  44. package/lib/main/browser/custom-editors/custom-editors-main.d.ts.map +1 -1
  45. package/lib/main/browser/debug/plugin-debug-service.d.ts +0 -1
  46. package/lib/main/browser/debug/plugin-debug-service.d.ts.map +1 -1
  47. package/lib/main/browser/editors-and-documents-main.d.ts +2 -0
  48. package/lib/main/browser/editors-and-documents-main.d.ts.map +1 -1
  49. package/lib/main/browser/editors-and-documents-main.js +4 -0
  50. package/lib/main/browser/editors-and-documents-main.js.map +1 -1
  51. package/lib/main/browser/languages-main.d.ts +0 -1
  52. package/lib/main/browser/languages-main.d.ts.map +1 -1
  53. package/lib/main/browser/menus/menus-contribution-handler.d.ts.map +1 -1
  54. package/lib/main/browser/menus/menus-contribution-handler.js +2 -1
  55. package/lib/main/browser/menus/menus-contribution-handler.js.map +1 -1
  56. package/lib/main/browser/notebooks/notebooks-main.d.ts +0 -1
  57. package/lib/main/browser/notebooks/notebooks-main.d.ts.map +1 -1
  58. package/lib/main/browser/notebooks/renderers/cell-output-webview.d.ts +2 -0
  59. package/lib/main/browser/notebooks/renderers/cell-output-webview.d.ts.map +1 -1
  60. package/lib/main/browser/notebooks/renderers/cell-output-webview.js +14 -2
  61. package/lib/main/browser/notebooks/renderers/cell-output-webview.js.map +1 -1
  62. package/lib/main/browser/notebooks/renderers/output-webview-internal.d.ts.map +1 -1
  63. package/lib/main/browser/notebooks/renderers/output-webview-internal.js +5 -0
  64. package/lib/main/browser/notebooks/renderers/output-webview-internal.js.map +1 -1
  65. package/lib/main/browser/notebooks/renderers/webview-communication.d.ts +5 -1
  66. package/lib/main/browser/notebooks/renderers/webview-communication.d.ts.map +1 -1
  67. package/lib/main/browser/quick-open-main.d.ts +0 -1
  68. package/lib/main/browser/quick-open-main.d.ts.map +1 -1
  69. package/lib/main/browser/terminal-main.d.ts +0 -1
  70. package/lib/main/browser/terminal-main.d.ts.map +1 -1
  71. package/lib/main/browser/text-editor-main.d.ts +2 -0
  72. package/lib/main/browser/text-editor-main.d.ts.map +1 -1
  73. package/lib/main/browser/text-editor-main.js +7 -0
  74. package/lib/main/browser/text-editor-main.js.map +1 -1
  75. package/lib/main/browser/text-editors-main.d.ts +2 -0
  76. package/lib/main/browser/text-editors-main.d.ts.map +1 -1
  77. package/lib/main/browser/text-editors-main.js +3 -0
  78. package/lib/main/browser/text-editors-main.js.map +1 -1
  79. package/lib/main/browser/view/tree-view-decorator-service.d.ts +0 -1
  80. package/lib/main/browser/view/tree-view-decorator-service.d.ts.map +1 -1
  81. package/lib/main/browser/view/tree-view-widget.d.ts +0 -1
  82. package/lib/main/browser/view/tree-view-widget.d.ts.map +1 -1
  83. package/lib/main/browser/view/tree-views-main.d.ts +0 -1
  84. package/lib/main/browser/view/tree-views-main.d.ts.map +1 -1
  85. package/lib/main/browser/webview/webview.d.ts +0 -1
  86. package/lib/main/browser/webview/webview.d.ts.map +1 -1
  87. package/lib/main/browser/webview-views/webview-views-main.d.ts +0 -1
  88. package/lib/main/browser/webview-views/webview-views-main.d.ts.map +1 -1
  89. package/lib/main/browser/webviews-main.d.ts +0 -1
  90. package/lib/main/browser/webviews-main.d.ts.map +1 -1
  91. package/lib/main/browser/workspace-main.d.ts +0 -1
  92. package/lib/main/browser/workspace-main.d.ts.map +1 -1
  93. package/lib/main/node/plugin-deployer-impl.d.ts +2 -0
  94. package/lib/main/node/plugin-deployer-impl.d.ts.map +1 -1
  95. package/lib/main/node/plugin-deployer-impl.js +6 -0
  96. package/lib/main/node/plugin-deployer-impl.js.map +1 -1
  97. package/lib/main/node/plugin-ext-backend-module.js +2 -2
  98. package/lib/main/node/plugin-ext-backend-module.js.map +1 -1
  99. package/lib/main/node/plugin-mgmt-cli-contribution.d.ts +2 -2
  100. package/lib/main/node/plugin-mgmt-cli-contribution.d.ts.map +1 -1
  101. package/lib/main/node/plugin-mgmt-cli-contribution.js +3 -3
  102. package/lib/main/node/plugin-mgmt-cli-contribution.js.map +1 -1
  103. package/lib/main/node/plugin-server-impl.d.ts +24 -0
  104. package/lib/main/node/plugin-server-impl.d.ts.map +1 -0
  105. package/lib/main/node/{plugin-server-handler.js → plugin-server-impl.js} +34 -13
  106. package/lib/main/node/plugin-server-impl.js.map +1 -0
  107. package/lib/main/node/plugin-service.d.ts +1 -0
  108. package/lib/main/node/plugin-service.d.ts.map +1 -1
  109. package/lib/main/node/plugin-uninstallation-manager.d.ts +19 -7
  110. package/lib/main/node/plugin-uninstallation-manager.d.ts.map +1 -1
  111. package/lib/main/node/plugin-uninstallation-manager.js +79 -27
  112. package/lib/main/node/plugin-uninstallation-manager.js.map +1 -1
  113. package/lib/plugin/authentication-ext.d.ts +0 -1
  114. package/lib/plugin/authentication-ext.d.ts.map +1 -1
  115. package/lib/plugin/clipboard-ext.d.ts +0 -1
  116. package/lib/plugin/clipboard-ext.d.ts.map +1 -1
  117. package/lib/plugin/command-registry.d.ts +0 -1
  118. package/lib/plugin/command-registry.d.ts.map +1 -1
  119. package/lib/plugin/comments.d.ts +0 -1
  120. package/lib/plugin/comments.d.ts.map +1 -1
  121. package/lib/plugin/custom-editors.d.ts +0 -1
  122. package/lib/plugin/custom-editors.d.ts.map +1 -1
  123. package/lib/plugin/debug/debug-ext.d.ts +0 -1
  124. package/lib/plugin/debug/debug-ext.d.ts.map +1 -1
  125. package/lib/plugin/debug/plugin-debug-adapter-creator.d.ts +0 -1
  126. package/lib/plugin/debug/plugin-debug-adapter-creator.d.ts.map +1 -1
  127. package/lib/plugin/debug/plugin-debug-adapter-session.d.ts +0 -1
  128. package/lib/plugin/debug/plugin-debug-adapter-session.d.ts.map +1 -1
  129. package/lib/plugin/debug/plugin-debug-adapter-tracker.d.ts +0 -1
  130. package/lib/plugin/debug/plugin-debug-adapter-tracker.d.ts.map +1 -1
  131. package/lib/plugin/decorations.d.ts +0 -1
  132. package/lib/plugin/decorations.d.ts.map +1 -1
  133. package/lib/plugin/dialogs.d.ts +0 -1
  134. package/lib/plugin/dialogs.d.ts.map +1 -1
  135. package/lib/plugin/document-data.d.ts +0 -1
  136. package/lib/plugin/document-data.d.ts.map +1 -1
  137. package/lib/plugin/documents.d.ts +0 -1
  138. package/lib/plugin/documents.d.ts.map +1 -1
  139. package/lib/plugin/env.d.ts +0 -1
  140. package/lib/plugin/env.d.ts.map +1 -1
  141. package/lib/plugin/file-system-event-service-ext-impl.d.ts +1 -2
  142. package/lib/plugin/file-system-event-service-ext-impl.d.ts.map +1 -1
  143. package/lib/plugin/file-system-event-service-ext-impl.js +2 -2
  144. package/lib/plugin/file-system-event-service-ext-impl.js.map +1 -1
  145. package/lib/plugin/file-system-ext-impl.d.ts +0 -1
  146. package/lib/plugin/file-system-ext-impl.d.ts.map +1 -1
  147. package/lib/plugin/label-service.d.ts +0 -1
  148. package/lib/plugin/label-service.d.ts.map +1 -1
  149. package/lib/plugin/languages/call-hierarchy.d.ts +0 -1
  150. package/lib/plugin/languages/call-hierarchy.d.ts.map +1 -1
  151. package/lib/plugin/languages/code-action.d.ts +0 -1
  152. package/lib/plugin/languages/code-action.d.ts.map +1 -1
  153. package/lib/plugin/languages/color.d.ts +0 -1
  154. package/lib/plugin/languages/color.d.ts.map +1 -1
  155. package/lib/plugin/languages/completion.d.ts +0 -1
  156. package/lib/plugin/languages/completion.d.ts.map +1 -1
  157. package/lib/plugin/languages/declaration.d.ts +0 -1
  158. package/lib/plugin/languages/declaration.d.ts.map +1 -1
  159. package/lib/plugin/languages/definition.d.ts +0 -1
  160. package/lib/plugin/languages/definition.d.ts.map +1 -1
  161. package/lib/plugin/languages/diagnostics.d.ts +0 -1
  162. package/lib/plugin/languages/diagnostics.d.ts.map +1 -1
  163. package/lib/plugin/languages/document-drop-edit.d.ts +0 -1
  164. package/lib/plugin/languages/document-drop-edit.d.ts.map +1 -1
  165. package/lib/plugin/languages/document-formatting.d.ts +0 -1
  166. package/lib/plugin/languages/document-formatting.d.ts.map +1 -1
  167. package/lib/plugin/languages/document-highlight.d.ts +0 -1
  168. package/lib/plugin/languages/document-highlight.d.ts.map +1 -1
  169. package/lib/plugin/languages/evaluatable-expression.d.ts +0 -1
  170. package/lib/plugin/languages/evaluatable-expression.d.ts.map +1 -1
  171. package/lib/plugin/languages/folding.d.ts +0 -1
  172. package/lib/plugin/languages/folding.d.ts.map +1 -1
  173. package/lib/plugin/languages/hover.d.ts +0 -1
  174. package/lib/plugin/languages/hover.d.ts.map +1 -1
  175. package/lib/plugin/languages/implementation.d.ts +0 -1
  176. package/lib/plugin/languages/implementation.d.ts.map +1 -1
  177. package/lib/plugin/languages/inlay-hints.d.ts +0 -1
  178. package/lib/plugin/languages/inlay-hints.d.ts.map +1 -1
  179. package/lib/plugin/languages/inline-completion.d.ts +0 -1
  180. package/lib/plugin/languages/inline-completion.d.ts.map +1 -1
  181. package/lib/plugin/languages/inline-values.d.ts +0 -1
  182. package/lib/plugin/languages/inline-values.d.ts.map +1 -1
  183. package/lib/plugin/languages/lens.d.ts +0 -1
  184. package/lib/plugin/languages/lens.d.ts.map +1 -1
  185. package/lib/plugin/languages/link-provider.d.ts +0 -1
  186. package/lib/plugin/languages/link-provider.d.ts.map +1 -1
  187. package/lib/plugin/languages/linked-editing-range.d.ts +0 -1
  188. package/lib/plugin/languages/linked-editing-range.d.ts.map +1 -1
  189. package/lib/plugin/languages/on-type-formatting.d.ts +0 -1
  190. package/lib/plugin/languages/on-type-formatting.d.ts.map +1 -1
  191. package/lib/plugin/languages/outline.d.ts +0 -1
  192. package/lib/plugin/languages/outline.d.ts.map +1 -1
  193. package/lib/plugin/languages/range-formatting.d.ts +0 -1
  194. package/lib/plugin/languages/range-formatting.d.ts.map +1 -1
  195. package/lib/plugin/languages/reference.d.ts +0 -1
  196. package/lib/plugin/languages/reference.d.ts.map +1 -1
  197. package/lib/plugin/languages/rename.d.ts +0 -1
  198. package/lib/plugin/languages/rename.d.ts.map +1 -1
  199. package/lib/plugin/languages/selection-range.d.ts +0 -1
  200. package/lib/plugin/languages/selection-range.d.ts.map +1 -1
  201. package/lib/plugin/languages/semantic-highlighting.d.ts +0 -1
  202. package/lib/plugin/languages/semantic-highlighting.d.ts.map +1 -1
  203. package/lib/plugin/languages/signature.d.ts +0 -1
  204. package/lib/plugin/languages/signature.d.ts.map +1 -1
  205. package/lib/plugin/languages/type-definition.d.ts +0 -1
  206. package/lib/plugin/languages/type-definition.d.ts.map +1 -1
  207. package/lib/plugin/languages/type-hierarchy.d.ts +0 -1
  208. package/lib/plugin/languages/type-hierarchy.d.ts.map +1 -1
  209. package/lib/plugin/languages/util.d.ts +0 -1
  210. package/lib/plugin/languages/util.d.ts.map +1 -1
  211. package/lib/plugin/languages/workspace-symbol.d.ts +0 -1
  212. package/lib/plugin/languages/workspace-symbol.d.ts.map +1 -1
  213. package/lib/plugin/languages-utils.d.ts +0 -1
  214. package/lib/plugin/languages-utils.d.ts.map +1 -1
  215. package/lib/plugin/languages.d.ts +0 -1
  216. package/lib/plugin/languages.d.ts.map +1 -1
  217. package/lib/plugin/markdown-string.d.ts +0 -1
  218. package/lib/plugin/markdown-string.d.ts.map +1 -1
  219. package/lib/plugin/message-registry.d.ts +0 -1
  220. package/lib/plugin/message-registry.d.ts.map +1 -1
  221. package/lib/plugin/node/debug/plugin-node-debug-adapter-creator.d.ts +0 -1
  222. package/lib/plugin/node/debug/plugin-node-debug-adapter-creator.d.ts.map +1 -1
  223. package/lib/plugin/notebook/notebook-document.d.ts +0 -1
  224. package/lib/plugin/notebook/notebook-document.d.ts.map +1 -1
  225. package/lib/plugin/notebook/notebook-documents.d.ts +0 -1
  226. package/lib/plugin/notebook/notebook-documents.d.ts.map +1 -1
  227. package/lib/plugin/notebook/notebook-editor.d.ts +0 -1
  228. package/lib/plugin/notebook/notebook-editor.d.ts.map +1 -1
  229. package/lib/plugin/notebook/notebook-editors.d.ts +0 -1
  230. package/lib/plugin/notebook/notebook-editors.d.ts.map +1 -1
  231. package/lib/plugin/notebook/notebook-kernels.d.ts +0 -1
  232. package/lib/plugin/notebook/notebook-kernels.d.ts.map +1 -1
  233. package/lib/plugin/notebook/notebook-renderers.d.ts +0 -1
  234. package/lib/plugin/notebook/notebook-renderers.d.ts.map +1 -1
  235. package/lib/plugin/notebook/notebooks.d.ts +0 -1
  236. package/lib/plugin/notebook/notebooks.d.ts.map +1 -1
  237. package/lib/plugin/notification.d.ts +0 -1
  238. package/lib/plugin/notification.d.ts.map +1 -1
  239. package/lib/plugin/output-channel/log-output-channel.d.ts +0 -1
  240. package/lib/plugin/output-channel/log-output-channel.d.ts.map +1 -1
  241. package/lib/plugin/output-channel/output-channel-item.d.ts +0 -1
  242. package/lib/plugin/output-channel/output-channel-item.d.ts.map +1 -1
  243. package/lib/plugin/output-channel-registry.d.ts +0 -1
  244. package/lib/plugin/output-channel-registry.d.ts.map +1 -1
  245. package/lib/plugin/plugin-context.d.ts +0 -1
  246. package/lib/plugin/plugin-context.d.ts.map +1 -1
  247. package/lib/plugin/plugin-context.js +15 -11
  248. package/lib/plugin/plugin-context.js.map +1 -1
  249. package/lib/plugin/plugin-manager.d.ts +0 -1
  250. package/lib/plugin/plugin-manager.d.ts.map +1 -1
  251. package/lib/plugin/plugin-storage.d.ts +0 -1
  252. package/lib/plugin/plugin-storage.d.ts.map +1 -1
  253. package/lib/plugin/preference-registry.d.ts +0 -1
  254. package/lib/plugin/preference-registry.d.ts.map +1 -1
  255. package/lib/plugin/quick-open.d.ts +0 -1
  256. package/lib/plugin/quick-open.d.ts.map +1 -1
  257. package/lib/plugin/scm.d.ts +0 -1
  258. package/lib/plugin/scm.d.ts.map +1 -1
  259. package/lib/plugin/secrets-ext.d.ts +0 -1
  260. package/lib/plugin/secrets-ext.d.ts.map +1 -1
  261. package/lib/plugin/status-bar/status-bar-item.d.ts +0 -1
  262. package/lib/plugin/status-bar/status-bar-item.d.ts.map +1 -1
  263. package/lib/plugin/status-bar-message-registry.d.ts +0 -1
  264. package/lib/plugin/status-bar-message-registry.d.ts.map +1 -1
  265. package/lib/plugin/tabs.d.ts +0 -1
  266. package/lib/plugin/tabs.d.ts.map +1 -1
  267. package/lib/plugin/tasks/task-provider.d.ts +0 -1
  268. package/lib/plugin/tasks/task-provider.d.ts.map +1 -1
  269. package/lib/plugin/tasks/task-provider.js +1 -1
  270. package/lib/plugin/tasks/task-provider.js.map +1 -1
  271. package/lib/plugin/tasks/tasks.d.ts +0 -1
  272. package/lib/plugin/tasks/tasks.d.ts.map +1 -1
  273. package/lib/plugin/tasks/tasks.js +3 -3
  274. package/lib/plugin/tasks/tasks.js.map +1 -1
  275. package/lib/plugin/terminal-ext.d.ts +0 -1
  276. package/lib/plugin/terminal-ext.d.ts.map +1 -1
  277. package/lib/plugin/test-item.d.ts +0 -1
  278. package/lib/plugin/test-item.d.ts.map +1 -1
  279. package/lib/plugin/tests.d.ts +0 -1
  280. package/lib/plugin/tests.d.ts.map +1 -1
  281. package/lib/plugin/text-editor.d.ts +1 -1
  282. package/lib/plugin/text-editor.d.ts.map +1 -1
  283. package/lib/plugin/text-editor.js +3 -0
  284. package/lib/plugin/text-editor.js.map +1 -1
  285. package/lib/plugin/text-editors.d.ts +1 -1
  286. package/lib/plugin/text-editors.d.ts.map +1 -1
  287. package/lib/plugin/text-editors.js +7 -0
  288. package/lib/plugin/text-editors.js.map +1 -1
  289. package/lib/plugin/timeline.d.ts +0 -1
  290. package/lib/plugin/timeline.d.ts.map +1 -1
  291. package/lib/plugin/tree/tree-views.d.ts +0 -1
  292. package/lib/plugin/tree/tree-views.d.ts.map +1 -1
  293. package/lib/plugin/type-converters.d.ts +0 -1
  294. package/lib/plugin/type-converters.d.ts.map +1 -1
  295. package/lib/plugin/type-converters.js +7 -7
  296. package/lib/plugin/type-converters.js.map +1 -1
  297. package/lib/plugin/type-converters.spec.js +2 -2
  298. package/lib/plugin/type-converters.spec.js.map +1 -1
  299. package/lib/plugin/types-impl.d.ts +0 -1
  300. package/lib/plugin/types-impl.d.ts.map +1 -1
  301. package/lib/plugin/uri-ext.d.ts +0 -1
  302. package/lib/plugin/uri-ext.d.ts.map +1 -1
  303. package/lib/plugin/webview-views.d.ts +0 -1
  304. package/lib/plugin/webview-views.d.ts.map +1 -1
  305. package/lib/plugin/webviews.d.ts +0 -1
  306. package/lib/plugin/webviews.d.ts.map +1 -1
  307. package/lib/plugin/window-state.d.ts +0 -1
  308. package/lib/plugin/window-state.d.ts.map +1 -1
  309. package/lib/plugin/workspace.d.ts +0 -1
  310. package/lib/plugin/workspace.d.ts.map +1 -1
  311. package/package.json +29 -29
  312. package/src/common/plugin-api-rpc.ts +2 -2
  313. package/src/common/plugin-protocol.ts +28 -20
  314. package/src/hosted/common/hosted-plugin.ts +7 -4
  315. package/src/hosted/node/hosted-plugin-process.ts +1 -15
  316. package/src/hosted/node/hosted-plugin.ts +1 -15
  317. package/src/hosted/node/metadata-scanner.ts +3 -2
  318. package/src/hosted/node/{hosted-plugin-deployer-handler.ts → plugin-deployer-handler-impl.ts} +15 -4
  319. package/src/hosted/node/plugin-ext-hosted-backend-module.ts +3 -3
  320. package/src/hosted/node/plugin-reader.ts +2 -2
  321. package/src/hosted/node/plugin-service.ts +57 -43
  322. package/src/main/browser/editors-and-documents-main.ts +6 -0
  323. package/src/main/browser/menus/menus-contribution-handler.ts +2 -1
  324. package/src/main/browser/notebooks/renderers/cell-output-webview.tsx +11 -0
  325. package/src/main/browser/notebooks/renderers/output-webview-internal.ts +6 -2
  326. package/src/main/browser/notebooks/renderers/webview-communication.ts +6 -0
  327. package/src/main/browser/text-editor-main.ts +9 -0
  328. package/src/main/browser/text-editors-main.ts +5 -0
  329. package/src/main/node/plugin-deployer-impl.ts +8 -0
  330. package/src/main/node/plugin-ext-backend-module.ts +2 -2
  331. package/src/main/node/plugin-mgmt-cli-contribution.ts +3 -3
  332. package/src/main/node/{plugin-server-handler.ts → plugin-server-impl.ts} +33 -7
  333. package/src/main/node/plugin-uninstallation-manager.ts +84 -26
  334. package/src/plugin/file-system-event-service-ext-impl.ts +2 -2
  335. package/src/plugin/plugin-context.ts +22 -17
  336. package/src/plugin/tasks/task-provider.ts +1 -1
  337. package/src/plugin/tasks/tasks.ts +3 -3
  338. package/src/plugin/text-editor.ts +4 -0
  339. package/src/plugin/text-editors.ts +8 -0
  340. package/src/plugin/type-converters.spec.ts +2 -2
  341. package/src/plugin/type-converters.ts +7 -7
  342. package/lib/hosted/node/hosted-plugin-deployer-handler.d.ts.map +0 -1
  343. package/lib/hosted/node/hosted-plugin-deployer-handler.js.map +0 -1
  344. package/lib/main/node/plugin-server-handler.d.ts +0 -17
  345. package/lib/main/node/plugin-server-handler.d.ts.map +0 -1
  346. package/lib/main/node/plugin-server-handler.js.map +0 -1
@@ -14,14 +14,15 @@
14
14
  // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
15
  // *****************************************************************************
16
16
  import { injectable, inject, named, optional, postConstruct } from '@theia/core/shared/inversify';
17
- import { HostedPluginServer, HostedPluginClient, PluginDeployer, GetDeployedPluginsParams, DeployedPlugin, PluginIdentifiers } from '../../common/plugin-protocol';
17
+ import { HostedPluginServer, HostedPluginClient, PluginDeployer, DeployedPlugin, PluginIdentifiers } from '../../common/plugin-protocol';
18
18
  import { HostedPluginSupport } from './hosted-plugin';
19
19
  import { ILogger, Disposable, ContributionProvider, DisposableCollection } from '@theia/core';
20
20
  import { ExtPluginApiProvider, ExtPluginApi } from '../../common/plugin-ext-api-contribution';
21
- import { HostedPluginDeployerHandler } from './hosted-plugin-deployer-handler';
21
+ import { PluginDeployerHandlerImpl } from './plugin-deployer-handler-impl';
22
22
  import { PluginDeployerImpl } from '../../main/node/plugin-deployer-impl';
23
23
  import { HostedPluginLocalizationService } from './hosted-plugin-localization-service';
24
24
  import { PluginUninstallationManager } from '../../main/node/plugin-uninstallation-manager';
25
+ import { Deferred } from '@theia/core/lib/common/promise-util';
25
26
 
26
27
  export const BackendPluginHostableFilter = Symbol('BackendPluginHostableFilter');
27
28
  /**
@@ -31,13 +32,16 @@ export const BackendPluginHostableFilter = Symbol('BackendPluginHostableFilter')
31
32
  */
32
33
  export type BackendPluginHostableFilter = (plugin: DeployedPlugin) => boolean;
33
34
 
35
+ /**
36
+ * This class implements the per-front-end services for plugin management and communication
37
+ */
34
38
  @injectable()
35
39
  export class HostedPluginServerImpl implements HostedPluginServer {
36
40
  @inject(ILogger)
37
41
  protected readonly logger: ILogger;
38
42
 
39
- @inject(HostedPluginDeployerHandler)
40
- protected readonly deployerHandler: HostedPluginDeployerHandler;
43
+ @inject(PluginDeployerHandlerImpl)
44
+ protected readonly deployerHandler: PluginDeployerHandlerImpl;
41
45
 
42
46
  @inject(PluginDeployer)
43
47
  protected readonly pluginDeployer: PluginDeployerImpl;
@@ -58,18 +62,13 @@ export class HostedPluginServerImpl implements HostedPluginServer {
58
62
  protected client: HostedPluginClient | undefined;
59
63
  protected toDispose = new DisposableCollection();
60
64
 
61
- protected _ignoredPlugins?: Set<PluginIdentifiers.VersionedId>;
62
-
63
- // We ignore any plugins that are marked as uninstalled the first time the frontend requests information about deployed plugins.
64
- protected get ignoredPlugins(): Set<PluginIdentifiers.VersionedId> {
65
- if (!this._ignoredPlugins) {
66
- this._ignoredPlugins = new Set(this.uninstallationManager.getUninstalledPluginIds());
67
- }
68
- return this._ignoredPlugins;
69
- }
65
+ protected uninstalledPlugins: Set<PluginIdentifiers.VersionedId>;
66
+ protected disabledPlugins: Set<PluginIdentifiers.VersionedId>;
70
67
 
71
68
  protected readonly pluginVersions = new Map<PluginIdentifiers.UnversionedId, string>();
72
69
 
70
+ protected readonly initialized = new Deferred<void>();
71
+
73
72
  constructor(
74
73
  @inject(HostedPluginSupport) private readonly hostedPlugin: HostedPluginSupport) {
75
74
  }
@@ -80,21 +79,40 @@ export class HostedPluginServerImpl implements HostedPluginServer {
80
79
  this.backendPluginHostableFilter = () => true;
81
80
  }
82
81
 
83
- this.toDispose.pushAll([
84
- this.pluginDeployer.onDidDeploy(() => this.client?.onDidDeploy()),
85
- this.uninstallationManager.onDidChangeUninstalledPlugins(currentUninstalled => {
86
- if (this._ignoredPlugins) {
87
- const uninstalled = new Set(currentUninstalled);
88
- for (const previouslyUninstalled of this._ignoredPlugins) {
89
- if (!uninstalled.has(previouslyUninstalled)) {
90
- this._ignoredPlugins.delete(previouslyUninstalled);
82
+ this.uninstalledPlugins = new Set(this.uninstallationManager.getUninstalledPluginIds());
83
+
84
+ const asyncInit = async () => {
85
+ this.disabledPlugins = new Set(await this.uninstallationManager.getDisabledPluginIds());
86
+
87
+ this.toDispose.pushAll([
88
+ this.pluginDeployer.onDidDeploy(() => this.client?.onDidDeploy()),
89
+ this.uninstallationManager.onDidChangeUninstalledPlugins(currentUninstalled => {
90
+ if (this.uninstalledPlugins) {
91
+ const uninstalled = new Set(currentUninstalled);
92
+ for (const previouslyUninstalled of this.uninstalledPlugins) {
93
+ if (!uninstalled.has(previouslyUninstalled)) {
94
+ this.uninstalledPlugins.delete(previouslyUninstalled);
95
+ }
91
96
  }
92
97
  }
93
- }
94
- this.client?.onDidDeploy();
95
- }),
96
- Disposable.create(() => this.hostedPlugin.clientClosed()),
97
- ]);
98
+ this.client?.onDidDeploy();
99
+ }),
100
+ this.uninstallationManager.onDidChangeDisabledPlugins(currentlyDisabled => {
101
+ if (this.disabledPlugins) {
102
+ const disabled = new Set(currentlyDisabled);
103
+ for (const previouslyUninstalled of this.disabledPlugins) {
104
+ if (!disabled.has(previouslyUninstalled)) {
105
+ this.disabledPlugins.delete(previouslyUninstalled);
106
+ }
107
+ }
108
+ }
109
+ this.client?.onDidDeploy();
110
+ }),
111
+ Disposable.create(() => this.hostedPlugin.clientClosed()),
112
+ ]);
113
+ this.initialized.resolve();
114
+ };
115
+ asyncInit();
98
116
  }
99
117
 
100
118
  protected getServerName(): string {
@@ -111,6 +129,7 @@ export class HostedPluginServerImpl implements HostedPluginServer {
111
129
  }
112
130
 
113
131
  async getDeployedPluginIds(): Promise<PluginIdentifiers.VersionedId[]> {
132
+ await this.initialized.promise;
114
133
  const backendPlugins = (await this.deployerHandler.getDeployedBackendPlugins())
115
134
  .filter(this.backendPluginHostableFilter);
116
135
  if (backendPlugins.length > 0) {
@@ -126,7 +145,6 @@ export class HostedPluginServerImpl implements HostedPluginServer {
126
145
  };
127
146
  addIds(await this.deployerHandler.getDeployedFrontendPluginIds());
128
147
  addIds(await this.deployerHandler.getDeployedBackendPluginIds());
129
- addIds(await this.hostedPlugin.getExtraDeployedPluginIds());
130
148
  return Array.from(plugins);
131
149
  }
132
150
 
@@ -146,7 +164,11 @@ export class HostedPluginServerImpl implements HostedPluginServer {
146
164
  if (knownVersion !== undefined && knownVersion !== versionAndId.version) {
147
165
  return false;
148
166
  }
149
- if (this.ignoredPlugins.has(identifier)) {
167
+ if (this.uninstalledPlugins.has(identifier)) {
168
+ return false;
169
+ }
170
+
171
+ if (this.disabledPlugins.has(identifier)) {
150
172
  return false;
151
173
  }
152
174
  if (knownVersion === undefined) {
@@ -159,26 +181,18 @@ export class HostedPluginServerImpl implements HostedPluginServer {
159
181
  return Promise.resolve(this.uninstallationManager.getUninstalledPluginIds());
160
182
  }
161
183
 
162
- async getDeployedPlugins({ pluginIds }: GetDeployedPluginsParams): Promise<DeployedPlugin[]> {
184
+ getDisabledPluginIds(): Promise<readonly PluginIdentifiers.VersionedId[]> {
185
+ return Promise.resolve(this.uninstallationManager.getDisabledPluginIds());
186
+ }
187
+
188
+ async getDeployedPlugins(pluginIds: PluginIdentifiers.VersionedId[]): Promise<DeployedPlugin[]> {
163
189
  if (!pluginIds.length) {
164
190
  return [];
165
191
  }
166
192
  const plugins: DeployedPlugin[] = [];
167
- let extraDeployedPlugins: Map<string, DeployedPlugin> | undefined;
168
193
  for (const versionedId of pluginIds) {
169
- if (!this.isRelevantPlugin(versionedId)) {
170
- continue;
171
- }
172
- let plugin = this.deployerHandler.getDeployedPlugin(versionedId);
173
- if (!plugin) {
174
- if (!extraDeployedPlugins) {
175
- extraDeployedPlugins = new Map<string, DeployedPlugin>();
176
- for (const extraDeployedPlugin of await this.hostedPlugin.getExtraDeployedPlugins()) {
177
- extraDeployedPlugins.set(PluginIdentifiers.componentsToVersionedId(extraDeployedPlugin.metadata.model), extraDeployedPlugin);
178
- }
179
- }
180
- plugin = extraDeployedPlugins.get(versionedId);
181
- }
194
+ const plugin = this.deployerHandler.getDeployedPlugin(versionedId);
195
+
182
196
  if (plugin) {
183
197
  plugins.push(plugin);
184
198
  }
@@ -16,6 +16,7 @@
16
16
 
17
17
  import { interfaces } from '@theia/core/shared/inversify';
18
18
  import * as monaco from '@theia/monaco-editor-core';
19
+ import { type ILineChange } from '@theia/monaco-editor-core/esm/vs/editor/common/diff/legacyLinesDiffComputer';
19
20
  import { RPCProtocol } from '../../common/rpc-protocol';
20
21
  import {
21
22
  MAIN_RPC_CONTEXT,
@@ -212,6 +213,11 @@ export class EditorsAndDocumentsMain implements Disposable {
212
213
  }
213
214
  return Promise.resolve();
214
215
  }
216
+
217
+ getDiffInformation(id: string): ILineChange[] {
218
+ const editor = this.getEditor(id);
219
+ return editor?.diffInformation || [];
220
+ }
215
221
  }
216
222
 
217
223
  class EditorAndDocumentStateComputer implements Disposable {
@@ -121,7 +121,8 @@ export class MenusContributionPointHandler {
121
121
  }
122
122
  }
123
123
  } catch (error) {
124
- console.warn(`Failed to register a menu item for plugin ${plugin.metadata.model.id} contributed to ${contributionPoint}`, item, error);
124
+ console.warn(`Failed to register a menu item for plugin ${plugin.metadata.model.id} contributed to ${contributionPoint}`, item);
125
+ console.debug(error);
125
126
  }
126
127
  }
127
128
  }
@@ -43,6 +43,8 @@ import { NotebookCellModel } from '@theia/notebook/lib/browser/view-model/notebo
43
43
  import { CellOutput, NotebookCellsChangeType } from '@theia/notebook/lib/common';
44
44
  import { NotebookCellOutputModel } from '@theia/notebook/lib/browser/view-model/notebook-cell-output-model';
45
45
  import { Deferred } from '@theia/core/lib/common/promise-util';
46
+ import { ContextKeyService } from '@theia/core/lib/browser/context-key-service';
47
+ import { NOTEBOOK_OUTPUT_FOCUSED } from '@theia/notebook/lib/browser/contributions/notebook-context-keys';
46
48
 
47
49
  export const AdditionalNotebookCellOutputCss = Symbol('AdditionalNotebookCellOutputCss');
48
50
 
@@ -228,6 +230,9 @@ export class CellOutputWebviewImpl implements CellOutputWebview, Disposable {
228
230
  @inject(NotebookOptionsService)
229
231
  protected readonly notebookOptionsService: NotebookOptionsService;
230
232
 
233
+ @inject(ContextKeyService)
234
+ protected readonly contextKeyService: ContextKeyService;
235
+
231
236
  // returns the output Height
232
237
  protected readonly onDidRenderOutputEmitter = new Emitter<OutputRenderEvent>();
233
238
  readonly onDidRenderOutput = this.onDidRenderOutputEmitter.event;
@@ -524,6 +529,12 @@ export class CellOutputWebviewImpl implements CellOutputWebview, Disposable {
524
529
  this.notebook.setSelectedCell(selectedCell);
525
530
  }
526
531
  break;
532
+ case 'webviewFocusChanged':
533
+ if (message.focused) {
534
+ window.getSelection()?.empty();
535
+ }
536
+ this.contextKeyService.setContext(NOTEBOOK_OUTPUT_FOCUSED, message.focused);
537
+ break;
527
538
  case 'cellHeightRequest':
528
539
  const cellHeight = this.notebook.getCellByHandle(message.cellHandle)?.cellHeight ?? 0;
529
540
  this.webviewWidget.sendMessage({
@@ -801,11 +801,15 @@ export async function outputWebviewPreload(ctx: PreloadContext): Promise<void> {
801
801
  theia.postMessage({ type: 'inputFocusChanged', focused: focus } as webviewCommunication.InputFocusChange);
802
802
  }
803
803
  };
804
-
805
804
  window.addEventListener('focusin', (event: FocusEvent) => focusChange(event, true));
806
-
807
805
  window.addEventListener('focusout', (event: FocusEvent) => focusChange(event, false));
808
806
 
807
+ const webviewFocuseChange = (focus: boolean) => {
808
+ theia.postMessage({ type: 'webviewFocusChanged', focused: focus } as webviewCommunication.WebviewFocusChange);
809
+ };
810
+ window.addEventListener('focus', () => webviewFocuseChange(true));
811
+ window.addEventListener('blur', () => webviewFocuseChange(false));
812
+
809
813
  new ResizeObserver(() => {
810
814
  theia.postMessage({
811
815
  type: 'bodyHeightChange',
@@ -150,6 +150,11 @@ export interface CellOuputFocus {
150
150
  readonly cellHandle: number;
151
151
  }
152
152
 
153
+ export interface WebviewFocusChange {
154
+ readonly type: 'webviewFocusChanged';
155
+ readonly focused: boolean;
156
+ }
157
+
153
158
  export interface CellHeightRequest {
154
159
  readonly type: 'cellHeightRequest';
155
160
  readonly cellHandle: number;
@@ -167,6 +172,7 @@ export type FromWebviewMessage = WebviewInitialized
167
172
  | KernelMessage
168
173
  | InputFocusChange
169
174
  | CellOuputFocus
175
+ | WebviewFocusChange
170
176
  | CellHeightRequest
171
177
  | BodyHeightChange;
172
178
 
@@ -16,6 +16,7 @@
16
16
 
17
17
  import * as monaco from '@theia/monaco-editor-core';
18
18
  import { StandaloneCodeEditor } from '@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneCodeEditor';
19
+ import { type ILineChange } from '@theia/monaco-editor-core/esm/vs/editor/common/diff/legacyLinesDiffComputer';
19
20
  import { Disposable, DisposableCollection } from '@theia/core/lib/common/disposable';
20
21
  import { MonacoEditor } from '@theia/monaco/lib/browser/monaco-editor';
21
22
  import {
@@ -34,6 +35,7 @@ import { Emitter, Event } from '@theia/core';
34
35
  import { TextEditorCursorStyle, cursorStyleToString } from '../../common/editor-options';
35
36
  import { TextEditorLineNumbersStyle, EndOfLine } from '../../plugin/types-impl';
36
37
  import { SimpleMonacoEditor } from '@theia/monaco/lib/browser/simple-monaco-editor';
38
+ import { MonacoDiffEditor } from '@theia/monaco/lib/browser/monaco-diff-editor';
37
39
  import { EndOfLineSequence, ITextModel } from '@theia/monaco-editor-core/esm/vs/editor/common/model';
38
40
  import { EditorOption, RenderLineNumbersType } from '@theia/monaco-editor-core/esm/vs/editor/common/config/editorOptions';
39
41
 
@@ -130,6 +132,13 @@ export class TextEditorMain implements Disposable {
130
132
  return this.onPropertiesChangedEmitter.event;
131
133
  }
132
134
 
135
+ get diffInformation(): ILineChange[] | undefined {
136
+ if (!(this.editor instanceof MonacoDiffEditor)) {
137
+ return [];
138
+ }
139
+ return this.editor.diffInformation;
140
+ }
141
+
133
142
  setSelections(selections: Selection[]): void {
134
143
  if (this.editor) {
135
144
  this.editor.getControl().setSelections(selections);
@@ -47,6 +47,7 @@ import { ResourceEdit } from '@theia/monaco-editor-core/esm/vs/editor/browser/se
47
47
  import { IDecorationRenderOptions } from '@theia/monaco-editor-core/esm/vs/editor/common/editorCommon';
48
48
  import { StandaloneServices } from '@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices';
49
49
  import { ICodeEditorService } from '@theia/monaco-editor-core/esm/vs/editor/browser/services/codeEditorService';
50
+ import { type ILineChange } from '@theia/monaco-editor-core/esm/vs/editor/common/diff/legacyLinesDiffComputer';
50
51
  import { ArrayUtils, URI } from '@theia/core';
51
52
  import { toNotebookWorspaceEdit } from './notebooks/notebooks-main';
52
53
  import { interfaces } from '@theia/core/shared/inversify';
@@ -231,4 +232,8 @@ export class TextEditorsMainImpl implements TextEditorsMain, Disposable {
231
232
  return this.editorsAndDocuments.saveAll(includeUntitled);
232
233
  }
233
234
 
235
+ $getDiffInformation(id: string): Promise<ILineChange[]> {
236
+ return Promise.resolve(this.editorsAndDocuments.getDiffInformation(id));
237
+ }
238
+
234
239
  }
@@ -141,6 +141,14 @@ export class PluginDeployerImpl implements PluginDeployer {
141
141
  await this.pluginDeployerHandler.uninstallPlugin(pluginId);
142
142
  }
143
143
 
144
+ enablePlugin(pluginId: PluginIdentifiers.VersionedId): Promise<boolean> {
145
+ return this.pluginDeployerHandler.enablePlugin(pluginId);
146
+ }
147
+
148
+ disablePlugin(pluginId: PluginIdentifiers.VersionedId): Promise<boolean> {
149
+ return this.pluginDeployerHandler.disablePlugin(pluginId);
150
+ }
151
+
144
152
  async undeploy(pluginId: PluginIdentifiers.VersionedId): Promise<void> {
145
153
  if (await this.pluginDeployerHandler.undeployPlugin(pluginId)) {
146
154
  this.onDidDeployEmitter.fire();
@@ -33,7 +33,7 @@ import { HttpPluginDeployerResolver } from './plugin-http-resolver';
33
33
  import { ConnectionHandler, RpcConnectionHandler, bindContributionProvider } from '@theia/core';
34
34
  import { PluginPathsService, pluginPathsServicePath } from '../common/plugin-paths-protocol';
35
35
  import { PluginPathsServiceImpl } from './paths/plugin-paths-service';
36
- import { PluginServerHandler } from './plugin-server-handler';
36
+ import { PluginServerImpl } from './plugin-server-impl';
37
37
  import { PluginCliContribution } from './plugin-cli-contribution';
38
38
  import { PluginTheiaEnvironment } from '../common/plugin-theia-environment';
39
39
  import { PluginTheiaDeployerParticipant } from './plugin-theia-deployer-participant';
@@ -70,7 +70,7 @@ export function bindMainBackend(bind: interfaces.Bind, unbind: interfaces.Unbind
70
70
  bind(PluginDeployerFileHandler).to(PluginTheiaFileHandler).inSingletonScope();
71
71
  bind(PluginDeployerDirectoryHandler).to(PluginTheiaDirectoryHandler).inSingletonScope();
72
72
 
73
- bind(PluginServer).to(PluginServerHandler).inSingletonScope();
73
+ bind(PluginServer).to(PluginServerImpl).inSingletonScope();
74
74
 
75
75
  bind(PluginsKeyValueStorage).toSelf().inSingletonScope();
76
76
 
@@ -17,7 +17,7 @@
17
17
  import { inject, injectable } from '@theia/core/shared/inversify';
18
18
  import { Argv, Arguments } from '@theia/core/shared/yargs';
19
19
  import { CliContribution } from '@theia/core/lib/node/cli';
20
- import { HostedPluginDeployerHandler } from '../../hosted/node/hosted-plugin-deployer-handler';
20
+ import { PluginDeployerHandlerImpl } from '../../hosted/node/plugin-deployer-handler-impl';
21
21
  import { PluginType } from '../../common';
22
22
 
23
23
  @injectable()
@@ -27,8 +27,8 @@ export class PluginMgmtCliContribution implements CliContribution {
27
27
  static SHOW_VERSIONS = '--show-versions';
28
28
  static SHOW_BUILTINS = '--show-builtins';
29
29
 
30
- @inject(HostedPluginDeployerHandler)
31
- protected deployerHandler: HostedPluginDeployerHandler;
30
+ @inject(PluginDeployerHandlerImpl)
31
+ protected deployerHandler: PluginDeployerHandlerImpl;
32
32
 
33
33
  configure(conf: Argv): void {
34
34
  conf.command([PluginMgmtCliContribution.LIST_PLUGINS, 'list-extensions'],
@@ -18,21 +18,31 @@ import { injectable, inject } from '@theia/core/shared/inversify';
18
18
  import { CancellationToken } from '@theia/core/lib/common/cancellation';
19
19
  import { PluginDeployerImpl } from './plugin-deployer-impl';
20
20
  import { PluginsKeyValueStorage } from './plugins-key-value-storage';
21
- import { PluginServer, PluginDeployer, PluginStorageKind, PluginType, UnresolvedPluginEntry, PluginIdentifiers, PluginDeployOptions } from '../../common/plugin-protocol';
21
+ import {
22
+ PluginServer, PluginDeployer, PluginStorageKind, PluginType, UnresolvedPluginEntry, PluginIdentifiers,
23
+ PluginDeployOptions, PluginDeployerHandler
24
+ } from '../../common/plugin-protocol';
22
25
  import { KeysToAnyValues, KeysToKeysToAnyValue } from '../../common/types';
26
+ import { PluginUninstallationManager } from './plugin-uninstallation-manager';
23
27
 
24
28
  @injectable()
25
- export class PluginServerHandler implements PluginServer {
29
+ export class PluginServerImpl implements PluginServer {
26
30
 
27
31
  @inject(PluginDeployer)
28
32
  protected readonly pluginDeployer: PluginDeployerImpl;
29
33
 
34
+ @inject(PluginDeployerHandler)
35
+ protected readonly pluginDeployerHandler: PluginDeployerHandler;
36
+
30
37
  @inject(PluginsKeyValueStorage)
31
38
  protected readonly pluginsKeyValueStorage: PluginsKeyValueStorage;
32
39
 
33
- async deploy(pluginEntry: string, arg2?: PluginType | CancellationToken, options?: PluginDeployOptions): Promise<void> {
40
+ @inject(PluginUninstallationManager)
41
+ protected readonly uninstallationManager: PluginUninstallationManager;
42
+
43
+ async install(pluginEntry: string, arg2?: PluginType | CancellationToken, options?: PluginDeployOptions): Promise<void> {
34
44
  const type = typeof arg2 === 'number' ? arg2 as PluginType : undefined;
35
- const successfulDeployments = await this.doDeploy({
45
+ const successfulDeployments = await this.doInstall({
36
46
  id: pluginEntry,
37
47
  type: type ?? PluginType.User
38
48
  }, options);
@@ -42,16 +52,32 @@ export class PluginServerHandler implements PluginServer {
42
52
  }
43
53
  }
44
54
 
45
- protected doDeploy(pluginEntry: UnresolvedPluginEntry, options?: PluginDeployOptions): Promise<number> {
55
+ protected doInstall(pluginEntry: UnresolvedPluginEntry, options?: PluginDeployOptions): Promise<number> {
46
56
  return this.pluginDeployer.deploy(pluginEntry, options);
47
57
  }
48
58
 
59
+ getInstalledPlugins(): Promise<readonly PluginIdentifiers.VersionedId[]> {
60
+ return Promise.resolve(this.pluginDeployerHandler.getDeployedPluginIds());
61
+ }
62
+
63
+ getUninstalledPlugins(): Promise<readonly PluginIdentifiers.VersionedId[]> {
64
+ return Promise.resolve(this.uninstallationManager.getUninstalledPluginIds());
65
+ }
66
+
67
+ getDisabledPlugins(): Promise<readonly PluginIdentifiers.VersionedId[]> {
68
+ return Promise.resolve(this.uninstallationManager.getDisabledPluginIds());
69
+ }
70
+
49
71
  uninstall(pluginId: PluginIdentifiers.VersionedId): Promise<void> {
50
72
  return this.pluginDeployer.uninstall(pluginId);
51
73
  }
52
74
 
53
- undeploy(pluginId: PluginIdentifiers.VersionedId): Promise<void> {
54
- return this.pluginDeployer.undeploy(pluginId);
75
+ enablePlugin(pluginId: PluginIdentifiers.VersionedId): Promise<boolean> {
76
+ return this.pluginDeployer.enablePlugin(pluginId);
77
+ }
78
+
79
+ disablePlugin(pluginId: PluginIdentifiers.VersionedId): Promise<boolean> {
80
+ return this.pluginDeployer.disablePlugin(pluginId);
55
81
  }
56
82
 
57
83
  setStorageValue(key: string, value: KeysToAnyValues, kind: PluginStorageKind): Promise<boolean> {
@@ -15,60 +15,118 @@
15
15
  // *****************************************************************************
16
16
 
17
17
  import { Emitter, Event } from '@theia/core';
18
- import { injectable } from '@theia/core/shared/inversify';
18
+ import { inject, injectable, postConstruct } from '@theia/core/shared/inversify';
19
19
  import { PluginIdentifiers } from '../../common';
20
+ import { SettingService } from '@theia/core/lib/node';
21
+ import { Deferred } from '@theia/core/lib/common/promise-util';
20
22
 
21
23
  @injectable()
22
24
  export class PluginUninstallationManager {
25
+ static DISABLED_PLUGINS = 'installedPlugins.disabledPlugins';
26
+
27
+ @inject(SettingService)
28
+ protected readonly settingService: SettingService;
29
+
23
30
  protected readonly onDidChangeUninstalledPluginsEmitter = new Emitter<readonly PluginIdentifiers.VersionedId[]>();
31
+ onDidChangeUninstalledPlugins: Event<readonly PluginIdentifiers.VersionedId[]> = this.onDidChangeUninstalledPluginsEmitter.event;
32
+
33
+ protected readonly onDidChangeDisabledPluginsEmitter = new Emitter<readonly PluginIdentifiers.VersionedId[]>();
34
+ onDidChangeDisabledPlugins: Event<readonly PluginIdentifiers.VersionedId[]> = this.onDidChangeDisabledPluginsEmitter.event;
24
35
 
25
- get onDidChangeUninstalledPlugins(): Event<readonly PluginIdentifiers.VersionedId[]> {
26
- return this.onDidChangeUninstalledPluginsEmitter.event;
36
+ protected uninstalledPlugins: Set<PluginIdentifiers.VersionedId> = new Set();
37
+ protected disabledPlugins: Set<PluginIdentifiers.VersionedId> = new Set();
38
+
39
+ protected readonly initialized = new Deferred<void>();
40
+
41
+ @postConstruct()
42
+ init(): void {
43
+ this.load().then(() => this.initialized.resolve());
27
44
  }
28
45
 
29
- protected uninstalledPlugins: PluginIdentifiers.VersionedId[] = [];
46
+ protected async load(): Promise<void> {
47
+ try {
48
+ const disabled: PluginIdentifiers.VersionedId[] = JSON.parse(await this.settingService.get(PluginUninstallationManager.DISABLED_PLUGINS) || '[]');
49
+ disabled.forEach(id => this.disabledPlugins.add(id));
50
+ } catch (e) {
51
+ // settings may be corrupt; just carry on
52
+ console.warn(e);
53
+ }
54
+ }
30
55
 
31
- protected fireDidChange(): void {
32
- this.onDidChangeUninstalledPluginsEmitter.fire(Object.freeze(this.uninstalledPlugins.slice()));
56
+ protected async save(): Promise<void> {
57
+ await this.settingService.set(PluginUninstallationManager.DISABLED_PLUGINS, JSON.stringify(await this.getDisabledPluginIds()));
33
58
  }
34
59
 
35
- markAsUninstalled(...pluginIds: PluginIdentifiers.VersionedId[]): boolean {
60
+ async markAsUninstalled(...pluginIds: PluginIdentifiers.VersionedId[]): Promise<boolean> {
36
61
  let didChange = false;
37
- for (const id of pluginIds) { didChange = this.markOneAsUninstalled(id) || didChange; }
38
- if (didChange) { this.fireDidChange(); }
62
+ for (const id of pluginIds) {
63
+ if (!this.uninstalledPlugins.has(id)) {
64
+ didChange = true;
65
+ this.uninstalledPlugins.add(id);
66
+ }
67
+ }
68
+ if (didChange) {
69
+ this.onDidChangeUninstalledPluginsEmitter.fire(this.getUninstalledPluginIds());
70
+ }
71
+ this.markAsEnabled(...pluginIds);
39
72
  return didChange;
40
73
  }
41
74
 
42
- protected markOneAsUninstalled(pluginId: PluginIdentifiers.VersionedId): boolean {
43
- if (!this.uninstalledPlugins.includes(pluginId)) {
44
- this.uninstalledPlugins.push(pluginId);
45
- return true;
75
+ async markAsInstalled(...pluginIds: PluginIdentifiers.VersionedId[]): Promise<boolean> {
76
+ let didChange = false;
77
+ for (const id of pluginIds) {
78
+ didChange = this.uninstalledPlugins.delete(id) || didChange;
79
+ }
80
+ if (didChange) {
81
+ this.onDidChangeUninstalledPluginsEmitter.fire(this.getUninstalledPluginIds());
46
82
  }
47
- return false;
83
+ return didChange;
48
84
  }
49
85
 
50
- markAsInstalled(...pluginIds: PluginIdentifiers.VersionedId[]): boolean {
86
+ isUninstalled(pluginId: PluginIdentifiers.VersionedId): boolean {
87
+ return this.uninstalledPlugins.has(pluginId);
88
+ }
89
+
90
+ getUninstalledPluginIds(): readonly PluginIdentifiers.VersionedId[] {
91
+ return [...this.uninstalledPlugins];
92
+ }
93
+
94
+ async markAsDisabled(...pluginIds: PluginIdentifiers.VersionedId[]): Promise<boolean> {
95
+ await this.initialized.promise;
51
96
  let didChange = false;
52
- for (const id of pluginIds) { didChange = this.markOneAsInstalled(id) || didChange; }
53
- if (didChange) { this.fireDidChange(); }
97
+ for (const id of pluginIds) {
98
+ if (!this.disabledPlugins.has(id)) {
99
+ this.disabledPlugins.add(id);
100
+ didChange = true;
101
+ }
102
+ }
103
+ if (didChange) {
104
+ await this.save();
105
+ this.onDidChangeDisabledPluginsEmitter.fire([...this.disabledPlugins]);
106
+ }
54
107
  return didChange;
55
108
  }
56
109
 
57
- protected markOneAsInstalled(pluginId: PluginIdentifiers.VersionedId): boolean {
58
- let index: number;
110
+ async markAsEnabled(...pluginIds: PluginIdentifiers.VersionedId[]): Promise<boolean> {
111
+ await this.initialized.promise;
59
112
  let didChange = false;
60
- while ((index = this.uninstalledPlugins.indexOf(pluginId)) !== -1) {
61
- this.uninstalledPlugins.splice(index, 1);
62
- didChange = true;
113
+ for (const id of pluginIds) {
114
+ didChange = this.disabledPlugins.delete(id) || didChange;
115
+ }
116
+ if (didChange) {
117
+ await this.save();
118
+ this.onDidChangeDisabledPluginsEmitter.fire([...this.disabledPlugins]);
63
119
  }
64
120
  return didChange;
65
121
  }
66
122
 
67
- isUninstalled(pluginId: PluginIdentifiers.VersionedId): boolean {
68
- return this.uninstalledPlugins.includes(pluginId);
123
+ async isDisabled(pluginId: PluginIdentifiers.VersionedId): Promise<boolean> {
124
+ await this.initialized.promise;
125
+ return this.disabledPlugins.has(pluginId);
69
126
  }
70
127
 
71
- getUninstalledPluginIds(): readonly PluginIdentifiers.VersionedId[] {
72
- return Object.freeze(this.uninstalledPlugins.slice());
128
+ async getDisabledPluginIds(): Promise<readonly PluginIdentifiers.VersionedId[]> {
129
+ await this.initialized.promise;
130
+ return [...this.disabledPlugins];
73
131
  }
74
132
  }
@@ -163,8 +163,8 @@ export class ExtHostFileSystemEventService implements ExtHostFileSystemEventServ
163
163
  // --- file events
164
164
 
165
165
  createFileSystemWatcher(globPattern: string | IRelativePattern, ignoreCreateEvents?: boolean,
166
- ignoreChangeEvents?: boolean, ignoreDeleteEvents?: boolean, excludes?: string[]): vscode.FileSystemWatcher {
167
- return new FileSystemWatcher(this._onFileSystemEvent.event, globPattern, ignoreCreateEvents, ignoreChangeEvents, ignoreDeleteEvents, excludes);
166
+ ignoreChangeEvents?: boolean, ignoreDeleteEvents?: boolean): vscode.FileSystemWatcher {
167
+ return new FileSystemWatcher(this._onFileSystemEvent.event, globPattern, ignoreCreateEvents, ignoreChangeEvents, ignoreDeleteEvents);
168
168
  }
169
169
 
170
170
  $onFileEvent(events: FileSystemEvents) {