@theia/plugin-ext 1.40.1 → 1.42.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 (311) hide show
  1. package/lib/common/collections.d.ts +4 -0
  2. package/lib/common/collections.d.ts.map +1 -1
  3. package/lib/common/collections.js +17 -1
  4. package/lib/common/collections.js.map +1 -1
  5. package/lib/common/errors.d.ts +14 -0
  6. package/lib/common/errors.d.ts.map +1 -1
  7. package/lib/common/errors.js +17 -1
  8. package/lib/common/errors.js.map +1 -1
  9. package/lib/common/plugin-api-rpc.d.ts +286 -6
  10. package/lib/common/plugin-api-rpc.d.ts.map +1 -1
  11. package/lib/common/plugin-api-rpc.js +20 -1
  12. package/lib/common/plugin-api-rpc.js.map +1 -1
  13. package/lib/common/plugin-protocol.d.ts +27 -5
  14. package/lib/common/plugin-protocol.d.ts.map +1 -1
  15. package/lib/common/plugin-protocol.js.map +1 -1
  16. package/lib/hosted/browser/hosted-plugin.d.ts +5 -2
  17. package/lib/hosted/browser/hosted-plugin.d.ts.map +1 -1
  18. package/lib/hosted/browser/hosted-plugin.js +21 -12
  19. package/lib/hosted/browser/hosted-plugin.js.map +1 -1
  20. package/lib/hosted/node/hosted-plugin-deployer-handler.js +1 -1
  21. package/lib/hosted/node/hosted-plugin-deployer-handler.js.map +1 -1
  22. package/lib/hosted/node/plugin-reader.d.ts +1 -1
  23. package/lib/hosted/node/plugin-reader.d.ts.map +1 -1
  24. package/lib/hosted/node/plugin-reader.js +1 -1
  25. package/lib/hosted/node/plugin-reader.js.map +1 -1
  26. package/lib/hosted/node/scanners/grammars-reader.d.ts +1 -1
  27. package/lib/hosted/node/scanners/grammars-reader.d.ts.map +1 -1
  28. package/lib/hosted/node/scanners/grammars-reader.js +5 -5
  29. package/lib/hosted/node/scanners/grammars-reader.js.map +1 -1
  30. package/lib/hosted/node/scanners/scanner-theia.d.ts +6 -6
  31. package/lib/hosted/node/scanners/scanner-theia.d.ts.map +1 -1
  32. package/lib/hosted/node/scanners/scanner-theia.js +54 -41
  33. package/lib/hosted/node/scanners/scanner-theia.js.map +1 -1
  34. package/lib/main/browser/custom-editors/custom-editor-widget.d.ts +1 -1
  35. package/lib/main/browser/custom-editors/custom-editor-widget.d.ts.map +1 -1
  36. package/lib/main/browser/custom-editors/custom-editor-widget.js +1 -1
  37. package/lib/main/browser/custom-editors/custom-editor-widget.js.map +1 -1
  38. package/lib/main/browser/custom-editors/custom-editors-main.d.ts +1 -1
  39. package/lib/main/browser/custom-editors/custom-editors-main.d.ts.map +1 -1
  40. package/lib/main/browser/custom-editors/custom-editors-main.js +1 -1
  41. package/lib/main/browser/custom-editors/custom-editors-main.js.map +1 -1
  42. package/lib/main/browser/editors-and-documents-main.d.ts.map +1 -1
  43. package/lib/main/browser/editors-and-documents-main.js +1 -0
  44. package/lib/main/browser/editors-and-documents-main.js.map +1 -1
  45. package/lib/main/browser/languages-main.d.ts.map +1 -1
  46. package/lib/main/browser/languages-main.js +6 -4
  47. package/lib/main/browser/languages-main.js.map +1 -1
  48. package/lib/main/browser/main-context.d.ts.map +1 -1
  49. package/lib/main/browser/main-context.js +18 -0
  50. package/lib/main/browser/main-context.js.map +1 -1
  51. package/lib/main/browser/menus/menus-contribution-handler.d.ts.map +1 -1
  52. package/lib/main/browser/menus/menus-contribution-handler.js +6 -3
  53. package/lib/main/browser/menus/menus-contribution-handler.js.map +1 -1
  54. package/lib/main/browser/notebooks/notebook-documents-and-editors-main.d.ts +50 -0
  55. package/lib/main/browser/notebooks/notebook-documents-and-editors-main.d.ts.map +1 -0
  56. package/lib/main/browser/notebooks/notebook-documents-and-editors-main.js +189 -0
  57. package/lib/main/browser/notebooks/notebook-documents-and-editors-main.js.map +1 -0
  58. package/lib/main/browser/notebooks/notebook-documents-main.d.ts +22 -0
  59. package/lib/main/browser/notebooks/notebook-documents-main.d.ts.map +1 -0
  60. package/lib/main/browser/notebooks/notebook-documents-main.js +133 -0
  61. package/lib/main/browser/notebooks/notebook-documents-main.js.map +1 -0
  62. package/lib/main/browser/notebooks/notebook-dto.d.ts +15 -0
  63. package/lib/main/browser/notebooks/notebook-dto.d.ts.map +1 -0
  64. package/lib/main/browser/notebooks/notebook-dto.js +138 -0
  65. package/lib/main/browser/notebooks/notebook-dto.js.map +1 -0
  66. package/lib/main/browser/notebooks/notebook-editors-main.d.ts +20 -0
  67. package/lib/main/browser/notebooks/notebook-editors-main.d.ts.map +1 -0
  68. package/lib/main/browser/notebooks/notebook-editors-main.js +58 -0
  69. package/lib/main/browser/notebooks/notebook-editors-main.js.map +1 -0
  70. package/lib/main/browser/notebooks/notebook-kernels-main.d.ts +42 -0
  71. package/lib/main/browser/notebooks/notebook-kernels-main.d.ts.map +1 -0
  72. package/lib/main/browser/notebooks/notebook-kernels-main.js +230 -0
  73. package/lib/main/browser/notebooks/notebook-kernels-main.js.map +1 -0
  74. package/lib/main/browser/notebooks/notebook-renderers-main.d.ts +12 -0
  75. package/lib/main/browser/notebooks/notebook-renderers-main.d.ts.map +1 -0
  76. package/lib/main/browser/notebooks/notebook-renderers-main.js +39 -0
  77. package/lib/main/browser/notebooks/notebook-renderers-main.js.map +1 -0
  78. package/lib/main/browser/notebooks/notebooks-main.d.ts +20 -0
  79. package/lib/main/browser/notebooks/notebooks-main.d.ts.map +1 -0
  80. package/lib/main/browser/notebooks/notebooks-main.js +103 -0
  81. package/lib/main/browser/notebooks/notebooks-main.js.map +1 -0
  82. package/lib/main/browser/notebooks/renderers/cell-output-webview.d.ts +35 -0
  83. package/lib/main/browser/notebooks/renderers/cell-output-webview.d.ts.map +1 -0
  84. package/lib/main/browser/notebooks/renderers/cell-output-webview.js +204 -0
  85. package/lib/main/browser/notebooks/renderers/cell-output-webview.js.map +1 -0
  86. package/lib/main/browser/notebooks/renderers/output-webview-internal.d.ts +13 -0
  87. package/lib/main/browser/notebooks/renderers/output-webview-internal.d.ts.map +1 -0
  88. package/lib/main/browser/notebooks/renderers/output-webview-internal.js +375 -0
  89. package/lib/main/browser/notebooks/renderers/output-webview-internal.js.map +1 -0
  90. package/lib/main/browser/notebooks/renderers/webview-communication.d.ts +52 -0
  91. package/lib/main/browser/notebooks/renderers/webview-communication.d.ts.map +1 -0
  92. package/{src/typings/index.d.ts → lib/main/browser/notebooks/renderers/webview-communication.js} +8 -11
  93. package/lib/main/browser/notebooks/renderers/webview-communication.js.map +1 -0
  94. package/lib/main/browser/plugin-contribution-handler.d.ts +3 -0
  95. package/lib/main/browser/plugin-contribution-handler.d.ts.map +1 -1
  96. package/lib/main/browser/plugin-contribution-handler.js +31 -3
  97. package/lib/main/browser/plugin-contribution-handler.js.map +1 -1
  98. package/lib/main/browser/plugin-ext-frontend-module.d.ts.map +1 -1
  99. package/lib/main/browser/plugin-ext-frontend-module.js +3 -2
  100. package/lib/main/browser/plugin-ext-frontend-module.js.map +1 -1
  101. package/lib/main/browser/plugin-icon-theme-service.d.ts.map +1 -1
  102. package/lib/main/browser/plugin-icon-theme-service.js +6 -0
  103. package/lib/main/browser/plugin-icon-theme-service.js.map +1 -1
  104. package/lib/main/browser/plugin-shared-style.d.ts.map +1 -1
  105. package/lib/main/browser/plugin-shared-style.js +2 -1
  106. package/lib/main/browser/plugin-shared-style.js.map +1 -1
  107. package/lib/main/browser/tasks-main.js +2 -2
  108. package/lib/main/browser/tasks-main.js.map +1 -1
  109. package/lib/main/browser/terminal-main.d.ts +2 -2
  110. package/lib/main/browser/terminal-main.d.ts.map +1 -1
  111. package/lib/main/browser/terminal-main.js +4 -4
  112. package/lib/main/browser/terminal-main.js.map +1 -1
  113. package/lib/main/browser/view/tree-view-widget.d.ts +3 -1
  114. package/lib/main/browser/view/tree-view-widget.d.ts.map +1 -1
  115. package/lib/main/browser/view/tree-view-widget.js +32 -1
  116. package/lib/main/browser/view/tree-view-widget.js.map +1 -1
  117. package/lib/main/browser/view/tree-views-main.d.ts +2 -1
  118. package/lib/main/browser/view/tree-views-main.d.ts.map +1 -1
  119. package/lib/main/browser/view/tree-views-main.js +10 -0
  120. package/lib/main/browser/view/tree-views-main.js.map +1 -1
  121. package/lib/main/browser/webview/webview.d.ts +1 -0
  122. package/lib/main/browser/webview/webview.d.ts.map +1 -1
  123. package/lib/main/browser/webview/webview.js +5 -0
  124. package/lib/main/browser/webview/webview.js.map +1 -1
  125. package/lib/main/node/errors.spec.d.ts +2 -0
  126. package/lib/main/node/errors.spec.d.ts.map +1 -0
  127. package/lib/main/node/errors.spec.js +36 -0
  128. package/lib/main/node/errors.spec.js.map +1 -0
  129. package/lib/main/node/handlers/plugin-theia-directory-handler.d.ts +5 -2
  130. package/lib/main/node/handlers/plugin-theia-directory-handler.d.ts.map +1 -1
  131. package/lib/main/node/handlers/plugin-theia-directory-handler.js +14 -8
  132. package/lib/main/node/handlers/plugin-theia-directory-handler.js.map +1 -1
  133. package/lib/main/node/handlers/plugin-theia-file-handler.d.ts +2 -1
  134. package/lib/main/node/handlers/plugin-theia-file-handler.d.ts.map +1 -1
  135. package/lib/main/node/handlers/plugin-theia-file-handler.js +13 -5
  136. package/lib/main/node/handlers/plugin-theia-file-handler.js.map +1 -1
  137. package/lib/main/node/paths/plugin-paths-service.d.ts.map +1 -1
  138. package/lib/main/node/paths/plugin-paths-service.js +4 -9
  139. package/lib/main/node/paths/plugin-paths-service.js.map +1 -1
  140. package/lib/main/node/plugin-deployer-directory-handler-context-impl.js +8 -8
  141. package/lib/main/node/plugin-deployer-directory-handler-context-impl.js.map +1 -1
  142. package/lib/main/node/plugin-deployer-entry-impl.d.ts +2 -2
  143. package/lib/main/node/plugin-deployer-entry-impl.d.ts.map +1 -1
  144. package/lib/main/node/plugin-deployer-entry-impl.js +9 -7
  145. package/lib/main/node/plugin-deployer-entry-impl.js.map +1 -1
  146. package/lib/main/node/plugin-deployer-impl.d.ts +2 -2
  147. package/lib/main/node/plugin-deployer-impl.d.ts.map +1 -1
  148. package/lib/main/node/plugin-deployer-impl.js +16 -24
  149. package/lib/main/node/plugin-deployer-impl.js.map +1 -1
  150. package/lib/main/node/plugin-deployer-proxy-entry-impl.d.ts +2 -2
  151. package/lib/main/node/plugin-deployer-proxy-entry-impl.d.ts.map +1 -1
  152. package/lib/main/node/plugin-ext-backend-module.js +3 -3
  153. package/lib/main/node/plugin-ext-backend-module.js.map +1 -1
  154. package/lib/main/node/plugin-github-resolver.d.ts.map +1 -1
  155. package/lib/main/node/plugin-github-resolver.js +14 -6
  156. package/lib/main/node/plugin-github-resolver.js.map +1 -1
  157. package/lib/main/node/plugin-http-resolver.d.ts.map +1 -1
  158. package/lib/main/node/plugin-http-resolver.js +14 -6
  159. package/lib/main/node/plugin-http-resolver.js.map +1 -1
  160. package/lib/main/node/{plugin-localization-backend-contribution.d.ts → plugin-localization-server.d.ts} +3 -3
  161. package/lib/main/node/plugin-localization-server.d.ts.map +1 -0
  162. package/lib/main/node/{plugin-localization-backend-contribution.js → plugin-localization-server.js} +8 -8
  163. package/lib/main/node/plugin-localization-server.js.map +1 -0
  164. package/lib/main/node/temp-dir-util.d.ts +1 -0
  165. package/lib/main/node/temp-dir-util.d.ts.map +1 -1
  166. package/lib/main/node/temp-dir-util.js +12 -3
  167. package/lib/main/node/temp-dir-util.js.map +1 -1
  168. package/lib/plugin/editors-and-documents.d.ts +1 -1
  169. package/lib/plugin/editors-and-documents.d.ts.map +1 -1
  170. package/lib/plugin/editors-and-documents.js +1 -1
  171. package/lib/plugin/editors-and-documents.js.map +1 -1
  172. package/lib/plugin/notebook/notebook-document.d.ts +62 -0
  173. package/lib/plugin/notebook/notebook-document.d.ts.map +1 -0
  174. package/lib/plugin/notebook/notebook-document.js +373 -0
  175. package/lib/plugin/notebook/notebook-document.js.map +1 -0
  176. package/lib/plugin/notebook/notebook-documents.d.ts +17 -0
  177. package/lib/plugin/notebook/notebook-documents.d.ts.map +1 -0
  178. package/lib/plugin/notebook/notebook-documents.js +48 -0
  179. package/lib/plugin/notebook/notebook-documents.js.map +1 -0
  180. package/lib/plugin/notebook/notebook-editor.d.ts +21 -0
  181. package/lib/plugin/notebook/notebook-editor.d.ts.map +1 -0
  182. package/lib/plugin/notebook/notebook-editor.js +99 -0
  183. package/lib/plugin/notebook/notebook-editor.js.map +1 -0
  184. package/lib/plugin/notebook/notebook-editors.d.ts +14 -0
  185. package/lib/plugin/notebook/notebook-editors.d.ts.map +1 -0
  186. package/lib/plugin/notebook/notebook-editors.js +65 -0
  187. package/lib/plugin/notebook/notebook-editors.js.map +1 -0
  188. package/lib/plugin/notebook/notebook-kernels.d.ts +37 -0
  189. package/lib/plugin/notebook/notebook-kernels.d.ts.map +1 -0
  190. package/lib/plugin/notebook/notebook-kernels.js +516 -0
  191. package/lib/plugin/notebook/notebook-kernels.js.map +1 -0
  192. package/lib/plugin/notebook/notebook-renderers.d.ts +14 -0
  193. package/lib/plugin/notebook/notebook-renderers.d.ts.map +1 -0
  194. package/lib/plugin/notebook/notebook-renderers.js +63 -0
  195. package/lib/plugin/notebook/notebook-renderers.js.map +1 -0
  196. package/lib/plugin/notebook/notebooks.d.ts +57 -0
  197. package/lib/plugin/notebook/notebooks.d.ts.map +1 -0
  198. package/lib/plugin/notebook/notebooks.js +295 -0
  199. package/lib/plugin/notebook/notebooks.js.map +1 -0
  200. package/lib/plugin/plugin-context.d.ts +2 -2
  201. package/lib/plugin/plugin-context.d.ts.map +1 -1
  202. package/lib/plugin/plugin-context.js +80 -59
  203. package/lib/plugin/plugin-context.js.map +1 -1
  204. package/lib/plugin/plugin-manager.d.ts +2 -0
  205. package/lib/plugin/plugin-manager.d.ts.map +1 -1
  206. package/lib/plugin/plugin-manager.js +9 -1
  207. package/lib/plugin/plugin-manager.js.map +1 -1
  208. package/lib/plugin/quick-open.d.ts.map +1 -1
  209. package/lib/plugin/quick-open.js +1 -0
  210. package/lib/plugin/quick-open.js.map +1 -1
  211. package/lib/plugin/stubs/tests-api.d.ts +1 -0
  212. package/lib/plugin/stubs/tests-api.d.ts.map +1 -1
  213. package/lib/plugin/stubs/tests-api.js +3 -1
  214. package/lib/plugin/stubs/tests-api.js.map +1 -1
  215. package/lib/plugin/tasks/task-provider.d.ts +2 -2
  216. package/lib/plugin/tasks/task-provider.d.ts.map +1 -1
  217. package/lib/plugin/tasks/task-provider.js +7 -10
  218. package/lib/plugin/tasks/task-provider.js.map +1 -1
  219. package/lib/plugin/tasks/tasks.d.ts +3 -2
  220. package/lib/plugin/tasks/tasks.d.ts.map +1 -1
  221. package/lib/plugin/tasks/tasks.js +18 -13
  222. package/lib/plugin/tasks/tasks.js.map +1 -1
  223. package/lib/plugin/terminal-ext.d.ts +3 -0
  224. package/lib/plugin/terminal-ext.d.ts.map +1 -1
  225. package/lib/plugin/terminal-ext.js +11 -1
  226. package/lib/plugin/terminal-ext.js.map +1 -1
  227. package/lib/plugin/tree/tree-views.d.ts +15 -5
  228. package/lib/plugin/tree/tree-views.d.ts.map +1 -1
  229. package/lib/plugin/tree/tree-views.js +52 -3
  230. package/lib/plugin/tree/tree-views.js.map +1 -1
  231. package/lib/plugin/type-converters.d.ts +60 -0
  232. package/lib/plugin/type-converters.d.ts.map +1 -1
  233. package/lib/plugin/type-converters.js +374 -14
  234. package/lib/plugin/type-converters.js.map +1 -1
  235. package/lib/plugin/types-impl.d.ts +68 -29
  236. package/lib/plugin/types-impl.d.ts.map +1 -1
  237. package/lib/plugin/types-impl.js +123 -44
  238. package/lib/plugin/types-impl.js.map +1 -1
  239. package/package.json +31 -29
  240. package/src/common/collections.ts +17 -0
  241. package/src/common/errors.ts +26 -0
  242. package/src/common/plugin-api-rpc.ts +340 -5
  243. package/src/common/plugin-protocol.ts +23 -5
  244. package/src/hosted/browser/hosted-plugin.ts +21 -14
  245. package/src/hosted/node/hosted-plugin-deployer-handler.ts +1 -1
  246. package/src/hosted/node/plugin-reader.ts +1 -1
  247. package/src/hosted/node/scanners/grammars-reader.ts +6 -5
  248. package/src/hosted/node/scanners/scanner-theia.ts +55 -41
  249. package/src/main/browser/custom-editors/custom-editor-widget.ts +1 -1
  250. package/src/main/browser/custom-editors/custom-editors-main.ts +1 -1
  251. package/src/main/browser/editors-and-documents-main.ts +1 -0
  252. package/src/main/browser/languages-main.ts +7 -4
  253. package/src/main/browser/main-context.ts +19 -0
  254. package/src/main/browser/menus/menus-contribution-handler.ts +7 -4
  255. package/src/main/browser/notebooks/notebook-documents-and-editors-main.ts +238 -0
  256. package/src/main/browser/notebooks/notebook-documents-main.ts +166 -0
  257. package/src/main/browser/notebooks/notebook-dto.ts +141 -0
  258. package/src/main/browser/notebooks/notebook-editors-main.ts +70 -0
  259. package/src/main/browser/notebooks/notebook-kernels-main.ts +291 -0
  260. package/src/main/browser/notebooks/notebook-renderers-main.ts +47 -0
  261. package/src/main/browser/notebooks/notebooks-main.ts +124 -0
  262. package/src/main/browser/notebooks/renderers/cell-output-webview.tsx +198 -0
  263. package/src/main/browser/notebooks/renderers/output-webview-internal.ts +476 -0
  264. package/src/main/browser/notebooks/renderers/webview-communication.ts +79 -0
  265. package/src/main/browser/plugin-contribution-handler.ts +36 -3
  266. package/src/main/browser/plugin-ext-frontend-module.ts +7 -3
  267. package/src/main/browser/plugin-icon-theme-service.ts +6 -0
  268. package/src/main/browser/plugin-shared-style.ts +2 -1
  269. package/src/main/browser/tasks-main.ts +4 -4
  270. package/src/main/browser/terminal-main.ts +5 -5
  271. package/src/main/browser/view/tree-view-widget.tsx +36 -2
  272. package/src/main/browser/view/tree-views-main.ts +8 -0
  273. package/src/main/browser/webview/webview.ts +6 -0
  274. package/src/main/node/errors.spec.ts +37 -0
  275. package/src/main/node/handlers/plugin-theia-directory-handler.ts +18 -8
  276. package/src/main/node/handlers/plugin-theia-file-handler.ts +18 -6
  277. package/src/main/node/paths/plugin-paths-service.ts +5 -10
  278. package/src/main/node/plugin-deployer-directory-handler-context-impl.ts +8 -8
  279. package/src/main/node/plugin-deployer-entry-impl.ts +9 -7
  280. package/src/main/node/plugin-deployer-impl.ts +20 -28
  281. package/src/main/node/plugin-deployer-proxy-entry-impl.ts +2 -2
  282. package/src/main/node/plugin-ext-backend-module.ts +3 -3
  283. package/src/main/node/plugin-github-resolver.ts +15 -8
  284. package/src/main/node/plugin-http-resolver.ts +15 -8
  285. package/src/main/node/{plugin-localization-backend-contribution.ts → plugin-localization-server.ts} +2 -2
  286. package/src/main/node/temp-dir-util.ts +11 -2
  287. package/src/plugin/editors-and-documents.ts +1 -1
  288. package/src/plugin/notebook/notebook-document.ts +438 -0
  289. package/src/plugin/notebook/notebook-documents.ts +58 -0
  290. package/src/plugin/notebook/notebook-editor.ts +116 -0
  291. package/src/plugin/notebook/notebook-editors.ts +71 -0
  292. package/src/plugin/notebook/notebook-kernels.ts +616 -0
  293. package/src/plugin/notebook/notebook-renderers.ts +72 -0
  294. package/src/plugin/notebook/notebooks.ts +385 -0
  295. package/src/plugin/plugin-context.ts +80 -71
  296. package/src/plugin/plugin-manager.ts +9 -1
  297. package/src/plugin/quick-open.ts +1 -0
  298. package/src/plugin/stubs/tests-api.ts +4 -0
  299. package/src/plugin/tasks/task-provider.ts +9 -12
  300. package/src/plugin/tasks/tasks.ts +18 -13
  301. package/src/plugin/terminal-ext.ts +13 -1
  302. package/src/plugin/tree/tree-views.ts +57 -7
  303. package/src/plugin/type-converters.ts +372 -13
  304. package/src/plugin/types-impl.ts +162 -58
  305. package/lib/main/browser/custom-editors/undo-redo-service.d.ts +0 -24
  306. package/lib/main/browser/custom-editors/undo-redo-service.d.ts.map +0 -1
  307. package/lib/main/browser/custom-editors/undo-redo-service.js +0 -111
  308. package/lib/main/browser/custom-editors/undo-redo-service.js.map +0 -1
  309. package/lib/main/node/plugin-localization-backend-contribution.d.ts.map +0 -1
  310. package/lib/main/node/plugin-localization-backend-contribution.js.map +0 -1
  311. package/src/main/browser/custom-editors/undo-redo-service.ts +0 -120
@@ -98,6 +98,7 @@ import {
98
98
  DataTransfer,
99
99
  TreeItem,
100
100
  TreeItemCollapsibleState,
101
+ TreeItemCheckboxState,
101
102
  DocumentSymbol,
102
103
  SymbolTag,
103
104
  WorkspaceEdit,
@@ -165,8 +166,8 @@ import {
165
166
  InlayHintKind,
166
167
  InlayHintLabelPart,
167
168
  TelemetryTrustedValue,
168
- NotebookCell,
169
169
  NotebookCellKind,
170
+ NotebookCellExecutionState,
170
171
  NotebookCellStatusBarAlignment,
171
172
  NotebookEditorRevealType,
172
173
  NotebookControllerAffinity,
@@ -174,10 +175,11 @@ import {
174
175
  NotebookCellOutput,
175
176
  NotebookCellOutputItem,
176
177
  NotebookData,
177
- NotebookDocument,
178
178
  NotebookRange,
179
179
  NotebookCellStatusBarItem,
180
180
  NotebookEdit,
181
+ NotebookKernelSourceAction,
182
+ NotebookRendererScript,
181
183
  TestRunProfileKind,
182
184
  TestTag,
183
185
  TestRunRequest,
@@ -230,7 +232,8 @@ import {
230
232
  createRunProfile,
231
233
  createTestRun,
232
234
  testItemCollection,
233
- createTestItem
235
+ createTestItem,
236
+ invalidateTestResults
234
237
  } from './stubs/tests-api';
235
238
  import { TimelineExtImpl } from './timeline';
236
239
  import { ThemingExtImpl } from './theming';
@@ -242,7 +245,13 @@ import { Endpoint } from '@theia/core/lib/browser/endpoint';
242
245
  import { FilePermission } from '@theia/filesystem/lib/common/files';
243
246
  import { TabsExtImpl } from './tabs';
244
247
  import { LocalizationExtImpl } from './localization-ext';
248
+ import { NotebooksExtImpl } from './notebook/notebooks';
245
249
  import { TelemetryExtImpl } from './telemetry-ext';
250
+ import { NotebookDocument } from './notebook/notebook-document';
251
+ import { NotebookRenderersExtImpl } from './notebook/notebook-renderers';
252
+ import { NotebookKernelsExtImpl } from './notebook/notebook-kernels';
253
+ import { NotebookDocumentsExtImpl } from './notebook/notebook-documents';
254
+ import { NotebookEditorsExtImpl } from './notebook/notebook-editors';
246
255
 
247
256
  export function createAPIFactory(
248
257
  rpc: RPCProtocol,
@@ -266,6 +275,11 @@ export function createAPIFactory(
266
275
  const notificationExt = rpc.set(MAIN_RPC_CONTEXT.NOTIFICATION_EXT, new NotificationExtImpl(rpc));
267
276
  const editors = rpc.set(MAIN_RPC_CONTEXT.TEXT_EDITORS_EXT, new TextEditorsExtImpl(rpc, editorsAndDocumentsExt));
268
277
  const documents = rpc.set(MAIN_RPC_CONTEXT.DOCUMENTS_EXT, new DocumentsExtImpl(rpc, editorsAndDocumentsExt));
278
+ const notebooksExt = rpc.set(MAIN_RPC_CONTEXT.NOTEBOOKS_EXT, new NotebooksExtImpl(rpc, commandRegistry, editorsAndDocumentsExt, documents));
279
+ const notebookEditors = rpc.set(MAIN_RPC_CONTEXT.NOTEBOOK_EDITORS_EXT, new NotebookEditorsExtImpl(notebooksExt));
280
+ const notebookRenderers = rpc.set(MAIN_RPC_CONTEXT.NOTEBOOK_RENDERERS_EXT, new NotebookRenderersExtImpl(rpc, notebooksExt));
281
+ const notebookKernels = rpc.set(MAIN_RPC_CONTEXT.NOTEBOOK_KERNELS_EXT, new NotebookKernelsExtImpl(rpc, notebooksExt, commandRegistry));
282
+ const notebookDocuments = rpc.set(MAIN_RPC_CONTEXT.NOTEBOOK_DOCUMENTS_EXT, new NotebookDocumentsExtImpl(notebooksExt));
269
283
  const statusBarMessageRegistryExt = new StatusBarMessageRegistryExt(rpc);
270
284
  const terminalExt = rpc.set(MAIN_RPC_CONTEXT.TERMINAL_EXT, new TerminalServiceExtImpl(rpc));
271
285
  const outputChannelRegistryExt = rpc.set(MAIN_RPC_CONTEXT.OUTPUT_CHANNEL_REGISTRY_EXT, new OutputChannelRegistryExtImpl(rpc));
@@ -427,24 +441,24 @@ export function createAPIFactory(
427
441
  }
428
442
  },
429
443
  get visibleNotebookEditors(): theia.NotebookEditor[] {
430
- return [] as theia.NotebookEditor[];
444
+ return notebooksExt.visibleApiNotebookEditors;
431
445
  },
432
446
  onDidChangeVisibleNotebookEditors(listener, thisArg?, disposables?) {
433
- return Disposable.NULL;
447
+ return notebooksExt.onDidChangeVisibleNotebookEditors(listener, thisArg, disposables);
434
448
  },
435
449
  get activeNotebookEditor(): theia.NotebookEditor | undefined {
436
- return undefined;
450
+ return notebooksExt.activeApiNotebookEditor;
437
451
  }, onDidChangeActiveNotebookEditor(listener, thisArg?, disposables?) {
438
- return Disposable.NULL;
452
+ return notebooksExt.onDidChangeActiveNotebookEditor(listener, thisArg, disposables);
439
453
  },
440
454
  onDidChangeNotebookEditorSelection(listener, thisArg?, disposables?) {
441
- return Disposable.NULL;
455
+ return notebookEditors.onDidChangeNotebookEditorSelection(listener, thisArg, disposables);
442
456
  },
443
457
  onDidChangeNotebookEditorVisibleRanges(listener, thisArg?, disposables?) {
444
- return Disposable.NULL;
458
+ return notebookEditors.onDidChangeNotebookEditorVisibleRanges(listener, thisArg, disposables);
445
459
  },
446
- showNotebookDocument(document: NotebookDocument, options?: theia.NotebookDocumentShowOptions) {
447
- return Promise.resolve({} as theia.NotebookEditor);
460
+ showNotebookDocument(document: theia.NotebookDocument, options?: theia.NotebookDocumentShowOptions) {
461
+ return notebooksExt.showNotebookDocument(document, options);
448
462
  },
449
463
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
450
464
  showQuickPick(items: any, options?: theia.QuickPickOptions, token?: theia.CancellationToken): any {
@@ -616,7 +630,7 @@ export function createAPIFactory(
616
630
  return workspaceExt.onDidChangeWorkspaceFolders(listener, thisArg, disposables);
617
631
  },
618
632
  get notebookDocuments(): theia.NotebookDocument[] {
619
- return [] as theia.NotebookDocument[];
633
+ return notebooksExt.getAllApiDocuments();
620
634
  },
621
635
  get textDocuments(): theia.TextDocument[] {
622
636
  return documents.getAllDocumentData().map(data => data.document);
@@ -628,19 +642,19 @@ export function createAPIFactory(
628
642
  return documents.onDidRemoveDocument(listener, thisArg, disposables);
629
643
  },
630
644
  onDidOpenNotebookDocument(listener, thisArg?, disposables?) {
631
- return Disposable.NULL;
645
+ return notebooksExt.onDidOpenNotebookDocument(listener, thisArg, disposables);
632
646
  },
633
647
  onDidCloseNotebookDocument(listener, thisArg?, disposables?) {
634
- return Disposable.NULL;
635
- },
636
- onDidChangeNotebookDocument(listener, thisArg?, disposables?) {
637
- return Disposable.NULL;
648
+ return notebooksExt.onDidCloseNotebookDocument(listener, thisArg, disposables);
638
649
  },
639
650
  onWillSaveNotebookDocument(listener, thisArg?, disposables?) {
640
651
  return Disposable.NULL;
641
652
  },
642
- onDidSaveNotebookDocument(listener, thisArg?, disposables?) {
643
- return Disposable.NULL;
653
+ onDidSaveNotebookDocument(listener, thisArg, disposables) {
654
+ return notebookDocuments.onDidSaveNotebookDocument(listener, thisArg, disposables);
655
+ },
656
+ onDidChangeNotebookDocument(listener, thisArg, disposables) {
657
+ return notebookDocuments.onDidChangeNotebookDocument(listener, thisArg, disposables);
644
658
  },
645
659
  onDidOpenTextDocument(listener, thisArg?, disposables?) {
646
660
  return documents.onDidAddDocument(listener, thisArg, disposables);
@@ -686,8 +700,18 @@ export function createAPIFactory(
686
700
  const data = await documents.openDocument(uri);
687
701
  return data && data.document;
688
702
  },
689
- openNotebookDocument(uriOrString: theia.Uri | string, content?: NotebookData): Promise<theia.NotebookDocument | undefined> {
690
- return Promise.reject(new Error('Notebook API is stubbed'));
703
+ async openNotebookDocument(uriOrType: theia.Uri | string, content?: NotebookData): Promise<theia.NotebookDocument | undefined> {
704
+ let uri: URI;
705
+ if (URI.isUri(uriOrType)) {
706
+ uri = uriOrType;
707
+ await notebooksExt.openNotebookDocument(uriOrType as URI);
708
+ } else if (typeof uriOrType === 'string') {
709
+ uri = URI.revive(await notebooksExt.createNotebookDocument({ viewType: uriOrType, content }));
710
+ } else {
711
+ throw new Error('Invalid arguments');
712
+ }
713
+ return notebooksExt.getNotebookDocument(uri).apiNotebook;
714
+
691
715
  },
692
716
  createFileSystemWatcher: (pattern, ignoreCreate, ignoreChange, ignoreDelete): theia.FileSystemWatcher =>
693
717
  extHostFileSystemEvent.createFileSystemWatcher(fromGlobPattern(pattern), ignoreCreate, ignoreChange, ignoreDelete),
@@ -729,7 +753,7 @@ export function createAPIFactory(
729
753
  return timelineExt.registerTimelineProvider(plugin, scheme, provider);
730
754
  },
731
755
  registerNotebookSerializer(notebookType: string, serializer: theia.NotebookSerializer, options?: theia.NotebookDocumentContentOptions): theia.Disposable {
732
- return Disposable.NULL;
756
+ return notebooksExt.registerNotebookSerializer(plugin, notebookType, serializer, options);
733
757
  },
734
758
  get isTrusted(): boolean {
735
759
  return workspaceExt.trusted;
@@ -987,6 +1011,7 @@ export function createAPIFactory(
987
1011
  createRunProfile,
988
1012
  createTestRun,
989
1013
  createTestItem,
1014
+ invalidateTestResults,
990
1015
  dispose: () => undefined,
991
1016
  };
992
1017
  },
@@ -1156,54 +1181,27 @@ export function createAPIFactory(
1156
1181
  label,
1157
1182
  handler?: (cells: theia.NotebookCell[],
1158
1183
  notebook: theia.NotebookDocument,
1159
- controller: theia.NotebookController) => void | Thenable<void>
1184
+ controller: theia.NotebookController) => void | Thenable<void>,
1185
+ rendererScripts?: NotebookRendererScript[]
1160
1186
  ) {
1161
- return {
1162
- id,
1163
- notebookType,
1164
- label,
1165
- handler,
1166
- createNotebookCellExecution: (cell: NotebookCell) => ({
1167
- cell,
1168
- token: CancellationToken.None,
1169
- executionOrder: undefined,
1170
- start: () => undefined,
1171
- end: () => undefined,
1172
- clearOutput: () => ({} as Thenable<void>),
1173
- replaceOutput: () => ({} as Thenable<void>),
1174
- appendOutput: () => ({} as Thenable<void>),
1175
- replaceOutputItems: () => ({} as Thenable<void>),
1176
- appendOutputItems: () => ({} as Thenable<void>)
1177
- }),
1178
- executeHandler(
1179
- cells: theia.NotebookCell[],
1180
- notebook: theia.NotebookDocument,
1181
- controller: theia.NotebookController
1182
- ): (void | Thenable<void>) { },
1183
- onDidChangeSelectedNotebooks: () => Disposable.create(() => { }),
1184
- updateNotebookAffinity: (notebook: theia.NotebookDocument, affinity: theia.NotebookControllerAffinity) => undefined,
1185
- dispose: () => undefined,
1186
- };
1187
-
1187
+ return notebookKernels.createNotebookController(plugin.model.id, id, notebookType, label, handler, rendererScripts);
1188
1188
  },
1189
- createRendererMessaging(
1190
- rendererId
1191
- ) {
1192
- return {
1193
- rendererId,
1194
- onDidReceiveMessage: () => Disposable.create(() => { }),
1195
- postMessage: () => Promise.resolve({}),
1196
- };
1189
+ createRendererMessaging(rendererId) {
1190
+ return notebookRenderers.createRendererMessaging(rendererId);
1197
1191
  },
1198
1192
  registerNotebookCellStatusBarItemProvider(
1199
1193
  notebookType,
1200
1194
  provider
1201
1195
  ) {
1202
- return {
1203
- notebookType,
1204
- provider,
1205
- dispose: () => undefined,
1206
- };
1196
+ return notebooksExt.registerNotebookCellStatusBarItemProvider(notebookType, provider);
1197
+ },
1198
+ onDidChangeNotebookCellExecutionState: notebookKernels.onDidChangeNotebookCellExecutionState,
1199
+
1200
+ createNotebookControllerDetectionTask(notebookType: string) {
1201
+ return notebookKernels.createNotebookControllerDetectionTask(notebookType);
1202
+ },
1203
+ registerKernelSourceActionProvider(notebookType: string, provider: theia.NotebookKernelSourceActionProvider) {
1204
+ return notebookKernels.registerKernelSourceActionProvider(notebookType, provider);
1207
1205
  }
1208
1206
  };
1209
1207
 
@@ -1291,6 +1289,7 @@ export function createAPIFactory(
1291
1289
  DataTransfer,
1292
1290
  TreeItem,
1293
1291
  TreeItemCollapsibleState,
1292
+ TreeItemCheckboxState,
1294
1293
  SymbolKind,
1295
1294
  SymbolTag,
1296
1295
  DocumentSymbol,
@@ -1357,6 +1356,7 @@ export function createAPIFactory(
1357
1356
  InlayHintLabelPart,
1358
1357
  TelemetryTrustedValue,
1359
1358
  NotebookCellData,
1359
+ NotebookCellExecutionState,
1360
1360
  NotebookCellKind,
1361
1361
  NotebookCellOutput,
1362
1362
  NotebookCellOutputItem,
@@ -1368,6 +1368,8 @@ export function createAPIFactory(
1368
1368
  NotebookDocument,
1369
1369
  NotebookRange,
1370
1370
  NotebookEdit,
1371
+ NotebookKernelSourceAction,
1372
+ NotebookRendererScript,
1371
1373
  TestRunProfileKind,
1372
1374
  TestTag,
1373
1375
  TestRunRequest,
@@ -1420,6 +1422,8 @@ export interface ExtensionPlugin<T> extends theia.Plugin<T> {
1420
1422
  }
1421
1423
 
1422
1424
  export class Plugin<T> implements theia.Plugin<T> {
1425
+ #pluginManager: PluginManager;
1426
+
1423
1427
  id: string;
1424
1428
  pluginPath: string;
1425
1429
  pluginUri: theia.Uri;
@@ -1427,7 +1431,9 @@ export class Plugin<T> implements theia.Plugin<T> {
1427
1431
  packageJSON: any;
1428
1432
  pluginType: theia.PluginType;
1429
1433
 
1430
- constructor(protected readonly pluginManager: PluginManager, plugin: InternalPlugin) {
1434
+ constructor(pluginManager: PluginManager, plugin: InternalPlugin) {
1435
+ this.#pluginManager = pluginManager;
1436
+
1431
1437
  this.id = plugin.model.id;
1432
1438
  this.pluginPath = plugin.pluginFolder;
1433
1439
  this.packageJSON = plugin.rawModel;
@@ -1442,26 +1448,29 @@ export class Plugin<T> implements theia.Plugin<T> {
1442
1448
  }
1443
1449
 
1444
1450
  get isActive(): boolean {
1445
- return this.pluginManager.isActive(this.id);
1451
+ return this.#pluginManager.isActive(this.id);
1446
1452
  }
1447
1453
 
1448
1454
  get exports(): T {
1449
- return <T>this.pluginManager.getPluginExport(this.id);
1455
+ return <T>this.#pluginManager.getPluginExport(this.id);
1450
1456
  }
1451
1457
 
1452
1458
  activate(): PromiseLike<T> {
1453
- return this.pluginManager.activatePlugin(this.id).then(() => this.exports);
1459
+ return this.#pluginManager.activatePlugin(this.id).then(() => this.exports);
1454
1460
  }
1455
1461
  }
1456
1462
 
1457
1463
  export class PluginExt<T> extends Plugin<T> implements ExtensionPlugin<T> {
1464
+ #pluginManager: PluginManager;
1465
+
1458
1466
  extensionPath: string;
1459
1467
  extensionUri: theia.Uri;
1460
1468
  extensionKind: ExtensionKind;
1461
1469
  isFromDifferentExtensionHost: boolean;
1462
1470
 
1463
- constructor(protected override readonly pluginManager: PluginManager, plugin: InternalPlugin, isFromDifferentExtensionHost = false) {
1471
+ constructor(pluginManager: PluginManager, plugin: InternalPlugin, isFromDifferentExtensionHost = false) {
1464
1472
  super(pluginManager, plugin);
1473
+ this.#pluginManager = pluginManager;
1465
1474
 
1466
1475
  this.extensionPath = this.pluginPath;
1467
1476
  this.extensionUri = this.pluginUri;
@@ -1470,14 +1479,14 @@ export class PluginExt<T> extends Plugin<T> implements ExtensionPlugin<T> {
1470
1479
  }
1471
1480
 
1472
1481
  override get isActive(): boolean {
1473
- return this.pluginManager.isActive(this.id);
1482
+ return this.#pluginManager.isActive(this.id);
1474
1483
  }
1475
1484
 
1476
1485
  override get exports(): T {
1477
- return <T>this.pluginManager.getPluginExport(this.id);
1486
+ return <T>this.#pluginManager.getPluginExport(this.id);
1478
1487
  }
1479
1488
 
1480
1489
  override activate(): PromiseLike<T> {
1481
- return this.pluginManager.activatePlugin(this.id).then(() => this.exports);
1490
+ return this.#pluginManager.activatePlugin(this.id).then(() => this.exports);
1482
1491
  }
1483
1492
  }
@@ -43,6 +43,7 @@ import { WebviewsExtImpl } from './webviews';
43
43
  import { URI as Uri } from './types-impl';
44
44
  import { SecretsExtImpl, SecretStorageExt } from '../plugin/secrets-ext';
45
45
  import { PluginExt } from './plugin-context';
46
+ import { Deferred } from '@theia/core/lib/common/promise-util';
46
47
 
47
48
  export interface PluginHost {
48
49
 
@@ -96,7 +97,9 @@ export class PluginManagerExtImpl implements PluginManagerExt, PluginManager {
96
97
  'onFileSystem',
97
98
  'onCustomEditor',
98
99
  'onStartupFinished',
99
- 'onAuthenticationRequest'
100
+ 'onAuthenticationRequest',
101
+ 'onNotebook',
102
+ 'onNotebookSerializer'
100
103
  ]);
101
104
 
102
105
  private configStorage: ConfigStorage | undefined;
@@ -115,6 +118,7 @@ export class PluginManagerExtImpl implements PluginManagerExt, PluginManager {
115
118
  }
116
119
 
117
120
  protected jsonValidation: PluginJsonValidationContribution[] = [];
121
+ protected ready = new Deferred();
118
122
 
119
123
  constructor(
120
124
  private readonly host: PluginHost,
@@ -230,6 +234,8 @@ export class PluginManagerExtImpl implements PluginManagerExt, PluginManager {
230
234
  this.registerPlugin(plugin);
231
235
  }
232
236
 
237
+ // ensure plugins are registered before running activation events
238
+ this.ready.resolve();
233
239
  // run eager plugins
234
240
  await this.$activateByEvent('*');
235
241
  for (const activationEvent of params.activationEvents) {
@@ -333,6 +339,8 @@ export class PluginManagerExtImpl implements PluginManagerExt, PluginManager {
333
339
  }
334
340
 
335
341
  async $activateByEvent(activationEvent: string): Promise<void> {
342
+ // Prevent the plugin manager from performing activations before plugins are registered
343
+ await this.ready.promise;
336
344
  if (activationEvent.endsWith(':*')) {
337
345
  const baseEvent = activationEvent.substring(0, activationEvent.length - 2);
338
346
  await this.activateByBaseEvent(baseEvent);
@@ -655,6 +655,7 @@ export class QuickPickExt<T extends theia.QuickPickItem> extends QuickInputExt i
655
655
  pickItems.push({
656
656
  kind: item.kind,
657
657
  label: item.label,
658
+ iconPath: item.iconPath ? getIconUris(item.iconPath) : undefined,
658
659
  description: item.description,
659
660
  handle,
660
661
  detail: item.detail,
@@ -96,3 +96,7 @@ export const createTestItem = (
96
96
  range: undefined,
97
97
  error: undefined,
98
98
  });
99
+
100
+ export const invalidateTestResults = (
101
+ items?: theia.TestItem | readonly theia.TestItem[]
102
+ ): void => undefined;
@@ -15,17 +15,17 @@
15
15
  // *****************************************************************************
16
16
 
17
17
  import * as theia from '@theia/plugin';
18
- import * as Converter from '../type-converters';
19
18
  import { TaskDto } from '../../common';
19
+ import * as Converter from '../type-converters';
20
20
 
21
21
  export class TaskProviderAdapter {
22
22
 
23
23
  constructor(private readonly provider: theia.TaskProvider) { }
24
24
 
25
- provideTasks(token: theia.CancellationToken): Promise<TaskDto[] | undefined> {
25
+ provideTasks(token: theia.CancellationToken): Promise<TaskDto[]> {
26
26
  return Promise.resolve(this.provider.provideTasks(token)).then(tasks => {
27
27
  if (!Array.isArray(tasks)) {
28
- return undefined;
28
+ return [];
29
29
  }
30
30
  const result: TaskDto[] = [];
31
31
  for (const task of tasks) {
@@ -40,21 +40,18 @@ export class TaskProviderAdapter {
40
40
  });
41
41
  }
42
42
 
43
- resolveTask(task: TaskDto, token: theia.CancellationToken): Promise<TaskDto | undefined> {
43
+ async resolveTask(task: TaskDto, token: theia.CancellationToken): Promise<TaskDto> {
44
44
  if (typeof this.provider.resolveTask !== 'function') {
45
- return Promise.resolve(undefined);
45
+ return task;
46
46
  }
47
47
 
48
48
  const item = Converter.toTask(task);
49
49
  if (!item) {
50
- return Promise.resolve(undefined);
50
+ return task;
51
51
  }
52
52
 
53
- return Promise.resolve(this.provider.resolveTask(item, token)).then(value => {
54
- if (value) {
55
- return Converter.fromTask(value);
56
- }
57
- return undefined;
58
- });
53
+ const resolved = await this.provider.resolveTask(item, token);
54
+ const converted = resolved ? Converter.fromTask(resolved) : Converter.fromTask(item);
55
+ return converted ?? task;
59
56
  }
60
57
  }
@@ -158,37 +158,42 @@ export class TasksExtImpl implements TasksExt {
158
158
  throw new Error('Task was not successfully transformed into a task config');
159
159
  }
160
160
 
161
- $provideTasks(handle: number): Promise<TaskDto[] | undefined> {
161
+ async $provideTasks(handle: number): Promise<TaskDto[]> {
162
162
  const adapter = this.adaptersMap.get(handle);
163
163
  if (adapter) {
164
164
  return adapter.provideTasks(CancellationToken.None).then(tasks => {
165
- if (tasks) {
166
- for (const task of tasks) {
167
- if (task.taskType === 'customExecution') {
168
- task.executionId = this.addCustomExecution(task.callback);
169
- task.callback = undefined;
170
- }
165
+ for (const task of tasks) {
166
+ if (task.taskType === 'customExecution') {
167
+ this.applyCustomExecution(task);
171
168
  }
172
169
  }
173
170
  return tasks;
174
171
  });
175
172
  } else {
176
- return Promise.reject(new Error('No adapter found to provide tasks'));
173
+ throw new Error('No adapter found to provide tasks');
177
174
  }
178
175
  }
179
176
 
180
- $resolveTask(handle: number, task: TaskDto, token: theia.CancellationToken): Promise<TaskDto | undefined> {
177
+ async $resolveTask(handle: number, task: TaskDto, token: theia.CancellationToken): Promise<TaskDto> {
181
178
  const adapter = this.adaptersMap.get(handle);
182
179
  if (adapter) {
183
180
  return adapter.resolveTask(task, token).then(resolvedTask => {
184
- if (resolvedTask && resolvedTask.taskType === 'customExecution') {
185
- resolvedTask.executionId = this.addCustomExecution(resolvedTask.callback);
186
- resolvedTask.callback = undefined;
181
+ // ensure we do not lose task type and execution id during resolution as we need it for custom execution
182
+ resolvedTask.taskType = resolvedTask.taskType ?? task.taskType;
183
+ if (resolvedTask.taskType === 'customExecution') {
184
+ this.applyCustomExecution(resolvedTask);
187
185
  }
188
186
  return resolvedTask;
189
187
  });
190
188
  } else {
191
- return Promise.reject(new Error('No adapter found to resolve task'));
189
+ throw new Error('No adapter found to resolve task');
190
+ }
191
+ }
192
+
193
+ private applyCustomExecution(task: TaskDto): void {
194
+ if (task.callback) {
195
+ task.executionId = this.addCustomExecution(task.callback);
196
+ task.callback = undefined;
192
197
  }
193
198
  }
194
199
 
@@ -20,6 +20,7 @@ import { RPCProtocol } from '../common/rpc-protocol';
20
20
  import { Event, Emitter } from '@theia/core/lib/common/event';
21
21
  import { Deferred } from '@theia/core/lib/common/promise-util';
22
22
  import * as theia from '@theia/plugin';
23
+ import * as Converter from './type-converters';
23
24
  import { Disposable, EnvironmentVariableMutatorType, TerminalExitReason, ThemeIcon } from './types-impl';
24
25
  import { SerializableEnvironmentVariableCollection } from '@theia/terminal/lib/common/base-terminal-protocol';
25
26
  import { ProvidedTerminalLink } from '../common/plugin-api-rpc-model';
@@ -313,7 +314,11 @@ export class TerminalServiceExtImpl implements TerminalServiceExt {
313
314
 
314
315
  private syncEnvironmentVariableCollection(extensionIdentifier: string, collection: EnvironmentVariableCollection): void {
315
316
  const serialized = [...collection.map.entries()];
316
- this.proxy.$setEnvironmentVariableCollection(extensionIdentifier, collection.persistent, serialized.length === 0 ? undefined : serialized);
317
+ this.proxy.$setEnvironmentVariableCollection(collection.persistent, {
318
+ extensionIdentifier,
319
+ collection: serialized.length === 0 ? undefined : serialized,
320
+ description: Converter.fromMarkdownOrString(collection.description)
321
+ });
317
322
  }
318
323
 
319
324
  private setEnvironmentVariableCollection(extensionIdentifier: string, collection: EnvironmentVariableCollection): void {
@@ -339,8 +344,15 @@ export class TerminalServiceExtImpl implements TerminalServiceExt {
339
344
 
340
345
  export class EnvironmentVariableCollection implements theia.EnvironmentVariableCollection {
341
346
  readonly map: Map<string, theia.EnvironmentVariableMutator> = new Map();
347
+ private _description?: string | theia.MarkdownString;
342
348
  private _persistent: boolean = true;
343
349
 
350
+ public get description(): string | theia.MarkdownString | undefined { return this._description; }
351
+ public set description(value: string | theia.MarkdownString | undefined) {
352
+ this._description = value;
353
+ this.onDidChangeCollectionEmitter.fire();
354
+ }
355
+
344
356
  public get persistent(): boolean { return this._persistent; }
345
357
  public set persistent(value: boolean) {
346
358
  this._persistent = value;