@theia/plugin-ext 1.50.1 → 1.52.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 (342) hide show
  1. package/lib/common/plugin-api-rpc-model.d.ts +13 -2
  2. package/lib/common/plugin-api-rpc-model.d.ts.map +1 -1
  3. package/lib/common/plugin-api-rpc.d.ts +38 -19
  4. package/lib/common/plugin-api-rpc.d.ts.map +1 -1
  5. package/lib/common/plugin-api-rpc.js +12 -1
  6. package/lib/common/plugin-api-rpc.js.map +1 -1
  7. package/lib/common/proxy-handler.d.ts.map +1 -1
  8. package/lib/common/proxy-handler.js +3 -1
  9. package/lib/common/proxy-handler.js.map +1 -1
  10. package/lib/common/test-types.d.ts +1 -0
  11. package/lib/common/test-types.d.ts.map +1 -1
  12. package/lib/common/test-types.js.map +1 -1
  13. package/lib/hosted/browser/hosted-plugin.d.ts.map +1 -1
  14. package/lib/hosted/browser/hosted-plugin.js +2 -0
  15. package/lib/hosted/browser/hosted-plugin.js.map +1 -1
  16. package/lib/hosted/browser/worker/worker-env-ext.d.ts +0 -3
  17. package/lib/hosted/browser/worker/worker-env-ext.d.ts.map +1 -1
  18. package/lib/hosted/browser/worker/worker-env-ext.js +2 -4
  19. package/lib/hosted/browser/worker/worker-env-ext.js.map +1 -1
  20. package/lib/hosted/browser/worker/worker-main.js +2 -2
  21. package/lib/hosted/browser/worker/worker-main.js.map +1 -1
  22. package/lib/hosted/node/scanners/scanner-theia.d.ts.map +1 -1
  23. package/lib/hosted/node/scanners/scanner-theia.js +1 -0
  24. package/lib/hosted/node/scanners/scanner-theia.js.map +1 -1
  25. package/lib/main/browser/authentication-main.d.ts +4 -2
  26. package/lib/main/browser/authentication-main.d.ts.map +1 -1
  27. package/lib/main/browser/command-registry-main.d.ts +4 -2
  28. package/lib/main/browser/command-registry-main.d.ts.map +1 -1
  29. package/lib/main/browser/custom-editors/custom-editors-main.d.ts +4 -2
  30. package/lib/main/browser/custom-editors/custom-editors-main.d.ts.map +1 -1
  31. package/lib/main/browser/debug/debug-main.d.ts +3 -0
  32. package/lib/main/browser/debug/debug-main.d.ts.map +1 -1
  33. package/lib/main/browser/debug/debug-main.js +20 -2
  34. package/lib/main/browser/debug/debug-main.js.map +1 -1
  35. package/lib/main/browser/debug/plugin-debug-service.d.ts +4 -2
  36. package/lib/main/browser/debug/plugin-debug-service.d.ts.map +1 -1
  37. package/lib/main/browser/debug/plugin-debug-session-factory.d.ts +7 -4
  38. package/lib/main/browser/debug/plugin-debug-session-factory.d.ts.map +1 -1
  39. package/lib/main/browser/debug/plugin-debug-session-factory.js +6 -5
  40. package/lib/main/browser/debug/plugin-debug-session-factory.js.map +1 -1
  41. package/lib/main/browser/documents-main.d.ts +2 -4
  42. package/lib/main/browser/documents-main.d.ts.map +1 -1
  43. package/lib/main/browser/documents-main.js +2 -18
  44. package/lib/main/browser/documents-main.js.map +1 -1
  45. package/lib/main/browser/editors-and-documents-main.d.ts +2 -1
  46. package/lib/main/browser/editors-and-documents-main.d.ts.map +1 -1
  47. package/lib/main/browser/editors-and-documents-main.js +12 -5
  48. package/lib/main/browser/editors-and-documents-main.js.map +1 -1
  49. package/lib/main/browser/languages-main.d.ts +4 -2
  50. package/lib/main/browser/languages-main.d.ts.map +1 -1
  51. package/lib/main/browser/main-context.d.ts.map +1 -1
  52. package/lib/main/browser/main-context.js +4 -6
  53. package/lib/main/browser/main-context.js.map +1 -1
  54. package/lib/main/browser/notebooks/notebooks-main.d.ts +4 -2
  55. package/lib/main/browser/notebooks/notebooks-main.d.ts.map +1 -1
  56. package/lib/main/browser/notebooks/renderers/cell-output-webview.d.ts +7 -0
  57. package/lib/main/browser/notebooks/renderers/cell-output-webview.d.ts.map +1 -1
  58. package/lib/main/browser/notebooks/renderers/cell-output-webview.js +30 -4
  59. package/lib/main/browser/notebooks/renderers/cell-output-webview.js.map +1 -1
  60. package/lib/main/browser/notebooks/renderers/output-webview-internal.d.ts.map +1 -1
  61. package/lib/main/browser/notebooks/renderers/output-webview-internal.js +15 -0
  62. package/lib/main/browser/notebooks/renderers/output-webview-internal.js.map +1 -1
  63. package/lib/main/browser/notebooks/renderers/webview-communication.d.ts +5 -1
  64. package/lib/main/browser/notebooks/renderers/webview-communication.d.ts.map +1 -1
  65. package/lib/main/browser/quick-open-main.d.ts +7 -3
  66. package/lib/main/browser/quick-open-main.d.ts.map +1 -1
  67. package/lib/main/browser/quick-open-main.js +21 -38
  68. package/lib/main/browser/quick-open-main.js.map +1 -1
  69. package/lib/main/browser/tabs/tabs-main.d.ts +5 -3
  70. package/lib/main/browser/tabs/tabs-main.d.ts.map +1 -1
  71. package/lib/main/browser/tabs/tabs-main.js +37 -13
  72. package/lib/main/browser/tabs/tabs-main.js.map +1 -1
  73. package/lib/main/browser/terminal-main.d.ts +9 -4
  74. package/lib/main/browser/terminal-main.d.ts.map +1 -1
  75. package/lib/main/browser/terminal-main.js +21 -2
  76. package/lib/main/browser/terminal-main.js.map +1 -1
  77. package/lib/main/browser/test-main.d.ts +3 -2
  78. package/lib/main/browser/test-main.d.ts.map +1 -1
  79. package/lib/main/browser/test-main.js +7 -3
  80. package/lib/main/browser/test-main.js.map +1 -1
  81. package/lib/main/browser/text-editor-model-service.d.ts +1 -0
  82. package/lib/main/browser/text-editor-model-service.d.ts.map +1 -1
  83. package/lib/main/browser/text-editor-model-service.js +8 -0
  84. package/lib/main/browser/text-editor-model-service.js.map +1 -1
  85. package/lib/main/browser/view/tree-view-decorator-service.d.ts +4 -2
  86. package/lib/main/browser/view/tree-view-decorator-service.d.ts.map +1 -1
  87. package/lib/main/browser/view/tree-view-widget.d.ts +4 -2
  88. package/lib/main/browser/view/tree-view-widget.d.ts.map +1 -1
  89. package/lib/main/browser/view/tree-views-main.d.ts +4 -3
  90. package/lib/main/browser/view/tree-views-main.d.ts.map +1 -1
  91. package/lib/main/browser/view/tree-views-main.js +0 -3
  92. package/lib/main/browser/view/tree-views-main.js.map +1 -1
  93. package/lib/main/browser/view/view-context-key-service.d.ts +0 -2
  94. package/lib/main/browser/view/view-context-key-service.d.ts.map +1 -1
  95. package/lib/main/browser/view/view-context-key-service.js +0 -4
  96. package/lib/main/browser/view/view-context-key-service.js.map +1 -1
  97. package/lib/main/browser/webview/webview.d.ts +4 -2
  98. package/lib/main/browser/webview/webview.d.ts.map +1 -1
  99. package/lib/main/browser/webview-views/webview-views-main.d.ts +4 -2
  100. package/lib/main/browser/webview-views/webview-views-main.d.ts.map +1 -1
  101. package/lib/main/browser/webviews-main.d.ts +4 -2
  102. package/lib/main/browser/webviews-main.d.ts.map +1 -1
  103. package/lib/main/browser/window-state-main.js +1 -1
  104. package/lib/main/browser/window-state-main.js.map +1 -1
  105. package/lib/main/browser/workspace-main.d.ts +4 -2
  106. package/lib/main/browser/workspace-main.d.ts.map +1 -1
  107. package/lib/plugin/authentication-ext.d.ts +4 -2
  108. package/lib/plugin/authentication-ext.d.ts.map +1 -1
  109. package/lib/plugin/clipboard-ext.d.ts +4 -2
  110. package/lib/plugin/clipboard-ext.d.ts.map +1 -1
  111. package/lib/plugin/command-registry.d.ts +4 -2
  112. package/lib/plugin/command-registry.d.ts.map +1 -1
  113. package/lib/plugin/comments.d.ts +4 -2
  114. package/lib/plugin/comments.d.ts.map +1 -1
  115. package/lib/plugin/custom-editors.d.ts +4 -2
  116. package/lib/plugin/custom-editors.d.ts.map +1 -1
  117. package/lib/plugin/debug/debug-ext.d.ts +12 -3
  118. package/lib/plugin/debug/debug-ext.d.ts.map +1 -1
  119. package/lib/plugin/debug/debug-ext.js +46 -3
  120. package/lib/plugin/debug/debug-ext.js.map +1 -1
  121. package/lib/plugin/debug/plugin-debug-adapter-creator.d.ts +4 -2
  122. package/lib/plugin/debug/plugin-debug-adapter-creator.d.ts.map +1 -1
  123. package/lib/plugin/debug/plugin-debug-adapter-session.d.ts +4 -2
  124. package/lib/plugin/debug/plugin-debug-adapter-session.d.ts.map +1 -1
  125. package/lib/plugin/debug/plugin-debug-adapter-tracker.d.ts +4 -2
  126. package/lib/plugin/debug/plugin-debug-adapter-tracker.d.ts.map +1 -1
  127. package/lib/plugin/decorations.d.ts +4 -2
  128. package/lib/plugin/decorations.d.ts.map +1 -1
  129. package/lib/plugin/dialogs.d.ts +4 -2
  130. package/lib/plugin/dialogs.d.ts.map +1 -1
  131. package/lib/plugin/document-data.d.ts +4 -2
  132. package/lib/plugin/document-data.d.ts.map +1 -1
  133. package/lib/plugin/documents.d.ts +4 -2
  134. package/lib/plugin/documents.d.ts.map +1 -1
  135. package/lib/plugin/env.d.ts +4 -2
  136. package/lib/plugin/env.d.ts.map +1 -1
  137. package/lib/plugin/file-system-event-service-ext-impl.d.ts +4 -2
  138. package/lib/plugin/file-system-event-service-ext-impl.d.ts.map +1 -1
  139. package/lib/plugin/file-system-ext-impl.d.ts +4 -2
  140. package/lib/plugin/file-system-ext-impl.d.ts.map +1 -1
  141. package/lib/plugin/label-service.d.ts +4 -2
  142. package/lib/plugin/label-service.d.ts.map +1 -1
  143. package/lib/plugin/languages/call-hierarchy.d.ts +4 -2
  144. package/lib/plugin/languages/call-hierarchy.d.ts.map +1 -1
  145. package/lib/plugin/languages/code-action.d.ts +4 -2
  146. package/lib/plugin/languages/code-action.d.ts.map +1 -1
  147. package/lib/plugin/languages/color.d.ts +4 -2
  148. package/lib/plugin/languages/color.d.ts.map +1 -1
  149. package/lib/plugin/languages/completion.d.ts +4 -2
  150. package/lib/plugin/languages/completion.d.ts.map +1 -1
  151. package/lib/plugin/languages/declaration.d.ts +4 -2
  152. package/lib/plugin/languages/declaration.d.ts.map +1 -1
  153. package/lib/plugin/languages/definition.d.ts +4 -2
  154. package/lib/plugin/languages/definition.d.ts.map +1 -1
  155. package/lib/plugin/languages/diagnostics.d.ts +4 -2
  156. package/lib/plugin/languages/diagnostics.d.ts.map +1 -1
  157. package/lib/plugin/languages/document-drop-edit.d.ts +4 -2
  158. package/lib/plugin/languages/document-drop-edit.d.ts.map +1 -1
  159. package/lib/plugin/languages/document-formatting.d.ts +4 -2
  160. package/lib/plugin/languages/document-formatting.d.ts.map +1 -1
  161. package/lib/plugin/languages/document-highlight.d.ts +4 -2
  162. package/lib/plugin/languages/document-highlight.d.ts.map +1 -1
  163. package/lib/plugin/languages/evaluatable-expression.d.ts +4 -2
  164. package/lib/plugin/languages/evaluatable-expression.d.ts.map +1 -1
  165. package/lib/plugin/languages/folding.d.ts +4 -2
  166. package/lib/plugin/languages/folding.d.ts.map +1 -1
  167. package/lib/plugin/languages/hover.d.ts +4 -2
  168. package/lib/plugin/languages/hover.d.ts.map +1 -1
  169. package/lib/plugin/languages/implementation.d.ts +4 -2
  170. package/lib/plugin/languages/implementation.d.ts.map +1 -1
  171. package/lib/plugin/languages/inlay-hints.d.ts +4 -2
  172. package/lib/plugin/languages/inlay-hints.d.ts.map +1 -1
  173. package/lib/plugin/languages/inline-completion.d.ts +4 -2
  174. package/lib/plugin/languages/inline-completion.d.ts.map +1 -1
  175. package/lib/plugin/languages/inline-values.d.ts +4 -2
  176. package/lib/plugin/languages/inline-values.d.ts.map +1 -1
  177. package/lib/plugin/languages/lens.d.ts +4 -2
  178. package/lib/plugin/languages/lens.d.ts.map +1 -1
  179. package/lib/plugin/languages/link-provider.d.ts +4 -2
  180. package/lib/plugin/languages/link-provider.d.ts.map +1 -1
  181. package/lib/plugin/languages/linked-editing-range.d.ts +4 -2
  182. package/lib/plugin/languages/linked-editing-range.d.ts.map +1 -1
  183. package/lib/plugin/languages/on-type-formatting.d.ts +4 -2
  184. package/lib/plugin/languages/on-type-formatting.d.ts.map +1 -1
  185. package/lib/plugin/languages/outline.d.ts +4 -2
  186. package/lib/plugin/languages/outline.d.ts.map +1 -1
  187. package/lib/plugin/languages/range-formatting.d.ts +4 -2
  188. package/lib/plugin/languages/range-formatting.d.ts.map +1 -1
  189. package/lib/plugin/languages/reference.d.ts +4 -2
  190. package/lib/plugin/languages/reference.d.ts.map +1 -1
  191. package/lib/plugin/languages/rename.d.ts +4 -2
  192. package/lib/plugin/languages/rename.d.ts.map +1 -1
  193. package/lib/plugin/languages/selection-range.d.ts +4 -2
  194. package/lib/plugin/languages/selection-range.d.ts.map +1 -1
  195. package/lib/plugin/languages/semantic-highlighting.d.ts +4 -2
  196. package/lib/plugin/languages/semantic-highlighting.d.ts.map +1 -1
  197. package/lib/plugin/languages/signature.d.ts +4 -2
  198. package/lib/plugin/languages/signature.d.ts.map +1 -1
  199. package/lib/plugin/languages/type-definition.d.ts +4 -2
  200. package/lib/plugin/languages/type-definition.d.ts.map +1 -1
  201. package/lib/plugin/languages/type-hierarchy.d.ts +4 -2
  202. package/lib/plugin/languages/type-hierarchy.d.ts.map +1 -1
  203. package/lib/plugin/languages/util.d.ts +4 -2
  204. package/lib/plugin/languages/util.d.ts.map +1 -1
  205. package/lib/plugin/languages/workspace-symbol.d.ts +4 -2
  206. package/lib/plugin/languages/workspace-symbol.d.ts.map +1 -1
  207. package/lib/plugin/languages-utils.d.ts +4 -2
  208. package/lib/plugin/languages-utils.d.ts.map +1 -1
  209. package/lib/plugin/languages.d.ts +4 -2
  210. package/lib/plugin/languages.d.ts.map +1 -1
  211. package/lib/plugin/markdown-string.d.ts +4 -2
  212. package/lib/plugin/markdown-string.d.ts.map +1 -1
  213. package/lib/plugin/message-registry.d.ts +4 -2
  214. package/lib/plugin/message-registry.d.ts.map +1 -1
  215. package/lib/plugin/node/debug/plugin-node-debug-adapter-creator.d.ts +4 -2
  216. package/lib/plugin/node/debug/plugin-node-debug-adapter-creator.d.ts.map +1 -1
  217. package/lib/plugin/notebook/notebook-document.d.ts +4 -2
  218. package/lib/plugin/notebook/notebook-document.d.ts.map +1 -1
  219. package/lib/plugin/notebook/notebook-documents.d.ts +4 -2
  220. package/lib/plugin/notebook/notebook-documents.d.ts.map +1 -1
  221. package/lib/plugin/notebook/notebook-editor.d.ts +4 -2
  222. package/lib/plugin/notebook/notebook-editor.d.ts.map +1 -1
  223. package/lib/plugin/notebook/notebook-editors.d.ts +4 -2
  224. package/lib/plugin/notebook/notebook-editors.d.ts.map +1 -1
  225. package/lib/plugin/notebook/notebook-kernels.d.ts +4 -2
  226. package/lib/plugin/notebook/notebook-kernels.d.ts.map +1 -1
  227. package/lib/plugin/notebook/notebook-renderers.d.ts +4 -2
  228. package/lib/plugin/notebook/notebook-renderers.d.ts.map +1 -1
  229. package/lib/plugin/notebook/notebooks.d.ts +4 -2
  230. package/lib/plugin/notebook/notebooks.d.ts.map +1 -1
  231. package/lib/plugin/notification.d.ts +4 -2
  232. package/lib/plugin/notification.d.ts.map +1 -1
  233. package/lib/plugin/output-channel/log-output-channel.d.ts +4 -2
  234. package/lib/plugin/output-channel/log-output-channel.d.ts.map +1 -1
  235. package/lib/plugin/output-channel/output-channel-item.d.ts +4 -2
  236. package/lib/plugin/output-channel/output-channel-item.d.ts.map +1 -1
  237. package/lib/plugin/output-channel-registry.d.ts +4 -2
  238. package/lib/plugin/output-channel-registry.d.ts.map +1 -1
  239. package/lib/plugin/plugin-context.d.ts +4 -2
  240. package/lib/plugin/plugin-context.d.ts.map +1 -1
  241. package/lib/plugin/plugin-context.js +57 -6
  242. package/lib/plugin/plugin-context.js.map +1 -1
  243. package/lib/plugin/plugin-icon-path.d.ts +2 -1
  244. package/lib/plugin/plugin-icon-path.d.ts.map +1 -1
  245. package/lib/plugin/plugin-icon-path.js +5 -1
  246. package/lib/plugin/plugin-icon-path.js.map +1 -1
  247. package/lib/plugin/plugin-manager.d.ts +7 -3
  248. package/lib/plugin/plugin-manager.d.ts.map +1 -1
  249. package/lib/plugin/plugin-manager.js +13 -1
  250. package/lib/plugin/plugin-manager.js.map +1 -1
  251. package/lib/plugin/plugin-storage.d.ts +4 -2
  252. package/lib/plugin/plugin-storage.d.ts.map +1 -1
  253. package/lib/plugin/preference-registry.d.ts +4 -2
  254. package/lib/plugin/preference-registry.d.ts.map +1 -1
  255. package/lib/plugin/quick-open.d.ts +7 -19
  256. package/lib/plugin/quick-open.d.ts.map +1 -1
  257. package/lib/plugin/quick-open.js +22 -39
  258. package/lib/plugin/quick-open.js.map +1 -1
  259. package/lib/plugin/scm.d.ts +4 -2
  260. package/lib/plugin/scm.d.ts.map +1 -1
  261. package/lib/plugin/secrets-ext.d.ts +4 -2
  262. package/lib/plugin/secrets-ext.d.ts.map +1 -1
  263. package/lib/plugin/status-bar/status-bar-item.d.ts +4 -2
  264. package/lib/plugin/status-bar/status-bar-item.d.ts.map +1 -1
  265. package/lib/plugin/status-bar-message-registry.d.ts +4 -2
  266. package/lib/plugin/status-bar-message-registry.d.ts.map +1 -1
  267. package/lib/plugin/tabs.d.ts +4 -2
  268. package/lib/plugin/tabs.d.ts.map +1 -1
  269. package/lib/plugin/tasks/task-provider.d.ts +4 -2
  270. package/lib/plugin/tasks/task-provider.d.ts.map +1 -1
  271. package/lib/plugin/tasks/tasks.d.ts +4 -2
  272. package/lib/plugin/tasks/tasks.d.ts.map +1 -1
  273. package/lib/plugin/terminal-ext.d.ts +13 -16
  274. package/lib/plugin/terminal-ext.d.ts.map +1 -1
  275. package/lib/plugin/terminal-ext.js +14 -21
  276. package/lib/plugin/terminal-ext.js.map +1 -1
  277. package/lib/plugin/test-item.d.ts +4 -2
  278. package/lib/plugin/test-item.d.ts.map +1 -1
  279. package/lib/plugin/tests.d.ts +11 -8
  280. package/lib/plugin/tests.d.ts.map +1 -1
  281. package/lib/plugin/tests.js +33 -28
  282. package/lib/plugin/tests.js.map +1 -1
  283. package/lib/plugin/text-editor.d.ts +4 -2
  284. package/lib/plugin/text-editor.d.ts.map +1 -1
  285. package/lib/plugin/text-editors.d.ts +4 -2
  286. package/lib/plugin/text-editors.d.ts.map +1 -1
  287. package/lib/plugin/timeline.d.ts +4 -2
  288. package/lib/plugin/timeline.d.ts.map +1 -1
  289. package/lib/plugin/tree/tree-views.d.ts +4 -2
  290. package/lib/plugin/tree/tree-views.d.ts.map +1 -1
  291. package/lib/plugin/tree/tree-views.js.map +1 -1
  292. package/lib/plugin/type-converters.d.ts +7 -6
  293. package/lib/plugin/type-converters.d.ts.map +1 -1
  294. package/lib/plugin/type-converters.js +9 -7
  295. package/lib/plugin/type-converters.js.map +1 -1
  296. package/lib/plugin/types-impl.d.ts +111 -3
  297. package/lib/plugin/types-impl.d.ts.map +1 -1
  298. package/lib/plugin/types-impl.js +134 -4
  299. package/lib/plugin/types-impl.js.map +1 -1
  300. package/lib/plugin/webview-views.d.ts +4 -2
  301. package/lib/plugin/webview-views.d.ts.map +1 -1
  302. package/lib/plugin/webviews.d.ts +4 -2
  303. package/lib/plugin/webviews.d.ts.map +1 -1
  304. package/lib/plugin/window-state.d.ts +4 -2
  305. package/lib/plugin/window-state.d.ts.map +1 -1
  306. package/lib/plugin/workspace.d.ts +4 -2
  307. package/lib/plugin/workspace.d.ts.map +1 -1
  308. package/package.json +29 -29
  309. package/src/common/plugin-api-rpc-model.ts +10 -0
  310. package/src/common/plugin-api-rpc.ts +32 -13
  311. package/src/common/proxy-handler.ts +3 -1
  312. package/src/common/test-types.ts +1 -0
  313. package/src/hosted/browser/hosted-plugin.ts +3 -1
  314. package/src/hosted/browser/worker/worker-env-ext.ts +2 -4
  315. package/src/hosted/browser/worker/worker-main.ts +2 -2
  316. package/src/hosted/node/scanners/scanner-theia.ts +1 -0
  317. package/src/main/browser/debug/debug-main.ts +26 -2
  318. package/src/main/browser/debug/plugin-debug-session-factory.ts +13 -3
  319. package/src/main/browser/documents-main.ts +3 -21
  320. package/src/main/browser/editors-and-documents-main.ts +13 -5
  321. package/src/main/browser/main-context.ts +5 -7
  322. package/src/main/browser/notebooks/renderers/cell-output-webview.tsx +33 -4
  323. package/src/main/browser/notebooks/renderers/output-webview-internal.ts +18 -0
  324. package/src/main/browser/notebooks/renderers/webview-communication.ts +12 -1
  325. package/src/main/browser/quick-open-main.ts +23 -45
  326. package/src/main/browser/tabs/tabs-main.ts +39 -15
  327. package/src/main/browser/terminal-main.ts +26 -6
  328. package/src/main/browser/test-main.ts +8 -3
  329. package/src/main/browser/text-editor-model-service.ts +9 -0
  330. package/src/main/browser/view/tree-views-main.ts +0 -4
  331. package/src/main/browser/view/view-context-key-service.ts +0 -6
  332. package/src/main/browser/window-state-main.ts +1 -1
  333. package/src/plugin/debug/debug-ext.ts +56 -6
  334. package/src/plugin/plugin-context.ts +78 -9
  335. package/src/plugin/plugin-icon-path.ts +5 -2
  336. package/src/plugin/plugin-manager.ts +17 -3
  337. package/src/plugin/quick-open.ts +9 -32
  338. package/src/plugin/terminal-ext.ts +27 -33
  339. package/src/plugin/tests.ts +39 -34
  340. package/src/plugin/tree/tree-views.ts +1 -1
  341. package/src/plugin/type-converters.ts +8 -8
  342. package/src/plugin/types-impl.ts +154 -1
@@ -18,14 +18,14 @@ import { Emitter } from '@theia/core/lib/common/event';
18
18
  import { Path } from '@theia/core/lib/common/path';
19
19
  import * as theia from '@theia/plugin';
20
20
  import { URI } from '@theia/core/shared/vscode-uri';
21
- import { Breakpoint } from '../../common/plugin-api-rpc-model';
21
+ import { Breakpoint, DebugStackFrameDTO, DebugThreadDTO } from '../../common/plugin-api-rpc-model';
22
22
  import { DebugConfigurationProviderTriggerKind, DebugExt, DebugMain, PLUGIN_RPC_CONTEXT as Ext, TerminalOptionsExt } from '../../common/plugin-api-rpc';
23
23
  import { PluginPackageDebuggersContribution } from '../../common/plugin-protocol';
24
24
  import { RPCProtocol } from '../../common/rpc-protocol';
25
25
  import { CommandRegistryImpl } from '../command-registry';
26
26
  import { ConnectionImpl } from '../../common/connection';
27
27
  import { DEBUG_SCHEME, SCHEME_PATTERN } from '@theia/debug/lib/common/debug-uri-utils';
28
- import { Disposable, Breakpoint as BreakpointExt, SourceBreakpoint, FunctionBreakpoint, Location, Range, URI as URIImpl } from '../types-impl';
28
+ import { Disposable, Breakpoint as BreakpointExt, SourceBreakpoint, FunctionBreakpoint, Location, Range, URI as URIImpl, DebugStackFrame, DebugThread } from '../types-impl';
29
29
  import { PluginDebugAdapterSession } from './plugin-debug-adapter-session';
30
30
  import { PluginDebugAdapterTracker } from './plugin-debug-adapter-tracker';
31
31
  import { generateUuid } from '@theia/core/lib/common/uuid';
@@ -33,7 +33,8 @@ import { DebugAdapter } from '@theia/debug/lib/common/debug-model';
33
33
  import { PluginDebugAdapterCreator } from './plugin-debug-adapter-creator';
34
34
  import { NodeDebugAdapterCreator } from '../node/debug/plugin-node-debug-adapter-creator';
35
35
  import { DebugProtocol } from '@vscode/debugprotocol';
36
- import { DebugConfiguration } from '@theia/debug/lib/common/debug-configuration';
36
+ import { DebugConfiguration, DebugSessionOptions } from '@theia/debug/lib/common/debug-configuration';
37
+ import { checkTestRunInstance } from '../tests';
37
38
 
38
39
  interface ConfigurationProviderRecord {
39
40
  handle: number;
@@ -79,6 +80,9 @@ export class DebugExtImpl implements DebugExt {
79
80
  activeDebugSession: theia.DebugSession | undefined;
80
81
  activeDebugConsole: theia.DebugConsole;
81
82
 
83
+ _activeStackItem: theia.DebugStackFrame | theia.DebugThread | undefined;
84
+ private readonly onDidChangeActiveStackItemEmitter = new Emitter<theia.DebugStackFrame | theia.DebugThread | undefined>();
85
+
82
86
  private readonly _breakpoints = new Map<string, theia.Breakpoint>();
83
87
 
84
88
  private frontendAdapterCreator = new PluginDebugAdapterCreator();
@@ -149,6 +153,10 @@ export class DebugExtImpl implements DebugExt {
149
153
  return this.onDidStartDebugSessionEmitter.event;
150
154
  }
151
155
 
156
+ get onDidChangeActiveStackItem(): theia.Event<theia.DebugStackFrame | theia.DebugThread | undefined> {
157
+ return this.onDidChangeActiveStackItemEmitter.event;
158
+ }
159
+
152
160
  get onDidChangeBreakpoints(): theia.Event<theia.BreakpointsChangeEvent> {
153
161
  return this.onDidChangeBreakpointsEmitter.event;
154
162
  }
@@ -186,7 +194,7 @@ export class DebugExtImpl implements DebugExt {
186
194
  }
187
195
 
188
196
  startDebugging(folder: theia.WorkspaceFolder | undefined, nameOrConfiguration: string | theia.DebugConfiguration, options: theia.DebugSessionOptions): PromiseLike<boolean> {
189
- return this.proxy.$startDebugging(folder, nameOrConfiguration, {
197
+ const optionsDto: DebugSessionOptions = {
190
198
  parentSessionId: options.parentSession?.id,
191
199
  compact: options.compact,
192
200
  consoleMode: options.consoleMode,
@@ -194,8 +202,16 @@ export class DebugExtImpl implements DebugExt {
194
202
  suppressDebugStatusbar: options.suppressDebugStatusbar,
195
203
  suppressDebugView: options.suppressDebugView,
196
204
  lifecycleManagedByParent: options.lifecycleManagedByParent,
197
- noDebug: options.noDebug
198
- });
205
+ noDebug: options.noDebug,
206
+ };
207
+ if (options.testRun) {
208
+ const run = checkTestRunInstance(options.testRun);
209
+ optionsDto.testRun = {
210
+ controllerId: run.controller.id,
211
+ runId: run.id
212
+ };
213
+ }
214
+ return this.proxy.$startDebugging(folder, nameOrConfiguration, optionsDto);
199
215
  }
200
216
 
201
217
  stopDebugging(session?: theia.DebugSession): PromiseLike<void> {
@@ -262,6 +278,40 @@ export class DebugExtImpl implements DebugExt {
262
278
  });
263
279
  }
264
280
 
281
+ set activeStackItem(stackItem: theia.DebugStackFrame | theia.DebugThread | undefined) {
282
+ if (this._activeStackItem === stackItem) {
283
+ return;
284
+ }
285
+ this._activeStackItem = stackItem;
286
+ this.onDidChangeActiveStackItemEmitter.fire(this.activeStackItem);
287
+ }
288
+
289
+ get activeStackItem(): theia.DebugStackFrame | theia.DebugThread | undefined {
290
+ return this._activeStackItem;
291
+ }
292
+
293
+ async $onDidChangeActiveThread(debugThread: DebugThreadDTO | undefined): Promise<void> {
294
+ if (!debugThread) {
295
+ this.activeStackItem = undefined;
296
+ return;
297
+ }
298
+ const session = this.sessions.get(debugThread.sessionId);
299
+ if (session) {
300
+ this.activeStackItem = new DebugThread(session, debugThread.threadId);
301
+ }
302
+ }
303
+
304
+ async $onDidChangeActiveFrame(debugFrame: DebugStackFrameDTO | undefined): Promise<void> {
305
+ if (!debugFrame) {
306
+ this.activeStackItem = undefined;
307
+ return;
308
+ }
309
+ const session = this.sessions.get(debugFrame!.sessionId);
310
+ if (session) {
311
+ this.activeStackItem = new DebugStackFrame(session, debugFrame.threadId, debugFrame.frameId);
312
+ }
313
+ }
314
+
265
315
  async $onSessionCustomEvent(sessionId: string, event: string, body?: any): Promise<void> {
266
316
  const session = this.sessions.get(sessionId);
267
317
  if (session) {
@@ -19,7 +19,7 @@
19
19
 
20
20
  import type * as theia from '@theia/plugin';
21
21
  import { CommandRegistryImpl } from './command-registry';
22
- import { Emitter } from '@theia/core/lib/common/event';
22
+ import { Emitter, Event } from '@theia/core/lib/common/event';
23
23
  import { CancellationError, CancellationToken, CancellationTokenSource } from '@theia/core/lib/common/cancellation';
24
24
  import { QuickOpenExtImpl } from './quick-open';
25
25
  import {
@@ -124,6 +124,8 @@ import {
124
124
  Breakpoint,
125
125
  SourceBreakpoint,
126
126
  FunctionBreakpoint,
127
+ DebugStackFrame,
128
+ DebugThread,
127
129
  FoldingRange,
128
130
  FoldingRangeKind,
129
131
  SelectionRange,
@@ -211,7 +213,22 @@ import {
211
213
  DeclarationCoverage,
212
214
  FileCoverage,
213
215
  StatementCoverage,
214
- TestCoverageCount
216
+ TestCoverageCount,
217
+ ChatRequestTurn,
218
+ ChatResponseTurn,
219
+ ChatResponseAnchorPart,
220
+ ChatResponseCommandButtonPart,
221
+ ChatResponseFileTreePart,
222
+ ChatResponseMarkdownPart,
223
+ ChatResponseProgressPart,
224
+ ChatResponseReferencePart,
225
+ ChatResultFeedbackKind,
226
+ LanguageModelChatMessage,
227
+ LanguageModelChatMessageRole,
228
+ LanguageModelError,
229
+ PortAutoForwardAction,
230
+ PortAttributes,
231
+ DebugVisualization
215
232
  } from './types-impl';
216
233
  import { AuthenticationExtImpl } from './authentication-ext';
217
234
  import { SymbolKind } from '../common/plugin-api-rpc-model';
@@ -469,7 +486,7 @@ export function createAPIFactory(
469
486
  },
470
487
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
471
488
  showQuickPick(items: any, options?: theia.QuickPickOptions, token?: theia.CancellationToken): any {
472
- return quickOpenExt.showQuickPick(items, options, token);
489
+ return quickOpenExt.showQuickPick(plugin, items, options, token);
473
490
  },
474
491
  createQuickPick<T extends theia.QuickPickItem>(): theia.QuickPick<T> {
475
492
  return quickOpenExt.createQuickPick(plugin);
@@ -550,7 +567,7 @@ export function createAPIFactory(
550
567
  createTerminal(nameOrOptions: theia.TerminalOptions | theia.ExtensionTerminalOptions | theia.ExtensionTerminalOptions | (string | undefined),
551
568
  shellPath?: string,
552
569
  shellArgs?: string[] | string): theia.Terminal {
553
- return terminalExt.createTerminal(nameOrOptions, shellPath, shellArgs);
570
+ return terminalExt.createTerminal(plugin, nameOrOptions, shellPath, shellArgs);
554
571
  },
555
572
  onDidChangeTerminalState,
556
573
  onDidCloseTerminal,
@@ -800,7 +817,13 @@ export function createAPIFactory(
800
817
  },
801
818
  getCanonicalUri(uri: theia.Uri, options: theia.CanonicalUriRequestOptions, token: CancellationToken): theia.ProviderResult<theia.Uri> {
802
819
  return workspaceExt.getCanonicalUri(uri, options, token);
803
- }
820
+ },
821
+ /**
822
+ * @stubbed
823
+ * This is a stub implementation, that should minimally satisfy vscode extensions
824
+ * that currently use this proposed API.
825
+ */
826
+ registerPortAttributesProvider: () => Disposable.NULL
804
827
  };
805
828
 
806
829
  const onDidChangeLogLevel = new Emitter<theia.LogLevel>();
@@ -1078,6 +1101,12 @@ export function createAPIFactory(
1078
1101
  get onDidChangeBreakpoints(): theia.Event<theia.BreakpointsChangeEvent> {
1079
1102
  return debugExt.onDidChangeBreakpoints;
1080
1103
  },
1104
+ get activeStackItem(): DebugThread | DebugStackFrame | undefined {
1105
+ return debugExt.activeStackItem;
1106
+ },
1107
+ get onDidChangeActiveStackItem(): theia.Event<DebugThread | DebugStackFrame | undefined> {
1108
+ return debugExt.onDidChangeActiveStackItem;
1109
+ },
1081
1110
  registerDebugAdapterDescriptorFactory(debugType: string, factory: theia.DebugAdapterDescriptorFactory): Disposable {
1082
1111
  return debugExt.registerDebugAdapterDescriptorFactory(debugType, factory);
1083
1112
  },
@@ -1112,7 +1141,11 @@ export function createAPIFactory(
1112
1141
  },
1113
1142
  asDebugSourceUri(source: theia.DebugProtocolSource, session?: theia.DebugSession): theia.Uri {
1114
1143
  return debugExt.asDebugSourceUri(source, session);
1115
- }
1144
+ },
1145
+ /** @stubbed Due to proposed API */
1146
+ registerDebugVisualizationProvider: () => Disposable.NULL,
1147
+ /** @stubbed Due to proposed API */
1148
+ registerDebugVisualizationTreeProvider: () => Disposable.NULL
1116
1149
  };
1117
1150
 
1118
1151
  const tasks: typeof theia.tasks = {
@@ -1219,13 +1252,31 @@ export function createAPIFactory(
1219
1252
  }
1220
1253
  };
1221
1254
 
1222
- const chat: typeof theia.chat = {
1255
+ const chat: typeof theia.chat = {
1223
1256
  /** @stubbed MappedEditsProvider */
1224
1257
  registerMappedEditsProvider(documentSelector: theia.DocumentSelector, provider: theia.MappedEditsProvider): Disposable {
1225
1258
  return Disposable.NULL;
1259
+ },
1260
+ /** @stubbed ChatRequestHandler */
1261
+ createChatParticipant(id: string, handler: theia.ChatRequestHandler): theia.ChatParticipant {
1262
+ return {
1263
+ id,
1264
+ requestHandler: handler,
1265
+ dispose() { },
1266
+ onDidReceiveFeedback: (listener, thisArgs?, disposables?) => Event.None(listener, thisArgs, disposables)
1267
+ };
1226
1268
  }
1227
1269
  };
1228
1270
 
1271
+ const lm: typeof theia.lm = {
1272
+ /** @stubbed LanguageModelChat */
1273
+ selectChatModels(selector?: theia.LanguageModelChatSelector): Thenable<theia.LanguageModelChat[]> {
1274
+ return Promise.resolve([]);
1275
+ },
1276
+ /** @stubbed LanguageModelChat */
1277
+ onDidChangeChatModels: (listener, thisArgs?, disposables?) => Event.None(listener, thisArgs, disposables)
1278
+ };
1279
+
1229
1280
  return <typeof theia>{
1230
1281
  version: require('../../package.json').version,
1231
1282
  authentication,
@@ -1244,6 +1295,7 @@ export function createAPIFactory(
1244
1295
  notebooks,
1245
1296
  l10n,
1246
1297
  tests,
1298
+ lm,
1247
1299
  // Types
1248
1300
  StatusBarAlignment: StatusBarAlignment,
1249
1301
  Disposable: Disposable,
@@ -1341,6 +1393,8 @@ export function createAPIFactory(
1341
1393
  Breakpoint,
1342
1394
  SourceBreakpoint,
1343
1395
  FunctionBreakpoint,
1396
+ DebugStackFrame,
1397
+ DebugThread,
1344
1398
  Color,
1345
1399
  ColorInformation,
1346
1400
  ColorPresentation,
@@ -1426,7 +1480,22 @@ export function createAPIFactory(
1426
1480
  DeclarationCoverage,
1427
1481
  FileCoverage,
1428
1482
  StatementCoverage,
1429
- TestCoverageCount
1483
+ TestCoverageCount,
1484
+ ChatRequestTurn,
1485
+ ChatResponseTurn,
1486
+ ChatResponseAnchorPart,
1487
+ ChatResponseCommandButtonPart,
1488
+ ChatResponseFileTreePart,
1489
+ ChatResponseMarkdownPart,
1490
+ ChatResponseProgressPart,
1491
+ ChatResponseReferencePart,
1492
+ ChatResultFeedbackKind,
1493
+ LanguageModelChatMessage,
1494
+ LanguageModelChatMessageRole,
1495
+ LanguageModelError,
1496
+ PortAutoForwardAction,
1497
+ PortAttributes,
1498
+ DebugVisualization
1430
1499
  };
1431
1500
  };
1432
1501
  }
@@ -1508,7 +1577,7 @@ export class PluginExt<T> extends Plugin<T> implements ExtensionPlugin<T> {
1508
1577
 
1509
1578
  this.extensionPath = this.pluginPath;
1510
1579
  this.extensionUri = this.pluginUri;
1511
- this.extensionKind = ExtensionKind.UI; // stub as a local extension (not running on a remote workspace)
1580
+ this.extensionKind = pluginManager.getPluginKind();
1512
1581
  this.isFromDifferentExtensionHost = isFromDifferentExtensionHost;
1513
1582
  }
1514
1583
 
@@ -24,8 +24,8 @@ export type PluginIconPath = string | URI | {
24
24
  dark: string | URI
25
25
  };
26
26
  export namespace PluginIconPath {
27
- export function toUrl(iconPath: PluginIconPath | undefined, plugin: Plugin): IconUrl | undefined {
28
- if (!iconPath) {
27
+ export function toUrl(iconPath: unknown, plugin: Plugin): IconUrl | undefined {
28
+ if (!is(iconPath)) {
29
29
  return undefined;
30
30
  }
31
31
  if (typeof iconPath === 'object' && 'light' in iconPath) {
@@ -36,6 +36,9 @@ export namespace PluginIconPath {
36
36
  }
37
37
  return asString(iconPath, plugin);
38
38
  }
39
+ export function is(item: unknown): item is PluginIconPath {
40
+ return typeof item === 'string' || item instanceof URI || typeof item === 'object' && !!item && 'light' in item && 'dark' in item;
41
+ }
39
42
  export function asString(arg: string | URI, plugin: Plugin): string {
40
43
  arg = arg instanceof URI && arg.scheme === 'file' ? arg.fsPath : arg;
41
44
  if (typeof arg !== 'string') {
@@ -29,7 +29,8 @@ import {
29
29
  PluginManagerInitializeParams,
30
30
  PluginManagerStartParams,
31
31
  TerminalServiceExt,
32
- LocalizationExt
32
+ LocalizationExt,
33
+ ExtensionKind
33
34
  } from '../common/plugin-api-rpc';
34
35
  import { PluginMetadata, PluginJsonValidationContribution } from '../common/plugin-protocol';
35
36
  import * as theia from '@theia/plugin';
@@ -40,7 +41,7 @@ import { PreferenceRegistryExtImpl } from './preference-registry';
40
41
  import { InternalStorageExt, Memento, GlobalState } from './plugin-storage';
41
42
  import { ExtPluginApi } from '../common/plugin-ext-api-contribution';
42
43
  import { RPCProtocol } from '../common/rpc-protocol';
43
- import { Emitter } from '@theia/core/lib/common/event';
44
+ import { Emitter, Event } from '@theia/core/lib/common/event';
44
45
  import { WebviewsExtImpl } from './webviews';
45
46
  import { URI as Uri } from './types-impl';
46
47
  import { InternalSecretsExt, SecretStorageExt } from '../plugin/secrets-ext';
@@ -121,6 +122,7 @@ export abstract class AbstractPluginManagerExtImpl<P extends Record<string, any>
121
122
  private notificationMain: NotificationMain;
122
123
 
123
124
  protected jsonValidation: PluginJsonValidationContribution[] = [];
125
+ protected pluginKind = ExtensionKind.UI;
124
126
  protected ready = new Deferred();
125
127
 
126
128
  @postConstruct()
@@ -389,7 +391,14 @@ export abstract class AbstractPluginManagerExtImpl<P extends Record<string, any>
389
391
  environmentVariableCollection: this.terminalService.getEnvironmentVariableCollection(plugin.model.id),
390
392
  extensionMode: extensionModeValue,
391
393
  extension,
392
- logUri: Uri.file(logPath)
394
+ logUri: Uri.file(logPath),
395
+ languageModelAccessInformation: {
396
+ /** @stubbed LanguageModelChat */
397
+ onDidChange: (listener, thisArgs?, disposables?) => Event.None(listener, thisArgs, disposables),
398
+ canSendRequest(chat: theia.LanguageModelChat): boolean | undefined {
399
+ return undefined;
400
+ }
401
+ }
393
402
  };
394
403
  this.pluginContextsMap.set(plugin.model.id, pluginContext);
395
404
 
@@ -410,6 +419,10 @@ export abstract class AbstractPluginManagerExtImpl<P extends Record<string, any>
410
419
  }
411
420
  }
412
421
 
422
+ getPluginKind(): theia.ExtensionKind {
423
+ return this.pluginKind;
424
+ }
425
+
413
426
  getAllPlugins(): Plugin[] {
414
427
  return Array.from(this.registry.values());
415
428
  }
@@ -477,6 +490,7 @@ export class PluginManagerExtImpl extends AbstractPluginManagerExtImpl<PluginMan
477
490
 
478
491
  this.webview.init(params.webview);
479
492
  this.jsonValidation = params.jsonValidation;
493
+ this.pluginKind = params.pluginKind;
480
494
 
481
495
  this.supportedActivationEvents = new Set(params.supportedActivationEvents ?? []);
482
496
  }
@@ -30,8 +30,8 @@ import { convertToTransferQuickPickItems } from './type-converters';
30
30
  import { PluginPackage } from '../common/plugin-protocol';
31
31
  import { QuickInputButtonHandle } from '@theia/core/lib/browser';
32
32
  import { MaybePromise } from '@theia/core/lib/common/types';
33
- import { ThemeIcon as MonacoThemeIcon } from '@theia/monaco-editor-core/esm/vs/base/common/themables';
34
33
  import { Severity } from '@theia/core/lib/common/severity';
34
+ import { PluginIconPath } from './plugin-icon-path';
35
35
 
36
36
  const canceledName = 'Canceled';
37
37
  /**
@@ -42,27 +42,6 @@ export function isPromiseCanceledError(error: any): boolean {
42
42
  return error instanceof Error && error.name === canceledName && error.message === canceledName;
43
43
  }
44
44
 
45
- export function getIconUris(iconPath: theia.QuickInputButton['iconPath']): { dark: URI, light: URI } | { id: string } {
46
- if (ThemeIcon.is(iconPath)) {
47
- return { id: iconPath.id };
48
- }
49
- const dark = getDarkIconUri(iconPath as URI | { light: URI; dark: URI; });
50
- const light = getLightIconUri(iconPath as URI | { light: URI; dark: URI; });
51
- // Tolerate strings: https://github.com/microsoft/vscode/issues/110432#issuecomment-726144556
52
- return {
53
- dark: typeof dark === 'string' ? URI.file(dark) : dark,
54
- light: typeof light === 'string' ? URI.file(light) : light
55
- };
56
- }
57
-
58
- export function getLightIconUri(iconPath: URI | { light: URI; dark: URI; }): URI {
59
- return typeof iconPath === 'object' && 'light' in iconPath ? iconPath.light : iconPath;
60
- }
61
-
62
- export function getDarkIconUri(iconPath: URI | { light: URI; dark: URI; }): URI {
63
- return typeof iconPath === 'object' && 'dark' in iconPath ? iconPath.dark : iconPath;
64
- }
65
-
66
45
  type Item = theia.QuickPickItem | string;
67
46
 
68
47
  export class QuickOpenExtImpl implements QuickOpenExt {
@@ -77,10 +56,10 @@ export class QuickOpenExtImpl implements QuickOpenExt {
77
56
  }
78
57
 
79
58
  /* eslint-disable max-len */
80
- showQuickPick(itemsOrItemsPromise: theia.QuickPickItem[] | Promise<theia.QuickPickItem[]>, options: theia.QuickPickOptions & { canPickMany: true; }, token?: theia.CancellationToken): Promise<Array<theia.QuickPickItem> | undefined>;
81
- showQuickPick(itemsOrItemsPromise: string[] | Promise<string[]>, options?: theia.QuickPickOptions, token?: theia.CancellationToken): Promise<string | undefined>;
82
- showQuickPick(itemsOrItemsPromise: theia.QuickPickItem[] | Promise<theia.QuickPickItem[]>, options?: theia.QuickPickOptions, token?: theia.CancellationToken): Promise<theia.QuickPickItem | undefined>;
83
- showQuickPick(itemsOrItemsPromise: Item[] | Promise<Item[]>, options?: theia.QuickPickOptions, token: theia.CancellationToken = CancellationToken.None): Promise<Item | Item[] | undefined> {
59
+ showQuickPick(plugin: Plugin, itemsOrItemsPromise: theia.QuickPickItem[] | Promise<theia.QuickPickItem[]>, options: theia.QuickPickOptions & { canPickMany: true; }, token?: theia.CancellationToken): Promise<Array<theia.QuickPickItem> | undefined>;
60
+ showQuickPick(plugin: Plugin, itemsOrItemsPromise: string[] | Promise<string[]>, options?: theia.QuickPickOptions, token?: theia.CancellationToken): Promise<string | undefined>;
61
+ showQuickPick(plugin: Plugin, itemsOrItemsPromise: theia.QuickPickItem[] | Promise<theia.QuickPickItem[]>, options?: theia.QuickPickOptions, token?: theia.CancellationToken): Promise<theia.QuickPickItem | undefined>;
62
+ showQuickPick(plugin: Plugin, itemsOrItemsPromise: Item[] | Promise<Item[]>, options?: theia.QuickPickOptions, token: theia.CancellationToken = CancellationToken.None): Promise<Item | Item[] | undefined> {
84
63
  this.onDidSelectItem = undefined;
85
64
 
86
65
  const itemsPromise = Promise.resolve(itemsOrItemsPromise);
@@ -104,7 +83,7 @@ export class QuickOpenExtImpl implements QuickOpenExt {
104
83
  return undefined;
105
84
  }
106
85
  return itemsPromise.then(async items => {
107
- const pickItems = convertToTransferQuickPickItems(items);
86
+ const pickItems = convertToTransferQuickPickItems(plugin, items);
108
87
 
109
88
  if (options && typeof options.onDidSelectItem === 'function') {
110
89
  this.onDidSelectItem = handle => {
@@ -398,8 +377,7 @@ export class QuickInputExt implements theia.QuickInput {
398
377
  });
399
378
  this.update({
400
379
  buttons: buttons.map<TransferQuickInputButton>((button, i) => ({
401
- iconPath: getIconUris(button.iconPath),
402
- iconClass: ThemeIcon.is(button.iconPath) ? MonacoThemeIcon.asClassName(button.iconPath) : undefined,
380
+ iconUrl: PluginIconPath.toUrl(button.iconPath, this.plugin) ?? ThemeIcon.get(button.iconPath),
403
381
  tooltip: button.tooltip,
404
382
  handle: button === QuickInputButtons.Back ? -1 : i,
405
383
  }))
@@ -640,15 +618,14 @@ export class QuickPickExt<T extends theia.QuickPickItem> extends QuickInputExt i
640
618
  pickItems.push({
641
619
  kind: 'item',
642
620
  label: item.label,
643
- iconPath: item.iconPath ? getIconUris(item.iconPath) : undefined,
621
+ iconUrl: PluginIconPath.toUrl(item.iconPath, this.plugin) ?? ThemeIcon.get(item.iconPath),
644
622
  description: item.description,
645
623
  handle,
646
624
  detail: item.detail,
647
625
  picked: item.picked,
648
626
  alwaysShow: item.alwaysShow,
649
627
  buttons: item.buttons?.map<TransferQuickInputButton>((button, index) => ({
650
- iconPath: getIconUris(button.iconPath),
651
- iconClass: ThemeIcon.is(button.iconPath) ? MonacoThemeIcon.asClassName(button.iconPath) : undefined,
628
+ iconUrl: PluginIconPath.toUrl(button.iconPath, this.plugin) ?? ThemeIcon.get(button.iconPath),
652
629
  tooltip: button.tooltip,
653
630
  handle: button === QuickInputButtons.Back ? -1 : index,
654
631
  }))
@@ -13,10 +13,10 @@
13
13
  //
14
14
  // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
15
  // *****************************************************************************
16
+
16
17
  import { UUID } from '@theia/core/shared/@phosphor/coreutils';
17
18
  import { inject, injectable } from '@theia/core/shared/inversify';
18
- import { Terminal, TerminalOptions, PseudoTerminalOptions, ExtensionTerminalOptions, TerminalState } from '@theia/plugin';
19
- import { TerminalServiceExt, TerminalServiceMain, PLUGIN_RPC_CONTEXT } from '../common/plugin-api-rpc';
19
+ import { TerminalServiceExt, TerminalServiceMain, PLUGIN_RPC_CONTEXT, Plugin, TerminalOptions } from '../common/plugin-api-rpc';
20
20
  import { RPCProtocol } from '../common/rpc-protocol';
21
21
  import { Event, Emitter } from '@theia/core/lib/common/event';
22
22
  import { MultiKeyMap } from '@theia/core/lib/common/collections';
@@ -26,28 +26,13 @@ import * as Converter from './type-converters';
26
26
  import { Disposable, EnvironmentVariableMutatorType, TerminalExitReason, ThemeIcon } from './types-impl';
27
27
  import { NO_ROOT_URI, SerializableEnvironmentVariableCollection } from '@theia/terminal/lib/common/shell-terminal-protocol';
28
28
  import { ProvidedTerminalLink } from '../common/plugin-api-rpc-model';
29
- import { ThemeIcon as MonacoThemeIcon } from '@theia/monaco-editor-core/esm/vs/base/common/themables';
30
-
31
- export function getIconUris(iconPath: theia.TerminalOptions['iconPath']): { id: string } | undefined {
32
- if (ThemeIcon.is(iconPath)) {
33
- return { id: iconPath.id };
34
- }
35
- return undefined;
36
- }
37
-
38
- export function getIconClass(options: theia.TerminalOptions | theia.ExtensionTerminalOptions): string | undefined {
39
- const iconClass = getIconUris(options.iconPath);
40
- if (iconClass) {
41
- return MonacoThemeIcon.asClassName(iconClass);
42
- }
43
- return undefined;
44
- }
29
+ import { PluginIconPath } from './plugin-icon-path';
45
30
 
46
31
  /**
47
32
  * Provides high level terminal plugin api to use in the Theia plugins.
48
33
  * This service allow(with help proxy) create and use terminal emulator.
49
34
  */
50
- @injectable()
35
+ @injectable()
51
36
  export class TerminalServiceExtImpl implements TerminalServiceExt {
52
37
  private readonly proxy: TerminalServiceMain;
53
38
 
@@ -59,17 +44,17 @@ export class TerminalServiceExtImpl implements TerminalServiceExt {
59
44
  private readonly terminalLinkProviders = new Map<string, theia.TerminalLinkProvider>();
60
45
  private readonly terminalObservers = new Map<string, theia.TerminalObserver>();
61
46
  private readonly terminalProfileProviders = new Map<string, theia.TerminalProfileProvider>();
62
- private readonly onDidCloseTerminalEmitter = new Emitter<Terminal>();
63
- readonly onDidCloseTerminal: theia.Event<Terminal> = this.onDidCloseTerminalEmitter.event;
47
+ private readonly onDidCloseTerminalEmitter = new Emitter<theia.Terminal>();
48
+ readonly onDidCloseTerminal: theia.Event<theia.Terminal> = this.onDidCloseTerminalEmitter.event;
64
49
 
65
- private readonly onDidOpenTerminalEmitter = new Emitter<Terminal>();
66
- readonly onDidOpenTerminal: theia.Event<Terminal> = this.onDidOpenTerminalEmitter.event;
50
+ private readonly onDidOpenTerminalEmitter = new Emitter<theia.Terminal>();
51
+ readonly onDidOpenTerminal: theia.Event<theia.Terminal> = this.onDidOpenTerminalEmitter.event;
67
52
 
68
- private readonly onDidChangeActiveTerminalEmitter = new Emitter<Terminal | undefined>();
69
- readonly onDidChangeActiveTerminal: theia.Event<Terminal | undefined> = this.onDidChangeActiveTerminalEmitter.event;
53
+ private readonly onDidChangeActiveTerminalEmitter = new Emitter<theia.Terminal | undefined>();
54
+ readonly onDidChangeActiveTerminal: theia.Event<theia.Terminal | undefined> = this.onDidChangeActiveTerminalEmitter.event;
70
55
 
71
- private readonly onDidChangeTerminalStateEmitter = new Emitter<Terminal>();
72
- readonly onDidChangeTerminalState: theia.Event<Terminal> = this.onDidChangeTerminalStateEmitter.event;
56
+ private readonly onDidChangeTerminalStateEmitter = new Emitter<theia.Terminal>();
57
+ readonly onDidChangeTerminalState: theia.Event<theia.Terminal> = this.onDidChangeTerminalStateEmitter.event;
73
58
 
74
59
  protected environmentVariableCollections: MultiKeyMap<string, EnvironmentVariableCollectionImpl> = new MultiKeyMap(2);
75
60
 
@@ -97,9 +82,10 @@ export class TerminalServiceExtImpl implements TerminalServiceExt {
97
82
  }
98
83
 
99
84
  createTerminal(
100
- nameOrOptions: TerminalOptions | PseudoTerminalOptions | ExtensionTerminalOptions | (string | undefined),
85
+ plugin: Plugin,
86
+ nameOrOptions: theia.TerminalOptions | theia.PseudoTerminalOptions | theia.ExtensionTerminalOptions | string | undefined,
101
87
  shellPath?: string, shellArgs?: string[] | string
102
- ): Terminal {
88
+ ): theia.Terminal {
103
89
  const id = `plugin-terminal-${UUID.uuid4()}`;
104
90
  let options: TerminalOptions;
105
91
  let pseudoTerminal: theia.Pseudoterminal | undefined = undefined;
@@ -122,7 +108,6 @@ export class TerminalServiceExtImpl implements TerminalServiceExt {
122
108
  }
123
109
 
124
110
  let parentId;
125
-
126
111
  if (options.location && typeof options.location === 'object' && 'parentTerminal' in options.location) {
127
112
  const parentTerminal = options.location.parentTerminal;
128
113
  if (parentTerminal instanceof TerminalExtImpl) {
@@ -135,6 +120,15 @@ export class TerminalServiceExtImpl implements TerminalServiceExt {
135
120
  }
136
121
  }
137
122
 
123
+ if (typeof nameOrOptions === 'object' && 'iconPath' in nameOrOptions) {
124
+ const iconPath = nameOrOptions.iconPath;
125
+ options.iconUrl = PluginIconPath.toUrl(iconPath, plugin) ?? ThemeIcon.get(iconPath);
126
+ }
127
+
128
+ if (typeof nameOrOptions === 'object' && 'color' in nameOrOptions) {
129
+ options.color = nameOrOptions.color;
130
+ }
131
+
138
132
  this.proxy.$createTerminal(id, options, parentId, !!pseudoTerminal);
139
133
 
140
134
  let creationOptions: theia.TerminalOptions | theia.ExtensionTerminalOptions = options;
@@ -462,7 +456,7 @@ export class EnvironmentVariableCollectionImpl implements theia.GlobalEnvironmen
462
456
  }
463
457
  }
464
458
 
465
- export class TerminalExtImpl implements Terminal {
459
+ export class TerminalExtImpl implements theia.Terminal {
466
460
 
467
461
  name: string;
468
462
 
@@ -476,9 +470,9 @@ export class TerminalExtImpl implements Terminal {
476
470
  return this.deferredProcessId.promise;
477
471
  }
478
472
 
479
- readonly creationOptions: Readonly<TerminalOptions | ExtensionTerminalOptions>;
473
+ readonly creationOptions: Readonly<theia.TerminalOptions | theia.ExtensionTerminalOptions>;
480
474
 
481
- state: TerminalState = { isInteractedWith: false };
475
+ state: theia.TerminalState = { isInteractedWith: false };
482
476
 
483
477
  constructor(private readonly proxy: TerminalServiceMain, private readonly options: theia.TerminalOptions | theia.ExtensionTerminalOptions) {
484
478
  this.creationOptions = this.options;