@theia/plugin-ext 1.40.1 → 1.41.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 (292) hide show
  1. package/lib/common/collections.d.ts +4 -0
  2. package/lib/common/collections.d.ts.map +1 -1
  3. package/lib/common/collections.js +17 -1
  4. package/lib/common/collections.js.map +1 -1
  5. package/lib/common/errors.d.ts +14 -0
  6. package/lib/common/errors.d.ts.map +1 -1
  7. package/lib/common/errors.js +17 -1
  8. package/lib/common/errors.js.map +1 -1
  9. package/lib/common/plugin-api-rpc.d.ts +286 -6
  10. package/lib/common/plugin-api-rpc.d.ts.map +1 -1
  11. package/lib/common/plugin-api-rpc.js +20 -1
  12. package/lib/common/plugin-api-rpc.js.map +1 -1
  13. package/lib/common/plugin-protocol.d.ts +27 -5
  14. package/lib/common/plugin-protocol.d.ts.map +1 -1
  15. package/lib/common/plugin-protocol.js.map +1 -1
  16. package/lib/hosted/browser/hosted-plugin.d.ts +5 -2
  17. package/lib/hosted/browser/hosted-plugin.d.ts.map +1 -1
  18. package/lib/hosted/browser/hosted-plugin.js +21 -12
  19. package/lib/hosted/browser/hosted-plugin.js.map +1 -1
  20. package/lib/hosted/node/hosted-plugin-deployer-handler.js +1 -1
  21. package/lib/hosted/node/hosted-plugin-deployer-handler.js.map +1 -1
  22. package/lib/hosted/node/plugin-reader.d.ts +1 -1
  23. package/lib/hosted/node/plugin-reader.d.ts.map +1 -1
  24. package/lib/hosted/node/plugin-reader.js +1 -1
  25. package/lib/hosted/node/plugin-reader.js.map +1 -1
  26. package/lib/hosted/node/scanners/grammars-reader.d.ts +1 -1
  27. package/lib/hosted/node/scanners/grammars-reader.d.ts.map +1 -1
  28. package/lib/hosted/node/scanners/grammars-reader.js +5 -5
  29. package/lib/hosted/node/scanners/grammars-reader.js.map +1 -1
  30. package/lib/hosted/node/scanners/scanner-theia.d.ts +6 -6
  31. package/lib/hosted/node/scanners/scanner-theia.d.ts.map +1 -1
  32. package/lib/hosted/node/scanners/scanner-theia.js +54 -41
  33. package/lib/hosted/node/scanners/scanner-theia.js.map +1 -1
  34. package/lib/main/browser/custom-editors/custom-editor-widget.d.ts +1 -1
  35. package/lib/main/browser/custom-editors/custom-editor-widget.d.ts.map +1 -1
  36. package/lib/main/browser/custom-editors/custom-editor-widget.js +1 -1
  37. package/lib/main/browser/custom-editors/custom-editor-widget.js.map +1 -1
  38. package/lib/main/browser/custom-editors/custom-editors-main.d.ts +1 -1
  39. package/lib/main/browser/custom-editors/custom-editors-main.d.ts.map +1 -1
  40. package/lib/main/browser/custom-editors/custom-editors-main.js +1 -1
  41. package/lib/main/browser/custom-editors/custom-editors-main.js.map +1 -1
  42. package/lib/main/browser/editors-and-documents-main.d.ts.map +1 -1
  43. package/lib/main/browser/editors-and-documents-main.js +1 -0
  44. package/lib/main/browser/editors-and-documents-main.js.map +1 -1
  45. package/lib/main/browser/languages-main.d.ts.map +1 -1
  46. package/lib/main/browser/languages-main.js +6 -4
  47. package/lib/main/browser/languages-main.js.map +1 -1
  48. package/lib/main/browser/main-context.d.ts.map +1 -1
  49. package/lib/main/browser/main-context.js +18 -0
  50. package/lib/main/browser/main-context.js.map +1 -1
  51. package/lib/main/browser/menus/menus-contribution-handler.d.ts.map +1 -1
  52. package/lib/main/browser/menus/menus-contribution-handler.js +6 -3
  53. package/lib/main/browser/menus/menus-contribution-handler.js.map +1 -1
  54. package/lib/main/browser/notebooks/notebook-documents-and-editors-main.d.ts +50 -0
  55. package/lib/main/browser/notebooks/notebook-documents-and-editors-main.d.ts.map +1 -0
  56. package/lib/main/browser/notebooks/notebook-documents-and-editors-main.js +189 -0
  57. package/lib/main/browser/notebooks/notebook-documents-and-editors-main.js.map +1 -0
  58. package/lib/main/browser/notebooks/notebook-documents-main.d.ts +22 -0
  59. package/lib/main/browser/notebooks/notebook-documents-main.d.ts.map +1 -0
  60. package/lib/main/browser/notebooks/notebook-documents-main.js +133 -0
  61. package/lib/main/browser/notebooks/notebook-documents-main.js.map +1 -0
  62. package/lib/main/browser/notebooks/notebook-dto.d.ts +15 -0
  63. package/lib/main/browser/notebooks/notebook-dto.d.ts.map +1 -0
  64. package/lib/main/browser/notebooks/notebook-dto.js +138 -0
  65. package/lib/main/browser/notebooks/notebook-dto.js.map +1 -0
  66. package/lib/main/browser/notebooks/notebook-editors-main.d.ts +20 -0
  67. package/lib/main/browser/notebooks/notebook-editors-main.d.ts.map +1 -0
  68. package/lib/main/browser/notebooks/notebook-editors-main.js +58 -0
  69. package/lib/main/browser/notebooks/notebook-editors-main.js.map +1 -0
  70. package/lib/main/browser/notebooks/notebook-kernels-main.d.ts +42 -0
  71. package/lib/main/browser/notebooks/notebook-kernels-main.d.ts.map +1 -0
  72. package/lib/main/browser/notebooks/notebook-kernels-main.js +230 -0
  73. package/lib/main/browser/notebooks/notebook-kernels-main.js.map +1 -0
  74. package/lib/main/browser/notebooks/notebook-renderers-main.d.ts +12 -0
  75. package/lib/main/browser/notebooks/notebook-renderers-main.d.ts.map +1 -0
  76. package/lib/main/browser/notebooks/notebook-renderers-main.js +39 -0
  77. package/lib/main/browser/notebooks/notebook-renderers-main.js.map +1 -0
  78. package/lib/main/browser/notebooks/notebooks-main.d.ts +20 -0
  79. package/lib/main/browser/notebooks/notebooks-main.d.ts.map +1 -0
  80. package/lib/main/browser/notebooks/notebooks-main.js +103 -0
  81. package/lib/main/browser/notebooks/notebooks-main.js.map +1 -0
  82. package/lib/main/browser/notebooks/renderers/cell-output-webview.d.ts +35 -0
  83. package/lib/main/browser/notebooks/renderers/cell-output-webview.d.ts.map +1 -0
  84. package/lib/main/browser/notebooks/renderers/cell-output-webview.js +204 -0
  85. package/lib/main/browser/notebooks/renderers/cell-output-webview.js.map +1 -0
  86. package/lib/main/browser/notebooks/renderers/output-webview-internal.d.ts +13 -0
  87. package/lib/main/browser/notebooks/renderers/output-webview-internal.d.ts.map +1 -0
  88. package/lib/main/browser/notebooks/renderers/output-webview-internal.js +375 -0
  89. package/lib/main/browser/notebooks/renderers/output-webview-internal.js.map +1 -0
  90. package/lib/main/browser/notebooks/renderers/webview-communication.d.ts +52 -0
  91. package/lib/main/browser/notebooks/renderers/webview-communication.d.ts.map +1 -0
  92. package/{src/typings/index.d.ts → lib/main/browser/notebooks/renderers/webview-communication.js} +8 -11
  93. package/lib/main/browser/notebooks/renderers/webview-communication.js.map +1 -0
  94. package/lib/main/browser/plugin-contribution-handler.d.ts +3 -0
  95. package/lib/main/browser/plugin-contribution-handler.d.ts.map +1 -1
  96. package/lib/main/browser/plugin-contribution-handler.js +31 -3
  97. package/lib/main/browser/plugin-contribution-handler.js.map +1 -1
  98. package/lib/main/browser/plugin-ext-frontend-module.d.ts.map +1 -1
  99. package/lib/main/browser/plugin-ext-frontend-module.js +3 -2
  100. package/lib/main/browser/plugin-ext-frontend-module.js.map +1 -1
  101. package/lib/main/browser/plugin-icon-theme-service.d.ts.map +1 -1
  102. package/lib/main/browser/plugin-icon-theme-service.js +6 -0
  103. package/lib/main/browser/plugin-icon-theme-service.js.map +1 -1
  104. package/lib/main/browser/plugin-shared-style.d.ts.map +1 -1
  105. package/lib/main/browser/plugin-shared-style.js +2 -1
  106. package/lib/main/browser/plugin-shared-style.js.map +1 -1
  107. package/lib/main/browser/tasks-main.js +2 -2
  108. package/lib/main/browser/tasks-main.js.map +1 -1
  109. package/lib/main/browser/terminal-main.d.ts +2 -2
  110. package/lib/main/browser/terminal-main.d.ts.map +1 -1
  111. package/lib/main/browser/terminal-main.js +4 -4
  112. package/lib/main/browser/terminal-main.js.map +1 -1
  113. package/lib/main/browser/view/tree-view-widget.d.ts +3 -1
  114. package/lib/main/browser/view/tree-view-widget.d.ts.map +1 -1
  115. package/lib/main/browser/view/tree-view-widget.js +32 -1
  116. package/lib/main/browser/view/tree-view-widget.js.map +1 -1
  117. package/lib/main/browser/view/tree-views-main.d.ts +2 -1
  118. package/lib/main/browser/view/tree-views-main.d.ts.map +1 -1
  119. package/lib/main/browser/view/tree-views-main.js +10 -0
  120. package/lib/main/browser/view/tree-views-main.js.map +1 -1
  121. package/lib/main/browser/webview/webview.d.ts +1 -0
  122. package/lib/main/browser/webview/webview.d.ts.map +1 -1
  123. package/lib/main/browser/webview/webview.js +5 -0
  124. package/lib/main/browser/webview/webview.js.map +1 -1
  125. package/lib/main/node/errors.spec.d.ts +2 -0
  126. package/lib/main/node/errors.spec.d.ts.map +1 -0
  127. package/lib/main/node/errors.spec.js +36 -0
  128. package/lib/main/node/errors.spec.js.map +1 -0
  129. package/lib/main/node/handlers/plugin-theia-directory-handler.d.ts +5 -2
  130. package/lib/main/node/handlers/plugin-theia-directory-handler.d.ts.map +1 -1
  131. package/lib/main/node/handlers/plugin-theia-directory-handler.js +14 -8
  132. package/lib/main/node/handlers/plugin-theia-directory-handler.js.map +1 -1
  133. package/lib/main/node/handlers/plugin-theia-file-handler.d.ts +2 -1
  134. package/lib/main/node/handlers/plugin-theia-file-handler.d.ts.map +1 -1
  135. package/lib/main/node/handlers/plugin-theia-file-handler.js +13 -5
  136. package/lib/main/node/handlers/plugin-theia-file-handler.js.map +1 -1
  137. package/lib/main/node/paths/plugin-paths-service.d.ts.map +1 -1
  138. package/lib/main/node/paths/plugin-paths-service.js +4 -9
  139. package/lib/main/node/paths/plugin-paths-service.js.map +1 -1
  140. package/lib/main/node/plugin-deployer-directory-handler-context-impl.js +8 -8
  141. package/lib/main/node/plugin-deployer-directory-handler-context-impl.js.map +1 -1
  142. package/lib/main/node/plugin-deployer-entry-impl.d.ts +2 -2
  143. package/lib/main/node/plugin-deployer-entry-impl.d.ts.map +1 -1
  144. package/lib/main/node/plugin-deployer-entry-impl.js +9 -7
  145. package/lib/main/node/plugin-deployer-entry-impl.js.map +1 -1
  146. package/lib/main/node/plugin-deployer-impl.d.ts +2 -2
  147. package/lib/main/node/plugin-deployer-impl.d.ts.map +1 -1
  148. package/lib/main/node/plugin-deployer-impl.js +16 -24
  149. package/lib/main/node/plugin-deployer-impl.js.map +1 -1
  150. package/lib/main/node/plugin-deployer-proxy-entry-impl.d.ts +2 -2
  151. package/lib/main/node/plugin-deployer-proxy-entry-impl.d.ts.map +1 -1
  152. package/lib/main/node/plugin-github-resolver.d.ts.map +1 -1
  153. package/lib/main/node/plugin-github-resolver.js +14 -6
  154. package/lib/main/node/plugin-github-resolver.js.map +1 -1
  155. package/lib/main/node/plugin-http-resolver.d.ts.map +1 -1
  156. package/lib/main/node/plugin-http-resolver.js +14 -6
  157. package/lib/main/node/plugin-http-resolver.js.map +1 -1
  158. package/lib/main/node/temp-dir-util.d.ts +1 -0
  159. package/lib/main/node/temp-dir-util.d.ts.map +1 -1
  160. package/lib/main/node/temp-dir-util.js +12 -3
  161. package/lib/main/node/temp-dir-util.js.map +1 -1
  162. package/lib/plugin/editors-and-documents.d.ts +1 -1
  163. package/lib/plugin/editors-and-documents.d.ts.map +1 -1
  164. package/lib/plugin/editors-and-documents.js +1 -1
  165. package/lib/plugin/editors-and-documents.js.map +1 -1
  166. package/lib/plugin/notebook/notebook-document.d.ts +62 -0
  167. package/lib/plugin/notebook/notebook-document.d.ts.map +1 -0
  168. package/lib/plugin/notebook/notebook-document.js +373 -0
  169. package/lib/plugin/notebook/notebook-document.js.map +1 -0
  170. package/lib/plugin/notebook/notebook-documents.d.ts +17 -0
  171. package/lib/plugin/notebook/notebook-documents.d.ts.map +1 -0
  172. package/lib/plugin/notebook/notebook-documents.js +48 -0
  173. package/lib/plugin/notebook/notebook-documents.js.map +1 -0
  174. package/lib/plugin/notebook/notebook-editor.d.ts +21 -0
  175. package/lib/plugin/notebook/notebook-editor.d.ts.map +1 -0
  176. package/lib/plugin/notebook/notebook-editor.js +99 -0
  177. package/lib/plugin/notebook/notebook-editor.js.map +1 -0
  178. package/lib/plugin/notebook/notebook-editors.d.ts +14 -0
  179. package/lib/plugin/notebook/notebook-editors.d.ts.map +1 -0
  180. package/lib/plugin/notebook/notebook-editors.js +65 -0
  181. package/lib/plugin/notebook/notebook-editors.js.map +1 -0
  182. package/lib/plugin/notebook/notebook-kernels.d.ts +37 -0
  183. package/lib/plugin/notebook/notebook-kernels.d.ts.map +1 -0
  184. package/lib/plugin/notebook/notebook-kernels.js +516 -0
  185. package/lib/plugin/notebook/notebook-kernels.js.map +1 -0
  186. package/lib/plugin/notebook/notebook-renderers.d.ts +14 -0
  187. package/lib/plugin/notebook/notebook-renderers.d.ts.map +1 -0
  188. package/lib/plugin/notebook/notebook-renderers.js +63 -0
  189. package/lib/plugin/notebook/notebook-renderers.js.map +1 -0
  190. package/lib/plugin/notebook/notebooks.d.ts +57 -0
  191. package/lib/plugin/notebook/notebooks.d.ts.map +1 -0
  192. package/lib/plugin/notebook/notebooks.js +295 -0
  193. package/lib/plugin/notebook/notebooks.js.map +1 -0
  194. package/lib/plugin/plugin-context.d.ts +2 -2
  195. package/lib/plugin/plugin-context.d.ts.map +1 -1
  196. package/lib/plugin/plugin-context.js +79 -59
  197. package/lib/plugin/plugin-context.js.map +1 -1
  198. package/lib/plugin/plugin-manager.d.ts +2 -0
  199. package/lib/plugin/plugin-manager.d.ts.map +1 -1
  200. package/lib/plugin/plugin-manager.js +9 -1
  201. package/lib/plugin/plugin-manager.js.map +1 -1
  202. package/lib/plugin/tasks/task-provider.d.ts +2 -2
  203. package/lib/plugin/tasks/task-provider.d.ts.map +1 -1
  204. package/lib/plugin/tasks/task-provider.js +7 -10
  205. package/lib/plugin/tasks/task-provider.js.map +1 -1
  206. package/lib/plugin/tasks/tasks.d.ts +3 -2
  207. package/lib/plugin/tasks/tasks.d.ts.map +1 -1
  208. package/lib/plugin/tasks/tasks.js +18 -13
  209. package/lib/plugin/tasks/tasks.js.map +1 -1
  210. package/lib/plugin/terminal-ext.d.ts +3 -0
  211. package/lib/plugin/terminal-ext.d.ts.map +1 -1
  212. package/lib/plugin/terminal-ext.js +11 -1
  213. package/lib/plugin/terminal-ext.js.map +1 -1
  214. package/lib/plugin/tree/tree-views.d.ts +15 -5
  215. package/lib/plugin/tree/tree-views.d.ts.map +1 -1
  216. package/lib/plugin/tree/tree-views.js +52 -3
  217. package/lib/plugin/tree/tree-views.js.map +1 -1
  218. package/lib/plugin/type-converters.d.ts +60 -0
  219. package/lib/plugin/type-converters.d.ts.map +1 -1
  220. package/lib/plugin/type-converters.js +372 -13
  221. package/lib/plugin/type-converters.js.map +1 -1
  222. package/lib/plugin/types-impl.d.ts +68 -29
  223. package/lib/plugin/types-impl.d.ts.map +1 -1
  224. package/lib/plugin/types-impl.js +123 -44
  225. package/lib/plugin/types-impl.js.map +1 -1
  226. package/package.json +31 -29
  227. package/src/common/collections.ts +17 -0
  228. package/src/common/errors.ts +26 -0
  229. package/src/common/plugin-api-rpc.ts +340 -5
  230. package/src/common/plugin-protocol.ts +23 -5
  231. package/src/hosted/browser/hosted-plugin.ts +21 -14
  232. package/src/hosted/node/hosted-plugin-deployer-handler.ts +1 -1
  233. package/src/hosted/node/plugin-reader.ts +1 -1
  234. package/src/hosted/node/scanners/grammars-reader.ts +6 -5
  235. package/src/hosted/node/scanners/scanner-theia.ts +55 -41
  236. package/src/main/browser/custom-editors/custom-editor-widget.ts +1 -1
  237. package/src/main/browser/custom-editors/custom-editors-main.ts +1 -1
  238. package/src/main/browser/editors-and-documents-main.ts +1 -0
  239. package/src/main/browser/languages-main.ts +7 -4
  240. package/src/main/browser/main-context.ts +19 -0
  241. package/src/main/browser/menus/menus-contribution-handler.ts +7 -4
  242. package/src/main/browser/notebooks/notebook-documents-and-editors-main.ts +238 -0
  243. package/src/main/browser/notebooks/notebook-documents-main.ts +166 -0
  244. package/src/main/browser/notebooks/notebook-dto.ts +141 -0
  245. package/src/main/browser/notebooks/notebook-editors-main.ts +70 -0
  246. package/src/main/browser/notebooks/notebook-kernels-main.ts +291 -0
  247. package/src/main/browser/notebooks/notebook-renderers-main.ts +47 -0
  248. package/src/main/browser/notebooks/notebooks-main.ts +124 -0
  249. package/src/main/browser/notebooks/renderers/cell-output-webview.tsx +198 -0
  250. package/src/main/browser/notebooks/renderers/output-webview-internal.ts +476 -0
  251. package/src/main/browser/notebooks/renderers/webview-communication.ts +79 -0
  252. package/src/main/browser/plugin-contribution-handler.ts +36 -3
  253. package/src/main/browser/plugin-ext-frontend-module.ts +7 -3
  254. package/src/main/browser/plugin-icon-theme-service.ts +6 -0
  255. package/src/main/browser/plugin-shared-style.ts +2 -1
  256. package/src/main/browser/tasks-main.ts +4 -4
  257. package/src/main/browser/terminal-main.ts +5 -5
  258. package/src/main/browser/view/tree-view-widget.tsx +36 -2
  259. package/src/main/browser/view/tree-views-main.ts +8 -0
  260. package/src/main/browser/webview/webview.ts +6 -0
  261. package/src/main/node/errors.spec.ts +37 -0
  262. package/src/main/node/handlers/plugin-theia-directory-handler.ts +18 -8
  263. package/src/main/node/handlers/plugin-theia-file-handler.ts +18 -6
  264. package/src/main/node/paths/plugin-paths-service.ts +5 -10
  265. package/src/main/node/plugin-deployer-directory-handler-context-impl.ts +8 -8
  266. package/src/main/node/plugin-deployer-entry-impl.ts +9 -7
  267. package/src/main/node/plugin-deployer-impl.ts +20 -28
  268. package/src/main/node/plugin-deployer-proxy-entry-impl.ts +2 -2
  269. package/src/main/node/plugin-github-resolver.ts +15 -8
  270. package/src/main/node/plugin-http-resolver.ts +15 -8
  271. package/src/main/node/temp-dir-util.ts +11 -2
  272. package/src/plugin/editors-and-documents.ts +1 -1
  273. package/src/plugin/notebook/notebook-document.ts +438 -0
  274. package/src/plugin/notebook/notebook-documents.ts +58 -0
  275. package/src/plugin/notebook/notebook-editor.ts +116 -0
  276. package/src/plugin/notebook/notebook-editors.ts +71 -0
  277. package/src/plugin/notebook/notebook-kernels.ts +616 -0
  278. package/src/plugin/notebook/notebook-renderers.ts +72 -0
  279. package/src/plugin/notebook/notebooks.ts +385 -0
  280. package/src/plugin/plugin-context.ts +77 -70
  281. package/src/plugin/plugin-manager.ts +9 -1
  282. package/src/plugin/tasks/task-provider.ts +9 -12
  283. package/src/plugin/tasks/tasks.ts +18 -13
  284. package/src/plugin/terminal-ext.ts +13 -1
  285. package/src/plugin/tree/tree-views.ts +57 -7
  286. package/src/plugin/type-converters.ts +370 -12
  287. package/src/plugin/types-impl.ts +162 -58
  288. package/lib/main/browser/custom-editors/undo-redo-service.d.ts +0 -24
  289. package/lib/main/browser/custom-editors/undo-redo-service.d.ts.map +0 -1
  290. package/lib/main/browser/custom-editors/undo-redo-service.js +0 -111
  291. package/lib/main/browser/custom-editors/undo-redo-service.js.map +0 -1
  292. package/src/main/browser/custom-editors/undo-redo-service.ts +0 -120
@@ -69,6 +69,7 @@ import { LanguageService } from '@theia/monaco-editor-core/esm/vs/editor/common/
69
69
  import { Measurement, Stopwatch } from '@theia/core/lib/common';
70
70
  import { Uint8ArrayReadBuffer, Uint8ArrayWriteBuffer } from '@theia/core/lib/common/message-rpc/uint8-array-message-buffer';
71
71
  import { BasicChannel } from '@theia/core/lib/common/message-rpc/channel';
72
+ import { NotebookTypeRegistry, NotebookService } from '@theia/notebook/lib/browser';
72
73
 
73
74
  export type PluginHost = 'frontend' | string;
74
75
  export type DebugActivationEvent = 'onDebugResolve' | 'onDebugInitialConfigurations' | 'onDebugAdapterProtocolTracker' | 'onDebugDynamicConfigurations';
@@ -114,6 +115,9 @@ export class HostedPluginSupport {
114
115
  @inject(WorkspaceService)
115
116
  protected readonly workspaceService: WorkspaceService;
116
117
 
118
+ @inject(NotebookService)
119
+ protected readonly notebookService: NotebookService;
120
+
117
121
  @inject(CommandRegistry)
118
122
  protected readonly commands: CommandRegistry;
119
123
 
@@ -132,6 +136,9 @@ export class HostedPluginSupport {
132
136
  @inject(FrontendApplicationStateService)
133
137
  protected readonly appState: FrontendApplicationStateService;
134
138
 
139
+ @inject(NotebookTypeRegistry)
140
+ protected readonly notebookTypeRegistry: NotebookTypeRegistry;
141
+
135
142
  @inject(PluginViewRegistry)
136
143
  protected readonly viewRegistry: PluginViewRegistry;
137
144
 
@@ -216,6 +223,7 @@ export class HostedPluginSupport {
216
223
  this.taskResolverRegistry.onWillProvideTaskResolver(event => this.ensureTaskActivation(event));
217
224
  this.fileService.onWillActivateFileSystemProvider(event => this.ensureFileSystemActivation(event));
218
225
  this.customEditorRegistry.onWillOpenCustomEditor(event => this.activateByCustomEditor(event));
226
+ this.notebookService.onWillOpenNotebook(async event => this.activateByNotebook(event));
219
227
 
220
228
  this.widgets.onDidCreateWidget(({ factoryId, widget }) => {
221
229
  if ((factoryId === WebviewWidget.FACTORY_ID || factoryId === CustomEditorWidget.FACTORY_ID) && widget instanceof WebviewWidget) {
@@ -304,8 +312,6 @@ export class HostedPluginSupport {
304
312
  await this.startPlugins(contributionsByHost, toDisconnect);
305
313
 
306
314
  this.deferredDidStart.resolve();
307
-
308
- this.restoreWebviews();
309
315
  }
310
316
 
311
317
  /**
@@ -623,6 +629,10 @@ export class HostedPluginSupport {
623
629
  await this.activateByEvent(`onCustomEditor:${viewType}`);
624
630
  }
625
631
 
632
+ async activateByNotebook(viewType: string): Promise<void> {
633
+ await this.activateByEvent(`onNotebook:${viewType}`);
634
+ }
635
+
626
636
  activateByFileSystem(event: FileSystemProviderActivationEvent): Promise<void> {
627
637
  return this.activateByEvent(`onFileSystem:${event.scheme}`);
628
638
  }
@@ -757,7 +767,7 @@ export class HostedPluginSupport {
757
767
  return `${plugins} plugin${plugins === 1 ? '' : 's'}`;
758
768
  }
759
769
 
760
- protected readonly webviewsToRestore = new Set<WebviewWidget>();
770
+ protected readonly webviewsToRestore = new Map<string, WebviewWidget>();
761
771
  protected readonly webviewRevivers = new Map<string, (webview: WebviewWidget) => Promise<void>>();
762
772
 
763
773
  registerWebviewReviver(viewType: string, reviver: (webview: WebviewWidget) => Promise<void>): void {
@@ -765,6 +775,10 @@ export class HostedPluginSupport {
765
775
  throw new Error(`Reviver for ${viewType} already registered`);
766
776
  }
767
777
  this.webviewRevivers.set(viewType, reviver);
778
+
779
+ if (this.webviewsToRestore.has(viewType)) {
780
+ this.restoreWebview(this.webviewsToRestore.get(viewType) as WebviewWidget);
781
+ }
768
782
  }
769
783
 
770
784
  unregisterWebviewReviver(viewType: string): void {
@@ -785,21 +799,14 @@ export class HostedPluginSupport {
785
799
  }
786
800
 
787
801
  protected preserveWebview(webview: WebviewWidget): void {
788
- if (!this.webviewsToRestore.has(webview)) {
789
- this.webviewsToRestore.add(webview);
790
- webview.disposed.connect(() => this.webviewsToRestore.delete(webview));
791
- }
792
- }
793
-
794
- protected restoreWebviews(): void {
795
- for (const webview of this.webviewsToRestore) {
796
- this.restoreWebview(webview);
802
+ if (!this.webviewsToRestore.has(webview.viewType)) {
803
+ this.activateByEvent(`onWebviewPanel:${webview.viewType}`);
804
+ this.webviewsToRestore.set(webview.viewType, webview);
805
+ webview.disposed.connect(() => this.webviewsToRestore.delete(webview.viewType));
797
806
  }
798
- this.webviewsToRestore.clear();
799
807
  }
800
808
 
801
809
  protected async restoreWebview(webview: WebviewWidget): Promise<void> {
802
- await this.activateByEvent(`onWebviewPanel:${webview.viewType}`);
803
810
  const restore = this.webviewRevivers.get(webview.viewType);
804
811
  if (restore) {
805
812
  try {
@@ -173,7 +173,7 @@ export class HostedPluginDeployerHandler implements PluginDeployerHandler {
173
173
 
174
174
  const { type } = entry;
175
175
  const deployed: DeployedPlugin = { metadata, type };
176
- deployed.contributes = this.reader.readContribution(manifest);
176
+ deployed.contributes = await this.reader.readContribution(manifest);
177
177
  await this.localizationService.deployLocalizations(deployed);
178
178
  deployedPlugins.set(id, deployed);
179
179
  deployPlugin.debug(`Deployed ${entryPoint} plugin "${id}" from "${metadata.model.entryPoint[entryPoint] || pluginPath}"`);
@@ -118,7 +118,7 @@ export class HostedPluginReader implements BackendApplicationContribution {
118
118
  return pluginMetadata;
119
119
  }
120
120
 
121
- readContribution(plugin: PluginPackage): PluginContribution | undefined {
121
+ async readContribution(plugin: PluginPackage): Promise<PluginContribution | undefined> {
122
122
  const scanner = this.scanner.getScanner(plugin);
123
123
  return scanner.getContribution(plugin);
124
124
  }
@@ -22,10 +22,10 @@ import * as fs from '@theia/core/shared/fs-extra';
22
22
  @injectable()
23
23
  export class GrammarsReader {
24
24
 
25
- readGrammars(rawGrammars: PluginPackageGrammarsContribution[], pluginPath: string): GrammarsContribution[] {
25
+ async readGrammars(rawGrammars: PluginPackageGrammarsContribution[], pluginPath: string): Promise<GrammarsContribution[]> {
26
26
  const result = new Array<GrammarsContribution>();
27
27
  for (const rawGrammar of rawGrammars) {
28
- const grammar = this.readGrammar(rawGrammar, pluginPath);
28
+ const grammar = await this.readGrammar(rawGrammar, pluginPath);
29
29
  if (grammar) {
30
30
  result.push(grammar);
31
31
  }
@@ -34,13 +34,14 @@ export class GrammarsReader {
34
34
  return result;
35
35
  }
36
36
 
37
- private readGrammar(rawGrammar: PluginPackageGrammarsContribution, pluginPath: string): GrammarsContribution | undefined {
37
+ private async readGrammar(rawGrammar: PluginPackageGrammarsContribution, pluginPath: string): Promise<GrammarsContribution | undefined> {
38
38
  // TODO: validate inputs
39
39
  let grammar: string | object;
40
+
40
41
  if (rawGrammar.path.endsWith('json')) {
41
- grammar = fs.readJSONSync(path.resolve(pluginPath, rawGrammar.path));
42
+ grammar = await fs.readJSON(path.resolve(pluginPath, rawGrammar.path));
42
43
  } else {
43
- grammar = fs.readFileSync(path.resolve(pluginPath, rawGrammar.path), 'utf8');
44
+ grammar = await fs.readFile(path.resolve(pluginPath, rawGrammar.path), 'utf8');
44
45
  }
45
46
  return {
46
47
  language: rawGrammar.language,
@@ -62,11 +62,12 @@ import {
62
62
  PluginIdentifiers,
63
63
  TerminalProfile
64
64
  } from '../../../common/plugin-protocol';
65
- import * as fs from 'fs';
65
+ import { promises as fs } from 'fs';
66
66
  import * as path from 'path';
67
67
  import { isObject, isStringArray, RecursivePartial } from '@theia/core/lib/common/types';
68
68
  import { GrammarsReader } from './grammars-reader';
69
69
  import { CharacterPair } from '../../../common/plugin-api-rpc';
70
+ import { isENOENT } from '../../../common/errors';
70
71
  import * as jsoncparser from 'jsonc-parser';
71
72
  import { IJSONSchema } from '@theia/core/lib/common/json-schema';
72
73
  import { deepClone } from '@theia/core/lib/common/objects';
@@ -144,7 +145,7 @@ export class TheiaPluginScanner implements PluginScanner {
144
145
  return undefined;
145
146
  }
146
147
 
147
- getContribution(rawPlugin: PluginPackage): PluginContribution | undefined {
148
+ async getContribution(rawPlugin: PluginPackage): Promise<PluginContribution | undefined> {
148
149
  if (!rawPlugin.contributes && !rawPlugin.activationEvents) {
149
150
  return undefined;
150
151
  }
@@ -175,15 +176,6 @@ export class TheiaPluginScanner implements PluginScanner {
175
176
  const configurationDefaults = rawPlugin.contributes.configurationDefaults;
176
177
  contributions.configurationDefaults = PreferenceSchemaProperties.is(configurationDefaults) ? configurationDefaults : undefined;
177
178
 
178
- try {
179
- if (rawPlugin.contributes.languages) {
180
- const languages = this.readLanguages(rawPlugin.contributes.languages, rawPlugin.packagePath);
181
- contributions.languages = languages;
182
- }
183
- } catch (err) {
184
- console.error(`Could not read '${rawPlugin.name}' contribution 'languages'.`, rawPlugin.contributes.languages, err);
185
- }
186
-
187
179
  try {
188
180
  if (rawPlugin.contributes.submenus) {
189
181
  contributions.submenus = this.readSubmenus(rawPlugin.contributes.submenus, rawPlugin);
@@ -192,15 +184,6 @@ export class TheiaPluginScanner implements PluginScanner {
192
184
  console.error(`Could not read '${rawPlugin.name}' contribution 'submenus'.`, rawPlugin.contributes.submenus, err);
193
185
  }
194
186
 
195
- try {
196
- if (rawPlugin.contributes.grammars) {
197
- const grammars = this.grammarsReader.readGrammars(rawPlugin.contributes.grammars, rawPlugin.packagePath);
198
- contributions.grammars = grammars;
199
- }
200
- } catch (err) {
201
- console.error(`Could not read '${rawPlugin.name}' contribution 'grammars'.`, rawPlugin.contributes.grammars, err);
202
- }
203
-
204
187
  try {
205
188
  if (rawPlugin.contributes.customEditors) {
206
189
  const customEditors = this.readCustomEditors(rawPlugin.contributes.customEditors);
@@ -330,6 +313,12 @@ export class TheiaPluginScanner implements PluginScanner {
330
313
  console.error(`Could not read '${rawPlugin.name}' contribution 'notebooks'.`, rawPlugin.contributes.authentication, err);
331
314
  }
332
315
 
316
+ try {
317
+ contributions.notebookRenderer = rawPlugin.contributes.notebookRenderer;
318
+ } catch (err) {
319
+ console.error(`Could not read '${rawPlugin.name}' contribution 'notebooks'.`, rawPlugin.contributes.authentication, err);
320
+ }
321
+
333
322
  try {
334
323
  contributions.snippets = this.readSnippets(rawPlugin);
335
324
  } catch (err) {
@@ -354,18 +343,40 @@ export class TheiaPluginScanner implements PluginScanner {
354
343
  console.error(`Could not read '${rawPlugin.name}' contribution 'colors'.`, rawPlugin.contributes.colors, err);
355
344
  }
356
345
 
357
- try {
358
- contributions.localizations = this.readLocalizations(rawPlugin);
359
- } catch (err) {
360
- console.error(`Could not read '${rawPlugin.name}' contribution 'localizations'.`, rawPlugin.contributes.colors, err);
361
- }
362
-
363
346
  try {
364
347
  contributions.terminalProfiles = this.readTerminals(rawPlugin);
365
348
  } catch (err) {
366
349
  console.error(`Could not read '${rawPlugin.name}' contribution 'terminals'.`, rawPlugin.contributes.terminal, err);
367
350
  }
368
351
 
352
+ const [localizationsResult, languagesResult, grammarsResult] = await Promise.allSettled([
353
+ this.readLocalizations(rawPlugin),
354
+ rawPlugin.contributes.languages ? this.readLanguages(rawPlugin.contributes.languages, rawPlugin.packagePath) : undefined,
355
+ rawPlugin.contributes.grammars ? this.grammarsReader.readGrammars(rawPlugin.contributes.grammars, rawPlugin.packagePath) : undefined
356
+ ]);
357
+
358
+ if (localizationsResult.status === 'fulfilled') {
359
+ contributions.localizations = localizationsResult.value;
360
+ } else {
361
+ console.error(`Could not read '${rawPlugin.name}' contribution 'localizations'.`, rawPlugin.contributes.localizations, localizationsResult.reason);
362
+ }
363
+
364
+ if (rawPlugin.contributes.languages) {
365
+ if (languagesResult.status === 'fulfilled') {
366
+ contributions.languages = languagesResult.value;
367
+ } else {
368
+ console.error(`Could not read '${rawPlugin.name}' contribution 'languages'.`, rawPlugin.contributes.languages, languagesResult.reason);
369
+ }
370
+ }
371
+
372
+ if (rawPlugin.contributes.grammars) {
373
+ if (grammarsResult.status === 'fulfilled') {
374
+ contributions.grammars = grammarsResult.value;
375
+ } else {
376
+ console.error(`Could not read '${rawPlugin.name}' contribution 'grammars'.`, rawPlugin.contributes.grammars, grammarsResult.reason);
377
+ }
378
+ }
379
+
369
380
  return contributions;
370
381
  }
371
382
 
@@ -376,26 +387,26 @@ export class TheiaPluginScanner implements PluginScanner {
376
387
  return pck.contributes.terminal.profiles.filter(profile => profile.id && profile.title);
377
388
  }
378
389
 
379
- protected readLocalizations(pck: PluginPackage): Localization[] | undefined {
390
+ protected async readLocalizations(pck: PluginPackage): Promise<Localization[] | undefined> {
380
391
  if (!pck.contributes || !pck.contributes.localizations) {
381
392
  return undefined;
382
393
  }
383
- return pck.contributes.localizations.map(e => this.readLocalization(e, pck.packagePath));
394
+ return Promise.all(pck.contributes.localizations.map(e => this.readLocalization(e, pck.packagePath)));
384
395
  }
385
396
 
386
- protected readLocalization({ languageId, languageName, localizedLanguageName, translations }: PluginPackageLocalization, pluginPath: string): Localization {
397
+ protected async readLocalization({ languageId, languageName, localizedLanguageName, translations }: PluginPackageLocalization, pluginPath: string): Promise<Localization> {
387
398
  const local: Localization = {
388
399
  languageId,
389
400
  languageName,
390
401
  localizedLanguageName,
391
402
  translations: []
392
403
  };
393
- local.translations = translations.map(e => this.readTranslation(e, pluginPath));
404
+ local.translations = await Promise.all(translations.map(e => this.readTranslation(e, pluginPath)));
394
405
  return local;
395
406
  }
396
407
 
397
- protected readTranslation(packageTranslation: PluginPackageTranslation, pluginPath: string): Translation {
398
- const translation = this.readJson<Translation>(path.resolve(pluginPath, packageTranslation.path));
408
+ protected async readTranslation(packageTranslation: PluginPackageTranslation, pluginPath: string): Promise<Translation> {
409
+ const translation = await this.readJson<Translation>(path.resolve(pluginPath, packageTranslation.path));
399
410
  if (!translation) {
400
411
  throw new Error(`Could not read json file '${packageTranslation.path}'.`);
401
412
  }
@@ -529,15 +540,18 @@ export class TheiaPluginScanner implements PluginScanner {
529
540
  return result;
530
541
  }
531
542
 
532
- protected readJson<T>(filePath: string): T | undefined {
533
- const content = this.readFileSync(filePath);
543
+ protected async readJson<T>(filePath: string): Promise<T | undefined> {
544
+ const content = await this.readFile(filePath);
534
545
  return content ? jsoncparser.parse(content, undefined, { disallowComments: false }) : undefined;
535
546
  }
536
- protected readFileSync(filePath: string): string {
547
+ protected async readFile(filePath: string): Promise<string> {
537
548
  try {
538
- return fs.existsSync(filePath) ? fs.readFileSync(filePath, 'utf8') : '';
549
+ const content = await fs.readFile(filePath, { encoding: 'utf8' });
550
+ return content;
539
551
  } catch (e) {
540
- console.error(e);
552
+ if (!isENOENT(e)) {
553
+ console.error(e);
554
+ }
541
555
  return '';
542
556
  }
543
557
  }
@@ -644,8 +658,8 @@ export class TheiaPluginScanner implements PluginScanner {
644
658
  return result;
645
659
  }
646
660
 
647
- private readLanguages(rawLanguages: PluginPackageLanguageContribution[], pluginPath: string): LanguageContribution[] {
648
- return rawLanguages.map(language => this.readLanguage(language, pluginPath));
661
+ private async readLanguages(rawLanguages: PluginPackageLanguageContribution[], pluginPath: string): Promise<LanguageContribution[]> {
662
+ return Promise.all(rawLanguages.map(language => this.readLanguage(language, pluginPath)));
649
663
  }
650
664
 
651
665
  private readSubmenus(rawSubmenus: PluginPackageSubmenu[], plugin: PluginPackage): Submenu[] {
@@ -662,7 +676,7 @@ export class TheiaPluginScanner implements PluginScanner {
662
676
 
663
677
  }
664
678
 
665
- private readLanguage(rawLang: PluginPackageLanguageContribution, pluginPath: string): LanguageContribution {
679
+ private async readLanguage(rawLang: PluginPackageLanguageContribution, pluginPath: string): Promise<LanguageContribution> {
666
680
  // TODO: add validation to all parameters
667
681
  const result: LanguageContribution = {
668
682
  id: rawLang.id,
@@ -674,7 +688,7 @@ export class TheiaPluginScanner implements PluginScanner {
674
688
  mimetypes: rawLang.mimetypes
675
689
  };
676
690
  if (rawLang.configuration) {
677
- const rawConfiguration = this.readJson<PluginPackageLanguageContributionConfiguration>(path.resolve(pluginPath, rawLang.configuration));
691
+ const rawConfiguration = await this.readJson<PluginPackageLanguageContributionConfiguration>(path.resolve(pluginPath, rawLang.configuration));
678
692
  if (rawConfiguration) {
679
693
  const configuration: LanguageConfiguration = {
680
694
  brackets: rawConfiguration.brackets,
@@ -21,7 +21,7 @@ import { ApplicationShell, NavigatableWidget, Saveable, SaveableSource, SaveOpti
21
21
  import { SaveResourceService } from '@theia/core/lib/browser/save-resource-service';
22
22
  import { Reference } from '@theia/core/lib/common/reference';
23
23
  import { WebviewWidget } from '../webview/webview';
24
- import { UndoRedoService } from './undo-redo-service';
24
+ import { UndoRedoService } from '@theia/editor/lib/browser/undo-redo-service';
25
25
  import { CustomEditorModel } from './custom-editors-main';
26
26
 
27
27
  @injectable()
@@ -36,7 +36,7 @@ import { MonacoEditorModel } from '@theia/monaco/lib/browser/monaco-editor-model
36
36
  import { EditorModelService } from '../text-editor-model-service';
37
37
  import { CustomEditorService } from './custom-editor-service';
38
38
  import { FileService } from '@theia/filesystem/lib/browser/file-service';
39
- import { UndoRedoService } from './undo-redo-service';
39
+ import { UndoRedoService } from '@theia/editor/lib/browser/undo-redo-service';
40
40
  import { WebviewsMainImpl } from '../webviews-main';
41
41
  import { WidgetManager } from '@theia/core/lib/browser/widget-manager';
42
42
  import { ApplicationShell, DefaultUriLabelProviderContribution, Saveable, SaveOptions, WidgetOpenerOptions } from '@theia/core/lib/browser';
@@ -139,6 +139,7 @@ export class EditorsAndDocumentsMain implements Disposable {
139
139
  uri: model.textEditorModel.uri,
140
140
  versionId: model.textEditorModel.getVersionId(),
141
141
  lines: model.textEditorModel.getLinesContent(),
142
+ languageId: model.getLanguageId(),
142
143
  EOL: model.textEditorModel.getEOL(),
143
144
  modeId: model.languageId,
144
145
  isDirty: model.dirty
@@ -32,6 +32,7 @@ import {
32
32
  LanguagesExt,
33
33
  WorkspaceEditDto,
34
34
  WorkspaceTextEditDto,
35
+ WorkspaceFileEditDto,
35
36
  PluginInfo,
36
37
  LanguageStatus as LanguageStatusDTO,
37
38
  InlayHintDto,
@@ -1418,13 +1419,15 @@ export function toMonacoWorkspaceEdit(data: WorkspaceEditDto | undefined): monac
1418
1419
  metadata: edit.metadata
1419
1420
  };
1420
1421
  } else {
1422
+ const fileEdit = edit as WorkspaceFileEditDto;
1421
1423
  return <monaco.languages.IWorkspaceFileEdit>{
1422
- newResource: monaco.Uri.revive(edit.newResource),
1423
- oldResource: monaco.Uri.revive(edit.oldResource),
1424
- options: edit.options,
1425
- metadata: edit.metadata
1424
+ newResource: monaco.Uri.revive(fileEdit.newResource),
1425
+ oldResource: monaco.Uri.revive(fileEdit.oldResource),
1426
+ options: fileEdit.options,
1427
+ metadata: fileEdit.metadata
1426
1428
  };
1427
1429
  }
1430
+ // TODO implement WorkspaceNotebookCellEditDto
1428
1431
  })
1429
1432
  };
1430
1433
  }
@@ -59,7 +59,15 @@ import { MonacoLanguages } from '@theia/monaco/lib/browser/monaco-languages';
59
59
  import { UntitledResourceResolver } from '@theia/core/lib/common/resource';
60
60
  import { ThemeService } from '@theia/core/lib/browser/theming';
61
61
  import { TabsMainImpl } from './tabs/tabs-main';
62
+ import { NotebooksMainImpl } from './notebooks/notebooks-main';
63
+ import { NotebookService } from '@theia/notebook/lib/browser';
62
64
  import { LocalizationMainImpl } from './localization-main';
65
+ import { NotebookRenderersMainImpl } from './notebooks/notebook-renderers-main';
66
+ import { HostedPluginSupport } from '../../hosted/browser/hosted-plugin';
67
+ import { NotebookEditorsMainImpl } from './notebooks/notebook-editors-main';
68
+ import { NotebookDocumentsMainImpl } from './notebooks/notebook-documents-main';
69
+ import { NotebookKernelsMainImpl } from './notebooks/notebook-kernels-main';
70
+ import { NotebooksAndEditorsMain } from './notebooks/notebook-documents-and-editors-main';
63
71
 
64
72
  export function setUpPluginApi(rpc: RPCProtocol, container: interfaces.Container): void {
65
73
  const authenticationMain = new AuthenticationMainImpl(rpc, container);
@@ -94,6 +102,17 @@ export function setUpPluginApi(rpc: RPCProtocol, container: interfaces.Container
94
102
  const documentsMain = new DocumentsMainImpl(editorsAndDocuments, modelService, rpc, editorManager, openerService, shell, untitledResourceResolver, languageService);
95
103
  rpc.set(PLUGIN_RPC_CONTEXT.DOCUMENTS_MAIN, documentsMain);
96
104
 
105
+ const notebookService = container.get(NotebookService);
106
+ const pluginSupport = container.get(HostedPluginSupport);
107
+ rpc.set(PLUGIN_RPC_CONTEXT.NOTEBOOKS_MAIN, new NotebooksMainImpl(rpc, notebookService, pluginSupport));
108
+ rpc.set(PLUGIN_RPC_CONTEXT.NOTEBOOK_RENDERERS_MAIN, new NotebookRenderersMainImpl(rpc, container));
109
+ const notebookEditorsMain = new NotebookEditorsMainImpl(rpc, container);
110
+ rpc.set(PLUGIN_RPC_CONTEXT.NOTEBOOK_EDITORS_MAIN, notebookEditorsMain);
111
+ const notebookDocumentsMain = new NotebookDocumentsMainImpl(rpc, container);
112
+ rpc.set(PLUGIN_RPC_CONTEXT.NOTEBOOK_DOCUMENTS_MAIN, notebookDocumentsMain);
113
+ rpc.set(PLUGIN_RPC_CONTEXT.NOTEBOOK_DOCUMENTS_AND_EDITORS_MAIN, new NotebooksAndEditorsMain(rpc, container, notebookDocumentsMain, notebookEditorsMain));
114
+ rpc.set(PLUGIN_RPC_CONTEXT.NOTEBOOK_KERNELS_MAIN, new NotebookKernelsMainImpl(rpc, container));
115
+
97
116
  const bulkEditService = container.get(MonacoBulkEditService);
98
117
  const monacoEditorService = container.get(MonacoEditorService);
99
118
  const editorsMain = new TextEditorsMainImpl(editorsAndDocuments, documentsMain, rpc, bulkEditService, monacoEditorService);
@@ -17,12 +17,11 @@
17
17
  /* eslint-disable @typescript-eslint/no-explicit-any */
18
18
 
19
19
  import { inject, injectable, optional } from '@theia/core/shared/inversify';
20
- import { MenuPath, CommandRegistry, Disposable, DisposableCollection, ActionMenuNode, MenuCommandAdapterRegistry, Emitter } from '@theia/core';
20
+ import { MenuPath, CommandRegistry, Disposable, DisposableCollection, ActionMenuNode, MenuCommandAdapterRegistry, Emitter, nls } from '@theia/core';
21
21
  import { MenuModelRegistry } from '@theia/core/lib/common';
22
22
  import { TabBarToolbarRegistry } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
23
23
  import { DeployedPlugin, IconUrl, Menu } from '../../../common';
24
24
  import { ScmWidget } from '@theia/scm/lib/browser/scm-widget';
25
- import { PluginViewWidget } from '../view/plugin-view-widget';
26
25
  import { QuickCommandService } from '@theia/core/lib/browser';
27
26
  import {
28
27
  CodeEditorWidgetUtil, codeToTheiaMappings, ContributionPoint,
@@ -56,9 +55,13 @@ export class MenusContributionPointHandler {
56
55
  this.initialized = true;
57
56
  this.commandAdapterRegistry.registerAdapter(this.commandAdapter);
58
57
  this.tabBarToolbar.registerMenuDelegate(PLUGIN_EDITOR_TITLE_MENU, widget => this.codeEditorWidgetUtil.is(widget));
59
- this.tabBarToolbar.registerMenuDelegate(PLUGIN_EDITOR_TITLE_RUN_MENU, widget => this.codeEditorWidgetUtil.is(widget));
58
+ this.tabBarToolbar.registerItem({
59
+ id: this.tabBarToolbar.toElementId(PLUGIN_EDITOR_TITLE_RUN_MENU), menuPath: PLUGIN_EDITOR_TITLE_RUN_MENU,
60
+ icon: 'debug-alt', text: nls.localizeByDefault('Run or Debug...'),
61
+ command: '', group: 'navigation', isVisible: widget => this.codeEditorWidgetUtil.is(widget)
62
+ });
60
63
  this.tabBarToolbar.registerMenuDelegate(PLUGIN_SCM_TITLE_MENU, widget => widget instanceof ScmWidget);
61
- this.tabBarToolbar.registerMenuDelegate(PLUGIN_VIEW_TITLE_MENU, widget => widget instanceof PluginViewWidget);
64
+ this.tabBarToolbar.registerMenuDelegate(PLUGIN_VIEW_TITLE_MENU, widget => !this.codeEditorWidgetUtil.is(widget));
62
65
  this.tabBarToolbar.registerItem({ id: 'plugin-menu-contribution-title-contribution', command: '_never_', onDidChange: this.onDidChangeTitleContributionEmitter.event });
63
66
  this.contextKeyService.onDidChange(event => {
64
67
  if (event.affects(this.titleContributionContextKeys)) {