@theia/plugin-ext 1.53.2 → 1.54.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 (287) 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 +14 -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 +2 -0
  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/quick-open-main.d.ts +0 -1
  43. package/lib/main/browser/quick-open-main.d.ts.map +1 -1
  44. package/lib/main/browser/tabs/tabs-main.d.ts +1 -1
  45. package/lib/main/browser/tabs/tabs-main.d.ts.map +1 -1
  46. package/lib/main/browser/tabs/tabs-main.js +1 -1
  47. package/lib/main/browser/tabs/tabs-main.js.map +1 -1
  48. package/lib/main/browser/terminal-main.d.ts +0 -1
  49. package/lib/main/browser/terminal-main.d.ts.map +1 -1
  50. package/lib/main/browser/test-main.d.ts.map +1 -1
  51. package/lib/main/browser/test-main.js.map +1 -1
  52. package/lib/main/browser/text-editor-main.d.ts +6 -3
  53. package/lib/main/browser/text-editor-main.d.ts.map +1 -1
  54. package/lib/main/browser/text-editor-main.js +39 -5
  55. package/lib/main/browser/text-editor-main.js.map +1 -1
  56. package/lib/main/browser/view/tree-view-decorator-service.d.ts +0 -1
  57. package/lib/main/browser/view/tree-view-decorator-service.d.ts.map +1 -1
  58. package/lib/main/browser/view/tree-view-widget.d.ts +0 -1
  59. package/lib/main/browser/view/tree-view-widget.d.ts.map +1 -1
  60. package/lib/main/browser/view/tree-views-main.d.ts +0 -1
  61. package/lib/main/browser/view/tree-views-main.d.ts.map +1 -1
  62. package/lib/main/browser/webview/webview.d.ts +0 -1
  63. package/lib/main/browser/webview/webview.d.ts.map +1 -1
  64. package/lib/main/browser/webview-views/webview-views-main.d.ts +0 -1
  65. package/lib/main/browser/webview-views/webview-views-main.d.ts.map +1 -1
  66. package/lib/main/browser/webviews-main.d.ts +0 -1
  67. package/lib/main/browser/webviews-main.d.ts.map +1 -1
  68. package/lib/main/browser/workspace-main.d.ts +0 -1
  69. package/lib/main/browser/workspace-main.d.ts.map +1 -1
  70. package/lib/plugin/authentication-ext.d.ts +3 -3
  71. package/lib/plugin/authentication-ext.d.ts.map +1 -1
  72. package/lib/plugin/authentication-ext.js +8 -5
  73. package/lib/plugin/authentication-ext.js.map +1 -1
  74. package/lib/plugin/clipboard-ext.d.ts +0 -1
  75. package/lib/plugin/clipboard-ext.d.ts.map +1 -1
  76. package/lib/plugin/command-registry.d.ts +0 -1
  77. package/lib/plugin/command-registry.d.ts.map +1 -1
  78. package/lib/plugin/comments.d.ts +0 -1
  79. package/lib/plugin/comments.d.ts.map +1 -1
  80. package/lib/plugin/custom-editors.d.ts +0 -1
  81. package/lib/plugin/custom-editors.d.ts.map +1 -1
  82. package/lib/plugin/debug/debug-ext.d.ts +0 -1
  83. package/lib/plugin/debug/debug-ext.d.ts.map +1 -1
  84. package/lib/plugin/debug/plugin-debug-adapter-creator.d.ts +0 -1
  85. package/lib/plugin/debug/plugin-debug-adapter-creator.d.ts.map +1 -1
  86. package/lib/plugin/debug/plugin-debug-adapter-session.d.ts +0 -1
  87. package/lib/plugin/debug/plugin-debug-adapter-session.d.ts.map +1 -1
  88. package/lib/plugin/debug/plugin-debug-adapter-tracker.d.ts +0 -1
  89. package/lib/plugin/debug/plugin-debug-adapter-tracker.d.ts.map +1 -1
  90. package/lib/plugin/decorations.d.ts +0 -1
  91. package/lib/plugin/decorations.d.ts.map +1 -1
  92. package/lib/plugin/dialogs.d.ts +0 -1
  93. package/lib/plugin/dialogs.d.ts.map +1 -1
  94. package/lib/plugin/document-data.d.ts +0 -1
  95. package/lib/plugin/document-data.d.ts.map +1 -1
  96. package/lib/plugin/documents.d.ts +0 -1
  97. package/lib/plugin/documents.d.ts.map +1 -1
  98. package/lib/plugin/env.d.ts +0 -1
  99. package/lib/plugin/env.d.ts.map +1 -1
  100. package/lib/plugin/file-system-event-service-ext-impl.d.ts +0 -1
  101. package/lib/plugin/file-system-event-service-ext-impl.d.ts.map +1 -1
  102. package/lib/plugin/file-system-ext-impl.d.ts +0 -1
  103. package/lib/plugin/file-system-ext-impl.d.ts.map +1 -1
  104. package/lib/plugin/label-service.d.ts +0 -1
  105. package/lib/plugin/label-service.d.ts.map +1 -1
  106. package/lib/plugin/languages/call-hierarchy.d.ts +0 -1
  107. package/lib/plugin/languages/call-hierarchy.d.ts.map +1 -1
  108. package/lib/plugin/languages/code-action.d.ts +0 -1
  109. package/lib/plugin/languages/code-action.d.ts.map +1 -1
  110. package/lib/plugin/languages/color.d.ts +0 -1
  111. package/lib/plugin/languages/color.d.ts.map +1 -1
  112. package/lib/plugin/languages/completion.d.ts +0 -1
  113. package/lib/plugin/languages/completion.d.ts.map +1 -1
  114. package/lib/plugin/languages/declaration.d.ts +0 -1
  115. package/lib/plugin/languages/declaration.d.ts.map +1 -1
  116. package/lib/plugin/languages/definition.d.ts +0 -1
  117. package/lib/plugin/languages/definition.d.ts.map +1 -1
  118. package/lib/plugin/languages/diagnostics.d.ts +0 -1
  119. package/lib/plugin/languages/diagnostics.d.ts.map +1 -1
  120. package/lib/plugin/languages/document-drop-edit.d.ts +0 -1
  121. package/lib/plugin/languages/document-drop-edit.d.ts.map +1 -1
  122. package/lib/plugin/languages/document-formatting.d.ts +0 -1
  123. package/lib/plugin/languages/document-formatting.d.ts.map +1 -1
  124. package/lib/plugin/languages/document-highlight.d.ts +0 -1
  125. package/lib/plugin/languages/document-highlight.d.ts.map +1 -1
  126. package/lib/plugin/languages/evaluatable-expression.d.ts +0 -1
  127. package/lib/plugin/languages/evaluatable-expression.d.ts.map +1 -1
  128. package/lib/plugin/languages/folding.d.ts +0 -1
  129. package/lib/plugin/languages/folding.d.ts.map +1 -1
  130. package/lib/plugin/languages/hover.d.ts +0 -1
  131. package/lib/plugin/languages/hover.d.ts.map +1 -1
  132. package/lib/plugin/languages/implementation.d.ts +0 -1
  133. package/lib/plugin/languages/implementation.d.ts.map +1 -1
  134. package/lib/plugin/languages/inlay-hints.d.ts +0 -1
  135. package/lib/plugin/languages/inlay-hints.d.ts.map +1 -1
  136. package/lib/plugin/languages/inline-completion.d.ts +0 -1
  137. package/lib/plugin/languages/inline-completion.d.ts.map +1 -1
  138. package/lib/plugin/languages/inline-values.d.ts +0 -1
  139. package/lib/plugin/languages/inline-values.d.ts.map +1 -1
  140. package/lib/plugin/languages/lens.d.ts +0 -1
  141. package/lib/plugin/languages/lens.d.ts.map +1 -1
  142. package/lib/plugin/languages/link-provider.d.ts +0 -1
  143. package/lib/plugin/languages/link-provider.d.ts.map +1 -1
  144. package/lib/plugin/languages/linked-editing-range.d.ts +0 -1
  145. package/lib/plugin/languages/linked-editing-range.d.ts.map +1 -1
  146. package/lib/plugin/languages/on-type-formatting.d.ts +0 -1
  147. package/lib/plugin/languages/on-type-formatting.d.ts.map +1 -1
  148. package/lib/plugin/languages/outline.d.ts +0 -1
  149. package/lib/plugin/languages/outline.d.ts.map +1 -1
  150. package/lib/plugin/languages/range-formatting.d.ts +0 -1
  151. package/lib/plugin/languages/range-formatting.d.ts.map +1 -1
  152. package/lib/plugin/languages/reference.d.ts +0 -1
  153. package/lib/plugin/languages/reference.d.ts.map +1 -1
  154. package/lib/plugin/languages/rename.d.ts +0 -1
  155. package/lib/plugin/languages/rename.d.ts.map +1 -1
  156. package/lib/plugin/languages/selection-range.d.ts +0 -1
  157. package/lib/plugin/languages/selection-range.d.ts.map +1 -1
  158. package/lib/plugin/languages/semantic-highlighting.d.ts +0 -1
  159. package/lib/plugin/languages/semantic-highlighting.d.ts.map +1 -1
  160. package/lib/plugin/languages/signature.d.ts +0 -1
  161. package/lib/plugin/languages/signature.d.ts.map +1 -1
  162. package/lib/plugin/languages/type-definition.d.ts +0 -1
  163. package/lib/plugin/languages/type-definition.d.ts.map +1 -1
  164. package/lib/plugin/languages/type-hierarchy.d.ts +0 -1
  165. package/lib/plugin/languages/type-hierarchy.d.ts.map +1 -1
  166. package/lib/plugin/languages/util.d.ts +0 -1
  167. package/lib/plugin/languages/util.d.ts.map +1 -1
  168. package/lib/plugin/languages/workspace-symbol.d.ts +0 -1
  169. package/lib/plugin/languages/workspace-symbol.d.ts.map +1 -1
  170. package/lib/plugin/languages-utils.d.ts +0 -1
  171. package/lib/plugin/languages-utils.d.ts.map +1 -1
  172. package/lib/plugin/languages.d.ts +0 -1
  173. package/lib/plugin/languages.d.ts.map +1 -1
  174. package/lib/plugin/markdown-string.d.ts +0 -1
  175. package/lib/plugin/markdown-string.d.ts.map +1 -1
  176. package/lib/plugin/message-registry.d.ts +0 -1
  177. package/lib/plugin/message-registry.d.ts.map +1 -1
  178. package/lib/plugin/node/debug/plugin-node-debug-adapter-creator.d.ts +0 -1
  179. package/lib/plugin/node/debug/plugin-node-debug-adapter-creator.d.ts.map +1 -1
  180. package/lib/plugin/notebook/notebook-document.d.ts +0 -1
  181. package/lib/plugin/notebook/notebook-document.d.ts.map +1 -1
  182. package/lib/plugin/notebook/notebook-documents.d.ts +0 -1
  183. package/lib/plugin/notebook/notebook-documents.d.ts.map +1 -1
  184. package/lib/plugin/notebook/notebook-editor.d.ts +0 -1
  185. package/lib/plugin/notebook/notebook-editor.d.ts.map +1 -1
  186. package/lib/plugin/notebook/notebook-editors.d.ts +0 -1
  187. package/lib/plugin/notebook/notebook-editors.d.ts.map +1 -1
  188. package/lib/plugin/notebook/notebook-kernels.d.ts +0 -1
  189. package/lib/plugin/notebook/notebook-kernels.d.ts.map +1 -1
  190. package/lib/plugin/notebook/notebook-renderers.d.ts +0 -1
  191. package/lib/plugin/notebook/notebook-renderers.d.ts.map +1 -1
  192. package/lib/plugin/notebook/notebooks.d.ts +1 -1
  193. package/lib/plugin/notebook/notebooks.d.ts.map +1 -1
  194. package/lib/plugin/notebook/notebooks.js +22 -2
  195. package/lib/plugin/notebook/notebooks.js.map +1 -1
  196. package/lib/plugin/notification.d.ts +0 -1
  197. package/lib/plugin/notification.d.ts.map +1 -1
  198. package/lib/plugin/output-channel/log-output-channel.d.ts +0 -1
  199. package/lib/plugin/output-channel/log-output-channel.d.ts.map +1 -1
  200. package/lib/plugin/output-channel/output-channel-item.d.ts +0 -1
  201. package/lib/plugin/output-channel/output-channel-item.d.ts.map +1 -1
  202. package/lib/plugin/output-channel-registry.d.ts +0 -1
  203. package/lib/plugin/output-channel-registry.d.ts.map +1 -1
  204. package/lib/plugin/plugin-context.d.ts +0 -1
  205. package/lib/plugin/plugin-context.d.ts.map +1 -1
  206. package/lib/plugin/plugin-context.js +4 -0
  207. package/lib/plugin/plugin-context.js.map +1 -1
  208. package/lib/plugin/plugin-manager.d.ts +0 -1
  209. package/lib/plugin/plugin-manager.d.ts.map +1 -1
  210. package/lib/plugin/plugin-storage.d.ts +0 -1
  211. package/lib/plugin/plugin-storage.d.ts.map +1 -1
  212. package/lib/plugin/preference-registry.d.ts +0 -1
  213. package/lib/plugin/preference-registry.d.ts.map +1 -1
  214. package/lib/plugin/quick-open.d.ts +0 -1
  215. package/lib/plugin/quick-open.d.ts.map +1 -1
  216. package/lib/plugin/scm.d.ts +0 -1
  217. package/lib/plugin/scm.d.ts.map +1 -1
  218. package/lib/plugin/secrets-ext.d.ts +0 -1
  219. package/lib/plugin/secrets-ext.d.ts.map +1 -1
  220. package/lib/plugin/status-bar/status-bar-item.d.ts +0 -1
  221. package/lib/plugin/status-bar/status-bar-item.d.ts.map +1 -1
  222. package/lib/plugin/status-bar-message-registry.d.ts +0 -1
  223. package/lib/plugin/status-bar-message-registry.d.ts.map +1 -1
  224. package/lib/plugin/tabs.d.ts +0 -1
  225. package/lib/plugin/tabs.d.ts.map +1 -1
  226. package/lib/plugin/tasks/task-provider.d.ts +0 -1
  227. package/lib/plugin/tasks/task-provider.d.ts.map +1 -1
  228. package/lib/plugin/tasks/tasks.d.ts +0 -1
  229. package/lib/plugin/tasks/tasks.d.ts.map +1 -1
  230. package/lib/plugin/terminal-ext.d.ts +1 -1
  231. package/lib/plugin/terminal-ext.d.ts.map +1 -1
  232. package/lib/plugin/terminal-ext.js +1 -0
  233. package/lib/plugin/terminal-ext.js.map +1 -1
  234. package/lib/plugin/test-item.d.ts +0 -1
  235. package/lib/plugin/test-item.d.ts.map +1 -1
  236. package/lib/plugin/tests.d.ts +8 -2
  237. package/lib/plugin/tests.d.ts.map +1 -1
  238. package/lib/plugin/tests.js +24 -1
  239. package/lib/plugin/tests.js.map +1 -1
  240. package/lib/plugin/text-editor.d.ts +1 -2
  241. package/lib/plugin/text-editor.d.ts.map +1 -1
  242. package/lib/plugin/text-editor.js.map +1 -1
  243. package/lib/plugin/text-editors.d.ts +0 -1
  244. package/lib/plugin/text-editors.d.ts.map +1 -1
  245. package/lib/plugin/timeline.d.ts +0 -1
  246. package/lib/plugin/timeline.d.ts.map +1 -1
  247. package/lib/plugin/tree/tree-views.d.ts +0 -1
  248. package/lib/plugin/tree/tree-views.d.ts.map +1 -1
  249. package/lib/plugin/type-converters.d.ts +13 -2
  250. package/lib/plugin/type-converters.d.ts.map +1 -1
  251. package/lib/plugin/type-converters.js +55 -5
  252. package/lib/plugin/type-converters.js.map +1 -1
  253. package/lib/plugin/types-impl.d.ts +7 -1
  254. package/lib/plugin/types-impl.d.ts.map +1 -1
  255. package/lib/plugin/types-impl.js +9 -1
  256. package/lib/plugin/types-impl.js.map +1 -1
  257. package/lib/plugin/uri-ext.d.ts +0 -1
  258. package/lib/plugin/uri-ext.d.ts.map +1 -1
  259. package/lib/plugin/webview-views.d.ts +0 -1
  260. package/lib/plugin/webview-views.d.ts.map +1 -1
  261. package/lib/plugin/webviews.d.ts +0 -1
  262. package/lib/plugin/webviews.d.ts.map +1 -1
  263. package/lib/plugin/window-state.d.ts +0 -1
  264. package/lib/plugin/window-state.d.ts.map +1 -1
  265. package/lib/plugin/workspace.d.ts +0 -1
  266. package/lib/plugin/workspace.d.ts.map +1 -1
  267. package/package.json +29 -29
  268. package/src/common/plugin-api-rpc-model.ts +11 -0
  269. package/src/common/plugin-api-rpc.ts +7 -5
  270. package/src/common/test-types.ts +15 -1
  271. package/src/main/browser/authentication-main.ts +24 -11
  272. package/src/main/browser/custom-editors/custom-editor-opener.tsx +19 -4
  273. package/src/main/browser/custom-editors/plugin-custom-editor-registry.ts +7 -3
  274. package/src/main/browser/editors-and-documents-main.ts +25 -2
  275. package/src/main/browser/menus/plugin-menu-command-adapter.ts +2 -2
  276. package/src/main/browser/notebooks/notebook-documents-and-editors-main.ts +4 -1
  277. package/src/main/browser/tabs/tabs-main.ts +6 -2
  278. package/src/main/browser/test-main.ts +4 -1
  279. package/src/main/browser/text-editor-main.ts +55 -14
  280. package/src/plugin/authentication-ext.ts +9 -5
  281. package/src/plugin/notebook/notebooks.ts +21 -0
  282. package/src/plugin/plugin-context.ts +6 -1
  283. package/src/plugin/terminal-ext.ts +1 -0
  284. package/src/plugin/tests.ts +34 -3
  285. package/src/plugin/text-editor.ts +1 -1
  286. package/src/plugin/type-converters.ts +58 -6
  287. package/src/plugin/types-impl.ts +10 -1
@@ -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,6 +335,11 @@ 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
344
  if (delta.newActiveEditor !== undefined) {
324
345
  this.onDidChangeActiveNotebookEditorEmitter.fire(this.activeNotebookEditor?.apiEditor);
@@ -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,
@@ -338,6 +339,9 @@ export function createAPIFactory(
338
339
  },
339
340
  get onDidChangeSessions(): theia.Event<theia.AuthenticationSessionsChangeEvent> {
340
341
  return authenticationExt.onDidChangeSessions;
342
+ },
343
+ getAccounts(providerId: string): Thenable<readonly theia.AuthenticationSessionAccountInformation[]> {
344
+ return authenticationExt.getAccounts(providerId);
341
345
  }
342
346
  };
343
347
  function commandIsDeclaredInPackage(id: string, model: PluginPackage): boolean {
@@ -881,7 +885,7 @@ export function createAPIFactory(
881
885
 
882
886
  const extensions: typeof theia.extensions = Object.freeze({
883
887
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
884
- getExtension<T = any>(extensionId: string, includeFromDifferentExtensionHosts: boolean = false): theia.Extension<T> | undefined {
888
+ getExtension<T = any>(extensionId: string, includeFromDifferentExtensionHosts: boolean = false): theia.Extension<T | undefined> | undefined {
885
889
  includeFromDifferentExtensionHosts = false;
886
890
  const plg = pluginManager.getPluginById(extensionId.toLowerCase());
887
891
  if (plg) {
@@ -1460,6 +1464,7 @@ export function createAPIFactory(
1460
1464
  TestTag,
1461
1465
  TestRunRequest,
1462
1466
  TestMessage,
1467
+ TestMessageStackFrame,
1463
1468
  ExtensionKind,
1464
1469
  InlineCompletionItem,
1465
1470
  InlineCompletionList,
@@ -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,
@@ -34,7 +34,7 @@ import { BinaryBuffer } from '@theia/core/lib/common/buffer';
34
34
  import { CellRange, isTextStreamMime } from '@theia/notebook/lib/common';
35
35
  import { MarkdownString as MarkdownStringDTO } from '@theia/core/lib/common/markdown-rendering';
36
36
 
37
- import { TestItemDTO, TestMessageDTO } from '../common/test-types';
37
+ import { TestItemDTO, TestMessageDTO, TestMessageStackFrameDTO } from '../common/test-types';
38
38
  import { PluginIconPath } from './plugin-icon-path';
39
39
 
40
40
  const SIDE_GROUP = -2;
@@ -134,12 +134,21 @@ export function fromRange(range: theia.Range | undefined): model.Range | undefin
134
134
  endColumn: end.character + 1
135
135
  };
136
136
  }
137
-
138
- export function fromPosition(position: types.Position | theia.Position): Position {
137
+ export function fromPosition(position: types.Position | theia.Position): Position;
138
+ export function fromPosition(position: types.Position | theia.Position | undefined): Position | undefined;
139
+ export function fromPosition(position: types.Position | theia.Position | undefined): Position | undefined {
140
+ if (!position) {
141
+ return undefined;
142
+ }
139
143
  return { lineNumber: position.line + 1, column: position.character + 1 };
140
144
  }
141
145
 
142
- export function toPosition(position: Position): types.Position {
146
+ export function toPosition(position: Position): types.Position;
147
+ export function toPosition(position: Position | undefined): types.Position | undefined;
148
+ export function toPosition(position: Position | undefined): types.Position | undefined {
149
+ if (!position) {
150
+ return undefined;
151
+ }
143
152
  return new types.Position(position.lineNumber - 1, position.column - 1);
144
153
  }
145
154
 
@@ -474,6 +483,18 @@ export function fromLocation(location: theia.Location | undefined): model.Locati
474
483
  };
475
484
  }
476
485
 
486
+ export function fromLocationToLanguageServerLocation(location: theia.Location): lstypes.Location;
487
+ export function fromLocationToLanguageServerLocation(location: theia.Location | undefined): lstypes.Location | undefined;
488
+ export function fromLocationToLanguageServerLocation(location: theia.Location | undefined): lstypes.Location | undefined {
489
+ if (!location) {
490
+ return undefined;
491
+ }
492
+ return <lstypes.Location>{
493
+ uri: location.uri.toString(),
494
+ range: location.range
495
+ };
496
+ }
497
+
477
498
  export function fromTextDocumentShowOptions(options: theia.TextDocumentShowOptions): model.TextDocumentShowOptions {
478
499
  if (options.selection) {
479
500
  return {
@@ -731,6 +752,26 @@ export function toSymbolTag(kind: model.SymbolTag): types.SymbolTag {
731
752
  }
732
753
  }
733
754
 
755
+ /**
756
+ * Creates a merged symbol of type theia.SymbolInformation & theia.DocumentSymbol.
757
+ * Is only used as the result type of the `vscode.executeDocumentSymbolProvider` command.
758
+ */
759
+ export function toMergedSymbol(uri: UriComponents, symbol: model.DocumentSymbol): theia.SymbolInformation & theia.DocumentSymbol {
760
+ const uriValue = URI.revive(uri);
761
+ const location = new types.Location(uriValue, toRange(symbol.range));
762
+ return {
763
+ name: symbol.name,
764
+ containerName: symbol.containerName ?? '',
765
+ kind: SymbolKind.toSymbolKind(symbol.kind),
766
+ tags: [],
767
+ location,
768
+ detail: symbol.detail,
769
+ range: location.range,
770
+ selectionRange: toRange(symbol.selectionRange),
771
+ children: symbol.children?.map(child => toMergedSymbol(uri, child)) ?? []
772
+ };
773
+ }
774
+
734
775
  export function isModelLocation(arg: unknown): arg is model.Location {
735
776
  return isObject<model.Location>(arg) &&
736
777
  isModelRange(arg.range) &&
@@ -1677,15 +1718,26 @@ export namespace TestMessage {
1677
1718
  return message.map(msg => TestMessage.from(msg)[0]);
1678
1719
  }
1679
1720
  return [{
1680
- location: fromLocation(message.location),
1721
+ location: fromLocationToLanguageServerLocation(message.location),
1681
1722
  message: fromMarkdown(message.message)!,
1682
1723
  expected: message.expectedOutput,
1683
1724
  actual: message.actualOutput,
1684
- contextValue: message.contextValue
1725
+ contextValue: message.contextValue,
1726
+ stackTrace: message.stackTrace && message.stackTrace.map(frame => TestMessageStackFrame.from(frame))
1685
1727
  }];
1686
1728
  }
1687
1729
  }
1688
1730
 
1731
+ export namespace TestMessageStackFrame {
1732
+ export function from(stackTrace: theia.TestMessageStackFrame): TestMessageStackFrameDTO {
1733
+ return {
1734
+ label: stackTrace.label,
1735
+ position: stackTrace.position,
1736
+ uri: stackTrace?.uri?.toString()
1737
+ };
1738
+ }
1739
+ }
1740
+
1689
1741
  export namespace TestItem {
1690
1742
  export function from(test: theia.TestItem): TestItemDTO {
1691
1743
  return <TestItemDTO>TestItem.fromPartial(test);
@@ -3036,7 +3036,7 @@ export class DebugThread implements theia.DebugThread {
3036
3036
  }
3037
3037
 
3038
3038
  export class DebugStackFrame implements theia.DebugStackFrame {
3039
- constructor(readonly session: theia.DebugSession, readonly threadId: number, readonly frameId: number) { }
3039
+ constructor(readonly session: theia.DebugSession, readonly threadId: number, readonly frameId: number) { }
3040
3040
  }
3041
3041
 
3042
3042
  @es5ClassCompat
@@ -3350,6 +3350,7 @@ export class TestMessage implements theia.TestMessage {
3350
3350
  public actualOutput?: string;
3351
3351
  public location?: theia.Location;
3352
3352
  public contextValue?: string;
3353
+ public stackTrace?: theia.TestMessageStackFrame[] | undefined;
3353
3354
 
3354
3355
  public static diff(message: string | theia.MarkdownString, expected: string, actual: string): theia.TestMessage {
3355
3356
  const msg = new TestMessage(message);
@@ -3366,6 +3367,14 @@ export class TestCoverageCount {
3366
3367
  constructor(public covered: number, public total: number) { }
3367
3368
  }
3368
3369
 
3370
+ export class TestMessageStackFrame implements theia.TestMessageStackFrame {
3371
+ constructor(
3372
+ public label: string,
3373
+ public uri?: theia.Uri,
3374
+ public position?: Position
3375
+ ) { }
3376
+ }
3377
+
3369
3378
  @es5ClassCompat
3370
3379
  export class FileCoverage {
3371
3380