@theia/plugin-ext 1.18.0-next.de7b81be → 1.20.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 (258) hide show
  1. package/LICENSE +642 -0
  2. package/README.md +5 -0
  3. package/lib/common/connection.d.ts +1 -2
  4. package/lib/common/connection.d.ts.map +1 -1
  5. package/lib/common/connection.js.map +1 -1
  6. package/lib/common/plugin-api-rpc-model.d.ts +4 -0
  7. package/lib/common/plugin-api-rpc-model.d.ts.map +1 -1
  8. package/lib/common/plugin-api-rpc-model.js.map +1 -1
  9. package/lib/common/plugin-api-rpc.d.ts +30 -10
  10. package/lib/common/plugin-api-rpc.d.ts.map +1 -1
  11. package/lib/common/plugin-api-rpc.js +21 -1
  12. package/lib/common/plugin-api-rpc.js.map +1 -1
  13. package/lib/common/plugin-protocol.d.ts +2 -1
  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 -6
  17. package/lib/hosted/browser/hosted-plugin.d.ts.map +1 -1
  18. package/lib/hosted/browser/hosted-plugin.js +19 -13
  19. package/lib/hosted/browser/hosted-plugin.js.map +1 -1
  20. package/lib/hosted/browser/worker/debug-stub.d.ts.map +1 -1
  21. package/lib/hosted/browser/worker/debug-stub.js +1 -0
  22. package/lib/hosted/browser/worker/debug-stub.js.map +1 -1
  23. package/lib/hosted/node/hosted-plugin-deployer-handler.d.ts +1 -1
  24. package/lib/hosted/node/hosted-plugin-deployer-handler.d.ts.map +1 -1
  25. package/lib/hosted/node/hosted-plugin-deployer-handler.js +14 -38
  26. package/lib/hosted/node/hosted-plugin-deployer-handler.js.map +1 -1
  27. package/lib/hosted/node/hosted-plugin-localization-service.d.ts +37 -0
  28. package/lib/hosted/node/hosted-plugin-localization-service.d.ts.map +1 -0
  29. package/lib/hosted/node/hosted-plugin-localization-service.js +197 -0
  30. package/lib/hosted/node/hosted-plugin-localization-service.js.map +1 -0
  31. package/lib/hosted/node/hosted-plugin-process.d.ts +2 -2
  32. package/lib/hosted/node/hosted-plugin-process.d.ts.map +1 -1
  33. package/lib/hosted/node/hosted-plugin-process.js +5 -7
  34. package/lib/hosted/node/hosted-plugin-process.js.map +1 -1
  35. package/lib/hosted/node/plugin-ext-hosted-backend-module.d.ts.map +1 -1
  36. package/lib/hosted/node/plugin-ext-hosted-backend-module.js +2 -0
  37. package/lib/hosted/node/plugin-ext-hosted-backend-module.js.map +1 -1
  38. package/lib/hosted/node/plugin-manifest-loader.d.ts +1 -1
  39. package/lib/hosted/node/plugin-manifest-loader.d.ts.map +1 -1
  40. package/lib/hosted/node/plugin-manifest-loader.js +4 -52
  41. package/lib/hosted/node/plugin-manifest-loader.js.map +1 -1
  42. package/lib/hosted/node/plugin-service.d.ts +3 -6
  43. package/lib/hosted/node/plugin-service.d.ts.map +1 -1
  44. package/lib/hosted/node/plugin-service.js +7 -40
  45. package/lib/hosted/node/plugin-service.js.map +1 -1
  46. package/lib/hosted/node/scanners/scanner-theia.d.ts +1 -1
  47. package/lib/hosted/node/scanners/scanner-theia.d.ts.map +1 -1
  48. package/lib/hosted/node/scanners/scanner-theia.js +2 -1
  49. package/lib/hosted/node/scanners/scanner-theia.js.map +1 -1
  50. package/lib/main/browser/callhierarchy/callhierarchy-type-converters.d.ts.map +1 -1
  51. package/lib/main/browser/callhierarchy/callhierarchy-type-converters.js +6 -2
  52. package/lib/main/browser/callhierarchy/callhierarchy-type-converters.js.map +1 -1
  53. package/lib/main/browser/custom-editors/custom-editor-opener.d.ts +1 -2
  54. package/lib/main/browser/custom-editors/custom-editor-opener.d.ts.map +1 -1
  55. package/lib/main/browser/custom-editors/custom-editor-opener.js +2 -1
  56. package/lib/main/browser/custom-editors/custom-editor-opener.js.map +1 -1
  57. package/lib/main/browser/custom-editors/custom-editors-main.d.ts.map +1 -1
  58. package/lib/main/browser/custom-editors/custom-editors-main.js +1 -2
  59. package/lib/main/browser/custom-editors/custom-editors-main.js.map +1 -1
  60. package/lib/main/browser/debug/debug-main.js +1 -1
  61. package/lib/main/browser/debug/debug-main.js.map +1 -1
  62. package/lib/main/browser/debug/plugin-debug-adapter-contribution.d.ts +1 -1
  63. package/lib/main/browser/debug/plugin-debug-adapter-contribution.d.ts.map +1 -1
  64. package/lib/main/browser/debug/plugin-debug-adapter-contribution.js +2 -2
  65. package/lib/main/browser/debug/plugin-debug-adapter-contribution.js.map +1 -1
  66. package/lib/main/browser/debug/plugin-debug-service.d.ts +8 -0
  67. package/lib/main/browser/debug/plugin-debug-service.d.ts.map +1 -1
  68. package/lib/main/browser/debug/plugin-debug-service.js +15 -0
  69. package/lib/main/browser/debug/plugin-debug-service.js.map +1 -1
  70. package/lib/main/browser/debug/plugin-debug-session-factory.d.ts +2 -2
  71. package/lib/main/browser/debug/plugin-debug-session-factory.d.ts.map +1 -1
  72. package/lib/main/browser/debug/plugin-debug-session-factory.js.map +1 -1
  73. package/lib/main/browser/dialogs/modal-notification.d.ts +3 -3
  74. package/lib/main/browser/dialogs/modal-notification.d.ts.map +1 -1
  75. package/lib/main/browser/dialogs/modal-notification.js +17 -6
  76. package/lib/main/browser/dialogs/modal-notification.js.map +1 -1
  77. package/lib/main/browser/editors-and-documents-main.d.ts.map +1 -1
  78. package/lib/main/browser/editors-and-documents-main.js +3 -4
  79. package/lib/main/browser/editors-and-documents-main.js.map +1 -1
  80. package/lib/main/browser/languages-main.js +1 -1
  81. package/lib/main/browser/languages-main.js.map +1 -1
  82. package/lib/main/browser/message-registry-main.js +1 -1
  83. package/lib/main/browser/message-registry-main.js.map +1 -1
  84. package/lib/main/browser/quick-open-main.d.ts +1 -1
  85. package/lib/main/browser/quick-open-main.d.ts.map +1 -1
  86. package/lib/main/browser/quick-open-main.js.map +1 -1
  87. package/lib/main/browser/tasks-main.d.ts.map +1 -1
  88. package/lib/main/browser/tasks-main.js +6 -0
  89. package/lib/main/browser/tasks-main.js.map +1 -1
  90. package/lib/main/browser/timeline-main.d.ts.map +1 -1
  91. package/lib/main/browser/timeline-main.js +1 -1
  92. package/lib/main/browser/timeline-main.js.map +1 -1
  93. package/lib/main/browser/view/plugin-view-registry.d.ts +3 -2
  94. package/lib/main/browser/view/plugin-view-registry.d.ts.map +1 -1
  95. package/lib/main/browser/view/plugin-view-registry.js +63 -23
  96. package/lib/main/browser/view/plugin-view-registry.js.map +1 -1
  97. package/lib/main/browser/view/plugin-view-widget.d.ts +2 -0
  98. package/lib/main/browser/view/plugin-view-widget.d.ts.map +1 -1
  99. package/lib/main/browser/view/plugin-view-widget.js +3 -1
  100. package/lib/main/browser/view/plugin-view-widget.js.map +1 -1
  101. package/lib/main/browser/view/tree-view-widget.d.ts +3 -7
  102. package/lib/main/browser/view/tree-view-widget.d.ts.map +1 -1
  103. package/lib/main/browser/view/tree-view-widget.js +26 -39
  104. package/lib/main/browser/view/tree-view-widget.js.map +1 -1
  105. package/lib/main/browser/webview/webview-frontend-security-warnings.d.ts.map +1 -1
  106. package/lib/main/browser/webview/webview-frontend-security-warnings.js +8 -5
  107. package/lib/main/browser/webview/webview-frontend-security-warnings.js.map +1 -1
  108. package/lib/main/browser/webview/webview-preferences.d.ts.map +1 -1
  109. package/lib/main/browser/webview/webview-preferences.js +3 -2
  110. package/lib/main/browser/webview/webview-preferences.js.map +1 -1
  111. package/lib/main/browser/webview/webview.d.ts +1 -1
  112. package/lib/main/browser/webview/webview.d.ts.map +1 -1
  113. package/lib/main/browser/webview/webview.js +1 -1
  114. package/lib/main/browser/webview/webview.js.map +1 -1
  115. package/lib/plugin/comments.d.ts.map +1 -1
  116. package/lib/plugin/comments.js +2 -3
  117. package/lib/plugin/comments.js.map +1 -1
  118. package/lib/plugin/custom-editors.d.ts +1 -2
  119. package/lib/plugin/custom-editors.d.ts.map +1 -1
  120. package/lib/plugin/custom-editors.js +2 -3
  121. package/lib/plugin/custom-editors.js.map +1 -1
  122. package/lib/plugin/decorations.d.ts.map +1 -1
  123. package/lib/plugin/decorations.js +2 -3
  124. package/lib/plugin/decorations.js.map +1 -1
  125. package/lib/plugin/document-data.d.ts.map +1 -1
  126. package/lib/plugin/document-data.js +1 -1
  127. package/lib/plugin/document-data.js.map +1 -1
  128. package/lib/plugin/documents.d.ts.map +1 -1
  129. package/lib/plugin/documents.js +1 -2
  130. package/lib/plugin/documents.js.map +1 -1
  131. package/lib/plugin/file-system-event-service-ext-impl.d.ts.map +1 -1
  132. package/lib/plugin/file-system-event-service-ext-impl.js +2 -3
  133. package/lib/plugin/file-system-event-service-ext-impl.js.map +1 -1
  134. package/lib/plugin/file-system-ext-impl.d.ts.map +1 -1
  135. package/lib/plugin/file-system-ext-impl.js +12 -13
  136. package/lib/plugin/file-system-ext-impl.js.map +1 -1
  137. package/lib/plugin/known-commands.spec.js +1 -2
  138. package/lib/plugin/known-commands.spec.js.map +1 -1
  139. package/lib/plugin/languages/call-hierarchy.d.ts +1 -1
  140. package/lib/plugin/languages/call-hierarchy.d.ts.map +1 -1
  141. package/lib/plugin/languages/call-hierarchy.js +8 -3
  142. package/lib/plugin/languages/call-hierarchy.js.map +1 -1
  143. package/lib/plugin/languages/rename.d.ts +1 -2
  144. package/lib/plugin/languages/rename.d.ts.map +1 -1
  145. package/lib/plugin/languages/rename.js.map +1 -1
  146. package/lib/plugin/languages.d.ts +1 -1
  147. package/lib/plugin/languages.d.ts.map +1 -1
  148. package/lib/plugin/languages.js.map +1 -1
  149. package/lib/plugin/message-registry.d.ts.map +1 -1
  150. package/lib/plugin/message-registry.js +3 -0
  151. package/lib/plugin/message-registry.js.map +1 -1
  152. package/lib/plugin/node/debug/debug.d.ts +4 -3
  153. package/lib/plugin/node/debug/debug.d.ts.map +1 -1
  154. package/lib/plugin/node/debug/debug.js +34 -15
  155. package/lib/plugin/node/debug/debug.js.map +1 -1
  156. package/lib/plugin/node/debug/plugin-debug-adapter-session.d.ts +3 -3
  157. package/lib/plugin/node/debug/plugin-debug-adapter-session.d.ts.map +1 -1
  158. package/lib/plugin/node/debug/plugin-debug-adapter-session.js.map +1 -1
  159. package/lib/plugin/node/debug/plugin-debug-adapter-starter.d.ts +6 -4
  160. package/lib/plugin/node/debug/plugin-debug-adapter-starter.d.ts.map +1 -1
  161. package/lib/plugin/node/debug/plugin-debug-adapter-starter.js +23 -13
  162. package/lib/plugin/node/debug/plugin-debug-adapter-starter.js.map +1 -1
  163. package/lib/plugin/plugin-context.d.ts.map +1 -1
  164. package/lib/plugin/plugin-context.js +8 -3
  165. package/lib/plugin/plugin-context.js.map +1 -1
  166. package/lib/plugin/plugin-manager.d.ts +2 -0
  167. package/lib/plugin/plugin-manager.d.ts.map +1 -1
  168. package/lib/plugin/plugin-manager.js +24 -3
  169. package/lib/plugin/plugin-manager.js.map +1 -1
  170. package/lib/plugin/plugin-storage.d.ts +4 -0
  171. package/lib/plugin/plugin-storage.d.ts.map +1 -1
  172. package/lib/plugin/plugin-storage.js +6 -1
  173. package/lib/plugin/plugin-storage.js.map +1 -1
  174. package/lib/plugin/preference-registry.spec.js.map +1 -1
  175. package/lib/plugin/quick-open.d.ts +1 -1
  176. package/lib/plugin/quick-open.d.ts.map +1 -1
  177. package/lib/plugin/quick-open.js +11 -6
  178. package/lib/plugin/quick-open.js.map +1 -1
  179. package/lib/plugin/tasks/tasks.d.ts +1 -3
  180. package/lib/plugin/tasks/tasks.d.ts.map +1 -1
  181. package/lib/plugin/tasks/tasks.js +3 -17
  182. package/lib/plugin/tasks/tasks.js.map +1 -1
  183. package/lib/plugin/timeline.d.ts.map +1 -1
  184. package/lib/plugin/timeline.js +1 -2
  185. package/lib/plugin/timeline.js.map +1 -1
  186. package/lib/plugin/type-converters.d.ts.map +1 -1
  187. package/lib/plugin/type-converters.js +12 -10
  188. package/lib/plugin/type-converters.js.map +1 -1
  189. package/lib/plugin/types-impl.d.ts +52 -0
  190. package/lib/plugin/types-impl.d.ts.map +1 -1
  191. package/lib/plugin/types-impl.js +79 -1
  192. package/lib/plugin/types-impl.js.map +1 -1
  193. package/lib/plugin/webviews.d.ts +1 -2
  194. package/lib/plugin/webviews.d.ts.map +1 -1
  195. package/lib/plugin/webviews.js.map +1 -1
  196. package/package.json +31 -27
  197. package/src/common/connection.ts +1 -2
  198. package/src/common/plugin-api-rpc-model.ts +4 -0
  199. package/src/common/plugin-api-rpc.ts +31 -9
  200. package/src/common/plugin-protocol.ts +2 -1
  201. package/src/hosted/browser/hosted-plugin.ts +19 -12
  202. package/src/hosted/browser/worker/debug-stub.ts +1 -0
  203. package/src/hosted/node/hosted-plugin-deployer-handler.ts +13 -40
  204. package/src/hosted/node/hosted-plugin-localization-service.ts +201 -0
  205. package/src/hosted/node/hosted-plugin-process.ts +4 -6
  206. package/src/hosted/node/plugin-ext-hosted-backend-module.ts +2 -0
  207. package/src/hosted/node/plugin-manifest-loader.ts +4 -56
  208. package/src/hosted/node/plugin-service.ts +7 -40
  209. package/src/hosted/node/scanners/scanner-theia.ts +3 -2
  210. package/src/main/browser/callhierarchy/callhierarchy-type-converters.ts +6 -2
  211. package/src/main/browser/custom-editors/custom-editor-opener.tsx +3 -3
  212. package/src/main/browser/custom-editors/custom-editors-main.ts +1 -2
  213. package/src/main/browser/debug/debug-main.ts +1 -1
  214. package/src/main/browser/debug/plugin-debug-adapter-contribution.ts +3 -3
  215. package/src/main/browser/debug/plugin-debug-service.ts +23 -0
  216. package/src/main/browser/debug/plugin-debug-session-factory.ts +3 -3
  217. package/src/main/browser/dialogs/modal-notification.ts +18 -7
  218. package/src/main/browser/dialogs/style/modal-notification.css +17 -2
  219. package/src/main/browser/editors-and-documents-main.ts +1 -2
  220. package/src/main/browser/languages-main.ts +1 -1
  221. package/src/main/browser/message-registry-main.ts +1 -1
  222. package/src/main/browser/quick-open-main.ts +1 -1
  223. package/src/main/browser/style/tree.css +4 -0
  224. package/src/main/browser/tasks-main.ts +7 -0
  225. package/src/main/browser/timeline-main.ts +1 -2
  226. package/src/main/browser/view/plugin-view-registry.ts +67 -25
  227. package/src/main/browser/view/plugin-view-widget.ts +7 -2
  228. package/src/main/browser/view/tree-view-widget.tsx +43 -65
  229. package/src/main/browser/webview/pre/host.js +20 -12
  230. package/src/main/browser/webview/pre/main.js +0 -1
  231. package/src/main/browser/webview/webview-frontend-security-warnings.ts +8 -7
  232. package/src/main/browser/webview/webview-preferences.ts +3 -2
  233. package/src/main/browser/webview/webview.ts +1 -1
  234. package/src/plugin/comments.ts +1 -2
  235. package/src/plugin/custom-editors.ts +2 -4
  236. package/src/plugin/decorations.ts +1 -2
  237. package/src/plugin/document-data.ts +1 -2
  238. package/src/plugin/documents.ts +1 -2
  239. package/src/plugin/file-system-event-service-ext-impl.ts +1 -2
  240. package/src/plugin/file-system-ext-impl.ts +1 -2
  241. package/src/plugin/known-commands.spec.ts +1 -2
  242. package/src/plugin/languages/call-hierarchy.ts +14 -5
  243. package/src/plugin/languages/rename.ts +1 -2
  244. package/src/plugin/languages.ts +3 -1
  245. package/src/plugin/message-registry.ts +3 -1
  246. package/src/plugin/node/debug/debug.ts +40 -19
  247. package/src/plugin/node/debug/plugin-debug-adapter-session.ts +3 -3
  248. package/src/plugin/node/debug/plugin-debug-adapter-starter.ts +24 -14
  249. package/src/plugin/plugin-context.ts +21 -10
  250. package/src/plugin/plugin-manager.ts +26 -4
  251. package/src/plugin/plugin-storage.ts +7 -2
  252. package/src/plugin/preference-registry.spec.ts +1 -2
  253. package/src/plugin/quick-open.ts +14 -10
  254. package/src/plugin/tasks/tasks.ts +4 -18
  255. package/src/plugin/timeline.ts +1 -2
  256. package/src/plugin/type-converters.ts +14 -12
  257. package/src/plugin/types-impl.ts +74 -0
  258. package/src/plugin/webviews.ts +1 -2
@@ -29,7 +29,9 @@ export class CallHierarchyAdapter {
29
29
  private readonly documents: DocumentsExtImpl
30
30
  ) { }
31
31
 
32
- async provideRootDefinition(resource: URI, position: rpc.Position, token: theia.CancellationToken): Promise<model.CallHierarchyDefinition | undefined> {
32
+ async provideRootDefinition(
33
+ resource: URI, position: rpc.Position, token: theia.CancellationToken
34
+ ): Promise<model.CallHierarchyDefinition | model.CallHierarchyDefinition[] | undefined> {
33
35
  const documentData = this.documents.getDocumentData(resource);
34
36
  if (!documentData) {
35
37
  return Promise.reject(new Error(`There is no document for ${resource}`));
@@ -40,12 +42,14 @@ export class CallHierarchyAdapter {
40
42
  position.lineNumber,
41
43
  position.column
42
44
  ),
43
- token);
45
+ token
46
+ );
47
+
44
48
  if (!definition) {
45
49
  return undefined;
46
50
  }
47
51
 
48
- return this.fromCallHierarchyItem(definition);
52
+ return Array.isArray(definition) ? definition.map(item => this.fromCallHierarchyItem(item)) : this.fromCallHierarchyItem(definition);
49
53
  }
50
54
 
51
55
  async provideCallers(definition: model.CallHierarchyDefinition, token: theia.CancellationToken): Promise<model.CallHierarchyReference[] | undefined> {
@@ -72,7 +76,9 @@ export class CallHierarchyAdapter {
72
76
  range: this.fromRange(item.range),
73
77
  selectionRange: this.fromRange(item.selectionRange),
74
78
  name: item.name,
75
- kind: item.kind
79
+ kind: item.kind,
80
+ tags: item.tags,
81
+ data: item.data,
76
82
  };
77
83
  }
78
84
 
@@ -95,7 +101,7 @@ export class CallHierarchyAdapter {
95
101
  }
96
102
 
97
103
  private toCallHierarchyItem(definition: model.CallHierarchyDefinition): theia.CallHierarchyItem {
98
- return new types.CallHierarchyItem(
104
+ const item = new types.CallHierarchyItem(
99
105
  Converter.SymbolKind.toSymbolKind(definition.kind),
100
106
  definition.name,
101
107
  definition.detail ? definition.detail : '',
@@ -103,6 +109,9 @@ export class CallHierarchyAdapter {
103
109
  this.toRange(definition.range),
104
110
  this.toRange(definition.selectionRange),
105
111
  );
112
+ item.tags = definition.tags;
113
+ item.data = definition.data;
114
+ return item;
106
115
  }
107
116
 
108
117
  private fromCallHierarchyIncomingCall(caller: theia.CallHierarchyIncomingCall): model.CallHierarchyReference {
@@ -19,8 +19,7 @@ import * as theia from '@theia/plugin';
19
19
  import * as Converter from '../type-converters';
20
20
  import * as model from '../../common/plugin-api-rpc-model';
21
21
  import { DocumentsExtImpl } from '../documents';
22
- import { WorkspaceEditDto } from '../../common/plugin-api-rpc';
23
- import { Position } from '../../common/plugin-api-rpc';
22
+ import { Position, WorkspaceEditDto } from '../../common/plugin-api-rpc';
24
23
  import { Range } from '../types-impl';
25
24
  import { isObject } from '../../common/types';
26
25
 
@@ -583,7 +583,9 @@ export class LanguagesExtImpl implements LanguagesExt {
583
583
  return this.createDisposable(callId);
584
584
  }
585
585
 
586
- $provideRootDefinition(handle: number, resource: UriComponents, location: Position, token: theia.CancellationToken): Promise<CallHierarchyDefinition | undefined> {
586
+ $provideRootDefinition(
587
+ handle: number, resource: UriComponents, location: Position, token: theia.CancellationToken
588
+ ): Promise<CallHierarchyDefinition | CallHierarchyDefinition[] | undefined> {
587
589
  return this.withAdapter(handle, CallHierarchyAdapter, adapter => adapter.provideRootDefinition(URI.revive(resource), location, token), undefined);
588
590
  }
589
591
 
@@ -50,6 +50,9 @@ export class MessageRegistryExt {
50
50
  } else {
51
51
  if ('modal' in optionsOrFirstItem) {
52
52
  options.modal = optionsOrFirstItem.modal;
53
+ if ('detail' in optionsOrFirstItem) {
54
+ options.detail = optionsOrFirstItem.detail;
55
+ }
53
56
  }
54
57
  }
55
58
  }
@@ -59,5 +62,4 @@ export class MessageRegistryExt {
59
62
  const actionHandle = await this.proxy.$showMessage(type, message, options, actions);
60
63
  return actionHandle !== undefined ? items[actionHandle] : undefined;
61
64
  }
62
-
63
65
  }
@@ -15,22 +15,25 @@
15
15
  ********************************************************************************/
16
16
  import { Emitter } from '@theia/core/lib/common/event';
17
17
  import { Path } from '@theia/core/lib/common/path';
18
- import { CommunicationProvider } from '@theia/debug/lib/common/debug-model';
19
18
  import * as theia from '@theia/plugin';
20
19
  import { URI } from '@theia/core/shared/vscode-uri';
21
20
  import { Breakpoint } from '../../../common/plugin-api-rpc-model';
22
- import { DebugExt, DebugMain, PLUGIN_RPC_CONTEXT as Ext, TerminalOptionsExt } from '../../../common/plugin-api-rpc';
21
+ import { DebugConfigurationProviderTriggerKind, DebugExt, DebugMain, PLUGIN_RPC_CONTEXT as Ext, TerminalOptionsExt } from '../../../common/plugin-api-rpc';
23
22
  import { PluginPackageDebuggersContribution } from '../../../common/plugin-protocol';
24
23
  import { RPCProtocol } from '../../../common/rpc-protocol';
25
24
  import { PluginWebSocketChannel } from '../../../common/connection';
26
25
  import { CommandRegistryImpl } from '../../command-registry';
27
26
  import { ConnectionExtImpl } from '../../connection-ext';
28
- import { Disposable, Breakpoint as BreakpointExt, SourceBreakpoint, FunctionBreakpoint, Location, Range } from '../../types-impl';
27
+ import {
28
+ Disposable, Breakpoint as BreakpointExt, SourceBreakpoint, FunctionBreakpoint, Location, Range,
29
+ DebugAdapterServer, DebugAdapterExecutable, DebugAdapterNamedPipeServer, DebugAdapterInlineImplementation
30
+ } from '../../types-impl';
29
31
  import { resolveDebugAdapterExecutable } from './plugin-debug-adapter-executable-resolver';
30
32
  import { PluginDebugAdapterSession } from './plugin-debug-adapter-session';
31
- import { connectDebugAdapter, startDebugAdapter } from './plugin-debug-adapter-starter';
33
+ import { connectInlineDebugAdapter, connectPipeDebugAdapter, connectSocketDebugAdapter, startDebugAdapter } from './plugin-debug-adapter-starter';
32
34
  import { PluginDebugAdapterTracker } from './plugin-debug-adapter-tracker';
33
35
  import uuid = require('uuid');
36
+ import { CommunicationProvider } from '@theia/debug/lib/node/debug-model';
34
37
 
35
38
  /* eslint-disable @typescript-eslint/no-explicit-any */
36
39
 
@@ -43,8 +46,11 @@ export class DebugExtImpl implements DebugExt {
43
46
  // debug sessions by sessionId
44
47
  private sessions = new Map<string, PluginDebugAdapterSession>();
45
48
 
46
- // providers by type
49
+ // providers by type (initial)
47
50
  private configurationProviders = new Map<string, Set<theia.DebugConfigurationProvider>>();
51
+ // providers by type (dynamic)
52
+ private dynamicConfigurationProviders = new Map<string, Set<theia.DebugConfigurationProvider>>();
53
+
48
54
  /**
49
55
  * Only use internally, don't send it to the frontend. It's expensive!
50
56
  * It's already there as a part of the plugin metadata.
@@ -182,19 +188,22 @@ export class DebugExtImpl implements DebugExt {
182
188
  });
183
189
  }
184
190
 
185
- registerDebugConfigurationProvider(debugType: string, provider: theia.DebugConfigurationProvider): Disposable {
186
- console.log(`Debug configuration provider has been registered: ${debugType}`);
187
- const providers = this.configurationProviders.get(debugType) || new Set<theia.DebugConfigurationProvider>();
188
- this.configurationProviders.set(debugType, providers);
191
+ registerDebugConfigurationProvider(debugType: string, provider: theia.DebugConfigurationProvider, trigger: theia.DebugConfigurationProviderTriggerKind): Disposable {
192
+ console.log(`Debug configuration provider has been registered: ${debugType}, trigger: ${trigger}`);
193
+ const providersByTriggerKind = trigger === DebugConfigurationProviderTriggerKind.Initial ? this.configurationProviders : this.dynamicConfigurationProviders;
194
+ let providers = providersByTriggerKind.get(debugType);
195
+ if (!providers) {
196
+ providersByTriggerKind.set(debugType, providers = new Set());
197
+ }
189
198
  providers.add(provider);
190
199
 
191
200
  return Disposable.create(() => {
192
201
  // eslint-disable-next-line @typescript-eslint/no-shadow
193
- const providers = this.configurationProviders.get(debugType);
202
+ const providers = providersByTriggerKind.get(debugType);
194
203
  if (providers) {
195
204
  providers.delete(provider);
196
205
  if (providers.size === 0) {
197
- this.configurationProviders.delete(debugType);
206
+ providersByTriggerKind.delete(debugType);
198
207
  }
199
208
  }
200
209
  });
@@ -319,10 +328,10 @@ export class DebugExtImpl implements DebugExt {
319
328
  return undefined;
320
329
  }
321
330
 
322
- async $provideDebugConfigurations(debugType: string, workspaceFolderUri: string | undefined): Promise<theia.DebugConfiguration[]> {
331
+ async $provideDebugConfigurations(debugType: string, workspaceFolderUri: string | undefined, dynamic: boolean = false): Promise<theia.DebugConfiguration[]> {
323
332
  let result: theia.DebugConfiguration[] = [];
324
333
 
325
- const providers = this.configurationProviders.get(debugType);
334
+ const providers = dynamic ? this.dynamicConfigurationProviders.get(debugType) : this.configurationProviders.get(debugType);
326
335
  if (providers) {
327
336
  for (const provider of providers) {
328
337
  if (provider.provideDebugConfigurations) {
@@ -337,7 +346,11 @@ export class DebugExtImpl implements DebugExt {
337
346
  async $resolveDebugConfigurations(debugConfiguration: theia.DebugConfiguration, workspaceFolderUri: string | undefined): Promise<theia.DebugConfiguration | undefined> {
338
347
  let current = debugConfiguration;
339
348
 
340
- for (const providers of [this.configurationProviders.get(debugConfiguration.type), this.configurationProviders.get('*')]) {
349
+ for (const providers of [
350
+ this.configurationProviders.get(debugConfiguration.type),
351
+ this.dynamicConfigurationProviders.get(debugConfiguration.type),
352
+ this.configurationProviders.get('*')
353
+ ]) {
341
354
  if (providers) {
342
355
  for (const provider of providers) {
343
356
  if (provider.resolveDebugConfiguration) {
@@ -363,7 +376,11 @@ export class DebugExtImpl implements DebugExt {
363
376
  Promise<theia.DebugConfiguration | undefined> {
364
377
  let current = debugConfiguration;
365
378
 
366
- for (const providers of [this.configurationProviders.get(debugConfiguration.type), this.configurationProviders.get('*')]) {
379
+ for (const providers of [
380
+ this.configurationProviders.get(debugConfiguration.type),
381
+ this.dynamicConfigurationProviders.get(debugConfiguration.type),
382
+ this.configurationProviders.get('*')
383
+ ]) {
367
384
  if (providers) {
368
385
  for (const provider of providers) {
369
386
  if (provider.resolveDebugConfigurationWithSubstitutedVariables) {
@@ -409,16 +426,20 @@ export class DebugExtImpl implements DebugExt {
409
426
  // @param executable The debug adapter's executable information as specified in the package.json (or undefined if no such information exists).
410
427
  const descriptor = await descriptorFactory.createDebugAdapterDescriptor(session, executable);
411
428
  if (descriptor) {
412
- if ('port' in descriptor) {
413
- return connectDebugAdapter(descriptor);
414
- } else {
429
+ if (DebugAdapterServer.is(descriptor)) {
430
+ return connectSocketDebugAdapter(descriptor);
431
+ } else if (DebugAdapterExecutable.is(descriptor)) {
415
432
  return startDebugAdapter(descriptor);
433
+ } else if (DebugAdapterNamedPipeServer.is(descriptor)) {
434
+ return connectPipeDebugAdapter(descriptor);
435
+ } else if (DebugAdapterInlineImplementation.is(descriptor)) {
436
+ return connectInlineDebugAdapter(descriptor);
416
437
  }
417
438
  }
418
439
  }
419
440
 
420
441
  if ('debugServer' in debugConfiguration) {
421
- return connectDebugAdapter({ port: debugConfiguration.debugServer });
442
+ return connectSocketDebugAdapter({ port: debugConfiguration.debugServer });
422
443
  } else {
423
444
  if (!executable) {
424
445
  throw new Error('It is not possible to provide debug adapter executable.');
@@ -14,23 +14,23 @@
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
16
 
17
- import { CommunicationProvider } from '@theia/debug/lib/common/debug-model';
18
17
  import { DebugAdapterSessionImpl } from '@theia/debug/lib/node/debug-adapter-session';
19
18
  import * as theia from '@theia/plugin';
20
19
  import { IWebSocket } from '@theia/core/shared/vscode-ws-jsonrpc';
20
+ import { CommunicationProvider, DebugAdapterSession } from '@theia/debug/lib/node/debug-model';
21
21
 
22
22
  /* eslint-disable @typescript-eslint/no-explicit-any */
23
23
 
24
24
  /**
25
25
  * Server debug adapter session.
26
26
  */
27
- export class PluginDebugAdapterSession extends DebugAdapterSessionImpl implements theia.DebugSession {
27
+ export class PluginDebugAdapterSession extends DebugAdapterSessionImpl implements theia.DebugSession, DebugAdapterSession {
28
28
  readonly type: string;
29
29
  readonly name: string;
30
30
  readonly configuration: theia.DebugConfiguration;
31
31
 
32
32
  constructor(
33
- protected readonly communicationProvider: CommunicationProvider,
33
+ readonly communicationProvider: CommunicationProvider,
34
34
  protected readonly tracker: theia.DebugAdapterTracker,
35
35
  protected readonly theiaSession: theia.DebugSession) {
36
36
 
@@ -15,15 +15,18 @@
15
15
  ********************************************************************************/
16
16
 
17
17
  import * as net from 'net';
18
- import * as theia from '@theia/plugin';
19
- import { CommunicationProvider } from '@theia/debug/lib/common/debug-model';
20
18
  import { ChildProcess, spawn, fork, ForkOptions } from 'child_process';
19
+ import { CommunicationProvider } from '@theia/debug/lib/node/debug-model';
20
+ import { StreamCommunicationProvider } from '@theia/debug/lib/node/stream-communication-provider';
21
+ import { Disposable } from '@theia/core/lib/common/disposable';
22
+ import { DebugAdapterExecutable, DebugAdapterInlineImplementation, DebugAdapterNamedPipeServer, DebugAdapterServer } from '../../types-impl';
23
+ import { InlineCommunicationProvider } from '@theia/debug/lib/node/inline-communication-provider';
21
24
  const isElectron = require('is-electron');
22
25
 
23
26
  /**
24
27
  * Starts debug adapter process.
25
28
  */
26
- export function startDebugAdapter(executable: theia.DebugAdapterExecutable): CommunicationProvider {
29
+ export function startDebugAdapter(executable: DebugAdapterExecutable): CommunicationProvider {
27
30
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
28
31
  const options: any = { stdio: ['pipe', 'pipe', 2] };
29
32
 
@@ -63,21 +66,28 @@ export function startDebugAdapter(executable: theia.DebugAdapterExecutable): Com
63
66
  childProcess = spawn(command, args, options);
64
67
  }
65
68
 
66
- return {
67
- input: childProcess.stdin!,
68
- output: childProcess.stdout!,
69
- dispose: () => childProcess.kill()
70
- };
69
+ const provider = new StreamCommunicationProvider(childProcess.stdout!, childProcess.stdin!);
70
+ provider.push(Disposable.create(() => childProcess.kill()));
71
+ return provider;
71
72
  }
72
73
 
73
74
  /**
74
75
  * Connects to a remote debug server.
75
76
  */
76
- export function connectDebugAdapter(server: theia.DebugAdapterServer): CommunicationProvider {
77
+ export function connectSocketDebugAdapter(server: DebugAdapterServer): CommunicationProvider {
77
78
  const socket = net.createConnection(server.port, server.host);
78
- return {
79
- input: socket,
80
- output: socket,
81
- dispose: () => socket.end()
82
- };
79
+ const provider = new StreamCommunicationProvider(socket, socket);
80
+ provider.push(Disposable.create(() => socket.end()));
81
+ return provider;
82
+ }
83
+
84
+ export function connectPipeDebugAdapter(adapter: DebugAdapterNamedPipeServer): CommunicationProvider {
85
+ const socket = net.createConnection(adapter.path);
86
+ const provider = new StreamCommunicationProvider(socket, socket);
87
+ provider.push(Disposable.create(() => socket.end()));
88
+ return provider;
89
+ }
90
+
91
+ export function connectInlineDebugAdapter(adapter: DebugAdapterInlineImplementation): CommunicationProvider {
92
+ return new InlineCommunicationProvider(adapter.implementation);
83
93
  }
@@ -17,17 +17,18 @@
17
17
  /* eslint-disable @typescript-eslint/no-explicit-any */
18
18
  /* tslint:disable:typedef */
19
19
 
20
- import * as theia from '@theia/plugin';
20
+ import type * as theia from '@theia/plugin';
21
21
  import { CommandRegistryImpl } from './command-registry';
22
22
  import { Emitter } from '@theia/core/lib/common/event';
23
- import { CancellationTokenSource } from '@theia/core/lib/common/cancellation';
23
+ import { CancellationError, CancellationToken, CancellationTokenSource } from '@theia/core/lib/common/cancellation';
24
24
  import { QuickOpenExtImpl } from './quick-open';
25
25
  import {
26
26
  MAIN_RPC_CONTEXT,
27
27
  Plugin as InternalPlugin,
28
28
  PluginManager,
29
29
  PluginAPIFactory,
30
- MainMessageType
30
+ MainMessageType,
31
+ DebugConfigurationProviderTriggerKind
31
32
  } from '../common/plugin-api-rpc';
32
33
  import { RPCProtocol } from '../common/rpc-protocol';
33
34
  import { MessageRegistryExt } from './message-registry';
@@ -105,6 +106,8 @@ import {
105
106
  Task2,
106
107
  DebugAdapterExecutable,
107
108
  DebugAdapterServer,
109
+ DebugAdapterNamedPipeServer,
110
+ DebugAdapterInlineImplementation,
108
111
  Breakpoint,
109
112
  SourceBreakpoint,
110
113
  FunctionBreakpoint,
@@ -134,7 +137,8 @@ import {
134
137
  ColorThemeKind,
135
138
  SourceControlInputBoxValidationType,
136
139
  URI,
137
- FileDecoration
140
+ FileDecoration,
141
+ ExtensionMode
138
142
  } from './types-impl';
139
143
  import { AuthenticationExtImpl } from './authentication-ext';
140
144
  import { SymbolKind } from '../common/plugin-api-rpc-model';
@@ -149,7 +153,6 @@ import { LanguagesExtImpl } from './languages';
149
153
  import { fromDocumentSelector, pluginToPluginInfo, fromGlobPattern } from './type-converters';
150
154
  import { DialogsExtImpl } from './dialogs';
151
155
  import { NotificationExtImpl } from './notification';
152
- import { CancellationToken } from '@theia/core/lib/common/cancellation';
153
156
  import { score } from '@theia/callhierarchy/lib/common/language-selector';
154
157
  import { MarkdownString } from './markdown-string';
155
158
  import { TreeViewsExtImpl } from './tree/tree-views';
@@ -157,9 +160,8 @@ import { ConnectionExtImpl } from './connection-ext';
157
160
  import { TasksExtImpl } from './tasks/tasks';
158
161
  import { DebugExtImpl } from './node/debug/debug';
159
162
  import { FileSystemExtImpl } from './file-system-ext-impl';
160
- import { QuickPick, QuickPickItem, ResourceLabelFormatter } from '@theia/plugin';
163
+ import { QuickPick, QuickPickItem, ResourceLabelFormatter, LineChange } from '@theia/plugin';
161
164
  import { ScmExtImpl } from './scm';
162
- import { LineChange } from '@theia/plugin';
163
165
  import { DecorationsExtImpl } from './decorations';
164
166
  import { TextEditorExt } from './text-editor';
165
167
  import { ClipboardExt } from './clipboard-ext';
@@ -767,8 +769,12 @@ export function createAPIFactory(
767
769
  registerDebugAdapterDescriptorFactory(debugType: string, factory: theia.DebugAdapterDescriptorFactory): Disposable {
768
770
  return debugExt.registerDebugAdapterDescriptorFactory(debugType, factory);
769
771
  },
770
- registerDebugConfigurationProvider(debugType: string, provider: theia.DebugConfigurationProvider): Disposable {
771
- return debugExt.registerDebugConfigurationProvider(debugType, provider);
772
+ registerDebugConfigurationProvider(
773
+ debugType: string,
774
+ provider: theia.DebugConfigurationProvider,
775
+ triggerKind?: theia.DebugConfigurationProviderTriggerKind
776
+ ): Disposable {
777
+ return debugExt.registerDebugConfigurationProvider(debugType, provider, triggerKind || DebugConfigurationProviderTriggerKind.Initial);
772
778
  },
773
779
  registerDebugAdapterTrackerFactory(debugType: string, factory: theia.DebugAdapterTrackerFactory): Disposable {
774
780
  return debugExt.registerDebugAdapterTrackerFactory(debugType, factory);
@@ -924,6 +930,9 @@ export function createAPIFactory(
924
930
  Task2,
925
931
  DebugAdapterExecutable,
926
932
  DebugAdapterServer,
933
+ DebugAdapterNamedPipeServer,
934
+ DebugAdapterInlineImplementation,
935
+ DebugConfigurationProviderTriggerKind,
927
936
  Breakpoint,
928
937
  SourceBreakpoint,
929
938
  FunctionBreakpoint,
@@ -952,7 +961,9 @@ export function createAPIFactory(
952
961
  SemanticTokensEdit,
953
962
  ColorThemeKind,
954
963
  SourceControlInputBoxValidationType,
955
- FileDecoration
964
+ FileDecoration,
965
+ CancellationError,
966
+ ExtensionMode
956
967
  };
957
968
  };
958
969
  }
@@ -33,7 +33,7 @@ import * as theia from '@theia/plugin';
33
33
  import { join } from './path';
34
34
  import { EnvExtImpl } from './env';
35
35
  import { PreferenceRegistryExtImpl } from './preference-registry';
36
- import { Memento, KeyValueStorageProxy } from './plugin-storage';
36
+ import { Memento, KeyValueStorageProxy, GlobalState } from './plugin-storage';
37
37
  import { ExtPluginApi } from '../common/plugin-ext-api-contribution';
38
38
  import { RPCProtocol } from '../common/rpc-protocol';
39
39
  import { Emitter } from '@theia/core/lib/common/event';
@@ -79,7 +79,11 @@ export class PluginManagerExtImpl implements PluginManagerExt, PluginManager {
79
79
  '*',
80
80
  'onLanguage',
81
81
  'onCommand',
82
- 'onDebug', 'onDebugInitialConfigurations', 'onDebugResolve', 'onDebugAdapterProtocolTracker',
82
+ 'onDebug',
83
+ 'onDebugInitialConfigurations',
84
+ 'onDebugResolve',
85
+ 'onDebugAdapterProtocolTracker',
86
+ 'onDebugDynamicConfigurations',
83
87
  'workspaceContains',
84
88
  'onView',
85
89
  'onUri',
@@ -321,6 +325,23 @@ export class PluginManagerExtImpl implements PluginManagerExt, PluginManager {
321
325
  }
322
326
 
323
327
  async $activateByEvent(activationEvent: string): Promise<void> {
328
+ if (activationEvent.endsWith(':*')) {
329
+ const baseEvent = activationEvent.substring(0, activationEvent.length - 2);
330
+ await this.activateByBaseEvent(baseEvent);
331
+ } else {
332
+ await this.activateBySingleEvent(activationEvent);
333
+ }
334
+ }
335
+
336
+ protected async activateByBaseEvent(baseEvent: string): Promise<void> {
337
+ await Promise.all(Array.from(this.activations.keys(), activation => {
338
+ if (activation.startsWith(baseEvent)) {
339
+ return this.activateBySingleEvent(activation);
340
+ }
341
+ }));
342
+ }
343
+
344
+ protected async activateBySingleEvent(activationEvent: string): Promise<void> {
324
345
  const activations = this.activations.get(activationEvent);
325
346
  if (!activations) {
326
347
  return;
@@ -351,7 +372,7 @@ export class PluginManagerExtImpl implements PluginManagerExt, PluginManager {
351
372
  const pluginContext: theia.PluginContext = {
352
373
  extensionPath: plugin.pluginFolder,
353
374
  extensionUri: Uri.file(plugin.pluginFolder),
354
- globalState: new Memento(plugin.model.id, true, this.storageProxy),
375
+ globalState: new GlobalState(plugin.model.id, true, this.storageProxy),
355
376
  workspaceState: new Memento(plugin.model.id, false, this.storageProxy),
356
377
  subscriptions: subscriptions,
357
378
  asAbsolutePath: asAbsolutePath,
@@ -361,7 +382,8 @@ export class PluginManagerExtImpl implements PluginManagerExt, PluginManager {
361
382
  secrets,
362
383
  globalStoragePath: globalStoragePath,
363
384
  globalStorageUri: Uri.file(globalStoragePath),
364
- environmentVariableCollection: this.terminalService.getEnvironmentVariableCollection(plugin.model.id)
385
+ environmentVariableCollection: this.terminalService.getEnvironmentVariableCollection(plugin.model.id),
386
+ extensionMode: 1 // @todo: implement proper `extensionMode`.
365
387
  };
366
388
  this.pluginContextsMap.set(plugin.model.id, pluginContext);
367
389
 
@@ -16,10 +16,9 @@
16
16
 
17
17
  import * as theia from '@theia/plugin';
18
18
  import { Event, Emitter } from '@theia/core/lib/common/event';
19
- import { StorageMain, StorageExt } from '../common/plugin-api-rpc';
19
+ import { PLUGIN_RPC_CONTEXT, StorageMain, StorageExt } from '../common/plugin-api-rpc';
20
20
  import { KeysToAnyValues, KeysToKeysToAnyValue } from '../common/types';
21
21
  import { RPCProtocol } from '../common/rpc-protocol';
22
- import { PLUGIN_RPC_CONTEXT } from '../common/plugin-api-rpc';
23
22
 
24
23
  export class Memento implements theia.Memento {
25
24
 
@@ -60,6 +59,12 @@ export class Memento implements theia.Memento {
60
59
  }
61
60
  }
62
61
 
62
+ export class GlobalState extends Memento {
63
+
64
+ /** @todo: API is not yet implemented. */
65
+ setKeysForSync(keys: readonly string[]): void { }
66
+ }
67
+
63
68
  /**
64
69
  * Singleton.
65
70
  * Is used to proxy storage requests to main side.
@@ -17,8 +17,7 @@
17
17
  import { PreferenceRegistryExtImpl } from './preference-registry';
18
18
  import * as chai from 'chai';
19
19
  import { WorkspaceExtImpl } from '../plugin/workspace';
20
- import { RPCProtocol } from '../common/rpc-protocol';
21
- import { ProxyIdentifier } from '../common/rpc-protocol';
20
+ import { ProxyIdentifier, RPCProtocol } from '../common/rpc-protocol';
22
21
 
23
22
  const expect = chai.expect;
24
23
 
@@ -30,6 +30,7 @@ import * as path from 'path';
30
30
  import { convertToTransferQuickPickItems } from './type-converters';
31
31
  import { PluginPackage } from '../common/plugin-protocol';
32
32
  import { QuickInputButtonHandle } from '@theia/core/lib/browser';
33
+ import { MaybePromise } from '@theia/core/lib/common/types';
33
34
 
34
35
  const canceledName = 'Canceled';
35
36
  /**
@@ -64,7 +65,7 @@ export function getDarkIconUri(iconPath: URI | { light: URI; dark: URI; }): URI
64
65
  export class QuickOpenExtImpl implements QuickOpenExt {
65
66
  private proxy: QuickOpenMain;
66
67
  private onDidSelectItem: undefined | ((handle: number) => void);
67
- private validateInputHandler: (input: string) => Promise<string | null | undefined> | undefined;
68
+ private validateInputHandler?: (input: string) => MaybePromise<string | null | undefined>;
68
69
  private _sessions = new Map<number, QuickInputExt>(); // Each quickinput will have a number so that we know where to fire events
69
70
  private _instances = 0;
70
71
 
@@ -143,17 +144,13 @@ export class QuickOpenExtImpl implements QuickOpenExt {
143
144
  // ---- input
144
145
 
145
146
  showInput(options?: InputBoxOptions, token: theia.CancellationToken = CancellationToken.None): PromiseLike<string | undefined> {
146
- if (options?.validateInput) {
147
- this.validateInputHandler = options.validateInput;
148
- }
149
-
147
+ this.validateInputHandler = options?.validateInput;
150
148
  if (!options) { options = { placeHolder: '' }; }
151
149
  return this.proxy.$input(options, typeof this.validateInputHandler === 'function', token);
152
150
  }
153
151
 
154
152
  async showInputBox(options: TransferInputBox): Promise<string | undefined> {
155
- this.validateInputHandler = options && options.validateInput;
156
-
153
+ this.validateInputHandler = typeof options.validateInput === 'function' ? options.validateInput : undefined;
157
154
  return this.proxy.$showInputBox(options, typeof this.validateInputHandler === 'function');
158
155
  }
159
156
 
@@ -259,7 +256,7 @@ export class QuickInputExt implements QuickInput {
259
256
  private onDidHideEmitter: Emitter<void>;
260
257
  private onDidTriggerButtonEmitter: Emitter<theia.QuickInputButton>;
261
258
  private _updateTimeout: any;
262
- private _pendingUpdate: TransferQuickInput<any> = { id: this._id };
259
+ private _pendingUpdate: TransferQuickInput = { id: this._id };
263
260
 
264
261
  constructor(readonly quickOpen: QuickOpenExtImpl, readonly quickOpenMain: QuickOpenMain, readonly plugin: Plugin, private _onDidDispose: () => void) {
265
262
  this.title = undefined;
@@ -613,9 +610,16 @@ export class QuickPickExt<T extends theia.QuickPickItem> extends QuickInputExt i
613
610
  this._handlesToItems.set(i, item);
614
611
  this._itemsToHandles.set(item, i);
615
612
  });
616
- items.forEach((item, i) => Object.assign(item, { handle: i }));
617
613
  this.update({
618
- items
614
+ items: items.map((item, i) => ({
615
+ type: item.type,
616
+ label: item.label,
617
+ description: item.description,
618
+ handle: i,
619
+ detail: item.detail,
620
+ picked: item.picked,
621
+ alwaysShow: item.alwaysShow
622
+ }))
619
623
  });
620
624
  }
621
625
 
@@ -24,7 +24,7 @@ import {
24
24
  import * as theia from '@theia/plugin';
25
25
  import * as converter from '../type-converters';
26
26
  import { CustomExecution, Disposable } from '../types-impl';
27
- import { RPCProtocol, ConnectionClosedError } from '../../common/rpc-protocol';
27
+ import { RPCProtocol } from '../../common/rpc-protocol';
28
28
  import { TaskProviderAdapter } from './task-provider';
29
29
  import { Emitter, Event } from '@theia/core/lib/common/event';
30
30
  import { TerminalServiceExtImpl } from '../terminal-ext';
@@ -49,15 +49,8 @@ export class TasksExtImpl implements TasksExt {
49
49
  private readonly onDidExecuteTaskProcess: Emitter<theia.TaskProcessStartEvent> = new Emitter<theia.TaskProcessStartEvent>();
50
50
  private readonly onDidTerminateTaskProcess: Emitter<theia.TaskProcessEndEvent> = new Emitter<theia.TaskProcessEndEvent>();
51
51
 
52
- private disposed = false;
53
-
54
52
  constructor(rpc: RPCProtocol, readonly terminalExt: TerminalServiceExtImpl) {
55
53
  this.proxy = rpc.getProxy(PLUGIN_RPC_CONTEXT.TASKS_MAIN);
56
- this.fetchTaskExecutions();
57
- }
58
-
59
- dispose(): void {
60
- this.disposed = true;
61
54
  }
62
55
 
63
56
  get taskExecutions(): ReadonlyArray<theia.TaskExecution> {
@@ -216,16 +209,9 @@ export class TasksExtImpl implements TasksExt {
216
209
  });
217
210
  }
218
211
 
219
- private async fetchTaskExecutions(): Promise<void> {
220
- try {
221
- const taskExecutions = await this.proxy.$taskExecutions();
222
- taskExecutions.forEach(execution => this.getTaskExecution(execution));
223
- } catch (error) {
224
- if (this.disposed && ConnectionClosedError.is(error)) {
225
- return;
226
- }
227
- console.error(`Can not fetch running tasks: ${error}`);
228
- }
212
+ // Initial `this.executions` map with the running tasks from the previous session
213
+ async $initLoadedTasks(taskExecutions: TaskExecutionDto[]): Promise<void> {
214
+ taskExecutions.forEach(execution => this.getTaskExecution(execution));
229
215
  }
230
216
 
231
217
  private getTaskExecution(execution: TaskExecutionDto): theia.TaskExecution {
@@ -13,10 +13,9 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
- import { Plugin, TimelineCommandArg, TimelineExt, TimelineMain } from '../common';
16
+ import { Plugin, PLUGIN_RPC_CONTEXT, TimelineCommandArg, TimelineExt, TimelineMain } from '../common';
17
17
  import { RPCProtocol } from '../common/rpc-protocol';
18
18
  import { Disposable, URI } from './types-impl';
19
- import { PLUGIN_RPC_CONTEXT } from '../common';
20
19
  import { DisposableCollection } from '@theia/core/lib/common/disposable';
21
20
  import { CommandRegistryImpl } from './command-registry';
22
21
  import type {