@theia/plugin-ext 1.77.0-next.49 → 1.77.0-next.57

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 (354) hide show
  1. package/lib/common/character-classifier.js.map +1 -1
  2. package/lib/common/plugin-api-rpc.d.ts +2 -0
  3. package/lib/common/plugin-api-rpc.d.ts.map +1 -1
  4. package/lib/common/plugin-api-rpc.js.map +1 -1
  5. package/lib/hosted/browser/hosted-plugin.d.ts.map +1 -1
  6. package/lib/hosted/browser/hosted-plugin.js +4 -2
  7. package/lib/hosted/browser/hosted-plugin.js.map +1 -1
  8. package/lib/hosted/browser/hosted-plugin.spec.d.ts +2 -0
  9. package/lib/hosted/browser/hosted-plugin.spec.d.ts.map +1 -0
  10. package/lib/hosted/browser/hosted-plugin.spec.js +59 -0
  11. package/lib/hosted/browser/hosted-plugin.spec.js.map +1 -0
  12. package/lib/hosted/browser/worker/worker-main.js +2 -1
  13. package/lib/hosted/browser/worker/worker-main.js.map +1 -1
  14. package/lib/hosted/browser-only/browser-only-plugin-paths-service.js +1 -1
  15. package/lib/hosted/browser-only/browser-only-plugin-paths-service.js.map +1 -1
  16. package/lib/hosted/browser-only/browser-only-plugin-paths-service.spec.js +2 -1
  17. package/lib/hosted/browser-only/browser-only-plugin-paths-service.spec.js.map +1 -1
  18. package/lib/hosted/node/hosted-plugin-localization-service.js +2 -2
  19. package/lib/hosted/node/hosted-plugin-localization-service.js.map +1 -1
  20. package/lib/hosted/node/hosted-plugin-process.js +1 -1
  21. package/lib/hosted/node/hosted-plugin-process.js.map +1 -1
  22. package/lib/hosted/node/plugin-deployer-handler-impl.js +1 -1
  23. package/lib/hosted/node/plugin-deployer-handler-impl.js.map +1 -1
  24. package/lib/hosted/node/plugin-ext-hosted-backend-module.js +2 -1
  25. package/lib/hosted/node/plugin-ext-hosted-backend-module.js.map +1 -1
  26. package/lib/hosted/node/plugin-host-proxy.d.ts.map +1 -1
  27. package/lib/hosted/node/plugin-host-proxy.js +10 -6
  28. package/lib/hosted/node/plugin-host-proxy.js.map +1 -1
  29. package/lib/hosted/node/plugin-host-rpc.js +1 -1
  30. package/lib/hosted/node/plugin-host-rpc.js.map +1 -1
  31. package/lib/hosted/node/plugin-host.js +2 -1
  32. package/lib/hosted/node/plugin-host.js.map +1 -1
  33. package/lib/hosted/node/plugin-reader.js +6 -6
  34. package/lib/hosted/node/plugin-reader.js.map +1 -1
  35. package/lib/hosted/node/plugin-reader.spec.js +4 -3
  36. package/lib/hosted/node/plugin-reader.spec.js.map +1 -1
  37. package/lib/hosted/node/plugin-require-override.d.ts.map +1 -1
  38. package/lib/hosted/node/plugin-require-override.js +3 -1
  39. package/lib/hosted/node/plugin-require-override.js.map +1 -1
  40. package/lib/hosted/node/plugin-require-override.spec.d.ts +2 -0
  41. package/lib/hosted/node/plugin-require-override.spec.d.ts.map +1 -0
  42. package/lib/hosted/node/plugin-require-override.spec.js +40 -0
  43. package/lib/hosted/node/plugin-require-override.spec.js.map +1 -0
  44. package/lib/hosted/node/scanners/file-plugin-uri-factory.js +1 -1
  45. package/lib/hosted/node/scanners/file-plugin-uri-factory.js.map +1 -1
  46. package/lib/hosted/node/scanners/scanner-theia.js +2 -2
  47. package/lib/hosted/node/scanners/scanner-theia.js.map +1 -1
  48. package/lib/hosted/node/scanners/scanner-theia.spec.js +5 -4
  49. package/lib/hosted/node/scanners/scanner-theia.spec.js.map +1 -1
  50. package/lib/hosted/node-electron/scanner-theia-electron.js +1 -1
  51. package/lib/hosted/node-electron/scanner-theia-electron.js.map +1 -1
  52. package/lib/main/browser/commands.js +1 -1
  53. package/lib/main/browser/commands.js.map +1 -1
  54. package/lib/main/browser/comments/comment-thread-widget.js +3 -2
  55. package/lib/main/browser/comments/comment-thread-widget.js.map +1 -1
  56. package/lib/main/browser/comments/comments-contribution.js +1 -1
  57. package/lib/main/browser/comments/comments-contribution.js.map +1 -1
  58. package/lib/main/browser/custom-editors/custom-editor-opener.spec.js +3 -2
  59. package/lib/main/browser/custom-editors/custom-editor-opener.spec.js.map +1 -1
  60. package/lib/main/browser/custom-editors/custom-editor-widget.js +1 -1
  61. package/lib/main/browser/custom-editors/custom-editor-widget.js.map +1 -1
  62. package/lib/main/browser/custom-editors/custom-editors-main.js +2 -1
  63. package/lib/main/browser/custom-editors/custom-editors-main.js.map +1 -1
  64. package/lib/main/browser/decorations/decorations-main.js +2 -1
  65. package/lib/main/browser/decorations/decorations-main.js.map +1 -1
  66. package/lib/main/browser/dialogs-main.js +2 -1
  67. package/lib/main/browser/dialogs-main.js.map +1 -1
  68. package/lib/main/browser/documents-main.js +3 -2
  69. package/lib/main/browser/documents-main.js.map +1 -1
  70. package/lib/main/browser/file-system-main-impl.js +3 -2
  71. package/lib/main/browser/file-system-main-impl.js.map +1 -1
  72. package/lib/main/browser/hierarchy/hierarchy-types-converters.js +3 -2
  73. package/lib/main/browser/hierarchy/hierarchy-types-converters.js.map +1 -1
  74. package/lib/main/browser/languages-main.js +3 -3
  75. package/lib/main/browser/languages-main.js.map +1 -1
  76. package/lib/main/browser/languages-main.spec.js +2 -1
  77. package/lib/main/browser/languages-main.spec.js.map +1 -1
  78. package/lib/main/browser/main-file-system-event-service.spec.js +2 -1
  79. package/lib/main/browser/main-file-system-event-service.spec.js.map +1 -1
  80. package/lib/main/browser/menus/menus-contribution-handler.d.ts.map +1 -1
  81. package/lib/main/browser/menus/menus-contribution-handler.js +1 -12
  82. package/lib/main/browser/menus/menus-contribution-handler.js.map +1 -1
  83. package/lib/main/browser/notebooks/renderers/output-webview-internal.d.ts.map +1 -1
  84. package/lib/main/browser/notebooks/renderers/output-webview-internal.js +3 -2
  85. package/lib/main/browser/notebooks/renderers/output-webview-internal.js.map +1 -1
  86. package/lib/main/browser/plugin-contribution-handler.js +1 -1
  87. package/lib/main/browser/plugin-contribution-handler.js.map +1 -1
  88. package/lib/main/browser/plugin-ext-widget.js +1 -1
  89. package/lib/main/browser/plugin-ext-widget.js.map +1 -1
  90. package/lib/main/browser/plugin-icon-service.js +1 -1
  91. package/lib/main/browser/plugin-icon-service.js.map +1 -1
  92. package/lib/main/browser/plugin-icon-theme-service.d.ts +2 -2
  93. package/lib/main/browser/plugin-icon-theme-service.d.ts.map +1 -1
  94. package/lib/main/browser/plugin-icon-theme-service.js +2 -2
  95. package/lib/main/browser/plugin-icon-theme-service.js.map +1 -1
  96. package/lib/main/browser/plugin-icon-theme-service.spec.js +2 -1
  97. package/lib/main/browser/plugin-icon-theme-service.spec.js.map +1 -1
  98. package/lib/main/browser/plugin-shared-style.js.map +1 -1
  99. package/lib/main/browser/scm-main.d.ts +3 -1
  100. package/lib/main/browser/scm-main.d.ts.map +1 -1
  101. package/lib/main/browser/scm-main.js +6 -3
  102. package/lib/main/browser/scm-main.js.map +1 -1
  103. package/lib/main/browser/scm-main.spec.js +31 -0
  104. package/lib/main/browser/scm-main.spec.js.map +1 -1
  105. package/lib/main/browser/status-bar-message-registry-main.js +2 -1
  106. package/lib/main/browser/status-bar-message-registry-main.js.map +1 -1
  107. package/lib/main/browser/text-editor-main.js +2 -1
  108. package/lib/main/browser/text-editor-main.js.map +1 -1
  109. package/lib/main/browser/text-editors-main.js +2 -1
  110. package/lib/main/browser/text-editors-main.js.map +1 -1
  111. package/lib/main/browser/view/plugin-tree-view-node-label-provider.js +1 -1
  112. package/lib/main/browser/view/plugin-tree-view-node-label-provider.js.map +1 -1
  113. package/lib/main/browser/view/plugin-view-registry.d.ts +7 -2
  114. package/lib/main/browser/view/plugin-view-registry.d.ts.map +1 -1
  115. package/lib/main/browser/view/plugin-view-registry.js +19 -3
  116. package/lib/main/browser/view/plugin-view-registry.js.map +1 -1
  117. package/lib/main/browser/view/plugin-view-registry.spec.js +82 -1
  118. package/lib/main/browser/view/plugin-view-registry.spec.js.map +1 -1
  119. package/lib/main/browser/view/tree-view-decorator-service.js +1 -1
  120. package/lib/main/browser/view/tree-view-decorator-service.js.map +1 -1
  121. package/lib/main/browser/view/tree-view-widget.js +2 -2
  122. package/lib/main/browser/view/tree-view-widget.js.map +1 -1
  123. package/lib/main/browser/webview/pre/main.spec.d.ts +2 -0
  124. package/lib/main/browser/webview/pre/main.spec.d.ts.map +1 -0
  125. package/lib/main/browser/webview/pre/main.spec.js +45 -0
  126. package/lib/main/browser/webview/pre/main.spec.js.map +1 -0
  127. package/lib/main/browser/webview/webview-theme-data-provider.d.ts +1 -1
  128. package/lib/main/browser/webview/webview-theme-data-provider.d.ts.map +1 -1
  129. package/lib/main/browser/webview/webview.d.ts.map +1 -1
  130. package/lib/main/browser/webview/webview.js +6 -3
  131. package/lib/main/browser/webview/webview.js.map +1 -1
  132. package/lib/main/browser/window-state-main.js +2 -1
  133. package/lib/main/browser/window-state-main.js.map +1 -1
  134. package/lib/main/browser/workspace-main.js +1 -1
  135. package/lib/main/browser/workspace-main.js.map +1 -1
  136. package/lib/main/common/plugin-theia-environment.js +1 -1
  137. package/lib/main/common/plugin-theia-environment.js.map +1 -1
  138. package/lib/main/node/handlers/plugin-theia-directory-handler.js +4 -4
  139. package/lib/main/node/handlers/plugin-theia-directory-handler.js.map +1 -1
  140. package/lib/main/node/handlers/plugin-theia-file-handler.js +3 -3
  141. package/lib/main/node/handlers/plugin-theia-file-handler.js.map +1 -1
  142. package/lib/main/node/paths/plugin-paths-service.js +4 -4
  143. package/lib/main/node/paths/plugin-paths-service.js.map +1 -1
  144. package/lib/main/node/plugin-deployer-directory-handler-context-impl.js +2 -1
  145. package/lib/main/node/plugin-deployer-directory-handler-context-impl.js.map +1 -1
  146. package/lib/main/node/plugin-deployer-file-handler-context-impl.js +3 -2
  147. package/lib/main/node/plugin-deployer-file-handler-context-impl.js.map +1 -1
  148. package/lib/main/node/plugin-deployer-impl.js +1 -1
  149. package/lib/main/node/plugin-deployer-impl.js.map +1 -1
  150. package/lib/main/node/plugin-github-resolver.js +1 -1
  151. package/lib/main/node/plugin-github-resolver.js.map +1 -1
  152. package/lib/main/node/plugin-http-resolver.js +1 -1
  153. package/lib/main/node/plugin-http-resolver.js.map +1 -1
  154. package/lib/main/node/plugin-service.d.ts +1 -1
  155. package/lib/main/node/plugin-service.d.ts.map +1 -1
  156. package/lib/main/node/plugin-service.js +4 -4
  157. package/lib/main/node/plugin-service.js.map +1 -1
  158. package/lib/main/node/plugins-key-value-storage.js +2 -2
  159. package/lib/main/node/plugins-key-value-storage.js.map +1 -1
  160. package/lib/main/node/plugins-key-value-storage.spec.js +2 -1
  161. package/lib/main/node/plugins-key-value-storage.spec.js.map +1 -1
  162. package/lib/main/node/resolvers/local-directory-plugin-deployer-resolver.js +2 -2
  163. package/lib/main/node/resolvers/local-directory-plugin-deployer-resolver.js.map +1 -1
  164. package/lib/main/node/resolvers/local-directory-plugin-deployer-resolver.spec.js +4 -3
  165. package/lib/main/node/resolvers/local-directory-plugin-deployer-resolver.spec.js.map +1 -1
  166. package/lib/main/node/resolvers/local-plugin-deployer-resolver.js +3 -3
  167. package/lib/main/node/resolvers/local-plugin-deployer-resolver.js.map +1 -1
  168. package/lib/main/node/temp-dir-util.js +3 -2
  169. package/lib/main/node/temp-dir-util.js.map +1 -1
  170. package/lib/plugin/comments.d.ts +1 -1
  171. package/lib/plugin/comments.d.ts.map +1 -1
  172. package/lib/plugin/custom-editors.js +2 -1
  173. package/lib/plugin/custom-editors.js.map +1 -1
  174. package/lib/plugin/decorations.spec.js +2 -1
  175. package/lib/plugin/decorations.spec.js.map +1 -1
  176. package/lib/plugin/document-data.d.ts.map +1 -1
  177. package/lib/plugin/document-data.js +0 -1
  178. package/lib/plugin/document-data.js.map +1 -1
  179. package/lib/plugin/documents.js +2 -1
  180. package/lib/plugin/documents.js.map +1 -1
  181. package/lib/plugin/editors-and-documents.js +1 -1
  182. package/lib/plugin/editors-and-documents.js.map +1 -1
  183. package/lib/plugin/file-system-event-service-ext-impl.d.ts +1 -1
  184. package/lib/plugin/file-system-event-service-ext-impl.d.ts.map +1 -1
  185. package/lib/plugin/file-system-event-service-ext-impl.js +3 -2
  186. package/lib/plugin/file-system-event-service-ext-impl.js.map +1 -1
  187. package/lib/plugin/file-system-ext-impl.js +5 -4
  188. package/lib/plugin/file-system-ext-impl.js.map +1 -1
  189. package/lib/plugin/file-system-watcher.spec.js +2 -1
  190. package/lib/plugin/file-system-watcher.spec.js.map +1 -1
  191. package/lib/plugin/known-commands.js +5 -5
  192. package/lib/plugin/known-commands.js.map +1 -1
  193. package/lib/plugin/known-commands.spec.js +2 -1
  194. package/lib/plugin/known-commands.spec.js.map +1 -1
  195. package/lib/plugin/languages/call-hierarchy.js +2 -1
  196. package/lib/plugin/languages/call-hierarchy.js.map +1 -1
  197. package/lib/plugin/languages/code-action.js +2 -1
  198. package/lib/plugin/languages/code-action.js.map +1 -1
  199. package/lib/plugin/languages/color.js +2 -1
  200. package/lib/plugin/languages/color.js.map +1 -1
  201. package/lib/plugin/languages/completion.js +2 -1
  202. package/lib/plugin/languages/completion.js.map +1 -1
  203. package/lib/plugin/languages/declaration.js +3 -2
  204. package/lib/plugin/languages/declaration.js.map +1 -1
  205. package/lib/plugin/languages/definition.js +3 -2
  206. package/lib/plugin/languages/definition.js.map +1 -1
  207. package/lib/plugin/languages/document-drop-edit.js +4 -3
  208. package/lib/plugin/languages/document-drop-edit.js.map +1 -1
  209. package/lib/plugin/languages/document-formatting.js +2 -1
  210. package/lib/plugin/languages/document-formatting.js.map +1 -1
  211. package/lib/plugin/languages/document-highlight.js +3 -2
  212. package/lib/plugin/languages/document-highlight.js.map +1 -1
  213. package/lib/plugin/languages/evaluatable-expression.js +2 -1
  214. package/lib/plugin/languages/evaluatable-expression.js.map +1 -1
  215. package/lib/plugin/languages/folding.js +2 -1
  216. package/lib/plugin/languages/folding.js.map +1 -1
  217. package/lib/plugin/languages/hover.js +2 -1
  218. package/lib/plugin/languages/hover.js.map +1 -1
  219. package/lib/plugin/languages/implementation.js +3 -2
  220. package/lib/plugin/languages/implementation.js.map +1 -1
  221. package/lib/plugin/languages/inlay-hints.js +2 -1
  222. package/lib/plugin/languages/inlay-hints.js.map +1 -1
  223. package/lib/plugin/languages/inline-completion.js +2 -1
  224. package/lib/plugin/languages/inline-completion.js.map +1 -1
  225. package/lib/plugin/languages/inline-values.js +2 -1
  226. package/lib/plugin/languages/inline-values.js.map +1 -1
  227. package/lib/plugin/languages/lens.js +2 -1
  228. package/lib/plugin/languages/lens.js.map +1 -1
  229. package/lib/plugin/languages/link-provider.js +2 -1
  230. package/lib/plugin/languages/link-provider.js.map +1 -1
  231. package/lib/plugin/languages/multi-document-highlight.js +3 -2
  232. package/lib/plugin/languages/multi-document-highlight.js.map +1 -1
  233. package/lib/plugin/languages/on-type-formatting.js +2 -1
  234. package/lib/plugin/languages/on-type-formatting.js.map +1 -1
  235. package/lib/plugin/languages/outline.js +3 -2
  236. package/lib/plugin/languages/outline.js.map +1 -1
  237. package/lib/plugin/languages/range-formatting.js +2 -1
  238. package/lib/plugin/languages/range-formatting.js.map +1 -1
  239. package/lib/plugin/languages/reference.js +2 -1
  240. package/lib/plugin/languages/reference.js.map +1 -1
  241. package/lib/plugin/languages/rename.js +2 -1
  242. package/lib/plugin/languages/rename.js.map +1 -1
  243. package/lib/plugin/languages/selection-range.js +2 -1
  244. package/lib/plugin/languages/selection-range.js.map +1 -1
  245. package/lib/plugin/languages/signature.js +2 -1
  246. package/lib/plugin/languages/signature.js.map +1 -1
  247. package/lib/plugin/languages/type-definition.js +3 -2
  248. package/lib/plugin/languages/type-definition.js.map +1 -1
  249. package/lib/plugin/languages/type-hierarchy.js +2 -1
  250. package/lib/plugin/languages/type-hierarchy.js.map +1 -1
  251. package/lib/plugin/languages/util.js +2 -1
  252. package/lib/plugin/languages/util.js.map +1 -1
  253. package/lib/plugin/languages/workspace-symbol.js +2 -1
  254. package/lib/plugin/languages/workspace-symbol.js.map +1 -1
  255. package/lib/plugin/node/debug/debug.spec.js +2 -1
  256. package/lib/plugin/node/debug/debug.spec.js.map +1 -1
  257. package/lib/plugin/node/debug/plugin-node-debug-adapter-creator.js +3 -2
  258. package/lib/plugin/node/debug/plugin-node-debug-adapter-creator.js.map +1 -1
  259. package/lib/plugin/node/env-node-ext.js +1 -1
  260. package/lib/plugin/node/env-node-ext.js.map +1 -1
  261. package/lib/plugin/notebook/notebook-document.js +3 -2
  262. package/lib/plugin/notebook/notebook-document.js.map +1 -1
  263. package/lib/plugin/notebook/notebook-editors.js +2 -1
  264. package/lib/plugin/notebook/notebook-editors.js.map +1 -1
  265. package/lib/plugin/notebook/notebooks.js +2 -1
  266. package/lib/plugin/notebook/notebooks.js.map +1 -1
  267. package/lib/plugin/path.spec.js +2 -1
  268. package/lib/plugin/path.spec.js.map +1 -1
  269. package/lib/plugin/plugin-context.js.map +1 -1
  270. package/lib/plugin/plugin-icon-path.js +2 -1
  271. package/lib/plugin/plugin-icon-path.js.map +1 -1
  272. package/lib/plugin/plugin-manager.js +1 -1
  273. package/lib/plugin/plugin-manager.js.map +1 -1
  274. package/lib/plugin/preference-registry.spec.js +2 -1
  275. package/lib/plugin/preference-registry.spec.js.map +1 -1
  276. package/lib/plugin/quick-open.js +2 -1
  277. package/lib/plugin/quick-open.js.map +1 -1
  278. package/lib/plugin/relative-pattern.spec.js +3 -2
  279. package/lib/plugin/relative-pattern.spec.js.map +1 -1
  280. package/lib/plugin/scm.d.ts.map +1 -1
  281. package/lib/plugin/scm.js +14 -1
  282. package/lib/plugin/scm.js.map +1 -1
  283. package/lib/plugin/scm.spec.js +56 -1
  284. package/lib/plugin/scm.spec.js.map +1 -1
  285. package/lib/plugin/tasks/task-provider.js +2 -1
  286. package/lib/plugin/tasks/task-provider.js.map +1 -1
  287. package/lib/plugin/tasks/tasks.js +2 -1
  288. package/lib/plugin/tasks/tasks.js.map +1 -1
  289. package/lib/plugin/telemetry-ext.spec.js +2 -1
  290. package/lib/plugin/telemetry-ext.spec.js.map +1 -1
  291. package/lib/plugin/terminal-ext.js +1 -1
  292. package/lib/plugin/terminal-ext.js.map +1 -1
  293. package/lib/plugin/terminal-ext.spec.js +2 -1
  294. package/lib/plugin/terminal-ext.spec.js.map +1 -1
  295. package/lib/plugin/tests.js +1 -1
  296. package/lib/plugin/tests.js.map +1 -1
  297. package/lib/plugin/text-editor.js +2 -1
  298. package/lib/plugin/text-editor.js.map +1 -1
  299. package/lib/plugin/text-editors.js +2 -1
  300. package/lib/plugin/text-editors.js.map +1 -1
  301. package/lib/plugin/tree/tree-views.d.ts.map +1 -1
  302. package/lib/plugin/tree/tree-views.js +2 -1
  303. package/lib/plugin/tree/tree-views.js.map +1 -1
  304. package/lib/plugin/type-converters.js +6 -5
  305. package/lib/plugin/type-converters.js.map +1 -1
  306. package/lib/plugin/type-converters.spec.js +5 -4
  307. package/lib/plugin/type-converters.spec.js.map +1 -1
  308. package/lib/plugin/types-impl.js +1 -1
  309. package/lib/plugin/types-impl.js.map +1 -1
  310. package/lib/plugin/types-impl.spec.js +3 -2
  311. package/lib/plugin/types-impl.spec.js.map +1 -1
  312. package/lib/plugin/workspace.js +2 -2
  313. package/lib/plugin/workspace.js.map +1 -1
  314. package/lib/plugin/workspace.spec.js +2 -1
  315. package/lib/plugin/workspace.spec.js.map +1 -1
  316. package/lib/plugin-ext-frontend-electron-module.js +2 -1
  317. package/lib/plugin-ext-frontend-electron-module.js.map +1 -1
  318. package/lib/plugin-ext-frontend-module.js +2 -1
  319. package/lib/plugin-ext-frontend-module.js.map +1 -1
  320. package/package.json +32 -32
  321. package/src/common/character-classifier.ts +1 -1
  322. package/src/common/plugin-api-rpc.ts +2 -0
  323. package/src/hosted/browser/hosted-plugin.spec.ts +66 -0
  324. package/src/hosted/browser/hosted-plugin.ts +3 -1
  325. package/src/hosted/node/plugin-host-proxy.ts +6 -3
  326. package/src/hosted/node/plugin-reader.ts +1 -1
  327. package/src/hosted/node/plugin-require-override.spec.ts +44 -0
  328. package/src/hosted/node/plugin-require-override.ts +1 -0
  329. package/src/main/browser/file-system-main-impl.ts +1 -1
  330. package/src/main/browser/menus/menus-contribution-handler.ts +6 -13
  331. package/src/main/browser/notebooks/renderers/output-webview-internal.ts +6 -3
  332. package/src/main/browser/plugin-shared-style.ts +2 -2
  333. package/src/main/browser/scm-main.spec.ts +32 -0
  334. package/src/main/browser/scm-main.ts +6 -2
  335. package/src/main/browser/view/plugin-view-registry.spec.ts +134 -3
  336. package/src/main/browser/view/plugin-view-registry.ts +20 -3
  337. package/src/main/browser/view/tree-view-widget.tsx +1 -1
  338. package/src/main/browser/webview/pre/main.js +19 -10
  339. package/src/main/browser/webview/pre/main.spec.ts +46 -0
  340. package/src/main/browser/webview/webview.ts +7 -3
  341. package/src/main/node/handlers/plugin-theia-directory-handler.ts +1 -1
  342. package/src/main/node/handlers/plugin-theia-file-handler.ts +1 -1
  343. package/src/main/node/plugin-deployer-file-handler-context-impl.ts +1 -1
  344. package/src/main/node/plugin-service.ts +1 -1
  345. package/src/plugin/document-data.ts +0 -1
  346. package/src/plugin/file-system-event-service-ext-impl.ts +1 -1
  347. package/src/plugin/file-system-ext-impl.ts +2 -2
  348. package/src/plugin/known-commands.ts +5 -5
  349. package/src/plugin/plugin-context.ts +3 -3
  350. package/src/plugin/scm.spec.ts +67 -1
  351. package/src/plugin/scm.ts +18 -1
  352. package/src/plugin/tests.ts +2 -2
  353. package/src/plugin/tree/tree-views.ts +2 -1
  354. package/src/plugin/type-converters.spec.ts +1 -1
@@ -15,6 +15,7 @@
15
15
  // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
16
  // *****************************************************************************
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- const plugin_ext_frontend_electron_module_1 = require("./main/electron-browser/plugin-ext-frontend-electron-module");
18
+ const tslib_1 = require("tslib");
19
+ const plugin_ext_frontend_electron_module_1 = tslib_1.__importDefault(require("./main/electron-browser/plugin-ext-frontend-electron-module"));
19
20
  exports.default = plugin_ext_frontend_electron_module_1.default;
20
21
  //# sourceMappingURL=plugin-ext-frontend-electron-module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-ext-frontend-electron-module.js","sourceRoot":"","sources":["../src/plugin-ext-frontend-electron-module.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;AAEhF,qHAAqF;AAErF,kBAAe,6CAAU,CAAC"}
1
+ {"version":3,"file":"plugin-ext-frontend-electron-module.js","sourceRoot":"","sources":["../src/plugin-ext-frontend-electron-module.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AAEhF,8IAAqF;AAErF,kBAAe,6CAAU,CAAC"}
@@ -15,6 +15,7 @@
15
15
  // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
16
  // *****************************************************************************
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- const plugin_ext_frontend_module_1 = require("./main/browser/plugin-ext-frontend-module");
18
+ const tslib_1 = require("tslib");
19
+ const plugin_ext_frontend_module_1 = tslib_1.__importDefault(require("./main/browser/plugin-ext-frontend-module"));
19
20
  exports.default = plugin_ext_frontend_module_1.default;
20
21
  //# sourceMappingURL=plugin-ext-frontend-module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-ext-frontend-module.js","sourceRoot":"","sources":["../src/plugin-ext-frontend-module.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;AAEhF,0FAAmE;AAEnE,kBAAe,oCAAU,CAAC"}
1
+ {"version":3,"file":"plugin-ext-frontend-module.js","sourceRoot":"","sources":["../src/plugin-ext-frontend-module.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AAEhF,mHAAmE;AAEnE,kBAAe,oCAAU,CAAC"}
package/package.json CHANGED
@@ -1,41 +1,41 @@
1
1
  {
2
2
  "name": "@theia/plugin-ext",
3
- "version": "1.77.0-next.49+19f3aa746",
3
+ "version": "1.77.0-next.57+81ea5f939",
4
4
  "description": "Theia - Plugin Extension",
5
5
  "main": "lib/common/index.js",
6
6
  "typings": "lib/common/index.d.ts",
7
7
  "dependencies": {
8
- "@theia/ai-core": "1.77.0-next.49+19f3aa746",
9
- "@theia/ai-mcp": "1.77.0-next.49+19f3aa746",
10
- "@theia/bulk-edit": "1.77.0-next.49+19f3aa746",
11
- "@theia/callhierarchy": "1.77.0-next.49+19f3aa746",
12
- "@theia/console": "1.77.0-next.49+19f3aa746",
13
- "@theia/core": "1.77.0-next.49+19f3aa746",
14
- "@theia/debug": "1.77.0-next.49+19f3aa746",
15
- "@theia/editor": "1.77.0-next.49+19f3aa746",
16
- "@theia/editor-preview": "1.77.0-next.49+19f3aa746",
17
- "@theia/file-search": "1.77.0-next.49+19f3aa746",
18
- "@theia/filesystem": "1.77.0-next.49+19f3aa746",
19
- "@theia/markers": "1.77.0-next.49+19f3aa746",
20
- "@theia/messages": "1.77.0-next.49+19f3aa746",
21
- "@theia/monaco": "1.77.0-next.49+19f3aa746",
8
+ "@theia/ai-core": "1.77.0-next.57+81ea5f939",
9
+ "@theia/ai-mcp": "1.77.0-next.57+81ea5f939",
10
+ "@theia/bulk-edit": "1.77.0-next.57+81ea5f939",
11
+ "@theia/callhierarchy": "1.77.0-next.57+81ea5f939",
12
+ "@theia/console": "1.77.0-next.57+81ea5f939",
13
+ "@theia/core": "1.77.0-next.57+81ea5f939",
14
+ "@theia/debug": "1.77.0-next.57+81ea5f939",
15
+ "@theia/editor": "1.77.0-next.57+81ea5f939",
16
+ "@theia/editor-preview": "1.77.0-next.57+81ea5f939",
17
+ "@theia/file-search": "1.77.0-next.57+81ea5f939",
18
+ "@theia/filesystem": "1.77.0-next.57+81ea5f939",
19
+ "@theia/markers": "1.77.0-next.57+81ea5f939",
20
+ "@theia/messages": "1.77.0-next.57+81ea5f939",
21
+ "@theia/monaco": "1.77.0-next.57+81ea5f939",
22
22
  "@theia/monaco-editor-core": "1.108.201",
23
- "@theia/navigator": "1.77.0-next.49+19f3aa746",
24
- "@theia/notebook": "1.77.0-next.49+19f3aa746",
25
- "@theia/output": "1.77.0-next.49+19f3aa746",
26
- "@theia/plugin": "1.77.0-next.49+19f3aa746",
27
- "@theia/plugin-utils": "1.77.0-next.49+19f3aa746",
28
- "@theia/preferences": "1.77.0-next.49+19f3aa746",
29
- "@theia/scm": "1.77.0-next.49+19f3aa746",
30
- "@theia/search-in-workspace": "1.77.0-next.49+19f3aa746",
31
- "@theia/task": "1.77.0-next.49+19f3aa746",
32
- "@theia/telemetry": "1.77.0-next.49+19f3aa746",
33
- "@theia/terminal": "1.77.0-next.49+19f3aa746",
34
- "@theia/test": "1.77.0-next.49+19f3aa746",
35
- "@theia/timeline": "1.77.0-next.49+19f3aa746",
36
- "@theia/typehierarchy": "1.77.0-next.49+19f3aa746",
37
- "@theia/variable-resolver": "1.77.0-next.49+19f3aa746",
38
- "@theia/workspace": "1.77.0-next.49+19f3aa746",
23
+ "@theia/navigator": "1.77.0-next.57+81ea5f939",
24
+ "@theia/notebook": "1.77.0-next.57+81ea5f939",
25
+ "@theia/output": "1.77.0-next.57+81ea5f939",
26
+ "@theia/plugin": "1.77.0-next.57+81ea5f939",
27
+ "@theia/plugin-utils": "1.77.0-next.57+81ea5f939",
28
+ "@theia/preferences": "1.77.0-next.57+81ea5f939",
29
+ "@theia/scm": "1.77.0-next.57+81ea5f939",
30
+ "@theia/search-in-workspace": "1.77.0-next.57+81ea5f939",
31
+ "@theia/task": "1.77.0-next.57+81ea5f939",
32
+ "@theia/telemetry": "1.77.0-next.57+81ea5f939",
33
+ "@theia/terminal": "1.77.0-next.57+81ea5f939",
34
+ "@theia/test": "1.77.0-next.57+81ea5f939",
35
+ "@theia/timeline": "1.77.0-next.57+81ea5f939",
36
+ "@theia/typehierarchy": "1.77.0-next.57+81ea5f939",
37
+ "@theia/variable-resolver": "1.77.0-next.57+81ea5f939",
38
+ "@theia/workspace": "1.77.0-next.57+81ea5f939",
39
39
  "@types/mime": "^2.0.3",
40
40
  "@vscode/debugprotocol": "^1.68.0",
41
41
  "@vscode/proxy-agent": "^0.13.2",
@@ -103,5 +103,5 @@
103
103
  "nyc": {
104
104
  "extends": "../../configs/nyc.json"
105
105
  },
106
- "gitHead": "19f3aa746ad23091ba655bc1509d18e4f961fb39"
106
+ "gitHead": "81ea5f939c40c905de91083d07e284bfd7437fac"
107
107
  }
@@ -65,7 +65,7 @@ export class CharacterClassifier<T extends number> {
65
65
 
66
66
  public get(charCode: number): T {
67
67
  if (charCode >= 0 && charCode < 256) {
68
- return <T>this._asciiMap[charCode];
68
+ return this._asciiMap[charCode] as T;
69
69
  } else {
70
70
  return <T>(this._map.get(charCode) || this._defaultValue);
71
71
  }
@@ -1104,6 +1104,8 @@ export interface SourceControlGroupFeatures {
1104
1104
  export interface ScmRawResource {
1105
1105
  handle: number,
1106
1106
  sourceUri: UriComponents,
1107
+ multiDiffEditorOriginalUri?: UriComponents,
1108
+ multiDiffEditorModifiedUri?: UriComponents,
1107
1109
  icons: (IconUrl | ThemeIcon | undefined)[], /* icons: light, dark */
1108
1110
  tooltip: string,
1109
1111
  strikeThrough: boolean,
@@ -0,0 +1,66 @@
1
+ // *****************************************************************************
2
+ // Copyright (C) 2026 JuliaHub, Inc. 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
+
17
+ import { enableJSDOM } from '@theia/core/lib/browser/test/jsdom';
18
+ // HostedPluginSupport transitively imports browser widgets (Lumino) that touch `document` at load time.
19
+ const disableJSDOM = enableJSDOM();
20
+
21
+ import { FrontendApplicationConfigProvider } from '@theia/core/lib/browser/frontend-application-config-provider';
22
+ // Some transitively imported modules read the frontend config at load time.
23
+ FrontendApplicationConfigProvider.set({});
24
+
25
+ import { expect } from 'chai';
26
+ import { Disposable, DisposableCollection } from '@theia/core/lib/common';
27
+ import { Deferred } from '@theia/core/lib/common/promise-util';
28
+ import { FrontendApplicationState } from '@theia/core/lib/common/frontend-application-state';
29
+ import { HostedPluginSupport } from './hosted-plugin';
30
+
31
+ disableJSDOM();
32
+
33
+ describe('HostedPluginSupport - plugin view initialization', () => {
34
+
35
+ it('initializes plugin views once the application is ready, after the onDidInitializeLayout hooks', async () => {
36
+ const states = new Map<FrontendApplicationState, Deferred<void>>();
37
+ const reach = (state: FrontendApplicationState): Deferred<void> => {
38
+ if (!states.has(state)) {
39
+ states.set(state, new Deferred<void>());
40
+ }
41
+ return states.get(state)!;
42
+ };
43
+ const calls: string[] = [];
44
+ const support = new HostedPluginSupport();
45
+ Object.assign(support, {
46
+ appState: { reachedState: (state: FrontendApplicationState) => reach(state).promise },
47
+ viewRegistry: {
48
+ initWidgets: async () => { calls.push('initWidgets'); },
49
+ removeStaleWidgets: () => { calls.push('removeStaleWidgets'); }
50
+ },
51
+ workspaceTrustService: { refreshRestrictedModeIndicator: () => { } }
52
+ });
53
+ const flush = () => new Promise(resolve => setTimeout(resolve));
54
+
55
+ await (support as unknown as { afterLoadContributions(toDisconnect: DisposableCollection): Promise<void> })
56
+ .afterLoadContributions(new DisposableCollection(Disposable.NULL));
57
+ reach('initialized_layout').resolve();
58
+ await flush();
59
+ expect(calls).to.deep.equal([]);
60
+
61
+ reach('ready').resolve();
62
+ await flush();
63
+ expect(calls).to.deep.equal(['initWidgets', 'removeStaleWidgets']);
64
+ });
65
+
66
+ });
@@ -288,9 +288,11 @@ export class HostedPluginSupport extends AbstractHostedPluginSupport<PluginManag
288
288
  // must not run while the ShellLayoutRestorer still holds restored plugin view widgets, otherwise
289
289
  // removeStaleWidgets can dispose a restored view container mid-restore and abort the whole
290
290
  // layout restoration (see https://github.com/eclipse-theia/theia/issues/17770).
291
+ // Wait for `ready` rather than `initialized_layout`: only `ready` follows the onDidInitializeLayout
292
+ // hooks, and PluginViewRegistry's hook disposes the data widgets that initWidgets would prepare.
291
293
  // Deliberately not awaited: startPlugins runs after this hook and may register file system
292
294
  // providers the layout restoration depends on (see beforeLoadContributions).
293
- this.appState.reachedState('initialized_layout').then(async () => {
295
+ this.appState.reachedState('ready').then(async () => {
294
296
  if (toDisconnect.disposed) {
295
297
  return;
296
298
  }
@@ -14,9 +14,12 @@
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
16
 
17
- import * as http from 'http';
18
- import * as https from 'https';
19
- import * as tls from 'tls';
17
+ // Default imports resolve to the real Node module objects. With `esModuleInterop`, a namespace
18
+ // import (`import * as http`) is a read-only copy with getter-only properties, and the
19
+ // `Object.assign(http, …)` patches below would throw "Cannot set property … which has only a getter".
20
+ import http from 'http';
21
+ import https from 'https';
22
+ import tls from 'tls';
20
23
 
21
24
  import { createHttpPatch, createProxyResolver, createTlsPatch, ProxySupportSetting } from '@vscode/proxy-agent';
22
25
  import { PreferenceRegistryExtImpl } from '../../plugin/preference-registry';
@@ -16,7 +16,7 @@
16
16
 
17
17
  import * as path from 'path';
18
18
  import * as express from '@theia/core/shared/express';
19
- import * as escape_html from 'escape-html';
19
+ import escape_html from 'escape-html';
20
20
  import { realpath, stat } from 'fs/promises';
21
21
  import { ILogger } from '@theia/core';
22
22
  import { inject, injectable, optional, multiInject, named } from '@theia/core/shared/inversify';
@@ -0,0 +1,44 @@
1
+ // *****************************************************************************
2
+ // Copyright (C) 2026 EclipseSource GmbH 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
+
17
+ import { expect } from 'chai';
18
+ import { overridePluginDependencies } from './plugin-require-override';
19
+
20
+ describe('overridePluginDependencies', () => {
21
+
22
+ const nodeModule = require('module');
23
+ let originalLoad: unknown;
24
+
25
+ beforeEach(() => {
26
+ originalLoad = nodeModule._load;
27
+ });
28
+
29
+ afterEach(() => {
30
+ nodeModule._load = originalLoad;
31
+ });
32
+
33
+ it('should provide the real node-pty module for an unresolvable node-pty request', () => {
34
+ overridePluginDependencies();
35
+ const nodePty = require('/nonexistent/vscode/node_modules/node-pty');
36
+ expect(nodePty).to.equal(require('node-pty'));
37
+ expect(nodePty.spawn).to.be.a('function');
38
+ });
39
+
40
+ it('should rethrow for unresolvable requests without an override', () => {
41
+ overridePluginDependencies();
42
+ expect(() => require('/nonexistent/vscode/node_modules/unknown-package')).to.throw();
43
+ });
44
+ });
@@ -14,6 +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
+ // node-pty sets __esModule, so a namespace import already yields the real module object (a default import would be undefined).
17
18
  import * as nodePty from 'node-pty';
18
19
 
19
20
  const overrides = [
@@ -20,8 +20,8 @@
20
20
  // based on https://github.com/microsoft/vscode/blob/04c36be045a94fee58e5f8992d3e3fd980294a84/src/vs/workbench/api/browser/mainThreadFileSystem.ts
21
21
 
22
22
  /* eslint-disable max-len */
23
- /* eslint-disable @typescript-eslint/tslint/config */
24
23
  /* eslint-disable @typescript-eslint/no-explicit-any */
24
+ /* eslint-disable @theia/explicit-return-type */
25
25
 
26
26
  import { URI } from '@theia/core/shared/vscode-uri';
27
27
  import { interfaces } from '@theia/core/shared/inversify';
@@ -17,7 +17,10 @@
17
17
  /* eslint-disable @typescript-eslint/no-explicit-any */
18
18
 
19
19
  import { inject, injectable, optional, named } from '@theia/core/shared/inversify';
20
- import { MenuPath, CommandRegistry, Disposable, DisposableCollection, nls, CommandMenu, AcceleratorSource, ContextExpressionMatcher, environment, ILogger } from '@theia/core';
20
+ import {
21
+ MenuPath, CommandRegistry, Disposable, DisposableCollection, nls, CommandMenu, AcceleratorSource, AcceleratorForm,
22
+ ContextExpressionMatcher, ILogger
23
+ } from '@theia/core';
21
24
  import { MenuModelRegistry } from '@theia/core/lib/common';
22
25
  import { TabBarToolbarRegistry } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
23
26
  import { DeployedPlugin, IconUrl, Menu } from '../../../common';
@@ -137,18 +140,8 @@ export class MenusContributionPointHandler {
137
140
  run: (effeciveMenuPath: MenuPath, ...args: any[]): Promise<void> =>
138
141
  this.commandRegistry.executeCommand(command, ...this.pluginMenuCommandAdapter.getArgumentAdapter(effeciveMenuPath)(...args)),
139
142
  isToggled: (effectiveMenuPath: MenuPath) => false,
140
- getAccelerator: (context: HTMLElement | undefined): string[] => {
141
- const bindings = this.keybindingRegistry.getKeybindingsForCommand(command);
142
- // Only consider the first active keybinding.
143
- if (bindings.length) {
144
- const binding = bindings.find(b => this.keybindingRegistry.isEnabledInScope(b, context));
145
- if (binding) {
146
- const asciiOnly = environment.electron.is();
147
- return this.keybindingRegistry.acceleratorFor(binding, '+', asciiOnly);
148
- }
149
- }
150
- return [];
151
- }
143
+ getAccelerator: (context: HTMLElement | undefined, form: AcceleratorForm): string[] =>
144
+ this.keybindingRegistry.acceleratorForCommand(command, context, form)
152
145
  };
153
146
  toDispose.push(this.menuRegistry.registerCommandMenu(menuPath, action));
154
147
  });
@@ -73,10 +73,13 @@ interface KernelPreloadModule {
73
73
  export async function outputWebviewPreload(ctx: PreloadContext): Promise<void> {
74
74
  // workaround to allow rendering of links in outputs for non chromium browsers
75
75
  // see https://developer.mozilla.org/en-US/docs/Web/API/Trusted_Types_API#cross-browser_support_for_trusted_types
76
- if (!window.trustedTypes) {
77
- window.trustedTypes = {
76
+ const windowWithTrustedTypes = window as unknown as {
77
+ trustedTypes?: { createPolicy(name: string, rules: unknown): unknown };
78
+ };
79
+ if (!windowWithTrustedTypes.trustedTypes) {
80
+ windowWithTrustedTypes.trustedTypes = {
78
81
  createPolicy: (name: string, rules: unknown) => rules
79
- } as unknown as typeof window.trustedTypes;
82
+ };
80
83
  }
81
84
 
82
85
  const theia = acquireVsCodeApi();
@@ -87,12 +87,12 @@ export class PluginSharedStyle {
87
87
  selector: string;
88
88
  body: (theme: Theme) => string
89
89
  }): void {
90
- const sheet = (<CSSStyleSheet>this.style.sheet);
90
+ const sheet = this.style.sheet as CSSStyleSheet;
91
91
  const cssBody = body(this.themeService.getCurrentTheme());
92
92
  sheet.insertRule(selector + ' {\n' + cssBody + '\n}', 0);
93
93
  }
94
94
  deleteRule(selector: string): void {
95
- const sheet = (<CSSStyleSheet>this.style.sheet);
95
+ const sheet = this.style.sheet as CSSStyleSheet;
96
96
  const rules = sheet.rules || sheet.cssRules || [];
97
97
  for (let i = rules.length - 1; i >= 0; i--) {
98
98
  const rule = rules[i];
@@ -17,6 +17,9 @@
17
17
  import { expect } from 'chai';
18
18
  import { ScmService } from '@theia/scm/lib/browser/scm-service';
19
19
  import { ScmMainImpl } from './scm-main';
20
+ import { ScmRawResource } from '../../common/plugin-api-rpc';
21
+ import URI from '@theia/core/lib/common/uri';
22
+ import { URI as vscodeURI } from '@theia/core/shared/vscode-uri';
20
23
 
21
24
  interface ScmMainInternals {
22
25
  repositories: Map<number, unknown>;
@@ -53,6 +56,35 @@ describe('ScmMainImpl - cascade dispose of children on $unregisterSourceControl'
53
56
  impl = createScmMainImpl(scmService);
54
57
  });
55
58
 
59
+ it('revives multi-diff URI components and preserves absent added/deleted sides', async () => {
60
+ await impl.$registerSourceControl(1, 'git', 'Main', undefined);
61
+ impl.$registerGroups(1, [{ handle: 2, id: 'changes', label: 'Changes', features: { hideWhenEmpty: undefined, contextValue: undefined } }], []);
62
+ const sourceUri = vscodeURI.file('/repo/file.txt').toJSON();
63
+ const originalUri = vscodeURI.parse('git:/repo/file.txt?ref=HEAD#original').toJSON();
64
+ const modifiedUri = vscodeURI.parse('file:///repo/file.txt?working=true#modified').toJSON();
65
+ const raw: ScmRawResource = {
66
+ handle: 3, sourceUri, icons: [], tooltip: '', strikeThrough: false, faded: false, contextValue: '', command: undefined
67
+ };
68
+ impl.$spliceResourceStates(1, [{
69
+ handle: 2, splices: [{
70
+ start: 0, deleteCount: 0, rawResources: [
71
+ { ...raw, multiDiffEditorOriginalUri: originalUri },
72
+ { ...raw, handle: 4, multiDiffEditorModifiedUri: modifiedUri },
73
+ { ...raw, handle: 5 }
74
+ ]
75
+ }]
76
+ }]);
77
+ const resources = scmService.repositories[0].provider.groups[0].resources;
78
+ expect(resources[0].multiDiffEditorOriginalUri).to.be.instanceOf(URI);
79
+ expect(resources[0].multiDiffEditorOriginalUri?.toString()).to.equal(vscodeURI.revive(originalUri).toString());
80
+ expect(resources[0].multiDiffEditorModifiedUri).to.equal(undefined);
81
+ expect(resources[1].multiDiffEditorOriginalUri).to.equal(undefined);
82
+ expect(resources[1].multiDiffEditorModifiedUri).to.be.instanceOf(URI);
83
+ expect(resources[1].multiDiffEditorModifiedUri?.toString()).to.equal(vscodeURI.revive(modifiedUri).toString());
84
+ expect(resources[2].multiDiffEditorOriginalUri).to.equal(undefined);
85
+ expect(resources[2].multiDiffEditorModifiedUri).to.equal(undefined);
86
+ });
87
+
56
88
  it('should unregister worktree children when their parent is unregistered', async () => {
57
89
  // Parent
58
90
  await impl.$registerSourceControl(1, 'git', 'Main', { scheme: 'file', path: '/repo', authority: '', query: '', fragment: '' });
@@ -106,7 +106,9 @@ export class PluginScmResource implements ScmResource {
106
106
  readonly group: PluginScmResourceGroup,
107
107
  readonly decorations: ScmResourceDecorations,
108
108
  readonly contextValue: string | undefined,
109
- readonly command: ScmCommand | undefined
109
+ readonly command: ScmCommand | undefined,
110
+ readonly multiDiffEditorOriginalUri?: URI,
111
+ readonly multiDiffEditorModifiedUri?: URI
110
112
  ) { }
111
113
 
112
114
  open(): Promise<void> {
@@ -487,7 +489,9 @@ export class PluginScmProvider implements ScmProvider {
487
489
  group,
488
490
  decorations,
489
491
  contextValue || undefined,
490
- command
492
+ command,
493
+ rawResource.multiDiffEditorOriginalUri ? new URI(vscodeURI.revive(rawResource.multiDiffEditorOriginalUri)) : undefined,
494
+ rawResource.multiDiffEditorModifiedUri ? new URI(vscodeURI.revive(rawResource.multiDiffEditorModifiedUri)) : undefined
491
495
  );
492
496
  });
493
497
 
@@ -25,7 +25,7 @@ FrontendApplicationConfigProvider.set({});
25
25
  import { expect } from 'chai';
26
26
  import { Command, Disposable } from '@theia/core/lib/common';
27
27
  import { PluginViewRegistry, ViewContainerInfo, PLUGIN_VIEW_DATA_FACTORY_ID } from './plugin-view-registry';
28
- import type { ViewWelcome } from '../../../common';
28
+ import { PluginViewType, ViewWelcome } from '../../../common';
29
29
 
30
30
  disableJSDOM();
31
31
 
@@ -104,6 +104,8 @@ describe('PluginViewRegistry - view menu labels', () => {
104
104
 
105
105
  });
106
106
 
107
+ const welcome = (view: string): ViewWelcome => ({ view, content: `[Hi](command:${view}.hi)`, order: 0 });
108
+
107
109
  describe('PluginViewRegistry - welcome-only views', () => {
108
110
 
109
111
  interface FakeTreeViewWidget {
@@ -116,8 +118,6 @@ describe('PluginViewRegistry - welcome-only views', () => {
116
118
  let createdWidget: FakeTreeViewWidget;
117
119
  let getOrCreateCalls: Array<{ factoryId: string; options: unknown }>;
118
120
 
119
- const welcome = (view: string): ViewWelcome => ({ view, content: `[Hi](command:${view}.hi)`, order: 0 });
120
-
121
121
  const internals = (): {
122
122
  views: Map<string, [string, { type?: unknown }]>;
123
123
  viewDataProviders: Map<string, unknown>;
@@ -171,6 +171,137 @@ describe('PluginViewRegistry - welcome-only views', () => {
171
171
 
172
172
  });
173
173
 
174
+ describe('PluginViewRegistry - welcome-only views on expand', () => {
175
+
176
+ const noop = () => Disposable.NULL;
177
+
178
+ let registry: PluginViewRegistry;
179
+ let view: { widgets: unknown[] };
180
+ let prepared: unknown[];
181
+
182
+ const internals = (): {
183
+ views: Map<string, [string, { type?: unknown }]>;
184
+ viewDataProviders: Map<string, unknown>;
185
+ viewsWelcome: Map<string, ViewWelcome[]>;
186
+ onDidExpandViewEmitter: { fire(viewId: string): void };
187
+ init(): void;
188
+ } => registry as unknown as {
189
+ views: Map<string, [string, { type?: unknown }]>;
190
+ viewDataProviders: Map<string, unknown>;
191
+ viewsWelcome: Map<string, ViewWelcome[]>;
192
+ onDidExpandViewEmitter: { fire(viewId: string): void };
193
+ init(): void;
194
+ };
195
+
196
+ async function expand(viewId: string): Promise<void> {
197
+ internals().onDidExpandViewEmitter.fire(viewId);
198
+ await new Promise(resolve => setTimeout(resolve));
199
+ }
200
+
201
+ beforeEach(() => {
202
+ registry = new PluginViewRegistry();
203
+ view = { widgets: [] };
204
+ prepared = [];
205
+ Object.assign(registry, {
206
+ shell: { activeWidget: undefined, onDidChangeActiveWidget: noop, initialized: new Promise(() => { }) },
207
+ viewContextKeys: { focusedView: { reset: () => { } } },
208
+ contextKeyService: { onDidChange: noop },
209
+ widgetManager: { onWillCreateWidget: noop, onDidCreateWidget: noop, getWidget: async () => view },
210
+ prepareView: async (widget: unknown) => { prepared.push(widget); }
211
+ });
212
+ internals().init();
213
+ internals().views.set('actions', ['container', {}]);
214
+ internals().viewsWelcome.set('actions', [welcome('actions')]);
215
+ });
216
+
217
+ it('prepares an empty welcome-only view when it is expanded, as after restoring a saved layout', async () => {
218
+ await expand('actions');
219
+
220
+ expect(prepared).to.deep.equal([view]);
221
+ });
222
+
223
+ it('leaves a view with a data provider to the provider', async () => {
224
+ internals().viewDataProviders.set('actions', () => undefined);
225
+
226
+ await expand('actions');
227
+
228
+ expect(prepared).to.have.lengthOf(0);
229
+ });
230
+
231
+ it('leaves a view that already has content alone', async () => {
232
+ view.widgets.push({});
233
+
234
+ await expand('actions');
235
+
236
+ expect(prepared).to.have.lengthOf(0);
237
+ });
238
+
239
+ it('leaves a view without welcomes alone', async () => {
240
+ internals().viewsWelcome.delete('actions');
241
+
242
+ await expand('actions');
243
+
244
+ expect(prepared).to.have.lengthOf(0);
245
+ });
246
+
247
+ it('leaves a webview view alone', async () => {
248
+ internals().views.set('actions', ['container', { type: PluginViewType.Webview }]);
249
+
250
+ await expand('actions');
251
+
252
+ expect(prepared).to.have.lengthOf(0);
253
+ });
254
+
255
+ });
256
+
257
+ describe('PluginViewRegistry - prepareView', () => {
258
+
259
+ interface FakeViewWidget {
260
+ options: { viewId: string };
261
+ title: { label: string };
262
+ widgets: unknown[];
263
+ isDisposed: boolean;
264
+ addWidget(widget: unknown): void;
265
+ }
266
+
267
+ let registry: PluginViewRegistry;
268
+ let view: FakeViewWidget;
269
+ let dataWidget: { isDisposed: boolean; dispose(): void };
270
+
271
+ beforeEach(() => {
272
+ registry = new PluginViewRegistry();
273
+ view = {
274
+ options: { viewId: 'actions' },
275
+ title: { label: '' },
276
+ widgets: [],
277
+ isDisposed: false,
278
+ addWidget(widget: unknown): void {
279
+ this.widgets.push(widget);
280
+ }
281
+ };
282
+ dataWidget = { isDisposed: false, dispose: () => { } };
283
+ (registry as unknown as { views: Map<string, unknown> }).views.set('actions', ['container', { id: 'actions', name: 'Actions' }]);
284
+ (registry as unknown as { createViewDataWidget: unknown }).createViewDataWidget = async () => dataWidget;
285
+ });
286
+
287
+ const prepareView = (): Promise<void> => (registry as unknown as { prepareView(widget: FakeViewWidget): Promise<void> }).prepareView(view);
288
+
289
+ it('adds the created data widget to the view', async () => {
290
+ await prepareView();
291
+
292
+ expect(view.widgets).to.deep.equal([dataWidget]);
293
+ });
294
+
295
+ it('leaves the view empty when its data widget was disposed before it could be added', async () => {
296
+ dataWidget.isDisposed = true;
297
+
298
+ await prepareView();
299
+
300
+ expect(view.widgets).to.have.lengthOf(0);
301
+ });
302
+
303
+ });
304
+
174
305
  describe('PluginViewRegistry - VS Code view commands', () => {
175
306
 
176
307
  let registry: PluginViewRegistry;