@theia/plugin-ext 1.46.1 → 1.47.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 (408) hide show
  1. package/lib/common/index.js +4 -13
  2. package/lib/common/index.js.map +1 -1
  3. package/lib/common/plugin-api-rpc-model.d.ts +1 -1
  4. package/lib/common/plugin-api-rpc-model.d.ts.map +1 -1
  5. package/lib/common/plugin-api-rpc.d.ts +41 -20
  6. package/lib/common/plugin-api-rpc.d.ts.map +1 -1
  7. package/lib/common/plugin-api-rpc.js +1 -1
  8. package/lib/common/plugin-api-rpc.js.map +1 -1
  9. package/lib/common/plugin-protocol.d.ts +10 -0
  10. package/lib/common/plugin-protocol.d.ts.map +1 -1
  11. package/lib/common/plugin-protocol.js.map +1 -1
  12. package/lib/common/uri-components.d.ts +1 -2
  13. package/lib/common/uri-components.d.ts.map +1 -1
  14. package/lib/common/uri-components.js +1 -5
  15. package/lib/common/uri-components.js.map +1 -1
  16. package/lib/hosted/browser/hosted-plugin-watcher.js +2 -7
  17. package/lib/hosted/browser/hosted-plugin-watcher.js.map +1 -1
  18. package/lib/hosted/browser/hosted-plugin.js +59 -67
  19. package/lib/hosted/browser/hosted-plugin.js.map +1 -1
  20. package/lib/hosted/browser/plugin-worker.js +3 -11
  21. package/lib/hosted/browser/plugin-worker.js.map +1 -1
  22. package/lib/hosted/browser/worker/worker-env-ext.js +3 -11
  23. package/lib/hosted/browser/worker/worker-env-ext.js.map +1 -1
  24. package/lib/hosted/common/hosted-plugin.js +21 -29
  25. package/lib/hosted/common/hosted-plugin.js.map +1 -1
  26. package/lib/hosted/node/hosted-plugin-cli-contribution.js +2 -7
  27. package/lib/hosted/node/hosted-plugin-cli-contribution.js.map +1 -1
  28. package/lib/hosted/node/hosted-plugin-deployer-handler.js +14 -22
  29. package/lib/hosted/node/hosted-plugin-deployer-handler.js.map +1 -1
  30. package/lib/hosted/node/hosted-plugin-localization-service.js +8 -16
  31. package/lib/hosted/node/hosted-plugin-localization-service.js.map +1 -1
  32. package/lib/hosted/node/hosted-plugin-process.js +14 -22
  33. package/lib/hosted/node/hosted-plugin-process.js.map +1 -1
  34. package/lib/hosted/node/hosted-plugin.js +12 -20
  35. package/lib/hosted/node/hosted-plugin.js.map +1 -1
  36. package/lib/hosted/node/metadata-scanner.js +6 -17
  37. package/lib/hosted/node/metadata-scanner.js.map +1 -1
  38. package/lib/hosted/node/plugin-host-rpc.js +42 -53
  39. package/lib/hosted/node/plugin-host-rpc.js.map +1 -1
  40. package/lib/hosted/node/plugin-language-pack-service.js +2 -7
  41. package/lib/hosted/node/plugin-language-pack-service.js.map +1 -1
  42. package/lib/hosted/node/plugin-reader.js +8 -16
  43. package/lib/hosted/node/plugin-reader.js.map +1 -1
  44. package/lib/hosted/node/plugin-service.js +22 -33
  45. package/lib/hosted/node/plugin-service.js.map +1 -1
  46. package/lib/hosted/node/scanners/file-plugin-uri-factory.js +2 -7
  47. package/lib/hosted/node/scanners/file-plugin-uri-factory.js.map +1 -1
  48. package/lib/hosted/node/scanners/grammars-reader.js +2 -7
  49. package/lib/hosted/node/scanners/grammars-reader.js.map +1 -1
  50. package/lib/hosted/node/scanners/scanner-theia.d.ts.map +1 -1
  51. package/lib/hosted/node/scanners/scanner-theia.js +17 -19
  52. package/lib/hosted/node/scanners/scanner-theia.js.map +1 -1
  53. package/lib/hosted/node-electron/scanner-theia-electron.js +2 -7
  54. package/lib/hosted/node-electron/scanner-theia-electron.js.map +1 -1
  55. package/lib/main/browser/command-registry-main.d.ts +1 -0
  56. package/lib/main/browser/command-registry-main.d.ts.map +1 -1
  57. package/lib/main/browser/command-registry-main.js +6 -1
  58. package/lib/main/browser/command-registry-main.js.map +1 -1
  59. package/lib/main/browser/commands.js +5 -16
  60. package/lib/main/browser/commands.js.map +1 -1
  61. package/lib/main/browser/comments/comments-context-key-service.js +8 -16
  62. package/lib/main/browser/comments/comments-context-key-service.js.map +1 -1
  63. package/lib/main/browser/comments/comments-contribution.d.ts.map +1 -1
  64. package/lib/main/browser/comments/comments-contribution.js +17 -25
  65. package/lib/main/browser/comments/comments-contribution.js.map +1 -1
  66. package/lib/main/browser/comments/comments-decorator.js +3 -11
  67. package/lib/main/browser/comments/comments-decorator.js.map +1 -1
  68. package/lib/main/browser/comments/comments-main.js +2 -2
  69. package/lib/main/browser/comments/comments-main.js.map +1 -1
  70. package/lib/main/browser/comments/comments-service.js +2 -7
  71. package/lib/main/browser/comments/comments-service.js.map +1 -1
  72. package/lib/main/browser/custom-editors/custom-editor-contribution.js +4 -12
  73. package/lib/main/browser/custom-editors/custom-editor-contribution.js.map +1 -1
  74. package/lib/main/browser/custom-editors/custom-editor-opener.js +7 -18
  75. package/lib/main/browser/custom-editors/custom-editor-opener.js.map +1 -1
  76. package/lib/main/browser/custom-editors/custom-editor-service.js +2 -7
  77. package/lib/main/browser/custom-editors/custom-editor-service.js.map +1 -1
  78. package/lib/main/browser/custom-editors/custom-editor-widget.d.ts.map +1 -1
  79. package/lib/main/browser/custom-editors/custom-editor-widget.js +15 -21
  80. package/lib/main/browser/custom-editors/custom-editor-widget.js.map +1 -1
  81. package/lib/main/browser/custom-editors/custom-editors-main.js +1 -1
  82. package/lib/main/browser/custom-editors/custom-editors-main.js.map +1 -1
  83. package/lib/main/browser/custom-editors/plugin-custom-editor-registry.js +18 -26
  84. package/lib/main/browser/custom-editors/plugin-custom-editor-registry.js.map +1 -1
  85. package/lib/main/browser/data-transfer/data-transfer-type-converters.d.ts +2 -2
  86. package/lib/main/browser/data-transfer/data-transfer-type-converters.d.ts.map +1 -1
  87. package/lib/main/browser/data-transfer/data-transfer-type-converters.js +2 -4
  88. package/lib/main/browser/data-transfer/data-transfer-type-converters.js.map +1 -1
  89. package/lib/main/browser/debug/plugin-debug-service.js +10 -18
  90. package/lib/main/browser/debug/plugin-debug-service.js.map +1 -1
  91. package/lib/main/browser/debug/plugin-debug-session-contribution-registry.js +8 -16
  92. package/lib/main/browser/debug/plugin-debug-session-contribution-registry.js.map +1 -1
  93. package/lib/main/browser/dialogs/modal-notification.js +3 -11
  94. package/lib/main/browser/dialogs/modal-notification.js.map +1 -1
  95. package/lib/main/browser/editors-and-documents-main.d.ts +5 -1
  96. package/lib/main/browser/editors-and-documents-main.d.ts.map +1 -1
  97. package/lib/main/browser/editors-and-documents-main.js +22 -3
  98. package/lib/main/browser/editors-and-documents-main.js.map +1 -1
  99. package/lib/main/browser/file-system-main-impl.d.ts +2 -1
  100. package/lib/main/browser/file-system-main-impl.d.ts.map +1 -1
  101. package/lib/main/browser/file-system-main-impl.js +5 -3
  102. package/lib/main/browser/file-system-main-impl.js.map +1 -1
  103. package/lib/main/browser/keybindings/keybindings-contribution-handler.js +4 -12
  104. package/lib/main/browser/keybindings/keybindings-contribution-handler.js.map +1 -1
  105. package/lib/main/browser/languages-main.d.ts +2 -2
  106. package/lib/main/browser/languages-main.d.ts.map +1 -1
  107. package/lib/main/browser/languages-main.js +19 -27
  108. package/lib/main/browser/languages-main.js.map +1 -1
  109. package/lib/main/browser/main-context.d.ts.map +1 -1
  110. package/lib/main/browser/main-context.js +1 -3
  111. package/lib/main/browser/main-context.js.map +1 -1
  112. package/lib/main/browser/menus/menus-contribution-handler.js +23 -31
  113. package/lib/main/browser/menus/menus-contribution-handler.js.map +1 -1
  114. package/lib/main/browser/menus/plugin-menu-command-adapter.d.ts.map +1 -1
  115. package/lib/main/browser/menus/plugin-menu-command-adapter.js +20 -25
  116. package/lib/main/browser/menus/plugin-menu-command-adapter.js.map +1 -1
  117. package/lib/main/browser/menus/vscode-theia-menu-mappings.d.ts +2 -2
  118. package/lib/main/browser/menus/vscode-theia-menu-mappings.d.ts.map +1 -1
  119. package/lib/main/browser/menus/vscode-theia-menu-mappings.js +11 -9
  120. package/lib/main/browser/menus/vscode-theia-menu-mappings.js.map +1 -1
  121. package/lib/main/browser/notebooks/notebook-documents-and-editors-main.d.ts +0 -1
  122. package/lib/main/browser/notebooks/notebook-documents-and-editors-main.d.ts.map +1 -1
  123. package/lib/main/browser/notebooks/notebook-documents-and-editors-main.js +5 -7
  124. package/lib/main/browser/notebooks/notebook-documents-and-editors-main.js.map +1 -1
  125. package/lib/main/browser/notebooks/notebook-kernels-main.d.ts +1 -0
  126. package/lib/main/browser/notebooks/notebook-kernels-main.d.ts.map +1 -1
  127. package/lib/main/browser/notebooks/notebook-kernels-main.js +41 -4
  128. package/lib/main/browser/notebooks/notebook-kernels-main.js.map +1 -1
  129. package/lib/main/browser/notebooks/renderers/cell-output-webview.d.ts +7 -2
  130. package/lib/main/browser/notebooks/renderers/cell-output-webview.d.ts.map +1 -1
  131. package/lib/main/browser/notebooks/renderers/cell-output-webview.js +79 -45
  132. package/lib/main/browser/notebooks/renderers/cell-output-webview.js.map +1 -1
  133. package/lib/main/browser/notebooks/renderers/output-webview-internal.d.ts +1 -0
  134. package/lib/main/browser/notebooks/renderers/output-webview-internal.d.ts.map +1 -1
  135. package/lib/main/browser/notebooks/renderers/output-webview-internal.js +74 -1
  136. package/lib/main/browser/notebooks/renderers/output-webview-internal.js.map +1 -1
  137. package/lib/main/browser/notebooks/renderers/webview-communication.d.ts +10 -2
  138. package/lib/main/browser/notebooks/renderers/webview-communication.d.ts.map +1 -1
  139. package/lib/main/browser/output-channel-registry-main.js +4 -12
  140. package/lib/main/browser/output-channel-registry-main.js.map +1 -1
  141. package/lib/main/browser/plugin-authentication-service.js +3 -11
  142. package/lib/main/browser/plugin-authentication-service.js.map +1 -1
  143. package/lib/main/browser/plugin-contribution-handler.d.ts.map +1 -1
  144. package/lib/main/browser/plugin-contribution-handler.js +66 -69
  145. package/lib/main/browser/plugin-contribution-handler.js.map +1 -1
  146. package/lib/main/browser/plugin-ext-frontend-module.d.ts.map +1 -1
  147. package/lib/main/browser/plugin-ext-frontend-module.js +3 -1
  148. package/lib/main/browser/plugin-ext-frontend-module.js.map +1 -1
  149. package/lib/main/browser/plugin-ext-widget.js +11 -19
  150. package/lib/main/browser/plugin-ext-widget.js.map +1 -1
  151. package/lib/main/browser/plugin-frontend-contribution.js +4 -12
  152. package/lib/main/browser/plugin-frontend-contribution.js.map +1 -1
  153. package/lib/main/browser/plugin-frontend-view-contribution.js +3 -11
  154. package/lib/main/browser/plugin-frontend-view-contribution.js.map +1 -1
  155. package/lib/main/browser/plugin-icon-service.d.ts +2 -5
  156. package/lib/main/browser/plugin-icon-service.d.ts.map +1 -1
  157. package/lib/main/browser/plugin-icon-service.js +10 -77
  158. package/lib/main/browser/plugin-icon-service.js.map +1 -1
  159. package/lib/main/browser/plugin-icon-theme-service.js +22 -30
  160. package/lib/main/browser/plugin-icon-theme-service.js.map +1 -1
  161. package/lib/main/browser/plugin-shared-style.js +8 -16
  162. package/lib/main/browser/plugin-shared-style.js.map +1 -1
  163. package/lib/main/browser/plugin-terminal-registry.js +2 -7
  164. package/lib/main/browser/plugin-terminal-registry.js.map +1 -1
  165. package/lib/main/browser/quick-open-main.d.ts +8 -7
  166. package/lib/main/browser/quick-open-main.d.ts.map +1 -1
  167. package/lib/main/browser/quick-open-main.js +51 -14
  168. package/lib/main/browser/quick-open-main.js.map +1 -1
  169. package/lib/main/browser/scm-main.js +3 -3
  170. package/lib/main/browser/scm-main.js.map +1 -1
  171. package/lib/main/browser/selection-provider-command.d.ts.map +1 -1
  172. package/lib/main/browser/selection-provider-command.js +5 -14
  173. package/lib/main/browser/selection-provider-command.js.map +1 -1
  174. package/lib/main/browser/test-main.d.ts +3 -1
  175. package/lib/main/browser/test-main.d.ts.map +1 -1
  176. package/lib/main/browser/test-main.js +29 -30
  177. package/lib/main/browser/test-main.js.map +1 -1
  178. package/lib/main/browser/text-editor-model-service.js +5 -16
  179. package/lib/main/browser/text-editor-model-service.js.map +1 -1
  180. package/lib/main/browser/text-editors-main.d.ts +4 -5
  181. package/lib/main/browser/text-editors-main.d.ts.map +1 -1
  182. package/lib/main/browser/text-editors-main.js +15 -9
  183. package/lib/main/browser/text-editors-main.js.map +1 -1
  184. package/lib/main/browser/theme-icon-override.js +13 -19
  185. package/lib/main/browser/theme-icon-override.js.map +1 -1
  186. package/lib/main/browser/view/dnd-file-content-store.js +2 -7
  187. package/lib/main/browser/view/dnd-file-content-store.js.map +1 -1
  188. package/lib/main/browser/view/plugin-tree-view-node-label-provider.js +8 -16
  189. package/lib/main/browser/view/plugin-tree-view-node-label-provider.js.map +1 -1
  190. package/lib/main/browser/view/plugin-view-registry.d.ts +2 -0
  191. package/lib/main/browser/view/plugin-view-registry.d.ts.map +1 -1
  192. package/lib/main/browser/view/plugin-view-registry.js +49 -44
  193. package/lib/main/browser/view/plugin-view-registry.js.map +1 -1
  194. package/lib/main/browser/view/plugin-view-widget.d.ts.map +1 -1
  195. package/lib/main/browser/view/plugin-view-widget.js +16 -25
  196. package/lib/main/browser/view/plugin-view-widget.js.map +1 -1
  197. package/lib/main/browser/view/tree-view-decorator-service.js +6 -17
  198. package/lib/main/browser/view/tree-view-decorator-service.js.map +1 -1
  199. package/lib/main/browser/view/tree-view-widget.d.ts.map +1 -1
  200. package/lib/main/browser/view/tree-view-widget.js +41 -50
  201. package/lib/main/browser/view/tree-view-widget.js.map +1 -1
  202. package/lib/main/browser/view/view-context-key-service.js +8 -16
  203. package/lib/main/browser/view/view-context-key-service.js.map +1 -1
  204. package/lib/main/browser/view-column-service.js +4 -15
  205. package/lib/main/browser/view-column-service.js.map +1 -1
  206. package/lib/main/browser/webview/webview-context-keys.js +10 -18
  207. package/lib/main/browser/webview/webview-context-keys.js.map +1 -1
  208. package/lib/main/browser/webview/webview-environment.js +8 -16
  209. package/lib/main/browser/webview/webview-environment.js.map +1 -1
  210. package/lib/main/browser/webview/webview-frontend-security-warnings.js +8 -16
  211. package/lib/main/browser/webview/webview-frontend-security-warnings.js.map +1 -1
  212. package/lib/main/browser/webview/webview-resource-cache.js +3 -11
  213. package/lib/main/browser/webview/webview-resource-cache.js.map +1 -1
  214. package/lib/main/browser/webview/webview-theme-data-provider.js +14 -22
  215. package/lib/main/browser/webview/webview-theme-data-provider.js.map +1 -1
  216. package/lib/main/browser/webview/webview.js +37 -45
  217. package/lib/main/browser/webview/webview.js.map +1 -1
  218. package/lib/main/browser/webview-views/webview-views-main.js +3 -11
  219. package/lib/main/browser/webview-views/webview-views-main.js.map +1 -1
  220. package/lib/main/browser/workspace-main.js +2 -7
  221. package/lib/main/browser/workspace-main.js.map +1 -1
  222. package/lib/main/common/plugin-theia-environment.js +4 -12
  223. package/lib/main/common/plugin-theia-environment.js.map +1 -1
  224. package/lib/main/node/errors.spec.js +2 -2
  225. package/lib/main/node/errors.spec.js.map +1 -1
  226. package/lib/main/node/handlers/plugin-theia-directory-handler.js +6 -14
  227. package/lib/main/node/handlers/plugin-theia-directory-handler.js.map +1 -1
  228. package/lib/main/node/handlers/plugin-theia-file-handler.js +5 -13
  229. package/lib/main/node/handlers/plugin-theia-file-handler.js.map +1 -1
  230. package/lib/main/node/paths/plugin-paths-service.js +10 -18
  231. package/lib/main/node/paths/plugin-paths-service.js.map +1 -1
  232. package/lib/main/node/plugin-cli-contribution.js +2 -7
  233. package/lib/main/node/plugin-cli-contribution.js.map +1 -1
  234. package/lib/main/node/plugin-deployer-contribution.js +6 -14
  235. package/lib/main/node/plugin-deployer-contribution.js.map +1 -1
  236. package/lib/main/node/plugin-deployer-impl.js +18 -26
  237. package/lib/main/node/plugin-deployer-impl.js.map +1 -1
  238. package/lib/main/node/plugin-deployer-proxy-entry-impl.js +3 -11
  239. package/lib/main/node/plugin-deployer-proxy-entry-impl.js.map +1 -1
  240. package/lib/main/node/plugin-github-resolver.js +5 -13
  241. package/lib/main/node/plugin-github-resolver.js.map +1 -1
  242. package/lib/main/node/plugin-http-resolver.js +5 -13
  243. package/lib/main/node/plugin-http-resolver.js.map +1 -1
  244. package/lib/main/node/plugin-localization-server.js +4 -12
  245. package/lib/main/node/plugin-localization-server.js.map +1 -1
  246. package/lib/main/node/plugin-mgmt-cli-contribution.js +4 -12
  247. package/lib/main/node/plugin-mgmt-cli-contribution.js.map +1 -1
  248. package/lib/main/node/plugin-server-handler.js +6 -14
  249. package/lib/main/node/plugin-server-handler.js.map +1 -1
  250. package/lib/main/node/plugin-service.js +10 -18
  251. package/lib/main/node/plugin-service.js.map +1 -1
  252. package/lib/main/node/plugin-theia-deployer-participant.js +4 -12
  253. package/lib/main/node/plugin-theia-deployer-participant.js.map +1 -1
  254. package/lib/main/node/plugin-uninstallation-manager.js +2 -7
  255. package/lib/main/node/plugin-uninstallation-manager.js.map +1 -1
  256. package/lib/main/node/plugins-key-value-storage.js +12 -20
  257. package/lib/main/node/plugins-key-value-storage.js.map +1 -1
  258. package/lib/main/node/resolvers/local-directory-plugin-deployer-resolver.js +2 -7
  259. package/lib/main/node/resolvers/local-directory-plugin-deployer-resolver.js.map +1 -1
  260. package/lib/main/node/resolvers/local-plugin-deployer-resolver.js +2 -7
  261. package/lib/main/node/resolvers/local-plugin-deployer-resolver.js.map +1 -1
  262. package/lib/main/node/webview-backend-security-warnings.js +2 -7
  263. package/lib/main/node/webview-backend-security-warnings.js.map +1 -1
  264. package/lib/plugin/clipboard-ext.js +8 -16
  265. package/lib/plugin/clipboard-ext.js.map +1 -1
  266. package/lib/plugin/custom-editors.js +1 -1
  267. package/lib/plugin/custom-editors.js.map +1 -1
  268. package/lib/plugin/debug/debug-ext.js +11 -19
  269. package/lib/plugin/debug/debug-ext.js.map +1 -1
  270. package/lib/plugin/editors-and-documents.js +4 -12
  271. package/lib/plugin/editors-and-documents.js.map +1 -1
  272. package/lib/plugin/env.js +12 -20
  273. package/lib/plugin/env.js.map +1 -1
  274. package/lib/plugin/file-system-ext-impl.d.ts +2 -1
  275. package/lib/plugin/file-system-ext-impl.d.ts.map +1 -1
  276. package/lib/plugin/file-system-ext-impl.js +13 -1
  277. package/lib/plugin/file-system-ext-impl.js.map +1 -1
  278. package/lib/plugin/known-commands.d.ts.map +1 -1
  279. package/lib/plugin/known-commands.js +1 -0
  280. package/lib/plugin/known-commands.js.map +1 -1
  281. package/lib/plugin/languages/diagnostics.js +2 -2
  282. package/lib/plugin/languages/diagnostics.js.map +1 -1
  283. package/lib/plugin/languages/link-provider.d.ts.map +1 -1
  284. package/lib/plugin/languages/link-provider.js +3 -1
  285. package/lib/plugin/languages/link-provider.js.map +1 -1
  286. package/lib/plugin/localization-ext.js +8 -16
  287. package/lib/plugin/localization-ext.js.map +1 -1
  288. package/lib/plugin/markdown-string.d.ts +3 -3
  289. package/lib/plugin/markdown-string.d.ts.map +1 -1
  290. package/lib/plugin/markdown-string.js +17 -36
  291. package/lib/plugin/markdown-string.js.map +1 -1
  292. package/lib/plugin/message-registry.js +8 -16
  293. package/lib/plugin/message-registry.js.map +1 -1
  294. package/lib/plugin/node/env-node-ext.js +5 -13
  295. package/lib/plugin/node/env-node-ext.js.map +1 -1
  296. package/lib/plugin/notebook/notebook-kernels.d.ts +5 -6
  297. package/lib/plugin/notebook/notebook-kernels.d.ts.map +1 -1
  298. package/lib/plugin/notebook/notebook-kernels.js +24 -23
  299. package/lib/plugin/notebook/notebook-kernels.js.map +1 -1
  300. package/lib/plugin/notebook/notebook-renderers.d.ts.map +1 -1
  301. package/lib/plugin/notebook/notebook-renderers.js.map +1 -1
  302. package/lib/plugin/notebook/notebooks.d.ts +1 -0
  303. package/lib/plugin/notebook/notebooks.d.ts.map +1 -1
  304. package/lib/plugin/notebook/notebooks.js +19 -0
  305. package/lib/plugin/notebook/notebooks.js.map +1 -1
  306. package/lib/plugin/plugin-context.d.ts.map +1 -1
  307. package/lib/plugin/plugin-context.js +18 -21
  308. package/lib/plugin/plugin-context.js.map +1 -1
  309. package/lib/plugin/plugin-manager.js +23 -31
  310. package/lib/plugin/plugin-manager.js.map +1 -1
  311. package/lib/plugin/plugin-storage.js +4 -15
  312. package/lib/plugin/plugin-storage.js.map +1 -1
  313. package/lib/plugin/preference-registry.js +12 -20
  314. package/lib/plugin/preference-registry.js.map +1 -1
  315. package/lib/plugin/quick-open.d.ts +2 -9
  316. package/lib/plugin/quick-open.d.ts.map +1 -1
  317. package/lib/plugin/quick-open.js +6 -22
  318. package/lib/plugin/quick-open.js.map +1 -1
  319. package/lib/plugin/secrets-ext.js +4 -15
  320. package/lib/plugin/secrets-ext.js.map +1 -1
  321. package/lib/plugin/terminal-ext.js +6 -17
  322. package/lib/plugin/terminal-ext.js.map +1 -1
  323. package/lib/plugin/test-item.js +17 -25
  324. package/lib/plugin/test-item.js.map +1 -1
  325. package/lib/plugin/tests.d.ts +8 -1
  326. package/lib/plugin/tests.d.ts.map +1 -1
  327. package/lib/plugin/tests.js +35 -21
  328. package/lib/plugin/tests.js.map +1 -1
  329. package/lib/plugin/text-editors.d.ts +2 -0
  330. package/lib/plugin/text-editors.d.ts.map +1 -1
  331. package/lib/plugin/text-editors.js +6 -0
  332. package/lib/plugin/text-editors.js.map +1 -1
  333. package/lib/plugin/type-converters.d.ts +10 -1
  334. package/lib/plugin/type-converters.d.ts.map +1 -1
  335. package/lib/plugin/type-converters.js +49 -10
  336. package/lib/plugin/type-converters.js.map +1 -1
  337. package/lib/plugin/types-impl.d.ts +2 -2
  338. package/lib/plugin/types-impl.d.ts.map +1 -1
  339. package/lib/plugin/types-impl.js +167 -180
  340. package/lib/plugin/types-impl.js.map +1 -1
  341. package/lib/plugin/webviews.d.ts +14 -1
  342. package/lib/plugin/webviews.d.ts.map +1 -1
  343. package/lib/plugin/webviews.js +32 -24
  344. package/lib/plugin/webviews.js.map +1 -1
  345. package/lib/plugin/workspace.js +12 -20
  346. package/lib/plugin/workspace.js.map +1 -1
  347. package/package.json +31 -31
  348. package/src/common/plugin-api-rpc-model.ts +1 -1
  349. package/src/common/plugin-api-rpc.ts +36 -20
  350. package/src/common/plugin-protocol.ts +12 -1
  351. package/src/common/uri-components.ts +1 -5
  352. package/src/hosted/browser/hosted-plugin.ts +2 -2
  353. package/src/hosted/node/hosted-plugin-deployer-handler.ts +2 -2
  354. package/src/hosted/node/scanners/scanner-theia.ts +8 -2
  355. package/src/main/browser/command-registry-main.ts +7 -0
  356. package/src/main/browser/comments/comments-contribution.ts +7 -3
  357. package/src/main/browser/comments/comments-main.ts +2 -2
  358. package/src/main/browser/custom-editors/custom-editor-opener.tsx +2 -2
  359. package/src/main/browser/custom-editors/custom-editor-widget.ts +3 -1
  360. package/src/main/browser/custom-editors/custom-editors-main.ts +1 -1
  361. package/src/main/browser/data-transfer/data-transfer-type-converters.ts +4 -6
  362. package/src/main/browser/editors-and-documents-main.ts +27 -5
  363. package/src/main/browser/file-system-main-impl.ts +9 -5
  364. package/src/main/browser/languages-main.ts +9 -5
  365. package/src/main/browser/main-context.ts +1 -3
  366. package/src/main/browser/menus/menus-contribution-handler.ts +1 -1
  367. package/src/main/browser/menus/plugin-menu-command-adapter.ts +4 -1
  368. package/src/main/browser/menus/vscode-theia-menu-mappings.ts +10 -2
  369. package/src/main/browser/notebooks/notebook-documents-and-editors-main.ts +5 -8
  370. package/src/main/browser/notebooks/notebook-kernels-main.ts +46 -5
  371. package/src/main/browser/notebooks/renderers/cell-output-webview.tsx +72 -21
  372. package/src/main/browser/notebooks/renderers/output-webview-internal.ts +93 -2
  373. package/src/main/browser/notebooks/renderers/webview-communication.ts +12 -2
  374. package/src/main/browser/plugin-contribution-handler.ts +9 -1
  375. package/src/main/browser/plugin-ext-frontend-module.ts +6 -2
  376. package/src/main/browser/plugin-icon-service.ts +8 -72
  377. package/src/main/browser/quick-open-main.ts +77 -28
  378. package/src/main/browser/scm-main.ts +1 -1
  379. package/src/main/browser/selection-provider-command.ts +1 -2
  380. package/src/main/browser/test-main.ts +11 -2
  381. package/src/main/browser/text-editors-main.ts +18 -10
  382. package/src/main/browser/theme-icon-override.ts +13 -19
  383. package/src/main/browser/view/plugin-tree-view-node-label-provider.ts +1 -1
  384. package/src/main/browser/view/plugin-view-registry.ts +21 -6
  385. package/src/main/browser/view/plugin-view-widget.ts +0 -1
  386. package/src/main/browser/view/tree-view-widget.tsx +2 -3
  387. package/src/main/node/errors.spec.ts +2 -2
  388. package/src/plugin/custom-editors.ts +1 -1
  389. package/src/plugin/debug/debug-ext.ts +2 -2
  390. package/src/plugin/env.ts +3 -3
  391. package/src/plugin/file-system-ext-impl.ts +15 -2
  392. package/src/plugin/known-commands.ts +1 -0
  393. package/src/plugin/languages/diagnostics.ts +2 -2
  394. package/src/plugin/languages/link-provider.ts +3 -1
  395. package/src/plugin/markdown-string.ts +3 -3
  396. package/src/plugin/node/env-node-ext.ts +2 -2
  397. package/src/plugin/notebook/notebook-kernels.ts +29 -29
  398. package/src/plugin/notebook/notebook-renderers.ts +0 -1
  399. package/src/plugin/notebook/notebooks.ts +20 -0
  400. package/src/plugin/plugin-context.ts +12 -3
  401. package/src/plugin/preference-registry.ts +2 -2
  402. package/src/plugin/quick-open.ts +10 -24
  403. package/src/plugin/terminal-ext.ts +1 -1
  404. package/src/plugin/tests.ts +33 -4
  405. package/src/plugin/text-editors.ts +9 -2
  406. package/src/plugin/type-converters.ts +45 -9
  407. package/src/plugin/types-impl.ts +4 -4
  408. package/src/plugin/webviews.ts +22 -5
@@ -18,14 +18,13 @@
18
18
  * Licensed under the MIT License. See License.txt in the project root for license information.
19
19
  *--------------------------------------------------------------------------------------------*/
20
20
 
21
- import { CancellationToken } from '@theia/plugin';
22
21
  import {
23
- CellExecuteUpdateDto, NotebookKernelDto, NotebookKernelsExt, NotebookKernelsMain, NotebookKernelSourceActionDto, NotebookOutputDto, PLUGIN_RPC_CONTEXT
22
+ CellExecuteUpdateDto, NotebookKernelDto, NotebookKernelsExt, NotebookKernelsMain,
23
+ NotebookKernelSourceActionDto, NotebookOutputDto, PluginModel, PluginPackage, PLUGIN_RPC_CONTEXT
24
24
  } from '../../common';
25
25
  import { RPCProtocol } from '../../common/rpc-protocol';
26
26
  import { UriComponents } from '../../common/uri-components';
27
- import * as theia from '@theia/plugin';
28
- import { CancellationTokenSource, Disposable, DisposableCollection, Emitter } from '@theia/core';
27
+ import { CancellationTokenSource, Disposable, DisposableCollection, Emitter, Path } from '@theia/core';
29
28
  import { Cell } from './notebook-document';
30
29
  import { NotebooksExtImpl } from './notebooks';
31
30
  import { NotebookCellOutputConverter, NotebookCellOutputItem, NotebookKernelSourceAction } from '../type-converters';
@@ -33,6 +32,8 @@ import { timeout, Deferred } from '@theia/core/lib/common/promise-util';
33
32
  import { CellExecutionUpdateType, NotebookCellExecutionState } from '@theia/notebook/lib/common';
34
33
  import { CommandRegistryImpl } from '../command-registry';
35
34
  import { NotebookCellOutput, NotebookRendererScript, URI } from '../types-impl';
35
+ import { toUriComponents } from '../../main/browser/hierarchy/hierarchy-types-converters';
36
+ import type * as theia from '@theia/plugin';
36
37
 
37
38
  interface KernelData {
38
39
  extensionId: string;
@@ -62,18 +63,18 @@ export class NotebookKernelsExtImpl implements NotebookKernelsExt {
62
63
  constructor(
63
64
  rpc: RPCProtocol,
64
65
  private readonly notebooks: NotebooksExtImpl,
65
- private readonly commands: CommandRegistryImpl
66
+ private readonly commands: CommandRegistryImpl,
66
67
  ) {
67
68
  this.proxy = rpc.getProxy(PLUGIN_RPC_CONTEXT.NOTEBOOK_KERNELS_MAIN);
68
69
  }
69
70
 
70
71
  private currentHandle = 0;
71
72
 
72
- createNotebookController(extensionId: string, id: string, viewType: string, label: string, handler?: (cells: theia.NotebookCell[],
73
+ createNotebookController(extension: PluginModel, id: string, viewType: string, label: string, handler?: (cells: theia.NotebookCell[],
73
74
  notebook: theia.NotebookDocument, controller: theia.NotebookController) => void | Thenable<void>, rendererScripts?: NotebookRendererScript[]): theia.NotebookController {
74
75
 
75
76
  for (const kernelData of this.kernelData.values()) {
76
- if (kernelData.controller.id === id && extensionId === kernelData.extensionId) {
77
+ if (kernelData.controller.id === id && extension.id === kernelData.extensionId) {
77
78
  throw new Error(`notebook controller with id '${id}' ALREADY exist`);
78
79
  }
79
80
  }
@@ -81,9 +82,9 @@ export class NotebookKernelsExtImpl implements NotebookKernelsExt {
81
82
  const handle = this.currentHandle++;
82
83
  const that = this;
83
84
 
84
- console.debug(`NotebookController[${handle}], CREATED by ${extensionId}, ${id}`);
85
+ console.debug(`NotebookController[${handle}], CREATED by ${extension.id}, ${id}`);
85
86
 
86
- const defaultExecuteHandler = () => console.warn(`NO execute handler from notebook controller '${data.id}' of extension: '${extensionId}'`);
87
+ const defaultExecuteHandler = () => console.warn(`NO execute handler from notebook controller '${data.id}' of extension: '${extension.id}'`);
87
88
 
88
89
  let isDisposed = false;
89
90
  const commandDisposables = new DisposableCollection();
@@ -92,10 +93,12 @@ export class NotebookKernelsExtImpl implements NotebookKernelsExt {
92
93
  const onDidReceiveMessage = new Emitter<{ editor: theia.NotebookEditor; message: unknown }>();
93
94
 
94
95
  const data: NotebookKernelDto = {
95
- id: createKernelId(extensionId, id),
96
+ id: createKernelId(extension.id, id),
96
97
  notebookType: viewType,
97
- extensionId: extensionId,
98
- label: label || extensionId,
98
+ extensionId: extension.id,
99
+ extensionLocation: toUriComponents(extension.packageUri),
100
+ label: label || extension.id,
101
+ preloads: rendererScripts?.map(preload => ({ uri: toUriComponents(preload.uri.toString()), provides: preload.provides })) ?? []
99
102
  };
100
103
 
101
104
  //
@@ -131,12 +134,11 @@ export class NotebookKernelsExtImpl implements NotebookKernelsExt {
131
134
  get id(): string { return id; },
132
135
  get notebookType(): string { return data.notebookType; },
133
136
  onDidChangeSelectedNotebooks: onDidChangeSelection.event,
134
- onDidReceiveMessage: onDidReceiveMessage.event,
135
137
  get label(): string {
136
138
  return data.label;
137
139
  },
138
140
  set label(value) {
139
- data.label = value ?? extensionId;
141
+ data.label = value ?? extension.id;
140
142
  update();
141
143
  },
142
144
  get detail(): string {
@@ -168,11 +170,7 @@ export class NotebookKernelsExtImpl implements NotebookKernelsExt {
168
170
  update();
169
171
  },
170
172
  get rendererScripts(): NotebookRendererScript[] {
171
- return data.rendererScripts ?? [];
172
- },
173
- set rendererScripts(value) {
174
- data.rendererScripts = value;
175
- update();
173
+ return data.preloads?.map(preload => (new NotebookRendererScript(URI.from(preload.uri), preload.provides))) ?? [];
176
174
  },
177
175
  get executeHandler(): (cells: theia.NotebookCell[], notebook: theia.NotebookDocument, controller: theia.NotebookController) => void | Thenable<void> {
178
176
  return executeHandler;
@@ -197,7 +195,7 @@ export class NotebookKernelsExtImpl implements NotebookKernelsExt {
197
195
  Array.from(associatedNotebooks.keys()).map(u => u.toString()));
198
196
  throw new Error(`notebook controller is NOT associated to notebook: ${cell.notebook.uri.toString()}`);
199
197
  }
200
- return that.createNotebookCellExecution(cell, createKernelId(extensionId, this.id));
198
+ return that.createNotebookCellExecution(cell, createKernelId(extension.id, this.id));
201
199
  },
202
200
  dispose: () => {
203
201
  if (!isDisposed) {
@@ -213,16 +211,18 @@ export class NotebookKernelsExtImpl implements NotebookKernelsExt {
213
211
  updateNotebookAffinity(notebook, priority): void {
214
212
  that.proxy.$updateNotebookPriority(handle, notebook.uri, priority);
215
213
  },
214
+ onDidReceiveMessage: onDidReceiveMessage.event,
216
215
  async postMessage(message: unknown, editor?: theia.NotebookEditor): Promise<boolean> {
217
- return Promise.resolve(true); // TODO needs implementation
216
+ return that.proxy.$postMessage(handle, 'notebook:' + editor?.notebook.uri.toString(), message);
218
217
  },
219
218
  asWebviewUri(localResource: theia.Uri): theia.Uri {
220
- throw new Error('Method not implemented.');
219
+ const basePath = PluginPackage.toPluginUrl(extension, '');
220
+ return URI.from({ path: new Path(basePath).join(localResource.path).toString(), scheme: 'https' });
221
221
  }
222
222
  };
223
223
 
224
224
  this.kernelData.set(handle, {
225
- extensionId: extensionId,
225
+ extensionId: extension.id,
226
226
  controller,
227
227
  onDidReceiveMessage,
228
228
  onDidChangeSelection,
@@ -294,11 +294,11 @@ export class NotebookKernelsExtImpl implements NotebookKernelsExt {
294
294
  };
295
295
  }
296
296
 
297
- $acceptNotebookAssociation(handle: number, uri: UriComponents, value: boolean): void {
297
+ async $acceptNotebookAssociation(handle: number, uri: UriComponents, value: boolean): Promise<void> {
298
298
  const obj = this.kernelData.get(handle);
299
299
  if (obj) {
300
300
  // update data structure
301
- const notebook = this.notebooks.getNotebookDocument(URI.from(uri))!;
301
+ const notebook = await this.notebooks.waitForNotebookDocument(URI.from(uri));
302
302
  if (value) {
303
303
  obj.associatedNotebooks.set(notebook.uri.toString(), true);
304
304
  } else {
@@ -320,7 +320,7 @@ export class NotebookKernelsExtImpl implements NotebookKernelsExt {
320
320
  // extension can dispose kernels in the meantime
321
321
  return Promise.resolve();
322
322
  }
323
- const document = this.notebooks.getNotebookDocument(URI.from(uri));
323
+ const document = await this.notebooks.waitForNotebookDocument(URI.from(uri));
324
324
  const cells: theia.NotebookCell[] = [];
325
325
  for (const cellHandle of handles) {
326
326
  const cell = document.getCell(cellHandle);
@@ -347,7 +347,7 @@ export class NotebookKernelsExtImpl implements NotebookKernelsExt {
347
347
 
348
348
  // cancel or interrupt depends on the controller. When an interrupt handler is used we
349
349
  // don't trigger the cancelation token of executions.N
350
- const document = this.notebooks.getNotebookDocument(URI.from(uri));
350
+ const document = await this.notebooks.waitForNotebookDocument(URI.from(uri));
351
351
  if (obj.controller.interruptHandler) {
352
352
  await obj.controller.interruptHandler.call(obj.controller, document.apiNotebook);
353
353
 
@@ -376,7 +376,7 @@ export class NotebookKernelsExtImpl implements NotebookKernelsExt {
376
376
  // Proposed Api though seems needed by jupyter for telemetry
377
377
  }
378
378
 
379
- async $provideKernelSourceActions(handle: number, token: CancellationToken): Promise<NotebookKernelSourceActionDto[]> {
379
+ async $provideKernelSourceActions(handle: number, token: theia.CancellationToken): Promise<NotebookKernelSourceActionDto[]> {
380
380
  const provider = this.kernelSourceActionProviders.get(handle);
381
381
  if (provider) {
382
382
  const disposables = new DisposableCollection();
@@ -496,7 +496,7 @@ class NotebookCellExecutionTask implements Disposable {
496
496
  asApiObject(): theia.NotebookCellExecution {
497
497
  const that = this;
498
498
  const result: theia.NotebookCellExecution = {
499
- get token(): CancellationToken { return that.tokenSource.token; },
499
+ get token(): theia.CancellationToken { return that.tokenSource.token; },
500
500
  get cell(): theia.NotebookCell { return that.cell.apiCell; },
501
501
  get executionOrder(): number | undefined { return that.executionOrder; },
502
502
  set executionOrder(v: number | undefined) {
@@ -43,7 +43,6 @@ export class NotebookRenderersExtImpl implements NotebookRenderersExt {
43
43
  const messaging: theia.NotebookRendererMessaging = {
44
44
  onDidReceiveMessage: (listener, thisArg, disposables) => this.getOrCreateEmitterFor(rendererId).event(listener, thisArg, disposables),
45
45
  postMessage: (message, editorOrAlias) => {
46
-
47
46
  const extHostEditor = editorOrAlias && NotebookEditor.apiEditorsToExtHost.get(editorOrAlias);
48
47
  return this.proxy.$postMessage(extHostEditor?.id, rendererId, message);
49
48
  },
@@ -312,6 +312,26 @@ export class NotebooksExtImpl implements NotebooksExt {
312
312
  return result;
313
313
  }
314
314
 
315
+ waitForNotebookDocument(uri: TheiaURI, duration = 2000): Promise<NotebookDocument> {
316
+ const existing = this.getNotebookDocument(uri, true);
317
+ if (existing) {
318
+ return Promise.resolve(existing);
319
+ }
320
+ return new Promise<NotebookDocument>((resolve, reject) => {
321
+ const listener = this.onDidOpenNotebookDocument(event => {
322
+ if (event.uri.toString() === uri.toString()) {
323
+ clearTimeout(timeout);
324
+ listener.dispose();
325
+ resolve(this.getNotebookDocument(uri));
326
+ }
327
+ });
328
+ const timeout = setTimeout(() => {
329
+ listener.dispose();
330
+ reject(new Error(`Notebook document did NOT open in ${duration}ms: ${uri}`));
331
+ }, duration);
332
+ });
333
+ }
334
+
315
335
  private createExtHostEditor(document: NotebookDocument, editorId: string, data: NotebookEditorAddData): void {
316
336
 
317
337
  if (this.editors.has(editorId)) {
@@ -709,7 +709,8 @@ export function createAPIFactory(
709
709
  } else {
710
710
  throw new Error('Invalid arguments');
711
711
  }
712
- return notebooksExt.getNotebookDocument(uri).apiNotebook;
712
+ const result = await notebooksExt.waitForNotebookDocument(uri);
713
+ return result.apiNotebook;
713
714
 
714
715
  },
715
716
  createFileSystemWatcher: (pattern, ignoreCreate, ignoreChange, ignoreDelete): theia.FileSystemWatcher =>
@@ -721,6 +722,13 @@ export function createAPIFactory(
721
722
  callbackOrToken?: CancellationToken | ((result: theia.TextSearchResult) => void), token?: CancellationToken): Promise<theia.TextSearchComplete> {
722
723
  return workspaceExt.findTextInFiles(query, optionsOrCallback, callbackOrToken, token);
723
724
  },
725
+ save(uri: theia.Uri): PromiseLike<theia.Uri | undefined> {
726
+ return editors.save(uri);
727
+ },
728
+
729
+ saveAs(uri: theia.Uri): PromiseLike<theia.Uri | undefined> {
730
+ return editors.saveAs(uri);
731
+ },
724
732
  saveAll(includeUntitled?: boolean): PromiseLike<boolean> {
725
733
  return editors.saveAll(includeUntitled);
726
734
  },
@@ -730,7 +738,8 @@ export function createAPIFactory(
730
738
  registerTextDocumentContentProvider(scheme: string, provider: theia.TextDocumentContentProvider): theia.Disposable {
731
739
  return workspaceExt.registerTextDocumentContentProvider(scheme, provider);
732
740
  },
733
- registerFileSystemProvider(scheme: string, provider: theia.FileSystemProvider, options?: { isCaseSensitive?: boolean, isReadonly?: boolean }): theia.Disposable {
741
+ registerFileSystemProvider(scheme: string, provider: theia.FileSystemProvider, options?: { isCaseSensitive?: boolean, isReadonly?: boolean | MarkdownString}):
742
+ theia.Disposable {
734
743
  return fileSystemExt.registerFileSystemProvider(scheme, provider, options);
735
744
  },
736
745
  getWorkspaceFolder(uri: theia.Uri): theia.WorkspaceFolder | undefined {
@@ -1175,7 +1184,7 @@ export function createAPIFactory(
1175
1184
  controller: theia.NotebookController) => void | Thenable<void>,
1176
1185
  rendererScripts?: NotebookRendererScript[]
1177
1186
  ) {
1178
- return notebookKernels.createNotebookController(plugin.model.id, id, notebookType, label, handler, rendererScripts);
1187
+ return notebookKernels.createNotebookController(plugin.model, id, notebookType, label, handler, rendererScripts);
1179
1188
  },
1180
1189
  createRendererMessaging(rendererId) {
1181
1190
  return notebookRenderers.createRendererMessaging(rendererId);
@@ -25,7 +25,7 @@ import { IConfigurationOverrides } from '@theia/monaco-editor-core/esm/vs/platfo
25
25
  import { Configuration, ConfigurationModel, ConfigurationModelParser } from '@theia/monaco-editor-core/esm/vs/platform/configuration/common/configurationModels';
26
26
  import { Workspace, WorkspaceFolder } from '@theia/monaco-editor-core/esm/vs/platform/workspace/common/workspace';
27
27
  import * as theia from '@theia/plugin';
28
- import { v4 } from 'uuid';
28
+ import { generateUuid } from '@theia/core/lib/common/uuid';
29
29
  import {
30
30
  PLUGIN_RPC_CONTEXT, PreferenceChangeExt, PreferenceData, PreferenceRegistryExt,
31
31
  PreferenceRegistryMain
@@ -75,7 +75,7 @@ function lookUp(tree: any, key: string): any {
75
75
  export class TheiaWorkspace extends Workspace {
76
76
  constructor(ext: WorkspaceExtImpl) {
77
77
  const folders = (ext.workspaceFolders ?? []).map(folder => new WorkspaceFolder(folder));
78
- super(v4(), folders, false, ext.workspaceFile ?? null, () => isOSX || isWindows);
78
+ super(generateUuid(), folders, false, ext.workspaceFile ?? null, () => isOSX || isWindows);
79
79
  }
80
80
  }
81
81
 
@@ -16,7 +16,7 @@
16
16
  /* eslint-disable @typescript-eslint/no-explicit-any */
17
17
  import {
18
18
  QuickOpenExt, PLUGIN_RPC_CONTEXT as Ext, QuickOpenMain, TransferInputBox, Plugin,
19
- Item, TransferQuickInputButton, TransferQuickPickItems, TransferQuickInput
19
+ TransferQuickInputButton, TransferQuickInput, TransferQuickPickItem
20
20
  } from '../common/plugin-api-rpc';
21
21
  import * as theia from '@theia/plugin';
22
22
  import { CancellationToken } from '@theia/core/lib/common/cancellation';
@@ -31,7 +31,7 @@ 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
33
  import Severity from '@theia/monaco-editor-core/esm/vs/base/common/severity';
34
- import { ThemeIcon as MonacoThemeIcon } from '@theia/monaco-editor-core/esm/vs/platform/theme/common/themeService';
34
+ import { ThemeIcon as MonacoThemeIcon } from '@theia/monaco-editor-core/esm/vs/base/common/themables';
35
35
 
36
36
  const canceledName = 'Canceled';
37
37
  /**
@@ -63,21 +63,7 @@ export function getDarkIconUri(iconPath: URI | { light: URI; dark: URI; }): URI
63
63
  return typeof iconPath === 'object' && 'dark' in iconPath ? iconPath.dark : iconPath;
64
64
  }
65
65
 
66
- export function getIconPathOrClass(button: theia.QuickInputButton): { iconPath: { dark: URI; light?: URI | undefined; } | undefined; iconClass: string | undefined; } {
67
- const iconPathOrIconClass = getIconUris(button.iconPath);
68
- let iconPath: { dark: URI; light?: URI | undefined } | undefined;
69
- let iconClass: string | undefined;
70
- if ('id' in iconPathOrIconClass) {
71
- iconClass = MonacoThemeIcon.asClassName(iconPathOrIconClass);
72
- } else {
73
- iconPath = iconPathOrIconClass;
74
- }
75
-
76
- return {
77
- iconPath,
78
- iconClass
79
- };
80
- }
66
+ type Item = theia.QuickPickItem | string;
81
67
 
82
68
  export class QuickOpenExtImpl implements QuickOpenExt {
83
69
  private proxy: QuickOpenMain;
@@ -91,13 +77,13 @@ export class QuickOpenExtImpl implements QuickOpenExt {
91
77
  }
92
78
 
93
79
  /* eslint-disable max-len */
94
- showQuickPick(itemsOrItemsPromise: Array<theia.QuickPickItem> | Promise<Array<theia.QuickPickItem>>, options: theia.QuickPickOptions & { canPickMany: true; }, token?: theia.CancellationToken): Promise<Array<theia.QuickPickItem> | undefined>;
80
+ showQuickPick(itemsOrItemsPromise: theia.QuickPickItem[] | Promise<theia.QuickPickItem[]>, options: theia.QuickPickOptions & { canPickMany: true; }, token?: theia.CancellationToken): Promise<Array<theia.QuickPickItem> | undefined>;
95
81
  showQuickPick(itemsOrItemsPromise: string[] | Promise<string[]>, options?: theia.QuickPickOptions, token?: theia.CancellationToken): Promise<string | undefined>;
96
- showQuickPick(itemsOrItemsPromise: Array<theia.QuickPickItem> | Promise<Array<theia.QuickPickItem>>, options?: theia.QuickPickOptions, token?: theia.CancellationToken): Promise<theia.QuickPickItem | undefined>;
82
+ showQuickPick(itemsOrItemsPromise: theia.QuickPickItem[] | Promise<theia.QuickPickItem[]>, options?: theia.QuickPickOptions, token?: theia.CancellationToken): Promise<theia.QuickPickItem | undefined>;
97
83
  showQuickPick(itemsOrItemsPromise: Item[] | Promise<Item[]>, options?: theia.QuickPickOptions, token: theia.CancellationToken = CancellationToken.None): Promise<Item | Item[] | undefined> {
98
84
  this.onDidSelectItem = undefined;
99
85
 
100
- const itemsPromise = <Promise<Item[]>>Promise.resolve(itemsOrItemsPromise);
86
+ const itemsPromise = Promise.resolve(itemsOrItemsPromise);
101
87
 
102
88
  const instance = ++this._instances;
103
89
 
@@ -118,7 +104,7 @@ export class QuickOpenExtImpl implements QuickOpenExt {
118
104
  return undefined;
119
105
  }
120
106
  return itemsPromise.then(async items => {
121
- const pickItems: Array<TransferQuickPickItems> = convertToTransferQuickPickItems(items);
107
+ const pickItems = convertToTransferQuickPickItems(items);
122
108
 
123
109
  if (options && typeof options.onDidSelectItem === 'function') {
124
110
  this.onDidSelectItem = handle => {
@@ -646,14 +632,14 @@ export class QuickPickExt<T extends theia.QuickPickItem> extends QuickInputExt i
646
632
  this._itemsToHandles.set(item, i);
647
633
  });
648
634
 
649
- const pickItems: TransferQuickPickItems[] = [];
635
+ const pickItems: TransferQuickPickItem[] = [];
650
636
  for (let handle = 0; handle < items.length; handle++) {
651
637
  const item = items[handle];
652
638
  if (item.kind === QuickPickItemKind.Separator) {
653
- pickItems.push({ type: 'separator', label: item.label, handle });
639
+ pickItems.push({ kind: 'separator', label: item.label, handle });
654
640
  } else {
655
641
  pickItems.push({
656
- kind: item.kind,
642
+ kind: 'item',
657
643
  label: item.label,
658
644
  iconPath: item.iconPath ? getIconUris(item.iconPath) : undefined,
659
645
  description: item.description,
@@ -26,7 +26,7 @@ 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/platform/theme/common/themeService';
29
+ import { ThemeIcon as MonacoThemeIcon } from '@theia/monaco-editor-core/esm/vs/base/common/themables';
30
30
 
31
31
  export function getIconUris(iconPath: theia.TerminalOptions['iconPath']): { id: string } | undefined {
32
32
  if (ThemeIcon.is(iconPath)) {
@@ -34,7 +34,7 @@ import { isDefined } from '@theia/core/lib/common/types';
34
34
  import { TestingExt, PLUGIN_RPC_CONTEXT, TestingMain } from '../common/plugin-api-rpc';
35
35
  import { CommandRegistryImpl } from './command-registry';
36
36
  import { RPCProtocol } from '../common/rpc-protocol';
37
- import { v4 as uuidv4 } from 'uuid';
37
+ import { generateUuid } from '@theia/core/lib/common/uuid';
38
38
  import * as Convert from './type-converters';
39
39
  import { TestItemImpl, TestItemCollection } from './test-item';
40
40
  import { AccumulatingTreeDeltaEmitter, TreeDelta } from '@theia/test/lib/common/tree-delta';
@@ -257,7 +257,7 @@ class TestRun implements theia.TestRun {
257
257
  readonly name: string,
258
258
  readonly isPersisted: boolean,
259
259
  isRunning: boolean) {
260
- this.id = uuidv4();
260
+ this.id = generateUuid();
261
261
 
262
262
  this.tokenSource = new CancellationTokenSource();
263
263
  this.token = this.tokenSource.token;
@@ -416,6 +416,14 @@ export class TestingExtImpl implements TestingExt {
416
416
  this.controllersById.get(controllerId)?.getProfile(profileId)?.configureHandler?.();
417
417
  }
418
418
 
419
+ /** @inheritdoc */
420
+ $onDidChangeDefault(controllerId: string, profileId: string, isDefault: boolean): void {
421
+ const profile = this.controllersById.get(controllerId)?.getProfile(profileId);
422
+ if (profile) {
423
+ profile.doSetDefault(isDefault);
424
+ }
425
+ }
426
+
419
427
  /** @inheritdoc */
420
428
  async $refreshTests(controllerId: string, token: CancellationToken): Promise<void> {
421
429
  await this.withController(controllerId).refreshHandler?.(token);
@@ -483,8 +491,29 @@ export class TestRunProfile implements theia.TestRunProfile {
483
491
  @observableProperty('notifyPropertyChange')
484
492
  label: string;
485
493
 
486
- @observableProperty('notifyPropertyChange')
487
- isDefault: boolean;
494
+ _isDefault: boolean;
495
+
496
+ get isDefault(): boolean {
497
+ return this._isDefault;
498
+ }
499
+
500
+ set isDefault(isDefault: boolean) {
501
+ if (this.doSetDefault(isDefault)) {
502
+ this.proxy.$updateTestRunProfile(this.controllerId, this.profileId, { isDefault: isDefault });
503
+ }
504
+ }
505
+
506
+ doSetDefault(isDefault: boolean): boolean {
507
+ if (this._isDefault !== isDefault) {
508
+ this._isDefault = isDefault;
509
+ this.onDidChangeDefaultEmitter.fire(isDefault);
510
+ return true;
511
+ }
512
+ return false;
513
+ }
514
+
515
+ private onDidChangeDefaultEmitter = new Emitter<boolean>();
516
+ onDidChangeDefault = this.onDidChangeDefaultEmitter.event;
488
517
 
489
518
  @observableProperty('notifyTagChange')
490
519
  tag: theia.TestTag | undefined;
@@ -21,11 +21,10 @@ import { Emitter, Event } from '@theia/core/lib/common/event';
21
21
  import { EditorsAndDocumentsExtImpl } from './editors-and-documents';
22
22
  import { TextEditorExt } from './text-editor';
23
23
  import * as Converters from './type-converters';
24
- import { TextEditorSelectionChangeKind } from './types-impl';
24
+ import { TextEditorSelectionChangeKind, URI } from './types-impl';
25
25
  import { IdGenerator } from '../common/id-generator';
26
26
 
27
27
  export class TextEditorsExtImpl implements TextEditorsExt {
28
-
29
28
  private readonly _onDidChangeTextEditorSelection = new Emitter<theia.TextEditorSelectionChangeEvent>();
30
29
  private readonly _onDidChangeTextEditorOptions = new Emitter<theia.TextEditorOptionsChangeEvent>();
31
30
  private readonly _onDidChangeTextEditorVisibleRanges = new Emitter<theia.TextEditorVisibleRangesChangeEvent>();
@@ -124,6 +123,14 @@ export class TextEditorsExtImpl implements TextEditorsExt {
124
123
  return this.proxy.$tryApplyWorkspaceEdit(dto, metadata);
125
124
  }
126
125
 
126
+ save(uri: theia.Uri): PromiseLike<theia.Uri | undefined> {
127
+ return this.proxy.$save(uri).then(components => URI.revive(components));
128
+ }
129
+
130
+ saveAs(uri: theia.Uri): PromiseLike<theia.Uri | undefined> {
131
+ return this.proxy.$saveAs(uri).then(components => URI.revive(components));
132
+ }
133
+
127
134
  saveAll(includeUntitled?: boolean): PromiseLike<boolean> {
128
135
  return this.proxy.$saveAll(includeUntitled);
129
136
  }
@@ -35,6 +35,7 @@ import { CellRange, isTextStreamMime } from '@theia/notebook/lib/common';
35
35
  import { MarkdownString as MarkdownStringDTO } from '@theia/core/lib/common/markdown-rendering';
36
36
 
37
37
  import { TestItemDTO, TestMessageDTO } from '../common/test-types';
38
+ import { ThemeIcon } from '@theia/monaco-editor-core/esm/vs/base/common/themables';
38
39
 
39
40
  const SIDE_GROUP = -2;
40
41
  const ACTIVE_GROUP = -1;
@@ -747,9 +748,10 @@ export function isModelRange(arg: unknown): arg is model.Range {
747
748
  export function isUriComponents(arg: unknown): arg is UriComponents {
748
749
  return isObject<UriComponents>(arg) &&
749
750
  typeof arg.scheme === 'string' &&
751
+ (arg['$mid'] === 1 || (
750
752
  typeof arg.path === 'string' &&
751
753
  typeof arg.query === 'string' &&
752
- typeof arg.fragment === 'string';
754
+ typeof arg.fragment === 'string'));
753
755
  }
754
756
 
755
757
  export function isModelCallHierarchyItem(arg: unknown): arg is model.CallHierarchyItem {
@@ -1212,23 +1214,57 @@ export function fromColorPresentation(colorPresentation: theia.ColorPresentation
1212
1214
  };
1213
1215
  }
1214
1216
 
1215
- export function convertToTransferQuickPickItems(items: rpc.Item[]): rpc.TransferQuickPickItems[] {
1216
- return items.map<rpc.TransferQuickPickItems>((item, index) => {
1217
+ export function convertIconPath(iconPath: types.URI | { light: types.URI; dark: types.URI } | theia.ThemeIcon | undefined):
1218
+ UriComponents | { light: UriComponents; dark: UriComponents } | ThemeIcon | undefined {
1219
+ if (!iconPath) {
1220
+ return undefined;
1221
+ }
1222
+ if (iconPath instanceof types.URI) {
1223
+ return iconPath.toJSON();
1224
+ } else if ('dark' in iconPath) {
1225
+ return {
1226
+ dark: iconPath.dark.toJSON(),
1227
+ light: iconPath.light?.toJSON()
1228
+ };
1229
+ } else if (ThemeIcon.isThemeIcon(iconPath)) {
1230
+ return {
1231
+ id: iconPath.id,
1232
+ color: iconPath.color ? { id: iconPath.color.id } : undefined
1233
+ };
1234
+ } else {
1235
+ return undefined;
1236
+ }
1237
+ }
1238
+
1239
+ export function convertQuickInputButton(button: theia.QuickInputButton, index: number): rpc.TransferQuickInputButton {
1240
+ const iconPath = convertIconPath(button.iconPath);
1241
+ if (!iconPath) {
1242
+ throw new Error(`Could not convert icon path: '${button.iconPath}'`);
1243
+ }
1244
+ return {
1245
+ handle: index,
1246
+ iconPath: iconPath,
1247
+ tooltip: button.tooltip
1248
+ };
1249
+ }
1250
+
1251
+ export function convertToTransferQuickPickItems(items: (theia.QuickPickItem | string)[]): rpc.TransferQuickPickItem[] {
1252
+ return items.map((item, index) => {
1217
1253
  if (typeof item === 'string') {
1218
- return { type: 'item', label: item, handle: index };
1254
+ return { kind: 'item', label: item, handle: index };
1219
1255
  } else if (item.kind === QuickPickItemKind.Separator) {
1220
- return { type: 'separator', label: item.label, handle: index };
1256
+ return { kind: 'separator', label: item.label, handle: index };
1221
1257
  } else {
1222
1258
  const { label, description, iconPath, detail, picked, alwaysShow, buttons } = item;
1223
1259
  return {
1224
- type: 'item',
1260
+ kind: 'item',
1225
1261
  label,
1226
1262
  description,
1227
- iconPath,
1263
+ iconPath: convertIconPath(iconPath),
1228
1264
  detail,
1229
1265
  picked,
1230
1266
  alwaysShow,
1231
- buttons,
1267
+ buttons: buttons ? buttons.map(convertQuickInputButton) : undefined,
1232
1268
  handle: index,
1233
1269
  };
1234
1270
  }
@@ -1403,7 +1439,7 @@ export namespace DataTransferItem {
1403
1439
  return {
1404
1440
  name: file.name,
1405
1441
  uri: URI.revive(file.uri),
1406
- data: () => resolveFileData(item.id),
1442
+ data: () => resolveFileData(file.id),
1407
1443
  };
1408
1444
  }
1409
1445
  }('');
@@ -1869,13 +1869,13 @@ export class WorkspaceEdit implements theia.WorkspaceEdit {
1869
1869
  }
1870
1870
 
1871
1871
  set(uri: URI, edits: ReadonlyArray<TextEdit | SnippetTextEdit>): void;
1872
- set(uri: URI, edits: ReadonlyArray<[TextEdit | SnippetTextEdit, theia.WorkspaceEditEntryMetadata]>): void;
1872
+ set(uri: URI, edits: ReadonlyArray<[TextEdit | SnippetTextEdit, theia.WorkspaceEditEntryMetadata | undefined]>): void;
1873
1873
  set(uri: URI, edits: ReadonlyArray<NotebookEdit>): void;
1874
- set(uri: URI, edits: ReadonlyArray<[NotebookEdit, theia.WorkspaceEditEntryMetadata]>): void;
1874
+ set(uri: URI, edits: ReadonlyArray<[NotebookEdit, theia.WorkspaceEditEntryMetadata | undefined]>): void;
1875
1875
 
1876
1876
  set(uri: URI, edits: ReadonlyArray<TextEdit | SnippetTextEdit
1877
- | NotebookEdit | [NotebookEdit, theia.WorkspaceEditEntryMetadata]
1878
- | [TextEdit | SnippetTextEdit, theia.WorkspaceEditEntryMetadata]>): void {
1877
+ | NotebookEdit | [NotebookEdit, theia.WorkspaceEditEntryMetadata | undefined]
1878
+ | [TextEdit | SnippetTextEdit, theia.WorkspaceEditEntryMetadata | undefined]>): void {
1879
1879
  if (!edits) {
1880
1880
  // remove all text edits for `uri`
1881
1881
  for (let i = 0; i < this._edits.length; i++) {
@@ -14,7 +14,7 @@
14
14
  // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
15
  // *****************************************************************************
16
16
 
17
- import { v4 } from 'uuid';
17
+ import { generateUuid, hashValue } from '@theia/core/lib/common/uuid';
18
18
  import { inject, injectable, postConstruct } from '@theia/core/shared/inversify';
19
19
  import { Plugin, WebviewsExt, WebviewPanelViewState, WebviewsMain, PLUGIN_RPC_CONTEXT, WebviewInitData, /* WebviewsMain, PLUGIN_RPC_CONTEXT */ } from '../common/plugin-api-rpc';
20
20
  import * as theia from '@theia/plugin';
@@ -24,7 +24,6 @@ import { fromViewColumn, toViewColumn, toWebviewPanelShowOptions } from './type-
24
24
  import { Disposable, WebviewPanelTargetArea, URI } from './types-impl';
25
25
  import { WorkspaceExtImpl } from './workspace';
26
26
  import { PluginIconPath } from './plugin-icon-path';
27
- import { hashValue } from '@theia/core/lib/common/uuid';
28
27
 
29
28
  @injectable()
30
29
  export class WebviewsExtImpl implements WebviewsExt {
@@ -118,7 +117,7 @@ export class WebviewsExtImpl implements WebviewsExt {
118
117
  options: theia.WebviewPanelOptions & theia.WebviewOptions,
119
118
  plugin: Plugin
120
119
  ): theia.WebviewPanel {
121
- const viewId = v4();
120
+ const viewId = generateUuid();
122
121
  const webviewShowOptions = toWebviewPanelShowOptions(showOptions);
123
122
  const webviewOptions = WebviewImpl.toWebviewOptions(options, this.workspace, plugin);
124
123
  this.proxy.$createWebviewPanel(viewId, viewType, title, webviewShowOptions, webviewOptions);
@@ -126,19 +125,33 @@ export class WebviewsExtImpl implements WebviewsExt {
126
125
  return panel;
127
126
  }
128
127
 
128
+ /**
129
+ * Creates a new webview panel.
130
+ *
131
+ * @param viewType Identifies the type of the webview panel.
132
+ * @param title Title of the panel.
133
+ * @param showOptions Where webview panel will be reside.
134
+ * @param options Settings for the new panel.
135
+ * @param plugin The plugin contributing the webview.
136
+ * @param viewId The identifier of the webview instance.
137
+ * @param originBasedOnType true if a stable origin based on the viewType shall be used, false if the viewId should be used.
138
+ * @returns The new webview panel.
139
+ */
129
140
  createWebviewPanel(
130
141
  viewType: string,
131
142
  title: string,
132
143
  showOptions: theia.ViewColumn | theia.WebviewPanelShowOptions,
133
144
  options: theia.WebviewPanelOptions & theia.WebviewOptions,
134
145
  plugin: Plugin,
135
- viewId: string
146
+ viewId: string,
147
+ originBasedOnType = true
136
148
  ): WebviewPanelImpl {
137
149
  if (!this.initData) {
138
150
  throw new Error('Webviews are not initialized');
139
151
  }
140
152
  const webviewShowOptions = toWebviewPanelShowOptions(showOptions);
141
- const webview = new WebviewImpl(viewId, this.proxy, options, this.initData, this.workspace, plugin, hashValue(viewType));
153
+ const origin = originBasedOnType ? hashValue(viewType) : undefined;
154
+ const webview = new WebviewImpl(viewId, this.proxy, options, this.initData, this.workspace, plugin, origin);
142
155
  const panel = new WebviewPanelImpl(viewId, this.proxy, viewType, title, webviewShowOptions, options, webview);
143
156
  this.webviewPanels.set(viewId, panel);
144
157
  return panel;
@@ -190,6 +203,10 @@ export class WebviewsExtImpl implements WebviewsExt {
190
203
  public getWebview(handle: string): WebviewImpl | undefined {
191
204
  return this.webviews.get(handle);
192
205
  }
206
+
207
+ public getResourceRoot(): string | undefined {
208
+ return this.initData?.webviewResourceRoot;
209
+ }
193
210
  }
194
211
 
195
212
  export class WebviewImpl implements theia.Webview {