@theia/plugin-ext 1.53.0-next.6 → 1.53.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 (330) hide show
  1. package/lib/common/plugin-api-rpc-model.d.ts +1 -0
  2. package/lib/common/plugin-api-rpc-model.d.ts.map +1 -1
  3. package/lib/common/plugin-api-rpc.d.ts +13 -2
  4. package/lib/common/plugin-api-rpc.d.ts.map +1 -1
  5. package/lib/common/plugin-api-rpc.js +4 -2
  6. package/lib/common/plugin-api-rpc.js.map +1 -1
  7. package/lib/common/rpc-protocol.d.ts +14 -13
  8. package/lib/common/rpc-protocol.d.ts.map +1 -1
  9. package/lib/common/rpc-protocol.js +56 -53
  10. package/lib/common/rpc-protocol.js.map +1 -1
  11. package/lib/hosted/browser/hosted-plugin.d.ts +1 -0
  12. package/lib/hosted/browser/hosted-plugin.d.ts.map +1 -1
  13. package/lib/hosted/browser/hosted-plugin.js +13 -3
  14. package/lib/hosted/browser/hosted-plugin.js.map +1 -1
  15. package/lib/hosted/node/scanners/scanner-theia.d.ts.map +1 -1
  16. package/lib/hosted/node/scanners/scanner-theia.js +13 -1
  17. package/lib/hosted/node/scanners/scanner-theia.js.map +1 -1
  18. package/lib/main/browser/authentication-main.d.ts +1 -0
  19. package/lib/main/browser/authentication-main.d.ts.map +1 -1
  20. package/lib/main/browser/command-registry-main.d.ts +1 -0
  21. package/lib/main/browser/command-registry-main.d.ts.map +1 -1
  22. package/lib/main/browser/custom-editors/custom-editor-opener.d.ts +5 -1
  23. package/lib/main/browser/custom-editors/custom-editor-opener.d.ts.map +1 -1
  24. package/lib/main/browser/custom-editors/custom-editor-opener.js +107 -31
  25. package/lib/main/browser/custom-editors/custom-editor-opener.js.map +1 -1
  26. package/lib/main/browser/custom-editors/custom-editor-widget.d.ts +7 -4
  27. package/lib/main/browser/custom-editors/custom-editor-widget.d.ts.map +1 -1
  28. package/lib/main/browser/custom-editors/custom-editor-widget.js +21 -7
  29. package/lib/main/browser/custom-editors/custom-editor-widget.js.map +1 -1
  30. package/lib/main/browser/custom-editors/custom-editors-main.d.ts +4 -4
  31. package/lib/main/browser/custom-editors/custom-editors-main.d.ts.map +1 -1
  32. package/lib/main/browser/custom-editors/custom-editors-main.js +5 -55
  33. package/lib/main/browser/custom-editors/custom-editors-main.js.map +1 -1
  34. package/lib/main/browser/custom-editors/plugin-custom-editor-registry.d.ts +3 -3
  35. package/lib/main/browser/custom-editors/plugin-custom-editor-registry.d.ts.map +1 -1
  36. package/lib/main/browser/custom-editors/plugin-custom-editor-registry.js +19 -15
  37. package/lib/main/browser/custom-editors/plugin-custom-editor-registry.js.map +1 -1
  38. package/lib/main/browser/debug/plugin-debug-service.d.ts +1 -0
  39. package/lib/main/browser/debug/plugin-debug-service.d.ts.map +1 -1
  40. package/lib/main/browser/languages-main.d.ts +1 -0
  41. package/lib/main/browser/languages-main.d.ts.map +1 -1
  42. package/lib/main/browser/main-context.d.ts.map +1 -1
  43. package/lib/main/browser/main-context.js +3 -0
  44. package/lib/main/browser/main-context.js.map +1 -1
  45. package/lib/main/browser/menus/menus-contribution-handler.d.ts.map +1 -1
  46. package/lib/main/browser/menus/menus-contribution-handler.js +1 -1
  47. package/lib/main/browser/menus/menus-contribution-handler.js.map +1 -1
  48. package/lib/main/browser/menus/plugin-menu-command-adapter.d.ts.map +1 -1
  49. package/lib/main/browser/menus/plugin-menu-command-adapter.js +1 -0
  50. package/lib/main/browser/menus/plugin-menu-command-adapter.js.map +1 -1
  51. package/lib/main/browser/menus/vscode-theia-menu-mappings.d.ts +2 -2
  52. package/lib/main/browser/menus/vscode-theia-menu-mappings.d.ts.map +1 -1
  53. package/lib/main/browser/menus/vscode-theia-menu-mappings.js +2 -0
  54. package/lib/main/browser/menus/vscode-theia-menu-mappings.js.map +1 -1
  55. package/lib/main/browser/notebooks/notebook-documents-and-editors-main.js +1 -1
  56. package/lib/main/browser/notebooks/notebook-documents-and-editors-main.js.map +1 -1
  57. package/lib/main/browser/notebooks/notebook-documents-main.d.ts.map +1 -1
  58. package/lib/main/browser/notebooks/notebook-documents-main.js +22 -3
  59. package/lib/main/browser/notebooks/notebook-documents-main.js.map +1 -1
  60. package/lib/main/browser/notebooks/notebook-editors-main.d.ts +1 -1
  61. package/lib/main/browser/notebooks/notebook-editors-main.d.ts.map +1 -1
  62. package/lib/main/browser/notebooks/notebook-editors-main.js +16 -2
  63. package/lib/main/browser/notebooks/notebook-editors-main.js.map +1 -1
  64. package/lib/main/browser/notebooks/notebooks-main.d.ts +1 -0
  65. package/lib/main/browser/notebooks/notebooks-main.d.ts.map +1 -1
  66. package/lib/main/browser/plugin-ext-frontend-module.d.ts.map +1 -1
  67. package/lib/main/browser/plugin-ext-frontend-module.js +18 -0
  68. package/lib/main/browser/plugin-ext-frontend-module.js.map +1 -1
  69. package/lib/main/browser/quick-open-main.d.ts +1 -0
  70. package/lib/main/browser/quick-open-main.d.ts.map +1 -1
  71. package/lib/main/browser/terminal-main.d.ts +1 -0
  72. package/lib/main/browser/terminal-main.d.ts.map +1 -1
  73. package/lib/main/browser/uri-main.d.ts +16 -0
  74. package/lib/main/browser/uri-main.d.ts.map +1 -0
  75. package/lib/main/browser/uri-main.js +64 -0
  76. package/lib/main/browser/uri-main.js.map +1 -0
  77. package/lib/main/browser/view/tree-view-decorator-service.d.ts +1 -0
  78. package/lib/main/browser/view/tree-view-decorator-service.d.ts.map +1 -1
  79. package/lib/main/browser/view/tree-view-widget.d.ts +1 -0
  80. package/lib/main/browser/view/tree-view-widget.d.ts.map +1 -1
  81. package/lib/main/browser/view/tree-views-main.d.ts +1 -0
  82. package/lib/main/browser/view/tree-views-main.d.ts.map +1 -1
  83. package/lib/main/browser/webview/webview.d.ts +2 -3
  84. package/lib/main/browser/webview/webview.d.ts.map +1 -1
  85. package/lib/main/browser/webview/webview.js +5 -4
  86. package/lib/main/browser/webview/webview.js.map +1 -1
  87. package/lib/main/browser/webview-views/webview-views-main.d.ts +1 -0
  88. package/lib/main/browser/webview-views/webview-views-main.d.ts.map +1 -1
  89. package/lib/main/browser/webviews-main.d.ts +1 -0
  90. package/lib/main/browser/webviews-main.d.ts.map +1 -1
  91. package/lib/main/browser/webviews-main.js +6 -1
  92. package/lib/main/browser/webviews-main.js.map +1 -1
  93. package/lib/main/browser/workspace-main.d.ts +1 -0
  94. package/lib/main/browser/workspace-main.d.ts.map +1 -1
  95. package/lib/plugin/authentication-ext.d.ts +1 -0
  96. package/lib/plugin/authentication-ext.d.ts.map +1 -1
  97. package/lib/plugin/clipboard-ext.d.ts +1 -0
  98. package/lib/plugin/clipboard-ext.d.ts.map +1 -1
  99. package/lib/plugin/command-registry.d.ts +1 -0
  100. package/lib/plugin/command-registry.d.ts.map +1 -1
  101. package/lib/plugin/comments.d.ts +1 -0
  102. package/lib/plugin/comments.d.ts.map +1 -1
  103. package/lib/plugin/custom-editors.d.ts +3 -4
  104. package/lib/plugin/custom-editors.d.ts.map +1 -1
  105. package/lib/plugin/custom-editors.js +5 -7
  106. package/lib/plugin/custom-editors.js.map +1 -1
  107. package/lib/plugin/debug/debug-ext.d.ts +1 -0
  108. package/lib/plugin/debug/debug-ext.d.ts.map +1 -1
  109. package/lib/plugin/debug/plugin-debug-adapter-creator.d.ts +1 -0
  110. package/lib/plugin/debug/plugin-debug-adapter-creator.d.ts.map +1 -1
  111. package/lib/plugin/debug/plugin-debug-adapter-session.d.ts +1 -0
  112. package/lib/plugin/debug/plugin-debug-adapter-session.d.ts.map +1 -1
  113. package/lib/plugin/debug/plugin-debug-adapter-tracker.d.ts +1 -0
  114. package/lib/plugin/debug/plugin-debug-adapter-tracker.d.ts.map +1 -1
  115. package/lib/plugin/decorations.d.ts +1 -0
  116. package/lib/plugin/decorations.d.ts.map +1 -1
  117. package/lib/plugin/dialogs.d.ts +1 -0
  118. package/lib/plugin/dialogs.d.ts.map +1 -1
  119. package/lib/plugin/document-data.d.ts +1 -0
  120. package/lib/plugin/document-data.d.ts.map +1 -1
  121. package/lib/plugin/documents.d.ts +1 -0
  122. package/lib/plugin/documents.d.ts.map +1 -1
  123. package/lib/plugin/env.d.ts +3 -0
  124. package/lib/plugin/env.d.ts.map +1 -1
  125. package/lib/plugin/env.js +4 -1
  126. package/lib/plugin/env.js.map +1 -1
  127. package/lib/plugin/file-system-event-service-ext-impl.d.ts +1 -0
  128. package/lib/plugin/file-system-event-service-ext-impl.d.ts.map +1 -1
  129. package/lib/plugin/file-system-ext-impl.d.ts +1 -0
  130. package/lib/plugin/file-system-ext-impl.d.ts.map +1 -1
  131. package/lib/plugin/known-commands.d.ts.map +1 -1
  132. package/lib/plugin/known-commands.js +1 -0
  133. package/lib/plugin/known-commands.js.map +1 -1
  134. package/lib/plugin/label-service.d.ts +1 -0
  135. package/lib/plugin/label-service.d.ts.map +1 -1
  136. package/lib/plugin/languages/call-hierarchy.d.ts +1 -0
  137. package/lib/plugin/languages/call-hierarchy.d.ts.map +1 -1
  138. package/lib/plugin/languages/code-action.d.ts +1 -0
  139. package/lib/plugin/languages/code-action.d.ts.map +1 -1
  140. package/lib/plugin/languages/color.d.ts +1 -0
  141. package/lib/plugin/languages/color.d.ts.map +1 -1
  142. package/lib/plugin/languages/completion.d.ts +1 -0
  143. package/lib/plugin/languages/completion.d.ts.map +1 -1
  144. package/lib/plugin/languages/declaration.d.ts +1 -0
  145. package/lib/plugin/languages/declaration.d.ts.map +1 -1
  146. package/lib/plugin/languages/definition.d.ts +1 -0
  147. package/lib/plugin/languages/definition.d.ts.map +1 -1
  148. package/lib/plugin/languages/diagnostics.d.ts +1 -0
  149. package/lib/plugin/languages/diagnostics.d.ts.map +1 -1
  150. package/lib/plugin/languages/document-drop-edit.d.ts +1 -0
  151. package/lib/plugin/languages/document-drop-edit.d.ts.map +1 -1
  152. package/lib/plugin/languages/document-formatting.d.ts +1 -0
  153. package/lib/plugin/languages/document-formatting.d.ts.map +1 -1
  154. package/lib/plugin/languages/document-highlight.d.ts +1 -0
  155. package/lib/plugin/languages/document-highlight.d.ts.map +1 -1
  156. package/lib/plugin/languages/evaluatable-expression.d.ts +1 -0
  157. package/lib/plugin/languages/evaluatable-expression.d.ts.map +1 -1
  158. package/lib/plugin/languages/folding.d.ts +1 -0
  159. package/lib/plugin/languages/folding.d.ts.map +1 -1
  160. package/lib/plugin/languages/hover.d.ts +1 -0
  161. package/lib/plugin/languages/hover.d.ts.map +1 -1
  162. package/lib/plugin/languages/implementation.d.ts +1 -0
  163. package/lib/plugin/languages/implementation.d.ts.map +1 -1
  164. package/lib/plugin/languages/inlay-hints.d.ts +1 -0
  165. package/lib/plugin/languages/inlay-hints.d.ts.map +1 -1
  166. package/lib/plugin/languages/inline-completion.d.ts +1 -0
  167. package/lib/plugin/languages/inline-completion.d.ts.map +1 -1
  168. package/lib/plugin/languages/inline-values.d.ts +1 -0
  169. package/lib/plugin/languages/inline-values.d.ts.map +1 -1
  170. package/lib/plugin/languages/lens.d.ts +1 -0
  171. package/lib/plugin/languages/lens.d.ts.map +1 -1
  172. package/lib/plugin/languages/link-provider.d.ts +1 -0
  173. package/lib/plugin/languages/link-provider.d.ts.map +1 -1
  174. package/lib/plugin/languages/linked-editing-range.d.ts +1 -0
  175. package/lib/plugin/languages/linked-editing-range.d.ts.map +1 -1
  176. package/lib/plugin/languages/on-type-formatting.d.ts +1 -0
  177. package/lib/plugin/languages/on-type-formatting.d.ts.map +1 -1
  178. package/lib/plugin/languages/outline.d.ts +1 -0
  179. package/lib/plugin/languages/outline.d.ts.map +1 -1
  180. package/lib/plugin/languages/range-formatting.d.ts +1 -0
  181. package/lib/plugin/languages/range-formatting.d.ts.map +1 -1
  182. package/lib/plugin/languages/reference.d.ts +1 -0
  183. package/lib/plugin/languages/reference.d.ts.map +1 -1
  184. package/lib/plugin/languages/rename.d.ts +1 -0
  185. package/lib/plugin/languages/rename.d.ts.map +1 -1
  186. package/lib/plugin/languages/selection-range.d.ts +1 -0
  187. package/lib/plugin/languages/selection-range.d.ts.map +1 -1
  188. package/lib/plugin/languages/semantic-highlighting.d.ts +1 -0
  189. package/lib/plugin/languages/semantic-highlighting.d.ts.map +1 -1
  190. package/lib/plugin/languages/signature.d.ts +1 -0
  191. package/lib/plugin/languages/signature.d.ts.map +1 -1
  192. package/lib/plugin/languages/type-definition.d.ts +1 -0
  193. package/lib/plugin/languages/type-definition.d.ts.map +1 -1
  194. package/lib/plugin/languages/type-hierarchy.d.ts +1 -0
  195. package/lib/plugin/languages/type-hierarchy.d.ts.map +1 -1
  196. package/lib/plugin/languages/util.d.ts +1 -0
  197. package/lib/plugin/languages/util.d.ts.map +1 -1
  198. package/lib/plugin/languages/workspace-symbol.d.ts +1 -0
  199. package/lib/plugin/languages/workspace-symbol.d.ts.map +1 -1
  200. package/lib/plugin/languages-utils.d.ts +1 -0
  201. package/lib/plugin/languages-utils.d.ts.map +1 -1
  202. package/lib/plugin/languages.d.ts +1 -0
  203. package/lib/plugin/languages.d.ts.map +1 -1
  204. package/lib/plugin/markdown-string.d.ts +1 -0
  205. package/lib/plugin/markdown-string.d.ts.map +1 -1
  206. package/lib/plugin/message-registry.d.ts +1 -0
  207. package/lib/plugin/message-registry.d.ts.map +1 -1
  208. package/lib/plugin/node/debug/plugin-node-debug-adapter-creator.d.ts +1 -0
  209. package/lib/plugin/node/debug/plugin-node-debug-adapter-creator.d.ts.map +1 -1
  210. package/lib/plugin/notebook/notebook-document.d.ts +1 -0
  211. package/lib/plugin/notebook/notebook-document.d.ts.map +1 -1
  212. package/lib/plugin/notebook/notebook-documents.d.ts +1 -0
  213. package/lib/plugin/notebook/notebook-documents.d.ts.map +1 -1
  214. package/lib/plugin/notebook/notebook-editor.d.ts +1 -0
  215. package/lib/plugin/notebook/notebook-editor.d.ts.map +1 -1
  216. package/lib/plugin/notebook/notebook-editors.d.ts +1 -0
  217. package/lib/plugin/notebook/notebook-editors.d.ts.map +1 -1
  218. package/lib/plugin/notebook/notebook-kernels.d.ts +1 -0
  219. package/lib/plugin/notebook/notebook-kernels.d.ts.map +1 -1
  220. package/lib/plugin/notebook/notebook-renderers.d.ts +1 -0
  221. package/lib/plugin/notebook/notebook-renderers.d.ts.map +1 -1
  222. package/lib/plugin/notebook/notebooks.d.ts +1 -0
  223. package/lib/plugin/notebook/notebooks.d.ts.map +1 -1
  224. package/lib/plugin/notification.d.ts +1 -0
  225. package/lib/plugin/notification.d.ts.map +1 -1
  226. package/lib/plugin/output-channel/log-output-channel.d.ts +1 -0
  227. package/lib/plugin/output-channel/log-output-channel.d.ts.map +1 -1
  228. package/lib/plugin/output-channel/output-channel-item.d.ts +1 -0
  229. package/lib/plugin/output-channel/output-channel-item.d.ts.map +1 -1
  230. package/lib/plugin/output-channel-registry.d.ts +1 -0
  231. package/lib/plugin/output-channel-registry.d.ts.map +1 -1
  232. package/lib/plugin/plugin-context.d.ts +1 -0
  233. package/lib/plugin/plugin-context.d.ts.map +1 -1
  234. package/lib/plugin/plugin-context.js +14 -6
  235. package/lib/plugin/plugin-context.js.map +1 -1
  236. package/lib/plugin/plugin-manager.d.ts +1 -0
  237. package/lib/plugin/plugin-manager.d.ts.map +1 -1
  238. package/lib/plugin/plugin-manager.js +2 -1
  239. package/lib/plugin/plugin-manager.js.map +1 -1
  240. package/lib/plugin/plugin-storage.d.ts +1 -0
  241. package/lib/plugin/plugin-storage.d.ts.map +1 -1
  242. package/lib/plugin/preference-registry.d.ts +1 -0
  243. package/lib/plugin/preference-registry.d.ts.map +1 -1
  244. package/lib/plugin/quick-open.d.ts +1 -0
  245. package/lib/plugin/quick-open.d.ts.map +1 -1
  246. package/lib/plugin/scm.d.ts +1 -0
  247. package/lib/plugin/scm.d.ts.map +1 -1
  248. package/lib/plugin/secrets-ext.d.ts +1 -0
  249. package/lib/plugin/secrets-ext.d.ts.map +1 -1
  250. package/lib/plugin/status-bar/status-bar-item.d.ts +1 -0
  251. package/lib/plugin/status-bar/status-bar-item.d.ts.map +1 -1
  252. package/lib/plugin/status-bar-message-registry.d.ts +1 -0
  253. package/lib/plugin/status-bar-message-registry.d.ts.map +1 -1
  254. package/lib/plugin/tabs.d.ts +1 -0
  255. package/lib/plugin/tabs.d.ts.map +1 -1
  256. package/lib/plugin/tasks/task-provider.d.ts +1 -0
  257. package/lib/plugin/tasks/task-provider.d.ts.map +1 -1
  258. package/lib/plugin/tasks/tasks.d.ts +1 -0
  259. package/lib/plugin/tasks/tasks.d.ts.map +1 -1
  260. package/lib/plugin/terminal-ext.d.ts +2 -0
  261. package/lib/plugin/terminal-ext.d.ts.map +1 -1
  262. package/lib/plugin/terminal-ext.js +1 -0
  263. package/lib/plugin/terminal-ext.js.map +1 -1
  264. package/lib/plugin/test-item.d.ts +1 -0
  265. package/lib/plugin/test-item.d.ts.map +1 -1
  266. package/lib/plugin/tests.d.ts +1 -0
  267. package/lib/plugin/tests.d.ts.map +1 -1
  268. package/lib/plugin/text-editor.d.ts +1 -0
  269. package/lib/plugin/text-editor.d.ts.map +1 -1
  270. package/lib/plugin/text-editors.d.ts +1 -0
  271. package/lib/plugin/text-editors.d.ts.map +1 -1
  272. package/lib/plugin/timeline.d.ts +1 -0
  273. package/lib/plugin/timeline.d.ts.map +1 -1
  274. package/lib/plugin/tree/tree-views.d.ts +1 -0
  275. package/lib/plugin/tree/tree-views.d.ts.map +1 -1
  276. package/lib/plugin/type-converters.d.ts +1 -0
  277. package/lib/plugin/type-converters.d.ts.map +1 -1
  278. package/lib/plugin/types-impl.d.ts +6 -0
  279. package/lib/plugin/types-impl.d.ts.map +1 -1
  280. package/lib/plugin/types-impl.js +9 -1
  281. package/lib/plugin/types-impl.js.map +1 -1
  282. package/lib/plugin/uri-ext.d.ts +38 -0
  283. package/lib/plugin/uri-ext.d.ts.map +1 -0
  284. package/lib/plugin/uri-ext.js +50 -0
  285. package/lib/plugin/uri-ext.js.map +1 -0
  286. package/lib/plugin/webview-views.d.ts +1 -0
  287. package/lib/plugin/webview-views.d.ts.map +1 -1
  288. package/lib/plugin/webviews.d.ts +1 -0
  289. package/lib/plugin/webviews.d.ts.map +1 -1
  290. package/lib/plugin/webviews.js +1 -1
  291. package/lib/plugin/webviews.js.map +1 -1
  292. package/lib/plugin/window-state.d.ts +1 -0
  293. package/lib/plugin/window-state.d.ts.map +1 -1
  294. package/lib/plugin/workspace.d.ts +1 -0
  295. package/lib/plugin/workspace.d.ts.map +1 -1
  296. package/package.json +29 -29
  297. package/src/common/plugin-api-rpc.ts +17 -4
  298. package/src/common/rpc-protocol.ts +62 -66
  299. package/src/hosted/browser/hosted-plugin.ts +16 -5
  300. package/src/hosted/node/scanners/scanner-theia.ts +12 -1
  301. package/src/main/browser/custom-editors/custom-editor-opener.tsx +110 -25
  302. package/src/main/browser/custom-editors/custom-editor-widget.ts +20 -11
  303. package/src/main/browser/custom-editors/custom-editors-main.ts +11 -70
  304. package/src/main/browser/custom-editors/plugin-custom-editor-registry.ts +15 -13
  305. package/src/main/browser/main-context.ts +4 -0
  306. package/src/main/browser/menus/menus-contribution-handler.ts +2 -1
  307. package/src/main/browser/menus/plugin-menu-command-adapter.ts +1 -0
  308. package/src/main/browser/menus/vscode-theia-menu-mappings.ts +3 -1
  309. package/src/main/browser/notebooks/notebook-documents-and-editors-main.ts +1 -1
  310. package/src/main/browser/notebooks/notebook-documents-main.ts +24 -4
  311. package/src/main/browser/notebooks/notebook-editors-main.ts +15 -2
  312. package/src/main/browser/plugin-ext-frontend-module.ts +23 -4
  313. package/src/main/browser/uri-main.ts +72 -0
  314. package/src/main/browser/webview/pre/service-worker.js +2 -1
  315. package/src/main/browser/webview/webview.ts +5 -6
  316. package/src/main/browser/webviews-main.ts +6 -1
  317. package/src/plugin/custom-editors.ts +8 -10
  318. package/src/plugin/env.ts +6 -1
  319. package/src/plugin/known-commands.ts +1 -0
  320. package/src/plugin/plugin-context.ts +16 -8
  321. package/src/plugin/plugin-manager.ts +2 -1
  322. package/src/plugin/terminal-ext.ts +2 -0
  323. package/src/plugin/types-impl.ts +10 -0
  324. package/src/plugin/uri-ext.ts +60 -0
  325. package/src/plugin/webviews.ts +1 -1
  326. package/lib/common/proxy-handler.d.ts +0 -73
  327. package/lib/common/proxy-handler.d.ts.map +0 -1
  328. package/lib/common/proxy-handler.js +0 -106
  329. package/lib/common/proxy-handler.js.map +0 -1
  330. package/src/common/proxy-handler.ts +0 -143
@@ -21,10 +21,10 @@ import '../../../src/main/browser/style/comments.css';
21
21
  import { ContainerModule } from '@theia/core/shared/inversify';
22
22
  import {
23
23
  FrontendApplicationContribution, WidgetFactory, bindViewContribution,
24
- ViewContainerIdentifier, ViewContainer, createTreeContainer, TreeWidget, LabelProviderContribution,
25
- UndoRedoHandler
24
+ ViewContainerIdentifier, ViewContainer, createTreeContainer, TreeWidget, LabelProviderContribution, LabelProvider,
25
+ UndoRedoHandler, DiffUris, Navigatable, SplitWidget
26
26
  } from '@theia/core/lib/browser';
27
- import { MaybePromise, CommandContribution, ResourceResolver, bindContributionProvider } from '@theia/core/lib/common';
27
+ import { MaybePromise, CommandContribution, ResourceResolver, bindContributionProvider, URI, generateUuid } from '@theia/core/lib/common';
28
28
  import { WebSocketConnectionProvider } from '@theia/core/lib/browser/messaging';
29
29
  import { HostedPluginSupport } from '../../hosted/browser/hosted-plugin';
30
30
  import { HostedPluginWatcher } from '../../hosted/browser/hosted-plugin-watcher';
@@ -200,6 +200,25 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
200
200
  bind(CustomEditorUndoRedoHandler).toSelf().inSingletonScope();
201
201
  bind(UndoRedoHandler).toService(CustomEditorUndoRedoHandler);
202
202
 
203
+ bind(WidgetFactory).toDynamicValue(ctx => ({
204
+ id: CustomEditorWidget.SIDE_BY_SIDE_FACTORY_ID,
205
+ createWidget: (arg: { uri: string, viewType: string }) => {
206
+ const uri = new URI(arg.uri);
207
+ const [leftUri, rightUri] = DiffUris.decode(uri);
208
+ const navigatable: Navigatable = {
209
+ getResourceUri: () => rightUri,
210
+ createMoveToUri: resourceUri => DiffUris.encode(leftUri, rightUri.withPath(resourceUri.path))
211
+ };
212
+ const widget = new SplitWidget({ navigatable });
213
+ widget.id = arg.viewType + '.side-by-side:' + generateUuid();
214
+ const labelProvider = ctx.container.get(LabelProvider);
215
+ widget.title.label = labelProvider.getName(uri);
216
+ widget.title.iconClass = labelProvider.getIcon(uri);
217
+ widget.title.closable = true;
218
+ return widget;
219
+ }
220
+ })).inSingletonScope();
221
+
203
222
  bind(PluginViewWidget).toSelf();
204
223
  bind(WidgetFactory).toDynamicValue(({ container }) => ({
205
224
  id: PLUGIN_VIEW_FACTORY_ID,
@@ -267,6 +286,6 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
267
286
  bind(CellOutputWebviewFactory).toFactory(ctx => async (cell: NotebookCellModel, notebook: NotebookModel) =>
268
287
  createCellOutputWebviewContainer(ctx.container, cell, notebook).getAsync(CellOutputWebviewImpl)
269
288
  );
270
-
271
289
  bindContributionProvider(bind, ArgumentProcessorContribution);
290
+
272
291
  });
@@ -0,0 +1,72 @@
1
+ // *****************************************************************************
2
+ // Copyright (C) 2024 STMicroelectronics.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { Disposable, URI } from '@theia/core';
18
+ import { MAIN_RPC_CONTEXT, UriExt, UriMain } from '../../common';
19
+ import { RPCProtocol } from '../../common/rpc-protocol';
20
+ import { interfaces } from '@theia/core/shared/inversify';
21
+ import { OpenHandler, OpenerOptions, OpenerService } from '@theia/core/lib/browser';
22
+ import { FrontendApplicationConfigProvider } from '@theia/core/lib/browser/frontend-application-config-provider';
23
+ import { HostedPluginSupport } from '../../hosted/browser/hosted-plugin';
24
+
25
+ export class UriMainImpl implements UriMain, Disposable {
26
+ private readonly proxy: UriExt;
27
+ private handlers = new Set<string>();
28
+ private readonly openerService: OpenerService;
29
+ private readonly pluginSupport: HostedPluginSupport;
30
+ private readonly openHandler: OpenHandler;
31
+
32
+ constructor(rpc: RPCProtocol, container: interfaces.Container) {
33
+ this.proxy = rpc.getProxy(MAIN_RPC_CONTEXT.URI_EXT);
34
+ this.openerService = container.get(OpenerService);
35
+ this.pluginSupport = container.get(HostedPluginSupport);
36
+
37
+ this.openHandler = {
38
+ id: 'theia-plugin-open-handler',
39
+ canHandle: async (uri: URI, options?: OpenerOptions | undefined): Promise<number> => {
40
+ if (uri.scheme !== FrontendApplicationConfigProvider.get().electron.uriScheme) {
41
+ return 0;
42
+ }
43
+ await this.pluginSupport.activateByUri(uri.scheme, uri.authority);
44
+ if (this.handlers.has(uri.authority)) {
45
+ return 500;
46
+ }
47
+ return 0;
48
+ },
49
+ open: async (uri: URI, options?: OpenerOptions | undefined): Promise<undefined> => {
50
+ if (!this.handlers.has(uri.authority)) {
51
+ throw new Error(`No plugin to handle this uri: : '${uri}'`);
52
+ }
53
+ this.proxy.$handleExternalUri(uri.toComponents());
54
+ }
55
+ };
56
+
57
+ this.openerService.addHandler?.(this.openHandler);
58
+ }
59
+
60
+ dispose(): void {
61
+ this.openerService.removeHandler?.(this.openHandler);
62
+ this.handlers.clear();
63
+ }
64
+
65
+ async $registerUriHandler(pluginId: string, extensionDisplayName: string): Promise<void> {
66
+ this.handlers.add(pluginId);
67
+ }
68
+
69
+ async $unregisterUriHandler(pluginId: string): Promise<void> {
70
+ this.handlers.delete(pluginId);
71
+ }
72
+ }
@@ -226,7 +226,8 @@ async function processResourceRequest(event, requestUrl, resourceRoot) {
226
226
 
227
227
  parentClient.postMessage({
228
228
  channel: 'load-resource',
229
- path: resourcePath
229
+ path: resourcePath,
230
+ query: requestUrl.search.replace(/^\?/, '')
230
231
  });
231
232
 
232
233
  return resourceRequestStore.create(webviewId, resourcePath)
@@ -48,7 +48,6 @@ import { isFirefox } from '@theia/core/lib/browser/browser';
48
48
  import { FileService } from '@theia/filesystem/lib/browser/file-service';
49
49
  import { FileOperationError, FileOperationResult } from '@theia/filesystem/lib/common/files';
50
50
  import { BinaryBufferReadableStream } from '@theia/core/lib/common/buffer';
51
- import { ViewColumn } from '../../../plugin/types-impl';
52
51
  import { ExtractableWidget } from '@theia/core/lib/browser/widgets/extractable-widget';
53
52
  import { BadgeWidget } from '@theia/core/lib/browser/view-container';
54
53
  import { MenuPath } from '@theia/core';
@@ -185,7 +184,6 @@ export class WebviewWidget extends BaseWidget implements StatefulWidget, Extract
185
184
  }
186
185
 
187
186
  viewType: string;
188
- viewColumn: ViewColumn;
189
187
  options: WebviewPanelOptions = {};
190
188
 
191
189
  protected ready = new Deferred<void>();
@@ -352,7 +350,7 @@ export class WebviewWidget extends BaseWidget implements StatefulWidget, Extract
352
350
  /* no-op: webview loses focus only if another element gains focus in the main window */
353
351
  }));
354
352
  this.toHide.push(this.on(WebviewMessageChannels.doReload, () => this.reload()));
355
- this.toHide.push(this.on(WebviewMessageChannels.loadResource, (entry: any) => this.loadResource(entry.path)));
353
+ this.toHide.push(this.on(WebviewMessageChannels.loadResource, (entry: any) => this.loadResource(entry.path, entry.query)));
356
354
  this.toHide.push(this.on(WebviewMessageChannels.loadLocalhost, (entry: any) =>
357
355
  this.loadLocalhost(entry.origin)
358
356
  ));
@@ -544,10 +542,11 @@ export class WebviewWidget extends BaseWidget implements StatefulWidget, Extract
544
542
  return undefined;
545
543
  }
546
544
 
547
- protected async loadResource(requestPath: string): Promise<void> {
548
- const normalizedUri = this.normalizeRequestUri(requestPath);
545
+ protected async loadResource(requestPath: string, requestQuery: string = ''): Promise<void> {
546
+ const normalizedUri = this.normalizeRequestUri(requestPath).withQuery(decodeURIComponent(requestQuery));
549
547
  // browser cache does not support file scheme, normalize to current endpoint scheme and host
550
- const cacheUrl = new Endpoint({ path: normalizedUri.path.toString() }).getRestUrl().toString();
548
+ // use requestPath rather than normalizedUri.path to preserve the scheme of the requested resource as a path segment
549
+ const cacheUrl = new Endpoint({ path: requestPath }).getRestUrl().withQuery(decodeURIComponent(requestQuery)).toString();
551
550
 
552
551
  try {
553
552
  if (this.contentOptions.localResourceRoots) {
@@ -191,7 +191,12 @@ export class WebviewsMainImpl implements WebviewsMain, Disposable {
191
191
 
192
192
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
193
193
  async $postMessage(handle: string, value: any): Promise<boolean> {
194
- const webview = await this.getWebview(handle);
194
+ // Due to async nature of $postMessage, the webview may have been disposed in the meantime.
195
+ // Therefore, don't throw an error if the webview is not found, but return false in this case.
196
+ const webview = await this.tryGetWebview(handle);
197
+ if (!webview) {
198
+ return false;
199
+ }
195
200
  webview.sendMessage(value);
196
201
  return true;
197
202
  }
@@ -25,11 +25,11 @@ import { RPCProtocol } from '../common/rpc-protocol';
25
25
  import { Disposable, URI } from './types-impl';
26
26
  import { UriComponents } from '../common/uri-components';
27
27
  import { DocumentsExtImpl } from './documents';
28
- import { WebviewImpl, WebviewsExtImpl } from './webviews';
28
+ import { WebviewsExtImpl } from './webviews';
29
29
  import { CancellationToken, CancellationTokenSource } from '@theia/core/lib/common/cancellation';
30
30
  import { DisposableCollection } from '@theia/core/lib/common/disposable';
31
- import { WorkspaceExtImpl } from './workspace';
32
31
  import { Cache } from '../common/cache';
32
+ import * as Converters from './type-converters';
33
33
 
34
34
  export class CustomEditorsExtImpl implements CustomEditorsExt {
35
35
  private readonly proxy: CustomEditorsMain;
@@ -38,8 +38,7 @@ export class CustomEditorsExtImpl implements CustomEditorsExt {
38
38
 
39
39
  constructor(rpc: RPCProtocol,
40
40
  private readonly documentExt: DocumentsExtImpl,
41
- private readonly webviewExt: WebviewsExtImpl,
42
- private readonly workspace: WorkspaceExtImpl) {
41
+ private readonly webviewExt: WebviewsExtImpl) {
43
42
  this.proxy = rpc.getProxy(PLUGIN_RPC_CONTEXT.CUSTOM_EDITORS_MAIN);
44
43
  }
45
44
 
@@ -116,22 +115,21 @@ export class CustomEditorsExtImpl implements CustomEditorsExt {
116
115
  document.dispose();
117
116
  }
118
117
 
119
- async $resolveWebviewEditor<T>(
118
+ async $resolveWebviewEditor(
120
119
  resource: UriComponents,
121
120
  handler: string,
122
121
  viewType: string,
123
122
  title: string,
124
- widgetOpenerOptions: object | undefined,
125
- options: theia.WebviewPanelOptions & theia.WebviewOptions,
123
+ position: number,
124
+ options: theia.WebviewPanelOptions,
126
125
  cancellation: CancellationToken
127
126
  ): Promise<void> {
128
127
  const entry = this.editorProviders.get(viewType);
129
128
  if (!entry) {
130
129
  throw new Error(`No provider found for '${viewType}'`);
131
130
  }
132
- const panel = this.webviewExt.createWebviewPanel(viewType, title, {}, options, entry.plugin, handler, false);
133
- const webviewOptions = WebviewImpl.toWebviewOptions(options, this.workspace, entry.plugin);
134
- await this.proxy.$createCustomEditorPanel(handler, title, widgetOpenerOptions, webviewOptions);
131
+ const viewColumn = Converters.toViewColumn(position);
132
+ const panel = this.webviewExt.createWebviewPanel(viewType, title, { viewColumn }, options, entry.plugin, handler, false);
135
133
 
136
134
  const revivedResource = URI.revive(resource);
137
135
 
package/src/plugin/env.ts CHANGED
@@ -35,6 +35,7 @@ export abstract class EnvExtImpl {
35
35
  private envSessionId: string;
36
36
  private host: string;
37
37
  private applicationRoot: string;
38
+ private appUriScheme: string;
38
39
  private _remoteName: string | undefined;
39
40
 
40
41
  constructor() {
@@ -89,6 +90,10 @@ export abstract class EnvExtImpl {
89
90
  this.applicationRoot = appRoot;
90
91
  }
91
92
 
93
+ setAppUriScheme(uriScheme: string): void {
94
+ this.appUriScheme = uriScheme;
95
+ }
96
+
92
97
  getClientOperatingSystem(): Promise<theia.OperatingSystem> {
93
98
  return this.proxy.$getClientOperatingSystem();
94
99
  }
@@ -121,7 +126,7 @@ export abstract class EnvExtImpl {
121
126
  return this.envSessionId;
122
127
  }
123
128
  get uriScheme(): string {
124
- return 'theia';
129
+ return this.appUriScheme;
125
130
  }
126
131
  get uiKind(): theia.UIKind {
127
132
  return this.ui;
@@ -297,6 +297,7 @@ export namespace KnownCommands {
297
297
  mappings['vscode.executeFormatDocumentProvider'] = ['vscode.executeFormatDocumentProvider', CONVERT_VSCODE_TO_MONACO, CONVERT_MONACO_TO_VSCODE];
298
298
  mappings['vscode.executeFormatRangeProvider'] = ['vscode.executeFormatRangeProvider', CONVERT_VSCODE_TO_MONACO, CONVERT_MONACO_TO_VSCODE];
299
299
  mappings['vscode.executeFormatOnTypeProvider'] = ['vscode.executeFormatOnTypeProvider', CONVERT_VSCODE_TO_MONACO, CONVERT_MONACO_TO_VSCODE];
300
+ mappings['vscode.executeCodeActionProvider'] = ['vscode.executeCodeActionProvider', CONVERT_VSCODE_TO_MONACO, CONVERT_MONACO_TO_VSCODE];
300
301
  mappings['vscode.prepareCallHierarchy'] = ['vscode.prepareCallHierarchy', CONVERT_VSCODE_TO_MONACO, CONVERT_MONACO_TO_VSCODE];
301
302
  mappings['vscode.provideIncomingCalls'] = ['vscode.provideIncomingCalls', CONVERT_VSCODE_TO_MONACO, CONVERT_MONACO_TO_VSCODE];
302
303
  mappings['vscode.provideOutgoingCalls'] = ['vscode.provideOutgoingCalls', CONVERT_VSCODE_TO_MONACO, CONVERT_MONACO_TO_VSCODE];
@@ -228,7 +228,8 @@ import {
228
228
  LanguageModelError,
229
229
  PortAutoForwardAction,
230
230
  PortAttributes,
231
- DebugVisualization
231
+ DebugVisualization,
232
+ TerminalShellExecutionCommandLineConfidence
232
233
  } from './types-impl';
233
234
  import { AuthenticationExtImpl } from './authentication-ext';
234
235
  import { SymbolKind } from '../common/plugin-api-rpc-model';
@@ -275,6 +276,7 @@ import { NotebookKernelsExtImpl } from './notebook/notebook-kernels';
275
276
  import { NotebookDocumentsExtImpl } from './notebook/notebook-documents';
276
277
  import { NotebookEditorsExtImpl } from './notebook/notebook-editors';
277
278
  import { TestingExtImpl } from './tests';
279
+ import { UriExtImpl } from './uri-ext';
278
280
 
279
281
  export function createAPIFactory(
280
282
  rpc: RPCProtocol,
@@ -319,10 +321,11 @@ export function createAPIFactory(
319
321
  const themingExt = rpc.set(MAIN_RPC_CONTEXT.THEMING_EXT, new ThemingExtImpl(rpc));
320
322
  const commentsExt = rpc.set(MAIN_RPC_CONTEXT.COMMENTS_EXT, new CommentsExtImpl(rpc, commandRegistry, documents));
321
323
  const tabsExt = rpc.set(MAIN_RPC_CONTEXT.TABS_EXT, new TabsExtImpl(rpc));
322
- const customEditorExt = rpc.set(MAIN_RPC_CONTEXT.CUSTOM_EDITORS_EXT, new CustomEditorsExtImpl(rpc, documents, webviewExt, workspaceExt));
324
+ const customEditorExt = rpc.set(MAIN_RPC_CONTEXT.CUSTOM_EDITORS_EXT, new CustomEditorsExtImpl(rpc, documents, webviewExt));
323
325
  const webviewViewsExt = rpc.set(MAIN_RPC_CONTEXT.WEBVIEW_VIEWS_EXT, new WebviewViewsExtImpl(rpc, webviewExt));
324
326
  const telemetryExt = rpc.set(MAIN_RPC_CONTEXT.TELEMETRY_EXT, new TelemetryExtImpl());
325
327
  const testingExt = rpc.set(MAIN_RPC_CONTEXT.TESTING_EXT, new TestingExtImpl(rpc, commandRegistry));
328
+ const uriExt = rpc.set(MAIN_RPC_CONTEXT.URI_EXT, new UriExtImpl(rpc));
326
329
  rpc.set(MAIN_RPC_CONTEXT.DEBUG_EXT, debugExt);
327
330
 
328
331
  return function (plugin: InternalPlugin): typeof theia {
@@ -595,8 +598,7 @@ export function createAPIFactory(
595
598
  return decorationsExt.registerFileDecorationProvider(provider, pluginToPluginInfo(plugin));
596
599
  },
597
600
  registerUriHandler(handler: theia.UriHandler): theia.Disposable {
598
- // TODO ?
599
- return new Disposable(() => { });
601
+ return uriExt.registerUriHandler(handler, pluginToPluginInfo(plugin));
600
602
  },
601
603
  createInputBox(): theia.InputBox {
602
604
  return quickOpenExt.createInputBox(plugin);
@@ -636,6 +638,12 @@ export function createAPIFactory(
636
638
 
637
639
  /** @stubbed ShareProvider */
638
640
  registerShareProvider: () => Disposable.NULL,
641
+ /** @stubbed Terminal Shell Ingration */
642
+ onDidChangeTerminalShellIntegration: Event.None,
643
+ /** @stubbed Terminal Shell Ingration */
644
+ onDidEndTerminalShellExecution: Event.None,
645
+ /** @stubbed Terminal Shell Ingration */
646
+ onDidStartTerminalShellExecution: Event.None
639
647
  };
640
648
 
641
649
  const workspace: typeof theia.workspace = {
@@ -740,9 +748,8 @@ export function createAPIFactory(
740
748
  } else {
741
749
  throw new Error('Invalid arguments');
742
750
  }
743
- const result = await notebooksExt.waitForNotebookDocument(uri);
744
- return result.apiNotebook;
745
-
751
+ // Notebook extension will create a document in openNotebookDocument() or create openNotebookDocument()
752
+ return notebooksExt.getNotebookDocument(uri).apiNotebook;
746
753
  },
747
754
  createFileSystemWatcher: (pattern, ignoreCreate, ignoreChange, ignoreDelete): theia.FileSystemWatcher =>
748
755
  extHostFileSystemEvent.createFileSystemWatcher(fromGlobPattern(pattern), ignoreCreate, ignoreChange, ignoreDelete),
@@ -1495,7 +1502,8 @@ export function createAPIFactory(
1495
1502
  LanguageModelError,
1496
1503
  PortAutoForwardAction,
1497
1504
  PortAttributes,
1498
- DebugVisualization
1505
+ DebugVisualization,
1506
+ TerminalShellExecutionCommandLineConfidence
1499
1507
  };
1500
1508
  };
1501
1509
  }
@@ -252,7 +252,7 @@ export abstract class AbstractPluginManagerExtImpl<P extends Record<string, any>
252
252
  }
253
253
  for (let activationEvent of activationEvents) {
254
254
  if (activationEvent === 'onUri') {
255
- activationEvent = `onUri:theia://${plugin.model.id}`;
255
+ activationEvent = `onUri:${this.envExt.uriScheme}://${plugin.model.id}`;
256
256
  }
257
257
  this.setActivation(activationEvent, activation);
258
258
  }
@@ -481,6 +481,7 @@ export class PluginManagerExtImpl extends AbstractPluginManagerExtImpl<PluginMan
481
481
  this.envExt.setApplicationName(params.env.appName);
482
482
  this.envExt.setAppHost(params.env.appHost);
483
483
  this.envExt.setAppRoot(params.env.appRoot);
484
+ this.envExt.setAppUriScheme(params.env.appUriScheme);
484
485
 
485
486
  this.preferencesManager.init(params.preferences);
486
487
 
@@ -478,6 +478,8 @@ export class TerminalExtImpl implements theia.Terminal {
478
478
  this.creationOptions = this.options;
479
479
  }
480
480
 
481
+ shellIntegration: theia.TerminalShellIntegration | undefined = undefined;
482
+
481
483
  sendText(text: string, shouldExecute: boolean = true): void {
482
484
  this.id.promise.then(id => this.proxy.$sendText(id, text, shouldExecute));
483
485
  }
@@ -3999,3 +3999,13 @@ export class DebugVisualization {
3999
3999
  }
4000
4000
 
4001
4001
  // #endregion
4002
+
4003
+ // #region Terminal Shell Integration
4004
+
4005
+ export enum TerminalShellExecutionCommandLineConfidence {
4006
+ Low = 0,
4007
+ Medium = 1,
4008
+ High = 2
4009
+ }
4010
+
4011
+ // #endregion
@@ -0,0 +1,60 @@
1
+ // *****************************************************************************
2
+ // Copyright (C) 2024 STMicroelectronics.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import * as theia from '@theia/plugin';
18
+ import {
19
+ UriExt,
20
+ PLUGIN_RPC_CONTEXT, PluginInfo, UriMain
21
+ } from '../common/plugin-api-rpc';
22
+ import { RPCProtocol } from '../common/rpc-protocol';
23
+ import { Disposable, URI } from './types-impl';
24
+ import { UriComponents } from '../common/uri-components';
25
+
26
+ export class UriExtImpl implements UriExt {
27
+
28
+ private handlers = new Map<string, theia.UriHandler>();
29
+
30
+ private readonly proxy: UriMain;
31
+
32
+ constructor(readonly rpc: RPCProtocol) {
33
+ this.proxy = rpc.getProxy(PLUGIN_RPC_CONTEXT.URI_MAIN);
34
+ console.log(this.proxy);
35
+ }
36
+
37
+ registerUriHandler(handler: theia.UriHandler, plugin: PluginInfo): theia.Disposable {
38
+ const pluginId = plugin.id;
39
+ if (this.handlers.has(pluginId)) {
40
+ throw new Error(`URI handler already registered for plugin ${pluginId}`);
41
+ }
42
+
43
+ this.handlers.set(pluginId, handler);
44
+ this.proxy.$registerUriHandler(pluginId, plugin.displayName || plugin.name);
45
+
46
+ return new Disposable(() => {
47
+ this.proxy.$unregisterUriHandler(pluginId);
48
+ this.handlers.delete(pluginId);
49
+ });
50
+ }
51
+
52
+ $handleExternalUri(uri: UriComponents): Promise<void> {
53
+ const handler = this.handlers.get(uri.authority);
54
+ if (!handler) {
55
+ return Promise.resolve();
56
+ }
57
+ handler.handleUri(URI.revive(uri));
58
+ return Promise.resolve();
59
+ }
60
+ }
@@ -255,7 +255,7 @@ export class WebviewImpl implements theia.Webview {
255
255
  .replace('{{authority}}', resource.authority)
256
256
  .replace('{{path}}', resource.path.replace(/^\//, ''))
257
257
  .replace('{{uuid}}', this.origin ?? this.viewId);
258
- return URI.parse(uri);
258
+ return URI.parse(uri).with({ query: resource.query });
259
259
  }
260
260
 
261
261
  get cspSource(): string {
@@ -1,73 +0,0 @@
1
- /********************************************************************************
2
- * Copyright (C) 2022 STMicroelectronics and others.
3
- *
4
- * This program and the accompanying materials are made available under the
5
- * terms of the Eclipse Public License v. 2.0 which is available at
6
- * http://www.eclipse.org/legal/epl-2.0.
7
- *
8
- * This Source Code may also be made available under the following Secondary
9
- * Licenses when the conditions for such availability set forth in the Eclipse
10
- * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- * with the GNU Classpath Exception which is available at
12
- * https://www.gnu.org/software/classpath/license.html.
13
- *
14
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- ********************************************************************************/
16
- import { Channel } from '@theia/core/';
17
- import { RpcMessageDecoder, RpcMessageEncoder } from '@theia/core/lib/common/message-rpc/rpc-message-encoder';
18
- export interface RpcHandlerOptions {
19
- id: string;
20
- encoder: RpcMessageEncoder;
21
- decoder: RpcMessageDecoder;
22
- }
23
- export interface ProxyHandlerOptions extends RpcHandlerOptions {
24
- channelProvider: () => Promise<Channel>;
25
- proxySynchronizer: ProxySynchronizer;
26
- }
27
- export interface InvocationHandlerOptions extends RpcHandlerOptions {
28
- target: any;
29
- }
30
- export interface ProxySynchronizer {
31
- startProxyInitialization(id: string, init: Promise<void>): void;
32
- pendingProxyInitializations(): Promise<void>;
33
- }
34
- /**
35
- * A proxy handler that will send any method invocation on the proxied object
36
- * as a rcp protocol message over a channel.
37
- */
38
- export declare class ClientProxyHandler<T extends object> implements ProxyHandler<T> {
39
- private rpcDeferred;
40
- private isRpcInitialized;
41
- readonly id: string;
42
- private readonly channelProvider;
43
- private readonly proxySynchronizer;
44
- private readonly encoder;
45
- private readonly decoder;
46
- constructor(options: ProxyHandlerOptions);
47
- private initializeRpc;
48
- get(target: any, name: string, receiver: any): any;
49
- private sendWhenNoInit;
50
- /**
51
- * Return whether the given property represents a notification. If true,
52
- * the promise returned from the invocation will resolve immediately to `undefined`
53
- *
54
- * A property leads to a notification rather than a method call if its name
55
- * begins with `notify` or `on`.
56
- *
57
- * @param p - The property being called on the proxy.
58
- * @return Whether `p` represents a notification.
59
- */
60
- protected isNotification(p: PropertyKey): boolean;
61
- }
62
- export declare class RpcInvocationHandler {
63
- readonly id: string;
64
- readonly target: any;
65
- private rpcDeferred;
66
- private readonly encoder;
67
- private readonly decoder;
68
- constructor(options: InvocationHandlerOptions);
69
- listen(channel: Channel): void;
70
- protected handleRequest(method: string, args: any[]): Promise<any>;
71
- protected onNotification(method: string, args: any[]): void;
72
- }
73
- //# sourceMappingURL=proxy-handler.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"proxy-handler.d.ts","sourceRoot":"","sources":["../../src/common/proxy-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,OAAO,EAAmC,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,wDAAwD,CAAC;AAG9G,MAAM,WAAW,iBAAiB;IAC9B,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,iBAAiB,CAAC;IAC3B,OAAO,EAAE,iBAAiB,CAAA;CAC7B;AACD,MAAM,WAAW,mBAAoB,SAAQ,iBAAiB;IAC1D,eAAe,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IACxC,iBAAiB,EAAE,iBAAiB,CAAC;CACxC;AAED,MAAM,WAAW,wBAAyB,SAAQ,iBAAiB;IAC/D,MAAM,EAAE,GAAG,CAAA;CACd;AAED,MAAM,WAAW,iBAAiB;IAC9B,wBAAwB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;IAC/D,2BAA2B,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CAC/C;AAED;;;GAGG;AACH,qBAAa,kBAAkB,CAAC,CAAC,SAAS,MAAM,CAAE,YAAW,YAAY,CAAC,CAAC,CAAC;IACxE,OAAO,CAAC,WAAW,CAAyC;IAC5D,OAAO,CAAC,gBAAgB,CAAS;IAEjC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAyB;IACzD,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAoB;IACtD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoB;IAC5C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoB;gBAEhC,OAAO,EAAE,mBAAmB;IAIxC,OAAO,CAAC,aAAa;IAYrB,GAAG,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,GAAG;IAqBlD,OAAO,CAAC,cAAc;IAItB;;;;;;;;;OASG;IACH,SAAS,CAAC,cAAc,CAAC,CAAC,EAAE,WAAW,GAAG,OAAO;CAOpD;AAED,qBAAa,oBAAoB;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC;IAErB,OAAO,CAAC,WAAW,CAAyC;IAC5D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoB;IAC5C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoB;gBAEhC,OAAO,EAAE,wBAAwB;IAI7C,MAAM,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAO9B,SAAS,CAAC,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;IAIlE,SAAS,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;CAK9D"}
@@ -1,106 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RpcInvocationHandler = exports.ClientProxyHandler = void 0;
4
- /********************************************************************************
5
- * Copyright (C) 2022 STMicroelectronics and others.
6
- *
7
- * This program and the accompanying materials are made available under the
8
- * terms of the Eclipse Public License v. 2.0 which is available at
9
- * http://www.eclipse.org/legal/epl-2.0.
10
- *
11
- * This Source Code may also be made available under the following Secondary
12
- * Licenses when the conditions for such availability set forth in the Eclipse
13
- * Public License v. 2.0 are satisfied: GNU General Public License, version 2
14
- * with the GNU Classpath Exception which is available at
15
- * https://www.gnu.org/software/classpath/license.html.
16
- *
17
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
18
- ********************************************************************************/
19
- /* eslint-disable @typescript-eslint/no-explicit-any */
20
- const core_1 = require("@theia/core/");
21
- const promise_util_1 = require("@theia/core/lib/common/promise-util");
22
- /**
23
- * A proxy handler that will send any method invocation on the proxied object
24
- * as a rcp protocol message over a channel.
25
- */
26
- class ClientProxyHandler {
27
- constructor(options) {
28
- this.rpcDeferred = new promise_util_1.Deferred();
29
- this.isRpcInitialized = false;
30
- Object.assign(this, options);
31
- }
32
- initializeRpc() {
33
- // we need to set the flag to true before waiting for the channel provider. Otherwise `get` might
34
- // get called again and we'll try to open a channel more than once
35
- this.proxySynchronizer.startProxyInitialization(this.id, this.rpcDeferred.promise.then(() => { }));
36
- this.isRpcInitialized = true;
37
- const clientOptions = { encoder: this.encoder, decoder: this.decoder, mode: 'clientOnly' };
38
- this.channelProvider().then(channel => {
39
- const rpc = new core_1.RpcProtocol(channel, undefined, clientOptions);
40
- this.rpcDeferred.resolve(rpc);
41
- });
42
- }
43
- get(target, name, receiver) {
44
- if (!this.isRpcInitialized) {
45
- this.initializeRpc();
46
- }
47
- if (target[name] || name.charCodeAt(0) !== 36 /* CharCode.DollarSign */) {
48
- return target[name];
49
- }
50
- const isNotify = this.isNotification(name);
51
- return (...args) => {
52
- const method = name.toString();
53
- return this.sendWhenNoInit(async (connection) => {
54
- if (isNotify) {
55
- connection.sendNotification(method, args);
56
- }
57
- else {
58
- return await connection.sendRequest(method, args);
59
- }
60
- });
61
- };
62
- }
63
- sendWhenNoInit(send) {
64
- return this.proxySynchronizer.pendingProxyInitializations().then(() => this.rpcDeferred.promise.then(send));
65
- }
66
- /**
67
- * Return whether the given property represents a notification. If true,
68
- * the promise returned from the invocation will resolve immediately to `undefined`
69
- *
70
- * A property leads to a notification rather than a method call if its name
71
- * begins with `notify` or `on`.
72
- *
73
- * @param p - The property being called on the proxy.
74
- * @return Whether `p` represents a notification.
75
- */
76
- isNotification(p) {
77
- let propertyString = p.toString();
78
- if (propertyString.charCodeAt(0) === 36 /* CharCode.DollarSign */) {
79
- propertyString = propertyString.substring(1);
80
- }
81
- return propertyString.startsWith('notify') || propertyString.startsWith('on');
82
- }
83
- }
84
- exports.ClientProxyHandler = ClientProxyHandler;
85
- class RpcInvocationHandler {
86
- constructor(options) {
87
- this.rpcDeferred = new promise_util_1.Deferred();
88
- Object.assign(this, options);
89
- }
90
- listen(channel) {
91
- const serverOptions = { encoder: this.encoder, decoder: this.decoder, mode: 'serverOnly' };
92
- const server = new core_1.RpcProtocol(channel, (method, args) => this.handleRequest(method, args), serverOptions);
93
- server.onNotification((e) => this.onNotification(e.method, e.args));
94
- this.rpcDeferred.resolve(server);
95
- }
96
- handleRequest(method, args) {
97
- return this.rpcDeferred.promise.then(() => this.target[method](...args));
98
- }
99
- onNotification(method, args) {
100
- this.rpcDeferred.promise.then(() => {
101
- this.target[method](...args);
102
- });
103
- }
104
- }
105
- exports.RpcInvocationHandler = RpcInvocationHandler;
106
- //# sourceMappingURL=proxy-handler.js.map