@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
@@ -1 +0,0 @@
1
- {"version":3,"file":"proxy-handler.js","sourceRoot":"","sources":["../../src/common/proxy-handler.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,uDAAuD;AACvD,uCAAwE;AAExE,sEAA+D;AAqB/D;;;GAGG;AACH,MAAa,kBAAkB;IAU3B,YAAY,OAA4B;QAThC,gBAAW,GAA0B,IAAI,uBAAQ,EAAE,CAAC;QACpD,qBAAgB,GAAG,KAAK,CAAC;QAS7B,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACjC,CAAC;IAEO,aAAa;QACjB,iGAAiG;QACjG,kEAAkE;QAClE,IAAI,CAAC,iBAAiB,CAAC,wBAAwB,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;QACnG,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;QAC7B,MAAM,aAAa,GAAuB,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;QAC/G,IAAI,CAAC,eAAe,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;YAClC,MAAM,GAAG,GAAG,IAAI,kBAAW,CAAC,OAAO,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;YAC/D,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAClC,CAAC,CAAC,CAAC;IACP,CAAC;IAED,GAAG,CAAC,MAAW,EAAE,IAAY,EAAE,QAAa;QACxC,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;YAC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************************************************
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
- /* eslint-disable @typescript-eslint/no-explicit-any */
17
- import { Channel, RpcProtocol, RpcProtocolOptions } from '@theia/core/';
18
- import { RpcMessageDecoder, RpcMessageEncoder } from '@theia/core/lib/common/message-rpc/rpc-message-encoder';
19
- import { Deferred } from '@theia/core/lib/common/promise-util';
20
-
21
- export interface RpcHandlerOptions {
22
- id: string
23
- encoder: RpcMessageEncoder,
24
- decoder: RpcMessageDecoder
25
- }
26
- export interface ProxyHandlerOptions extends RpcHandlerOptions {
27
- channelProvider: () => Promise<Channel>,
28
- proxySynchronizer: ProxySynchronizer,
29
- }
30
-
31
- export interface InvocationHandlerOptions extends RpcHandlerOptions {
32
- target: any
33
- }
34
-
35
- export interface ProxySynchronizer {
36
- startProxyInitialization(id: string, init: Promise<void>): void
37
- pendingProxyInitializations(): Promise<void>
38
- }
39
-
40
- /**
41
- * A proxy handler that will send any method invocation on the proxied object
42
- * as a rcp protocol message over a channel.
43
- */
44
- export class ClientProxyHandler<T extends object> implements ProxyHandler<T> {
45
- private rpcDeferred: Deferred<RpcProtocol> = new Deferred();
46
- private isRpcInitialized = false;
47
-
48
- readonly id: string;
49
- private readonly channelProvider: () => Promise<Channel>;
50
- private readonly proxySynchronizer: ProxySynchronizer;
51
- private readonly encoder: RpcMessageEncoder;
52
- private readonly decoder: RpcMessageDecoder;
53
-
54
- constructor(options: ProxyHandlerOptions) {
55
- Object.assign(this, options);
56
- }
57
-
58
- private initializeRpc(): void {
59
- // we need to set the flag to true before waiting for the channel provider. Otherwise `get` might
60
- // get called again and we'll try to open a channel more than once
61
- this.proxySynchronizer.startProxyInitialization(this.id, this.rpcDeferred.promise.then(() => { }));
62
- this.isRpcInitialized = true;
63
- const clientOptions: RpcProtocolOptions = { encoder: this.encoder, decoder: this.decoder, mode: 'clientOnly' };
64
- this.channelProvider().then(channel => {
65
- const rpc = new RpcProtocol(channel, undefined, clientOptions);
66
- this.rpcDeferred.resolve(rpc);
67
- });
68
- }
69
-
70
- get(target: any, name: string, receiver: any): any {
71
- if (!this.isRpcInitialized) {
72
- this.initializeRpc();
73
- }
74
-
75
- if (target[name] || name.charCodeAt(0) !== 36 /* CharCode.DollarSign */) {
76
- return target[name];
77
- }
78
- const isNotify = this.isNotification(name);
79
- return (...args: any[]) => {
80
- const method = name.toString();
81
- return this.sendWhenNoInit(async (connection: RpcProtocol) => {
82
- if (isNotify) {
83
- connection.sendNotification(method, args);
84
- } else {
85
- return await connection.sendRequest(method, args) as Promise<any>;
86
- }
87
- });
88
- };
89
- }
90
-
91
- private sendWhenNoInit(send: (connection: RpcProtocol) => Promise<any>): Promise<any> {
92
- return this.proxySynchronizer.pendingProxyInitializations().then(() => this.rpcDeferred.promise.then(send));
93
- }
94
-
95
- /**
96
- * Return whether the given property represents a notification. If true,
97
- * the promise returned from the invocation will resolve immediately to `undefined`
98
- *
99
- * A property leads to a notification rather than a method call if its name
100
- * begins with `notify` or `on`.
101
- *
102
- * @param p - The property being called on the proxy.
103
- * @return Whether `p` represents a notification.
104
- */
105
- protected isNotification(p: PropertyKey): boolean {
106
- let propertyString = p.toString();
107
- if (propertyString.charCodeAt(0) === 36/* CharCode.DollarSign */) {
108
- propertyString = propertyString.substring(1);
109
- }
110
- return propertyString.startsWith('notify') || propertyString.startsWith('on');
111
- }
112
- }
113
-
114
- export class RpcInvocationHandler {
115
- readonly id: string;
116
- readonly target: any;
117
-
118
- private rpcDeferred: Deferred<RpcProtocol> = new Deferred();
119
- private readonly encoder: RpcMessageEncoder;
120
- private readonly decoder: RpcMessageDecoder;
121
-
122
- constructor(options: InvocationHandlerOptions) {
123
- Object.assign(this, options);
124
- }
125
-
126
- listen(channel: Channel): void {
127
- const serverOptions: RpcProtocolOptions = { encoder: this.encoder, decoder: this.decoder, mode: 'serverOnly' };
128
- const server = new RpcProtocol(channel, (method: string, args: any[]) => this.handleRequest(method, args), serverOptions);
129
- server.onNotification((e: { method: string, args: any }) => this.onNotification(e.method, e.args));
130
- this.rpcDeferred.resolve(server);
131
- }
132
-
133
- protected handleRequest(method: string, args: any[]): Promise<any> {
134
- return this.rpcDeferred.promise.then(() => this.target[method](...args));
135
- }
136
-
137
- protected onNotification(method: string, args: any[]): void {
138
- this.rpcDeferred.promise.then(() => {
139
- this.target[method](...args);
140
- });
141
- }
142
- }
143
-