@theia/plugin-ext 1.53.2 → 1.55.0-next.14

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 (310) hide show
  1. package/lib/common/plugin-api-rpc-model.d.ts +10 -1
  2. package/lib/common/plugin-api-rpc-model.d.ts.map +1 -1
  3. package/lib/common/plugin-api-rpc-model.js.map +1 -1
  4. package/lib/common/plugin-api-rpc.d.ts +7 -6
  5. package/lib/common/plugin-api-rpc.d.ts.map +1 -1
  6. package/lib/common/plugin-api-rpc.js.map +1 -1
  7. package/lib/common/test-types.d.ts +11 -1
  8. package/lib/common/test-types.d.ts.map +1 -1
  9. package/lib/common/test-types.js +9 -1
  10. package/lib/common/test-types.js.map +1 -1
  11. package/lib/main/browser/authentication-main.d.ts +6 -6
  12. package/lib/main/browser/authentication-main.d.ts.map +1 -1
  13. package/lib/main/browser/authentication-main.js +15 -9
  14. package/lib/main/browser/authentication-main.js.map +1 -1
  15. package/lib/main/browser/command-registry-main.d.ts +0 -1
  16. package/lib/main/browser/command-registry-main.d.ts.map +1 -1
  17. package/lib/main/browser/custom-editors/custom-editor-opener.d.ts +5 -3
  18. package/lib/main/browser/custom-editors/custom-editor-opener.d.ts.map +1 -1
  19. package/lib/main/browser/custom-editors/custom-editor-opener.js +16 -3
  20. package/lib/main/browser/custom-editors/custom-editor-opener.js.map +1 -1
  21. package/lib/main/browser/custom-editors/custom-editors-main.d.ts +0 -1
  22. package/lib/main/browser/custom-editors/custom-editors-main.d.ts.map +1 -1
  23. package/lib/main/browser/custom-editors/plugin-custom-editor-registry.d.ts +2 -1
  24. package/lib/main/browser/custom-editors/plugin-custom-editor-registry.d.ts.map +1 -1
  25. package/lib/main/browser/custom-editors/plugin-custom-editor-registry.js +6 -2
  26. package/lib/main/browser/custom-editors/plugin-custom-editor-registry.js.map +1 -1
  27. package/lib/main/browser/debug/plugin-debug-service.d.ts +0 -1
  28. package/lib/main/browser/debug/plugin-debug-service.d.ts.map +1 -1
  29. package/lib/main/browser/editors-and-documents-main.d.ts.map +1 -1
  30. package/lib/main/browser/editors-and-documents-main.js +17 -2
  31. package/lib/main/browser/editors-and-documents-main.js.map +1 -1
  32. package/lib/main/browser/languages-main.d.ts +0 -1
  33. package/lib/main/browser/languages-main.d.ts.map +1 -1
  34. package/lib/main/browser/menus/plugin-menu-command-adapter.d.ts.map +1 -1
  35. package/lib/main/browser/menus/plugin-menu-command-adapter.js +2 -2
  36. package/lib/main/browser/menus/plugin-menu-command-adapter.js.map +1 -1
  37. package/lib/main/browser/notebooks/notebook-documents-and-editors-main.d.ts.map +1 -1
  38. package/lib/main/browser/notebooks/notebook-documents-and-editors-main.js +10 -7
  39. package/lib/main/browser/notebooks/notebook-documents-and-editors-main.js.map +1 -1
  40. package/lib/main/browser/notebooks/notebooks-main.d.ts +0 -1
  41. package/lib/main/browser/notebooks/notebooks-main.d.ts.map +1 -1
  42. package/lib/main/browser/notebooks/renderers/cell-output-webview.d.ts +22 -12
  43. package/lib/main/browser/notebooks/renderers/cell-output-webview.d.ts.map +1 -1
  44. package/lib/main/browser/notebooks/renderers/cell-output-webview.js +145 -74
  45. package/lib/main/browser/notebooks/renderers/cell-output-webview.js.map +1 -1
  46. package/lib/main/browser/notebooks/renderers/output-webview-internal.d.ts.map +1 -1
  47. package/lib/main/browser/notebooks/renderers/output-webview-internal.js +198 -69
  48. package/lib/main/browser/notebooks/renderers/output-webview-internal.js.map +1 -1
  49. package/lib/main/browser/notebooks/renderers/webview-communication.d.ts +56 -6
  50. package/lib/main/browser/notebooks/renderers/webview-communication.d.ts.map +1 -1
  51. package/lib/main/browser/plugin-ext-frontend-module.d.ts.map +1 -1
  52. package/lib/main/browser/plugin-ext-frontend-module.js +2 -1
  53. package/lib/main/browser/plugin-ext-frontend-module.js.map +1 -1
  54. package/lib/main/browser/quick-open-main.d.ts +0 -1
  55. package/lib/main/browser/quick-open-main.d.ts.map +1 -1
  56. package/lib/main/browser/tabs/tabs-main.d.ts +1 -1
  57. package/lib/main/browser/tabs/tabs-main.d.ts.map +1 -1
  58. package/lib/main/browser/tabs/tabs-main.js +1 -1
  59. package/lib/main/browser/tabs/tabs-main.js.map +1 -1
  60. package/lib/main/browser/terminal-main.d.ts +0 -1
  61. package/lib/main/browser/terminal-main.d.ts.map +1 -1
  62. package/lib/main/browser/test-main.d.ts.map +1 -1
  63. package/lib/main/browser/test-main.js.map +1 -1
  64. package/lib/main/browser/text-editor-main.d.ts +6 -3
  65. package/lib/main/browser/text-editor-main.d.ts.map +1 -1
  66. package/lib/main/browser/text-editor-main.js +39 -5
  67. package/lib/main/browser/text-editor-main.js.map +1 -1
  68. package/lib/main/browser/view/tree-view-decorator-service.d.ts +0 -1
  69. package/lib/main/browser/view/tree-view-decorator-service.d.ts.map +1 -1
  70. package/lib/main/browser/view/tree-view-widget.d.ts +0 -1
  71. package/lib/main/browser/view/tree-view-widget.d.ts.map +1 -1
  72. package/lib/main/browser/view/tree-views-main.d.ts +0 -1
  73. package/lib/main/browser/view/tree-views-main.d.ts.map +1 -1
  74. package/lib/main/browser/webview/webview.d.ts +0 -1
  75. package/lib/main/browser/webview/webview.d.ts.map +1 -1
  76. package/lib/main/browser/webview-views/webview-views-main.d.ts +0 -1
  77. package/lib/main/browser/webview-views/webview-views-main.d.ts.map +1 -1
  78. package/lib/main/browser/webviews-main.d.ts +0 -1
  79. package/lib/main/browser/webviews-main.d.ts.map +1 -1
  80. package/lib/main/browser/workspace-main.d.ts +0 -1
  81. package/lib/main/browser/workspace-main.d.ts.map +1 -1
  82. package/lib/plugin/authentication-ext.d.ts +3 -3
  83. package/lib/plugin/authentication-ext.d.ts.map +1 -1
  84. package/lib/plugin/authentication-ext.js +8 -5
  85. package/lib/plugin/authentication-ext.js.map +1 -1
  86. package/lib/plugin/clipboard-ext.d.ts +0 -1
  87. package/lib/plugin/clipboard-ext.d.ts.map +1 -1
  88. package/lib/plugin/command-registry.d.ts +0 -1
  89. package/lib/plugin/command-registry.d.ts.map +1 -1
  90. package/lib/plugin/comments.d.ts +0 -1
  91. package/lib/plugin/comments.d.ts.map +1 -1
  92. package/lib/plugin/custom-editors.d.ts +0 -1
  93. package/lib/plugin/custom-editors.d.ts.map +1 -1
  94. package/lib/plugin/debug/debug-ext.d.ts +0 -1
  95. package/lib/plugin/debug/debug-ext.d.ts.map +1 -1
  96. package/lib/plugin/debug/plugin-debug-adapter-creator.d.ts +0 -1
  97. package/lib/plugin/debug/plugin-debug-adapter-creator.d.ts.map +1 -1
  98. package/lib/plugin/debug/plugin-debug-adapter-session.d.ts +0 -1
  99. package/lib/plugin/debug/plugin-debug-adapter-session.d.ts.map +1 -1
  100. package/lib/plugin/debug/plugin-debug-adapter-tracker.d.ts +0 -1
  101. package/lib/plugin/debug/plugin-debug-adapter-tracker.d.ts.map +1 -1
  102. package/lib/plugin/decorations.d.ts +0 -1
  103. package/lib/plugin/decorations.d.ts.map +1 -1
  104. package/lib/plugin/dialogs.d.ts +0 -1
  105. package/lib/plugin/dialogs.d.ts.map +1 -1
  106. package/lib/plugin/document-data.d.ts +0 -1
  107. package/lib/plugin/document-data.d.ts.map +1 -1
  108. package/lib/plugin/documents.d.ts +0 -1
  109. package/lib/plugin/documents.d.ts.map +1 -1
  110. package/lib/plugin/env.d.ts +0 -1
  111. package/lib/plugin/env.d.ts.map +1 -1
  112. package/lib/plugin/file-system-event-service-ext-impl.d.ts +0 -1
  113. package/lib/plugin/file-system-event-service-ext-impl.d.ts.map +1 -1
  114. package/lib/plugin/file-system-ext-impl.d.ts +27 -4
  115. package/lib/plugin/file-system-ext-impl.d.ts.map +1 -1
  116. package/lib/plugin/file-system-ext-impl.js +4 -2
  117. package/lib/plugin/file-system-ext-impl.js.map +1 -1
  118. package/lib/plugin/label-service.d.ts +0 -1
  119. package/lib/plugin/label-service.d.ts.map +1 -1
  120. package/lib/plugin/languages/call-hierarchy.d.ts +0 -1
  121. package/lib/plugin/languages/call-hierarchy.d.ts.map +1 -1
  122. package/lib/plugin/languages/code-action.d.ts +0 -1
  123. package/lib/plugin/languages/code-action.d.ts.map +1 -1
  124. package/lib/plugin/languages/color.d.ts +0 -1
  125. package/lib/plugin/languages/color.d.ts.map +1 -1
  126. package/lib/plugin/languages/completion.d.ts +0 -1
  127. package/lib/plugin/languages/completion.d.ts.map +1 -1
  128. package/lib/plugin/languages/declaration.d.ts +0 -1
  129. package/lib/plugin/languages/declaration.d.ts.map +1 -1
  130. package/lib/plugin/languages/definition.d.ts +0 -1
  131. package/lib/plugin/languages/definition.d.ts.map +1 -1
  132. package/lib/plugin/languages/diagnostics.d.ts +0 -1
  133. package/lib/plugin/languages/diagnostics.d.ts.map +1 -1
  134. package/lib/plugin/languages/document-drop-edit.d.ts +0 -1
  135. package/lib/plugin/languages/document-drop-edit.d.ts.map +1 -1
  136. package/lib/plugin/languages/document-formatting.d.ts +0 -1
  137. package/lib/plugin/languages/document-formatting.d.ts.map +1 -1
  138. package/lib/plugin/languages/document-highlight.d.ts +0 -1
  139. package/lib/plugin/languages/document-highlight.d.ts.map +1 -1
  140. package/lib/plugin/languages/evaluatable-expression.d.ts +0 -1
  141. package/lib/plugin/languages/evaluatable-expression.d.ts.map +1 -1
  142. package/lib/plugin/languages/folding.d.ts +0 -1
  143. package/lib/plugin/languages/folding.d.ts.map +1 -1
  144. package/lib/plugin/languages/hover.d.ts +0 -1
  145. package/lib/plugin/languages/hover.d.ts.map +1 -1
  146. package/lib/plugin/languages/implementation.d.ts +0 -1
  147. package/lib/plugin/languages/implementation.d.ts.map +1 -1
  148. package/lib/plugin/languages/inlay-hints.d.ts +0 -1
  149. package/lib/plugin/languages/inlay-hints.d.ts.map +1 -1
  150. package/lib/plugin/languages/inline-completion.d.ts +0 -1
  151. package/lib/plugin/languages/inline-completion.d.ts.map +1 -1
  152. package/lib/plugin/languages/inline-values.d.ts +0 -1
  153. package/lib/plugin/languages/inline-values.d.ts.map +1 -1
  154. package/lib/plugin/languages/lens.d.ts +0 -1
  155. package/lib/plugin/languages/lens.d.ts.map +1 -1
  156. package/lib/plugin/languages/link-provider.d.ts +0 -1
  157. package/lib/plugin/languages/link-provider.d.ts.map +1 -1
  158. package/lib/plugin/languages/linked-editing-range.d.ts +0 -1
  159. package/lib/plugin/languages/linked-editing-range.d.ts.map +1 -1
  160. package/lib/plugin/languages/on-type-formatting.d.ts +0 -1
  161. package/lib/plugin/languages/on-type-formatting.d.ts.map +1 -1
  162. package/lib/plugin/languages/outline.d.ts +0 -1
  163. package/lib/plugin/languages/outline.d.ts.map +1 -1
  164. package/lib/plugin/languages/range-formatting.d.ts +0 -1
  165. package/lib/plugin/languages/range-formatting.d.ts.map +1 -1
  166. package/lib/plugin/languages/reference.d.ts +0 -1
  167. package/lib/plugin/languages/reference.d.ts.map +1 -1
  168. package/lib/plugin/languages/rename.d.ts +0 -1
  169. package/lib/plugin/languages/rename.d.ts.map +1 -1
  170. package/lib/plugin/languages/selection-range.d.ts +0 -1
  171. package/lib/plugin/languages/selection-range.d.ts.map +1 -1
  172. package/lib/plugin/languages/semantic-highlighting.d.ts +0 -1
  173. package/lib/plugin/languages/semantic-highlighting.d.ts.map +1 -1
  174. package/lib/plugin/languages/signature.d.ts +0 -1
  175. package/lib/plugin/languages/signature.d.ts.map +1 -1
  176. package/lib/plugin/languages/type-definition.d.ts +0 -1
  177. package/lib/plugin/languages/type-definition.d.ts.map +1 -1
  178. package/lib/plugin/languages/type-hierarchy.d.ts +0 -1
  179. package/lib/plugin/languages/type-hierarchy.d.ts.map +1 -1
  180. package/lib/plugin/languages/util.d.ts +0 -1
  181. package/lib/plugin/languages/util.d.ts.map +1 -1
  182. package/lib/plugin/languages/workspace-symbol.d.ts +0 -1
  183. package/lib/plugin/languages/workspace-symbol.d.ts.map +1 -1
  184. package/lib/plugin/languages-utils.d.ts +0 -1
  185. package/lib/plugin/languages-utils.d.ts.map +1 -1
  186. package/lib/plugin/languages.d.ts +0 -1
  187. package/lib/plugin/languages.d.ts.map +1 -1
  188. package/lib/plugin/markdown-string.d.ts +0 -1
  189. package/lib/plugin/markdown-string.d.ts.map +1 -1
  190. package/lib/plugin/message-registry.d.ts +0 -1
  191. package/lib/plugin/message-registry.d.ts.map +1 -1
  192. package/lib/plugin/node/debug/plugin-node-debug-adapter-creator.d.ts +0 -1
  193. package/lib/plugin/node/debug/plugin-node-debug-adapter-creator.d.ts.map +1 -1
  194. package/lib/plugin/notebook/notebook-document.d.ts +0 -1
  195. package/lib/plugin/notebook/notebook-document.d.ts.map +1 -1
  196. package/lib/plugin/notebook/notebook-documents.d.ts +0 -1
  197. package/lib/plugin/notebook/notebook-documents.d.ts.map +1 -1
  198. package/lib/plugin/notebook/notebook-editor.d.ts +0 -1
  199. package/lib/plugin/notebook/notebook-editor.d.ts.map +1 -1
  200. package/lib/plugin/notebook/notebook-editors.d.ts +0 -1
  201. package/lib/plugin/notebook/notebook-editors.d.ts.map +1 -1
  202. package/lib/plugin/notebook/notebook-kernels.d.ts +0 -1
  203. package/lib/plugin/notebook/notebook-kernels.d.ts.map +1 -1
  204. package/lib/plugin/notebook/notebook-renderers.d.ts +0 -1
  205. package/lib/plugin/notebook/notebook-renderers.d.ts.map +1 -1
  206. package/lib/plugin/notebook/notebooks.d.ts +1 -1
  207. package/lib/plugin/notebook/notebooks.d.ts.map +1 -1
  208. package/lib/plugin/notebook/notebooks.js +23 -3
  209. package/lib/plugin/notebook/notebooks.js.map +1 -1
  210. package/lib/plugin/notification.d.ts +0 -1
  211. package/lib/plugin/notification.d.ts.map +1 -1
  212. package/lib/plugin/output-channel/log-output-channel.d.ts +0 -1
  213. package/lib/plugin/output-channel/log-output-channel.d.ts.map +1 -1
  214. package/lib/plugin/output-channel/output-channel-item.d.ts +0 -1
  215. package/lib/plugin/output-channel/output-channel-item.d.ts.map +1 -1
  216. package/lib/plugin/output-channel-registry.d.ts +0 -1
  217. package/lib/plugin/output-channel-registry.d.ts.map +1 -1
  218. package/lib/plugin/plugin-context.d.ts +1 -1
  219. package/lib/plugin/plugin-context.d.ts.map +1 -1
  220. package/lib/plugin/plugin-context.js +37 -15
  221. package/lib/plugin/plugin-context.js.map +1 -1
  222. package/lib/plugin/plugin-manager.d.ts +0 -1
  223. package/lib/plugin/plugin-manager.d.ts.map +1 -1
  224. package/lib/plugin/plugin-storage.d.ts +0 -1
  225. package/lib/plugin/plugin-storage.d.ts.map +1 -1
  226. package/lib/plugin/preference-registry.d.ts +0 -1
  227. package/lib/plugin/preference-registry.d.ts.map +1 -1
  228. package/lib/plugin/quick-open.d.ts +0 -1
  229. package/lib/plugin/quick-open.d.ts.map +1 -1
  230. package/lib/plugin/scm.d.ts +1 -1
  231. package/lib/plugin/scm.d.ts.map +1 -1
  232. package/lib/plugin/scm.js +3 -3
  233. package/lib/plugin/scm.js.map +1 -1
  234. package/lib/plugin/secrets-ext.d.ts +0 -1
  235. package/lib/plugin/secrets-ext.d.ts.map +1 -1
  236. package/lib/plugin/status-bar/status-bar-item.d.ts +0 -1
  237. package/lib/plugin/status-bar/status-bar-item.d.ts.map +1 -1
  238. package/lib/plugin/status-bar-message-registry.d.ts +0 -1
  239. package/lib/plugin/status-bar-message-registry.d.ts.map +1 -1
  240. package/lib/plugin/tabs.d.ts +0 -1
  241. package/lib/plugin/tabs.d.ts.map +1 -1
  242. package/lib/plugin/tasks/task-provider.d.ts +0 -1
  243. package/lib/plugin/tasks/task-provider.d.ts.map +1 -1
  244. package/lib/plugin/tasks/tasks.d.ts +0 -1
  245. package/lib/plugin/tasks/tasks.d.ts.map +1 -1
  246. package/lib/plugin/terminal-ext.d.ts +1 -1
  247. package/lib/plugin/terminal-ext.d.ts.map +1 -1
  248. package/lib/plugin/terminal-ext.js +1 -0
  249. package/lib/plugin/terminal-ext.js.map +1 -1
  250. package/lib/plugin/test-item.d.ts +0 -1
  251. package/lib/plugin/test-item.d.ts.map +1 -1
  252. package/lib/plugin/tests.d.ts +8 -2
  253. package/lib/plugin/tests.d.ts.map +1 -1
  254. package/lib/plugin/tests.js +24 -1
  255. package/lib/plugin/tests.js.map +1 -1
  256. package/lib/plugin/text-editor.d.ts +1 -2
  257. package/lib/plugin/text-editor.d.ts.map +1 -1
  258. package/lib/plugin/text-editor.js.map +1 -1
  259. package/lib/plugin/text-editors.d.ts +0 -1
  260. package/lib/plugin/text-editors.d.ts.map +1 -1
  261. package/lib/plugin/timeline.d.ts +0 -1
  262. package/lib/plugin/timeline.d.ts.map +1 -1
  263. package/lib/plugin/tree/tree-views.d.ts +0 -1
  264. package/lib/plugin/tree/tree-views.d.ts.map +1 -1
  265. package/lib/plugin/type-converters.d.ts +13 -2
  266. package/lib/plugin/type-converters.d.ts.map +1 -1
  267. package/lib/plugin/type-converters.js +55 -5
  268. package/lib/plugin/type-converters.js.map +1 -1
  269. package/lib/plugin/types-impl.d.ts +7 -1
  270. package/lib/plugin/types-impl.d.ts.map +1 -1
  271. package/lib/plugin/types-impl.js +9 -1
  272. package/lib/plugin/types-impl.js.map +1 -1
  273. package/lib/plugin/uri-ext.d.ts +0 -1
  274. package/lib/plugin/uri-ext.d.ts.map +1 -1
  275. package/lib/plugin/webview-views.d.ts +0 -1
  276. package/lib/plugin/webview-views.d.ts.map +1 -1
  277. package/lib/plugin/webviews.d.ts +0 -1
  278. package/lib/plugin/webviews.d.ts.map +1 -1
  279. package/lib/plugin/window-state.d.ts +0 -1
  280. package/lib/plugin/window-state.d.ts.map +1 -1
  281. package/lib/plugin/workspace.d.ts +0 -1
  282. package/lib/plugin/workspace.d.ts.map +1 -1
  283. package/package.json +29 -29
  284. package/src/common/plugin-api-rpc-model.ts +11 -0
  285. package/src/common/plugin-api-rpc.ts +7 -5
  286. package/src/common/test-types.ts +15 -1
  287. package/src/main/browser/authentication-main.ts +24 -11
  288. package/src/main/browser/custom-editors/custom-editor-opener.tsx +19 -4
  289. package/src/main/browser/custom-editors/plugin-custom-editor-registry.ts +7 -3
  290. package/src/main/browser/editors-and-documents-main.ts +27 -2
  291. package/src/main/browser/menus/plugin-menu-command-adapter.ts +2 -2
  292. package/src/main/browser/notebooks/notebook-documents-and-editors-main.ts +13 -9
  293. package/src/main/browser/notebooks/notebook-kernels-main.ts +2 -2
  294. package/src/main/browser/notebooks/renderers/cell-output-webview.tsx +170 -74
  295. package/src/main/browser/notebooks/renderers/output-webview-internal.ts +237 -73
  296. package/src/main/browser/notebooks/renderers/webview-communication.ts +78 -7
  297. package/src/main/browser/plugin-ext-frontend-module.ts +6 -5
  298. package/src/main/browser/tabs/tabs-main.ts +6 -2
  299. package/src/main/browser/test-main.ts +4 -1
  300. package/src/main/browser/text-editor-main.ts +55 -14
  301. package/src/plugin/authentication-ext.ts +9 -5
  302. package/src/plugin/file-system-ext-impl.ts +7 -3
  303. package/src/plugin/notebook/notebooks.ts +22 -1
  304. package/src/plugin/plugin-context.ts +40 -15
  305. package/src/plugin/scm.ts +5 -4
  306. package/src/plugin/terminal-ext.ts +1 -0
  307. package/src/plugin/tests.ts +34 -3
  308. package/src/plugin/text-editor.ts +1 -1
  309. package/src/plugin/type-converters.ts +58 -6
  310. package/src/plugin/types-impl.ts +10 -1
@@ -33,11 +33,14 @@ import { Range } from '../../common/plugin-api-rpc-model';
33
33
  import { Emitter, Event } from '@theia/core';
34
34
  import { TextEditorCursorStyle, cursorStyleToString } from '../../common/editor-options';
35
35
  import { TextEditorLineNumbersStyle, EndOfLine } from '../../plugin/types-impl';
36
+ import { SimpleMonacoEditor } from '@theia/monaco/lib/browser/simple-monaco-editor';
37
+ import { EndOfLineSequence, ITextModel } from '@theia/monaco-editor-core/esm/vs/editor/common/model';
38
+ import { EditorOption, RenderLineNumbersType } from '@theia/monaco-editor-core/esm/vs/editor/common/config/editorOptions';
36
39
 
37
40
  export class TextEditorMain implements Disposable {
38
41
 
39
42
  private properties: TextEditorPropertiesMain | undefined;
40
- private editor: MonacoEditor | undefined;
43
+ private editor: MonacoEditor | SimpleMonacoEditor | undefined;
41
44
 
42
45
  private readonly onPropertiesChangedEmitter = new Emitter<EditorChangedPropertiesData>();
43
46
 
@@ -48,8 +51,8 @@ export class TextEditorMain implements Disposable {
48
51
 
49
52
  constructor(
50
53
  private id: string,
51
- private model: monaco.editor.IModel,
52
- editor: MonacoEditor
54
+ private model: monaco.editor.IModel | ITextModel,
55
+ editor: MonacoEditor | SimpleMonacoEditor
53
56
  ) {
54
57
  this.toDispose.push(this.model.onDidChangeOptions(() =>
55
58
  this.updateProperties(undefined)
@@ -76,7 +79,7 @@ export class TextEditorMain implements Disposable {
76
79
 
77
80
  protected readonly toDisposeOnEditor = new DisposableCollection();
78
81
 
79
- private setEditor(editor?: MonacoEditor): void {
82
+ private setEditor(editor?: MonacoEditor | SimpleMonacoEditor): void {
80
83
  if (this.editor === editor) {
81
84
  return;
82
85
  }
@@ -115,7 +118,7 @@ export class TextEditorMain implements Disposable {
115
118
  return this.id;
116
119
  }
117
120
 
118
- getModel(): monaco.editor.IModel {
121
+ getModel(): monaco.editor.IModel | ITextModel {
119
122
  return this.model;
120
123
  }
121
124
 
@@ -208,7 +211,7 @@ export class TextEditorMain implements Disposable {
208
211
  }
209
212
 
210
213
  revealRange(range: monaco.Range, revealType: TextEditorRevealType): void {
211
- if (!this.editor) {
214
+ if (!this.editor || this.editor instanceof SimpleMonacoEditor) {
212
215
  return;
213
216
  }
214
217
  switch (revealType) {
@@ -240,10 +243,14 @@ export class TextEditorMain implements Disposable {
240
243
  return false;
241
244
  }
242
245
 
243
- if (opts.setEndOfLine === EndOfLine.CRLF) {
246
+ if (opts.setEndOfLine === EndOfLine.CRLF && !this.isSimpleWidget(this.model)) {
244
247
  this.model.setEOL(monaco.editor.EndOfLineSequence.CRLF);
245
- } else if (opts.setEndOfLine === EndOfLine.LF) {
248
+ } else if (opts.setEndOfLine === EndOfLine.LF && !this.isSimpleWidget(this.model)) {
246
249
  this.model.setEOL(monaco.editor.EndOfLineSequence.LF);
250
+ } else if (opts.setEndOfLine === EndOfLine.CRLF && this.isSimpleWidget(this.model)) {
251
+ this.model.setEOL(EndOfLineSequence.CRLF);
252
+ } else if (opts.setEndOfLine === EndOfLine.LF && this.isSimpleWidget(this.model)) {
253
+ this.model.setEOL(EndOfLineSequence.CRLF);
247
254
  }
248
255
 
249
256
  const editOperations: monaco.editor.IIdentifiedSingleEditOperation[] = [];
@@ -311,6 +318,10 @@ export class TextEditorMain implements Disposable {
311
318
  private static toMonacoSelections(selection: Selection): monaco.Selection {
312
319
  return new monaco.Selection(selection.selectionStartLineNumber, selection.selectionStartColumn, selection.positionLineNumber, selection.positionColumn);
313
320
  }
321
+
322
+ private isSimpleWidget(model: monaco.editor.IModel | ITextModel): model is ITextModel {
323
+ return !!(model as ITextModel).isForSimpleWidget;
324
+ }
314
325
  }
315
326
 
316
327
  // TODO move to monaco typings!
@@ -362,17 +373,26 @@ export class TextEditorPropertiesMain {
362
373
  return undefined;
363
374
  }
364
375
 
365
- static readFromEditor(prevProperties: TextEditorPropertiesMain | undefined, model: monaco.editor.IModel, editor: MonacoEditor): TextEditorPropertiesMain {
376
+ static readFromEditor(prevProperties: TextEditorPropertiesMain | undefined,
377
+ model: monaco.editor.IModel | ITextModel,
378
+ editor: MonacoEditor | SimpleMonacoEditor): TextEditorPropertiesMain {
379
+
366
380
  const selections = TextEditorPropertiesMain.getSelectionsFromEditor(prevProperties, editor);
367
381
  const options = TextEditorPropertiesMain.getOptionsFromEditor(prevProperties, model, editor);
368
382
  const visibleRanges = TextEditorPropertiesMain.getVisibleRangesFromEditor(prevProperties, editor);
369
383
  return new TextEditorPropertiesMain(selections, options, visibleRanges);
370
384
  }
371
385
 
372
- private static getSelectionsFromEditor(prevProperties: TextEditorPropertiesMain | undefined, editor: MonacoEditor): monaco.Selection[] {
386
+ private static getSelectionsFromEditor(prevProperties: TextEditorPropertiesMain | undefined, editor: MonacoEditor | SimpleMonacoEditor): monaco.Selection[] {
373
387
  let result: monaco.Selection[] | undefined = undefined;
374
- if (editor) {
388
+ if (editor && editor instanceof MonacoEditor) {
375
389
  result = editor.getControl().getSelections() || undefined;
390
+ } else if (editor && editor instanceof SimpleMonacoEditor) {
391
+ result = editor.getControl().getSelections()?.map(selection => new monaco.Selection(
392
+ selection.startLineNumber,
393
+ selection.startColumn,
394
+ selection.positionLineNumber,
395
+ selection.positionColumn));
376
396
  }
377
397
 
378
398
  if (!result && prevProperties) {
@@ -385,14 +405,16 @@ export class TextEditorPropertiesMain {
385
405
  return result;
386
406
  }
387
407
 
388
- private static getOptionsFromEditor(prevProperties: TextEditorPropertiesMain | undefined, model: monaco.editor.IModel, editor: MonacoEditor): TextEditorConfiguration {
408
+ private static getOptionsFromEditor(prevProperties: TextEditorPropertiesMain | undefined,
409
+ model: monaco.editor.IModel | ITextModel,
410
+ editor: MonacoEditor | SimpleMonacoEditor): TextEditorConfiguration {
389
411
  if (model.isDisposed()) {
390
412
  return prevProperties!.options;
391
413
  }
392
414
 
393
415
  let cursorStyle: TextEditorCursorStyle;
394
416
  let lineNumbers: TextEditorLineNumbersStyle;
395
- if (editor) {
417
+ if (editor && editor instanceof MonacoEditor) {
396
418
  const editorOptions = editor.getControl().getOptions();
397
419
  const lineNumbersOpts = editorOptions.get(monaco.editor.EditorOption.lineNumbers);
398
420
  cursorStyle = editorOptions.get(monaco.editor.EditorOption.cursorStyle);
@@ -410,6 +432,25 @@ export class TextEditorPropertiesMain {
410
432
  lineNumbers = TextEditorLineNumbersStyle.On;
411
433
  break;
412
434
  }
435
+ } else if (editor && editor instanceof SimpleMonacoEditor) {
436
+ const editorOptions = editor.getControl().getOptions();
437
+ const lineNumbersOpts = editorOptions.get(EditorOption.lineNumbers);
438
+ cursorStyle = editorOptions.get(EditorOption.cursorStyle);
439
+ switch (lineNumbersOpts.renderType) {
440
+ case RenderLineNumbersType.Off:
441
+ lineNumbers = TextEditorLineNumbersStyle.Off;
442
+ break;
443
+ case RenderLineNumbersType.Relative:
444
+ lineNumbers = TextEditorLineNumbersStyle.Relative;
445
+ break;
446
+ case RenderLineNumbersType.Interval:
447
+ lineNumbers = TextEditorLineNumbersStyle.Interval;
448
+ break;
449
+ default:
450
+ lineNumbers = TextEditorLineNumbersStyle.On;
451
+ break;
452
+ }
453
+
413
454
  } else if (prevProperties) {
414
455
  cursorStyle = prevProperties.options.cursorStyle;
415
456
  lineNumbers = prevProperties.options.lineNumbers;
@@ -428,7 +469,7 @@ export class TextEditorPropertiesMain {
428
469
  };
429
470
  }
430
471
 
431
- private static getVisibleRangesFromEditor(prevProperties: TextEditorPropertiesMain | undefined, editor: MonacoEditor): monaco.Range[] {
472
+ private static getVisibleRangesFromEditor(prevProperties: TextEditorPropertiesMain | undefined, editor: MonacoEditor | SimpleMonacoEditor): monaco.Range[] {
432
473
  if (editor) {
433
474
  return editor.getControl().getVisibleRanges();
434
475
  }
@@ -57,6 +57,10 @@ export class AuthenticationExtImpl implements AuthenticationExt {
57
57
  return this.proxy.$getSession(providerId, scopes, extensionId, extensionName, options);
58
58
  }
59
59
 
60
+ getAccounts(providerId: string): Thenable<readonly theia.AuthenticationSessionAccountInformation[]> {
61
+ return this.proxy.$getAccounts(providerId);
62
+ }
63
+
60
64
  registerAuthenticationProvider(id: string, label: string, provider: theia.AuthenticationProvider, options?: theia.AuthenticationProviderOptions): theia.Disposable {
61
65
  if (this.authenticationProviders.get(id)) {
62
66
  throw new Error(`An authentication provider with id '${id}' is already registered.`);
@@ -64,7 +68,7 @@ export class AuthenticationExtImpl implements AuthenticationExt {
64
68
 
65
69
  this.authenticationProviders.set(id, provider);
66
70
 
67
- provider.getSessions().then(sessions => { // sessions might have been restored from secret storage
71
+ provider.getSessions(undefined, {}).then(sessions => { // sessions might have been restored from secret storage
68
72
  if (sessions.length > 0) {
69
73
  this.proxy.$onDidChangeSessions(id, {
70
74
  added: sessions,
@@ -87,10 +91,10 @@ export class AuthenticationExtImpl implements AuthenticationExt {
87
91
  });
88
92
  }
89
93
 
90
- $createSession(providerId: string, scopes: string[]): Promise<theia.AuthenticationSession> {
94
+ $createSession(providerId: string, scopes: string[], options: theia.AuthenticationProviderSessionOptions): Promise<theia.AuthenticationSession> {
91
95
  const authProvider = this.authenticationProviders.get(providerId);
92
96
  if (authProvider) {
93
- return Promise.resolve(authProvider.createSession(scopes));
97
+ return Promise.resolve(authProvider.createSession(scopes, options));
94
98
  }
95
99
 
96
100
  throw new Error(`Unable to find authentication provider with handle: ${providerId}`);
@@ -105,10 +109,10 @@ export class AuthenticationExtImpl implements AuthenticationExt {
105
109
  throw new Error(`Unable to find authentication provider with handle: ${providerId}`);
106
110
  }
107
111
 
108
- async $getSessions(providerId: string, scopes?: string[]): Promise<ReadonlyArray<theia.AuthenticationSession>> {
112
+ async $getSessions(providerId: string, scopes: string[] | undefined, options: theia.AuthenticationProviderSessionOptions): Promise<ReadonlyArray<theia.AuthenticationSession>> {
109
113
  const authProvider = this.authenticationProviders.get(providerId);
110
114
  if (authProvider) {
111
- const sessions = await authProvider.getSessions(scopes);
115
+ const sessions = await authProvider.getSessions(scopes, options);
112
116
 
113
117
  /* Wrap the session object received from the plugin to prevent serialization mismatches
114
118
  e.g. if the plugin object is constructed with the help of getters they won't be serialized:
@@ -40,8 +40,9 @@ import { State, StateMachine, LinkComputer, Edge } from '../common/link-computer
40
40
  import { commonPrefixLength } from '@theia/core/lib/common/strings';
41
41
  import { CharCode } from '@theia/core/lib/common/char-code';
42
42
  import { BinaryBuffer } from '@theia/core/lib/common/buffer';
43
- import { Emitter } from '@theia/core/shared/vscode-languageserver-protocol';
44
43
  import { MarkdownString } from '../common/plugin-api-rpc-model';
44
+ import { Emitter } from '@theia/core/lib/common';
45
+ import { createAPIObject } from './plugin-context';
45
46
 
46
47
  type IDisposable = vscode.Disposable;
47
48
 
@@ -137,8 +138,11 @@ export class FsLinkProvider {
137
138
  }
138
139
 
139
140
  class ConsumerFileSystem implements vscode.FileSystem {
141
+ apiObject: vscode.FileSystem;
140
142
 
141
- constructor(private _proxy: FileSystemMain, private _capabilities: Map<string, number>) { }
143
+ constructor(private _proxy: FileSystemMain, private _capabilities: Map<string, number>) {
144
+ this.apiObject = createAPIObject(this);
145
+ }
142
146
 
143
147
  stat(uri: vscode.Uri): Promise<vscode.FileStat> {
144
148
  return this._proxy.$stat(uri).catch(ConsumerFileSystem._handleError);
@@ -210,7 +214,7 @@ export class FileSystemExtImpl implements FileSystemExt {
210
214
 
211
215
  private _handlePool: number = 0;
212
216
 
213
- readonly fileSystem: vscode.FileSystem;
217
+ readonly fileSystem: ConsumerFileSystem;
214
218
 
215
219
  constructor(rpc: RPCProtocol) {
216
220
  this._proxy = rpc.getProxy(PLUGIN_RPC_CONTEXT.FILE_SYSTEM_MAIN);
@@ -97,6 +97,13 @@ export class NotebooksExtImpl implements NotebooksExt {
97
97
  }
98
98
  }
99
99
  });
100
+
101
+ textDocumentsAndEditors.onDidChangeActiveTextEditor(e => {
102
+ if (e && e?.document.uri.scheme !== CellUri.cellUriScheme && this.activeNotebookEditor) {
103
+ this.activeNotebookEditor = undefined;
104
+ this.onDidChangeActiveNotebookEditorEmitter.fire(undefined);
105
+ }
106
+ });
100
107
  }
101
108
 
102
109
  async $provideNotebookCellStatusBarItems(handle: number, uri: UriComponents, index: number, token: CancellationToken): Promise<NotebookCellStatusBarListDto | undefined> {
@@ -131,6 +138,15 @@ export class NotebooksExtImpl implements NotebooksExt {
131
138
  this.statusBarRegistry.delete(cacheId);
132
139
  }
133
140
 
141
+ $acceptActiveCellEditorChange(newActiveEditor: string | null): void {
142
+ const newActiveEditorId = this.textDocumentsAndEditors.allEditors().find(editor => editor.document.uri.toString() === newActiveEditor)?.id;
143
+ if (newActiveEditorId || newActiveEditor === null) {
144
+ this.textDocumentsAndEditors.acceptEditorsAndDocumentsDelta({
145
+ newActiveEditor: newActiveEditorId ?? null
146
+ });
147
+ }
148
+ }
149
+
134
150
  // --- serialize/deserialize
135
151
 
136
152
  private currentSerializerHandle = 0;
@@ -319,8 +335,13 @@ export class NotebooksExtImpl implements NotebooksExt {
319
335
  console.error(`FAILED to find active notebook editor ${delta.newActiveEditor}`);
320
336
  }
321
337
  this.activeNotebookEditor = this.editors.get(delta.newActiveEditor);
338
+ if (this.textDocumentsAndEditors.activeEditor()?.document.uri.path !== this.activeNotebookEditor?.notebookData.uri.path) {
339
+ this.textDocumentsAndEditors.acceptEditorsAndDocumentsDelta({
340
+ newActiveEditor: null
341
+ });
342
+ }
322
343
  }
323
- if (delta.newActiveEditor !== undefined) {
344
+ if (delta.newActiveEditor !== undefined && delta.newActiveEditor !== this.activeNotebookEditor?.id) {
324
345
  this.onDidChangeActiveNotebookEditorEmitter.fire(this.activeNotebookEditor?.apiEditor);
325
346
  }
326
347
  }
@@ -187,6 +187,7 @@ import {
187
187
  TestTag,
188
188
  TestRunRequest,
189
189
  TestMessage,
190
+ TestMessageStackFrame,
190
191
  ExtensionKind,
191
192
  InlineCompletionItem,
192
193
  InlineCompletionList,
@@ -278,6 +279,21 @@ import { NotebookEditorsExtImpl } from './notebook/notebook-editors';
278
279
  import { TestingExtImpl } from './tests';
279
280
  import { UriExtImpl } from './uri-ext';
280
281
 
282
+ export function createAPIObject<T extends Object>(rawObject: T): T {
283
+ return new Proxy(rawObject, {
284
+ get(target, p, receiver) {
285
+ const isOwnProperty = !!Object.getOwnPropertyDescriptor(target, p);
286
+ const val = Reflect.get(target, p);
287
+ if (!isOwnProperty && typeof val === 'function') {
288
+ // bind functions that are inherited from the prototype to the object itself.
289
+ // This should handle the case of events.
290
+ return val.bind(target);
291
+ }
292
+ return val;
293
+ },
294
+ }) as T;
295
+ }
296
+
281
297
  export function createAPIFactory(
282
298
  rpc: RPCProtocol,
283
299
  pluginManager: PluginManager,
@@ -338,6 +354,9 @@ export function createAPIFactory(
338
354
  },
339
355
  get onDidChangeSessions(): theia.Event<theia.AuthenticationSessionsChangeEvent> {
340
356
  return authenticationExt.onDidChangeSessions;
357
+ },
358
+ getAccounts(providerId: string): Thenable<readonly theia.AuthenticationSessionAccountInformation[]> {
359
+ return authenticationExt.getAccounts(providerId);
341
360
  }
342
361
  };
343
362
  function commandIsDeclaredInPackage(id: string, model: PluginPackage): boolean {
@@ -492,7 +511,8 @@ export function createAPIFactory(
492
511
  return quickOpenExt.showQuickPick(plugin, items, options, token);
493
512
  },
494
513
  createQuickPick<T extends theia.QuickPickItem>(): theia.QuickPick<T> {
495
- return quickOpenExt.createQuickPick(plugin);
514
+
515
+ return createAPIObject(quickOpenExt.createQuickPick(plugin));
496
516
  },
497
517
  showWorkspaceFolderPick(options?: theia.WorkspaceFolderPickOptions): PromiseLike<theia.WorkspaceFolder | undefined> {
498
518
  return workspaceExt.pickWorkspaceFolder(options);
@@ -531,9 +551,12 @@ export function createAPIFactory(
531
551
  priority = priorityOrAlignment;
532
552
  }
533
553
 
554
+ // TODO: here
534
555
  return statusBarMessageRegistryExt.createStatusBarItem(alignment, priority, id);
535
556
  },
536
557
  createOutputChannel(name: string, options?: { log: true }): any {
558
+
559
+ // TODO: here
537
560
  return !options
538
561
  ? outputChannelRegistryExt.createOutputChannel(name, pluginToPluginInfo(plugin))
539
562
  : outputChannelRegistryExt.createOutputChannel(name, pluginToPluginInfo(plugin), options);
@@ -542,7 +565,7 @@ export function createAPIFactory(
542
565
  title: string,
543
566
  showOptions: theia.ViewColumn | theia.WebviewPanelShowOptions,
544
567
  options: theia.WebviewPanelOptions & theia.WebviewOptions = {}): theia.WebviewPanel {
545
- return webviewExt.createWebview(viewType, title, showOptions, options, plugin);
568
+ return createAPIObject(webviewExt.createWebview(viewType, title, showOptions, options, plugin));
546
569
  },
547
570
  registerWebviewPanelSerializer(viewType: string, serializer: theia.WebviewPanelSerializer): theia.Disposable {
548
571
  return webviewExt.registerWebviewPanelSerializer(viewType, serializer, plugin);
@@ -570,19 +593,19 @@ export function createAPIFactory(
570
593
  createTerminal(nameOrOptions: theia.TerminalOptions | theia.ExtensionTerminalOptions | theia.ExtensionTerminalOptions | (string | undefined),
571
594
  shellPath?: string,
572
595
  shellArgs?: string[] | string): theia.Terminal {
573
- return terminalExt.createTerminal(plugin, nameOrOptions, shellPath, shellArgs);
596
+ return createAPIObject(terminalExt.createTerminal(plugin, nameOrOptions, shellPath, shellArgs));
574
597
  },
575
598
  onDidChangeTerminalState,
576
599
  onDidCloseTerminal,
577
600
  onDidOpenTerminal,
578
601
  createTextEditorDecorationType(options: theia.DecorationRenderOptions): theia.TextEditorDecorationType {
579
- return editors.createTextEditorDecorationType(options);
602
+ return createAPIObject(editors.createTextEditorDecorationType(options));
580
603
  },
581
604
  registerTreeDataProvider<T>(viewId: string, treeDataProvider: theia.TreeDataProvider<T>): Disposable {
582
605
  return treeViewsExt.registerTreeDataProvider(plugin, viewId, treeDataProvider);
583
606
  },
584
607
  createTreeView<T>(viewId: string, options: theia.TreeViewOptions<T>): theia.TreeView<T> {
585
- return treeViewsExt.createTreeView(plugin, viewId, options);
608
+ return createAPIObject(treeViewsExt.createTreeView(plugin, viewId, options));
586
609
  },
587
610
  withScmProgress<R>(task: (progress: theia.Progress<number>) => Thenable<R>) {
588
611
  const options: ProgressOptions = { location: ProgressLocation.SourceControl };
@@ -601,7 +624,7 @@ export function createAPIFactory(
601
624
  return uriExt.registerUriHandler(handler, pluginToPluginInfo(plugin));
602
625
  },
603
626
  createInputBox(): theia.InputBox {
604
- return quickOpenExt.createInputBox(plugin);
627
+ return createAPIObject(quickOpenExt.createInputBox(plugin));
605
628
  },
606
629
  registerTerminalLinkProvider(provider: theia.TerminalLinkProvider): theia.Disposable {
607
630
  return terminalExt.registerTerminalLinkProvider(provider);
@@ -649,7 +672,7 @@ export function createAPIFactory(
649
672
  const workspace: typeof theia.workspace = {
650
673
 
651
674
  get fs(): theia.FileSystem {
652
- return fileSystemExt.fileSystem;
675
+ return fileSystemExt.fileSystem.apiObject;
653
676
  },
654
677
 
655
678
  get rootPath(): string | undefined {
@@ -752,7 +775,7 @@ export function createAPIFactory(
752
775
  return notebooksExt.getNotebookDocument(uri).apiNotebook;
753
776
  },
754
777
  createFileSystemWatcher: (pattern, ignoreCreate, ignoreChange, ignoreDelete): theia.FileSystemWatcher =>
755
- extHostFileSystemEvent.createFileSystemWatcher(fromGlobPattern(pattern), ignoreCreate, ignoreChange, ignoreDelete),
778
+ createAPIObject(extHostFileSystemEvent.createFileSystemWatcher(fromGlobPattern(pattern), ignoreCreate, ignoreChange, ignoreDelete)),
756
779
  findFiles(include: theia.GlobPattern, exclude?: theia.GlobPattern | null, maxResults?: number, token?: CancellationToken): PromiseLike<URI[]> {
757
780
  return workspaceExt.findFiles(include, exclude, maxResults, token);
758
781
  },
@@ -845,7 +868,7 @@ export function createAPIFactory(
845
868
  return telemetryExt.onDidChangeTelemetryEnabled;
846
869
  },
847
870
  createTelemetryLogger(sender: theia.TelemetrySender, options?: theia.TelemetryLoggerOptions): theia.TelemetryLogger {
848
- return telemetryExt.createTelemetryLogger(sender, options);
871
+ return createAPIObject(telemetryExt.createTelemetryLogger(sender, options));
849
872
  },
850
873
  get remoteName(): string | undefined { return envExt.remoteName; },
851
874
  get machineId(): string { return envExt.machineId; },
@@ -881,7 +904,7 @@ export function createAPIFactory(
881
904
 
882
905
  const extensions: typeof theia.extensions = Object.freeze({
883
906
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
884
- getExtension<T = any>(extensionId: string, includeFromDifferentExtensionHosts: boolean = false): theia.Extension<T> | undefined {
907
+ getExtension<T = any>(extensionId: string, includeFromDifferentExtensionHosts: boolean = false): theia.Extension<T | undefined> | undefined {
885
908
  includeFromDifferentExtensionHosts = false;
886
909
  const plg = pluginManager.getPluginById(extensionId.toLowerCase());
887
910
  if (plg) {
@@ -920,7 +943,7 @@ export function createAPIFactory(
920
943
  return <any>languagesExt.getDiagnostics(resource);
921
944
  },
922
945
  createDiagnosticCollection(name?: string): theia.DiagnosticCollection {
923
- return languagesExt.createDiagnosticCollection(name);
946
+ return createAPIObject(languagesExt.createDiagnosticCollection(name));
924
947
  },
925
948
  setLanguageConfiguration(language: string, configuration: theia.LanguageConfiguration): theia.Disposable {
926
949
  return languagesExt.setLanguageConfiguration(language, configuration);
@@ -1057,7 +1080,7 @@ export function createAPIFactory(
1057
1080
 
1058
1081
  const tests: typeof theia.tests = {
1059
1082
  createTestController(id, label: string) {
1060
- return testingExt.createTestController(id, label);
1083
+ return createAPIObject(testingExt.createTestController(id, label));
1061
1084
  }
1062
1085
  };
1063
1086
  /* End of Tests API */
@@ -1169,6 +1192,7 @@ export function createAPIFactory(
1169
1192
  },
1170
1193
 
1171
1194
  get taskExecutions(): ReadonlyArray<theia.TaskExecution> {
1195
+ // TODO: here
1172
1196
  return tasksExt.taskExecutions;
1173
1197
  },
1174
1198
  onDidStartTask(listener, thisArg?, disposables?) {
@@ -1189,19 +1213,19 @@ export function createAPIFactory(
1189
1213
  get inputBox(): theia.SourceControlInputBox {
1190
1214
  const inputBox = scmExt.getLastInputBox(plugin);
1191
1215
  if (inputBox) {
1192
- return inputBox;
1216
+ return inputBox.apiObject;
1193
1217
  } else {
1194
1218
  throw new Error('Input box not found!');
1195
1219
  }
1196
1220
  },
1197
1221
  createSourceControl(id: string, label: string, rootUri?: URI): theia.SourceControl {
1198
- return scmExt.createSourceControl(plugin, id, label, rootUri);
1222
+ return createAPIObject(scmExt.createSourceControl(plugin, id, label, rootUri));
1199
1223
  }
1200
1224
  };
1201
1225
 
1202
1226
  const comments: typeof theia.comments = {
1203
1227
  createCommentController(id: string, label: string): theia.CommentController {
1204
- return commentsExt.createCommentController(plugin, id, label);
1228
+ return createAPIObject(commentsExt.createCommentController(plugin, id, label));
1205
1229
  }
1206
1230
  };
1207
1231
 
@@ -1460,6 +1484,7 @@ export function createAPIFactory(
1460
1484
  TestTag,
1461
1485
  TestRunRequest,
1462
1486
  TestMessage,
1487
+ TestMessageStackFrame,
1463
1488
  ExtensionKind,
1464
1489
  InlineCompletionItem,
1465
1490
  InlineCompletionList,
package/src/plugin/scm.ts CHANGED
@@ -39,6 +39,7 @@ import { URI, ThemeIcon } from './types-impl';
39
39
  import { ScmCommandArg } from '../common/plugin-api-rpc';
40
40
  import { sep } from '@theia/core/lib/common/paths';
41
41
  import { PluginIconPath } from './plugin-icon-path';
42
+ import { createAPIObject } from './plugin-context';
42
43
  type ProviderHandle = number;
43
44
  type GroupHandle = number;
44
45
  type ResourceStateHandle = number;
@@ -290,6 +291,7 @@ interface ValidateInput {
290
291
  export class ScmInputBoxImpl implements theia.SourceControlInputBox {
291
292
 
292
293
  private _value: string = '';
294
+ apiObject: theia.SourceControlInputBox;
293
295
 
294
296
  get value(): string {
295
297
  return this._value;
@@ -354,7 +356,7 @@ export class ScmInputBoxImpl implements theia.SourceControlInputBox {
354
356
  }
355
357
 
356
358
  constructor(private plugin: Plugin, private proxy: ScmMain, private sourceControlHandle: number) {
357
- // noop
359
+ this.apiObject = createAPIObject(this);
358
360
  }
359
361
 
360
362
  onInputBoxValueChange(value: string): void {
@@ -543,8 +545,7 @@ class SourceControlImpl implements theia.SourceControl {
543
545
  return this._rootUri;
544
546
  }
545
547
 
546
- private _inputBox: ScmInputBoxImpl;
547
- get inputBox(): ScmInputBoxImpl { return this._inputBox; }
548
+ readonly inputBox: ScmInputBoxImpl;
548
549
 
549
550
  private _count: number | undefined = undefined;
550
551
 
@@ -642,7 +643,7 @@ class SourceControlImpl implements theia.SourceControl {
642
643
  private _label: string,
643
644
  private _rootUri?: theia.Uri
644
645
  ) {
645
- this._inputBox = new ScmInputBoxImpl(plugin, this.proxy, this.handle);
646
+ this.inputBox = new ScmInputBoxImpl(plugin, this.proxy, this.handle);
646
647
  this.proxy.$registerSourceControl(this.handle, _id, _label, _rootUri);
647
648
  }
648
649
 
@@ -478,6 +478,7 @@ export class TerminalExtImpl implements theia.Terminal {
478
478
  this.creationOptions = this.options;
479
479
  }
480
480
 
481
+ /** @stubbed Terminal Shell Ingration */
481
482
  shellIntegration: theia.TerminalShellIntegration | undefined = undefined;
482
483
 
483
484
  sendText(text: string, shouldExecute: boolean = true): void {
@@ -40,10 +40,12 @@ import { TestItemImpl, TestItemCollection } from './test-item';
40
40
  import { AccumulatingTreeDeltaEmitter, TreeDelta } from '@theia/test/lib/common/tree-delta';
41
41
  import {
42
42
  TestItemDTO, TestOutputDTO, TestExecutionState, TestRunProfileDTO,
43
- TestRunProfileKind, TestRunRequestDTO, TestStateChangeDTO, TestItemReference, TestMessageArg, TestMessageDTO
43
+ TestRunProfileKind, TestRunRequestDTO, TestStateChangeDTO, TestItemReference, TestMessageArg, TestMessageDTO,
44
+ TestMessageStackFrameDTO
44
45
  } from '../common/test-types';
46
+ import * as protocol from '@theia/core/shared/vscode-languageserver-protocol';
45
47
  import { ChangeBatcher, observableProperty } from '@theia/test/lib/common/collections';
46
- import { TestRunRequest } from './types-impl';
48
+ import { Location, Position, Range, TestRunRequest, URI } from './types-impl';
47
49
  import { MarkdownString } from '../common/plugin-api-rpc-model';
48
50
 
49
51
  type RefreshHandler = (token: theia.CancellationToken) => void | theia.Thenable<void>;
@@ -374,7 +376,36 @@ export class TestingExtImpl implements TestingExt {
374
376
  actualOutput: testMessage.actual,
375
377
  expectedOutput: testMessage.expected,
376
378
  contextValue: testMessage.contextValue,
377
- location: testMessage.location ? Convert.toLocation(testMessage.location) : undefined
379
+ location: this.toLocation(testMessage.location),
380
+ stackTrace: testMessage.stackTrace ? testMessage.stackTrace.map(frame => this.toStackFrame(frame)) : undefined
381
+ };
382
+ }
383
+
384
+ toLocation(location: protocol.Location | undefined): Location | undefined {
385
+ if (!location) {
386
+ return undefined;
387
+ }
388
+ return new Location(URI.parse(location.uri), this.toRange(location.range));
389
+ }
390
+
391
+ toRange(range: protocol.Range): Range {
392
+ return new Range(this.toPosition(range.start), this.toPosition(range.end));
393
+ }
394
+
395
+ toPosition(position: protocol.Position): Position;
396
+ toPosition(position: protocol.Position | undefined): Position | undefined;
397
+ toPosition(position: protocol.Position | undefined): Position | undefined {
398
+ if (!position) {
399
+ return undefined;
400
+ }
401
+ return new Position(position.line, position.character);
402
+ }
403
+
404
+ toStackFrame(stackFrame: TestMessageStackFrameDTO): theia.TestMessageStackFrame {
405
+ return {
406
+ label: stackFrame.label,
407
+ position: this.toPosition(stackFrame.position),
408
+ uri: stackFrame.uri ? URI.parse(stackFrame.uri) : undefined
378
409
  };
379
410
  }
380
411
 
@@ -30,7 +30,7 @@ export class TextEditorExt implements theia.TextEditor {
30
30
  private disposed = false;
31
31
  constructor(
32
32
  private readonly proxy: TextEditorsMain,
33
- private readonly id: string,
33
+ readonly id: string,
34
34
  document: DocumentDataExt,
35
35
  private _selections: Selection[],
36
36
  options: TextEditorConfiguration,