@theia/plugin-ext 1.18.0-next.ed824933 → 1.21.0-next.11

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 (301) hide show
  1. package/LICENSE +642 -0
  2. package/README.md +5 -0
  3. package/lib/common/arrays.d.ts +4 -0
  4. package/lib/common/arrays.d.ts.map +1 -1
  5. package/lib/common/arrays.js +9 -1
  6. package/lib/common/arrays.js.map +1 -1
  7. package/lib/common/connection.d.ts +47 -34
  8. package/lib/common/connection.d.ts.map +1 -1
  9. package/lib/common/connection.js +90 -28
  10. package/lib/common/connection.js.map +1 -1
  11. package/lib/common/plugin-api-rpc-model.d.ts +4 -0
  12. package/lib/common/plugin-api-rpc-model.d.ts.map +1 -1
  13. package/lib/common/plugin-api-rpc-model.js.map +1 -1
  14. package/lib/common/plugin-api-rpc.d.ts +30 -13
  15. package/lib/common/plugin-api-rpc.d.ts.map +1 -1
  16. package/lib/common/plugin-api-rpc.js +21 -1
  17. package/lib/common/plugin-api-rpc.js.map +1 -1
  18. package/lib/common/plugin-protocol.d.ts +3 -1
  19. package/lib/common/plugin-protocol.d.ts.map +1 -1
  20. package/lib/common/plugin-protocol.js.map +1 -1
  21. package/lib/hosted/browser/hosted-plugin.d.ts +5 -6
  22. package/lib/hosted/browser/hosted-plugin.d.ts.map +1 -1
  23. package/lib/hosted/browser/hosted-plugin.js +20 -14
  24. package/lib/hosted/browser/hosted-plugin.js.map +1 -1
  25. package/lib/hosted/browser/worker/debug-stub.d.ts.map +1 -1
  26. package/lib/hosted/browser/worker/debug-stub.js +1 -0
  27. package/lib/hosted/browser/worker/debug-stub.js.map +1 -1
  28. package/lib/hosted/node/hosted-plugin-deployer-handler.d.ts +1 -1
  29. package/lib/hosted/node/hosted-plugin-deployer-handler.d.ts.map +1 -1
  30. package/lib/hosted/node/hosted-plugin-deployer-handler.js +14 -38
  31. package/lib/hosted/node/hosted-plugin-deployer-handler.js.map +1 -1
  32. package/lib/hosted/node/hosted-plugin-localization-service.d.ts +37 -0
  33. package/lib/hosted/node/hosted-plugin-localization-service.d.ts.map +1 -0
  34. package/lib/hosted/node/hosted-plugin-localization-service.js +197 -0
  35. package/lib/hosted/node/hosted-plugin-localization-service.js.map +1 -0
  36. package/lib/hosted/node/hosted-plugin-process.d.ts +2 -2
  37. package/lib/hosted/node/hosted-plugin-process.d.ts.map +1 -1
  38. package/lib/hosted/node/hosted-plugin-process.js +5 -7
  39. package/lib/hosted/node/hosted-plugin-process.js.map +1 -1
  40. package/lib/hosted/node/plugin-ext-hosted-backend-module.d.ts.map +1 -1
  41. package/lib/hosted/node/plugin-ext-hosted-backend-module.js +2 -0
  42. package/lib/hosted/node/plugin-ext-hosted-backend-module.js.map +1 -1
  43. package/lib/hosted/node/plugin-manifest-loader.d.ts +1 -1
  44. package/lib/hosted/node/plugin-manifest-loader.d.ts.map +1 -1
  45. package/lib/hosted/node/plugin-manifest-loader.js +4 -52
  46. package/lib/hosted/node/plugin-manifest-loader.js.map +1 -1
  47. package/lib/hosted/node/plugin-service.d.ts +3 -6
  48. package/lib/hosted/node/plugin-service.d.ts.map +1 -1
  49. package/lib/hosted/node/plugin-service.js +7 -40
  50. package/lib/hosted/node/plugin-service.js.map +1 -1
  51. package/lib/hosted/node/scanners/scanner-theia.d.ts +1 -1
  52. package/lib/hosted/node/scanners/scanner-theia.d.ts.map +1 -1
  53. package/lib/hosted/node/scanners/scanner-theia.js +6 -2
  54. package/lib/hosted/node/scanners/scanner-theia.js.map +1 -1
  55. package/lib/main/browser/callhierarchy/callhierarchy-type-converters.d.ts.map +1 -1
  56. package/lib/main/browser/callhierarchy/callhierarchy-type-converters.js +6 -2
  57. package/lib/main/browser/callhierarchy/callhierarchy-type-converters.js.map +1 -1
  58. package/lib/main/browser/custom-editors/custom-editor-opener.d.ts +2 -2
  59. package/lib/main/browser/custom-editors/custom-editor-opener.d.ts.map +1 -1
  60. package/lib/main/browser/custom-editors/custom-editor-opener.js +6 -2
  61. package/lib/main/browser/custom-editors/custom-editor-opener.js.map +1 -1
  62. package/lib/main/browser/custom-editors/custom-editors-main.d.ts.map +1 -1
  63. package/lib/main/browser/custom-editors/custom-editors-main.js +1 -2
  64. package/lib/main/browser/custom-editors/custom-editors-main.js.map +1 -1
  65. package/lib/main/browser/debug/debug-main.d.ts +3 -3
  66. package/lib/main/browser/debug/debug-main.d.ts.map +1 -1
  67. package/lib/main/browser/debug/debug-main.js +2 -3
  68. package/lib/main/browser/debug/debug-main.js.map +1 -1
  69. package/lib/main/browser/debug/plugin-debug-adapter-contribution.d.ts +1 -1
  70. package/lib/main/browser/debug/plugin-debug-adapter-contribution.d.ts.map +1 -1
  71. package/lib/main/browser/debug/plugin-debug-adapter-contribution.js +2 -2
  72. package/lib/main/browser/debug/plugin-debug-adapter-contribution.js.map +1 -1
  73. package/lib/main/browser/debug/plugin-debug-service.d.ts +8 -0
  74. package/lib/main/browser/debug/plugin-debug-service.d.ts.map +1 -1
  75. package/lib/main/browser/debug/plugin-debug-service.js +15 -0
  76. package/lib/main/browser/debug/plugin-debug-service.js.map +1 -1
  77. package/lib/main/browser/debug/plugin-debug-session-factory.d.ts +6 -6
  78. package/lib/main/browser/debug/plugin-debug-session-factory.d.ts.map +1 -1
  79. package/lib/main/browser/debug/plugin-debug-session-factory.js +1 -1
  80. package/lib/main/browser/debug/plugin-debug-session-factory.js.map +1 -1
  81. package/lib/main/browser/dialogs/modal-notification.d.ts +3 -3
  82. package/lib/main/browser/dialogs/modal-notification.d.ts.map +1 -1
  83. package/lib/main/browser/dialogs/modal-notification.js +17 -6
  84. package/lib/main/browser/dialogs/modal-notification.js.map +1 -1
  85. package/lib/main/browser/editors-and-documents-main.d.ts.map +1 -1
  86. package/lib/main/browser/editors-and-documents-main.js +3 -4
  87. package/lib/main/browser/editors-and-documents-main.js.map +1 -1
  88. package/lib/main/browser/file-system-main-impl.js +1 -1
  89. package/lib/main/browser/file-system-main-impl.js.map +1 -1
  90. package/lib/main/browser/languages-main.js +1 -1
  91. package/lib/main/browser/languages-main.js.map +1 -1
  92. package/lib/main/browser/main-context.js +2 -2
  93. package/lib/main/browser/main-context.js.map +1 -1
  94. package/lib/main/browser/message-registry-main.js +1 -1
  95. package/lib/main/browser/message-registry-main.js.map +1 -1
  96. package/lib/main/browser/plugin-ext-frontend-module.d.ts.map +1 -1
  97. package/lib/main/browser/plugin-ext-frontend-module.js +5 -3
  98. package/lib/main/browser/plugin-ext-frontend-module.js.map +1 -1
  99. package/lib/main/browser/quick-open-main.d.ts +3 -6
  100. package/lib/main/browser/quick-open-main.d.ts.map +1 -1
  101. package/lib/main/browser/quick-open-main.js +48 -100
  102. package/lib/main/browser/quick-open-main.js.map +1 -1
  103. package/lib/main/browser/tasks-main.d.ts.map +1 -1
  104. package/lib/main/browser/tasks-main.js +6 -0
  105. package/lib/main/browser/tasks-main.js.map +1 -1
  106. package/lib/main/browser/timeline-main.d.ts.map +1 -1
  107. package/lib/main/browser/timeline-main.js +1 -1
  108. package/lib/main/browser/timeline-main.js.map +1 -1
  109. package/lib/main/browser/view/plugin-view-registry.d.ts +3 -2
  110. package/lib/main/browser/view/plugin-view-registry.d.ts.map +1 -1
  111. package/lib/main/browser/view/plugin-view-registry.js +77 -26
  112. package/lib/main/browser/view/plugin-view-registry.js.map +1 -1
  113. package/lib/main/browser/view/plugin-view-widget.d.ts +2 -0
  114. package/lib/main/browser/view/plugin-view-widget.d.ts.map +1 -1
  115. package/lib/main/browser/view/plugin-view-widget.js +3 -1
  116. package/lib/main/browser/view/plugin-view-widget.js.map +1 -1
  117. package/lib/main/browser/view/tree-view-widget.d.ts +3 -7
  118. package/lib/main/browser/view/tree-view-widget.d.ts.map +1 -1
  119. package/lib/main/browser/view/tree-view-widget.js +26 -39
  120. package/lib/main/browser/view/tree-view-widget.js.map +1 -1
  121. package/lib/main/browser/webview/webview-frontend-security-warnings.d.ts.map +1 -1
  122. package/lib/main/browser/webview/webview-frontend-security-warnings.js +8 -5
  123. package/lib/main/browser/webview/webview-frontend-security-warnings.js.map +1 -1
  124. package/lib/main/browser/webview/webview-preferences.d.ts.map +1 -1
  125. package/lib/main/browser/webview/webview-preferences.js +3 -2
  126. package/lib/main/browser/webview/webview-preferences.js.map +1 -1
  127. package/lib/main/browser/webview/webview.d.ts +1 -1
  128. package/lib/main/browser/webview/webview.d.ts.map +1 -1
  129. package/lib/main/browser/webview/webview.js +2 -2
  130. package/lib/main/browser/webview/webview.js.map +1 -1
  131. package/lib/plugin/comments.d.ts.map +1 -1
  132. package/lib/plugin/comments.js +2 -3
  133. package/lib/plugin/comments.js.map +1 -1
  134. package/lib/plugin/custom-editors.d.ts +1 -2
  135. package/lib/plugin/custom-editors.d.ts.map +1 -1
  136. package/lib/plugin/custom-editors.js +2 -3
  137. package/lib/plugin/custom-editors.js.map +1 -1
  138. package/lib/plugin/decorations.d.ts.map +1 -1
  139. package/lib/plugin/decorations.js +2 -3
  140. package/lib/plugin/decorations.js.map +1 -1
  141. package/lib/plugin/document-data.d.ts.map +1 -1
  142. package/lib/plugin/document-data.js +1 -1
  143. package/lib/plugin/document-data.js.map +1 -1
  144. package/lib/plugin/documents.d.ts.map +1 -1
  145. package/lib/plugin/documents.js +1 -2
  146. package/lib/plugin/documents.js.map +1 -1
  147. package/lib/plugin/file-system-event-service-ext-impl.d.ts.map +1 -1
  148. package/lib/plugin/file-system-event-service-ext-impl.js +2 -3
  149. package/lib/plugin/file-system-event-service-ext-impl.js.map +1 -1
  150. package/lib/plugin/file-system-ext-impl.d.ts.map +1 -1
  151. package/lib/plugin/file-system-ext-impl.js +12 -13
  152. package/lib/plugin/file-system-ext-impl.js.map +1 -1
  153. package/lib/plugin/known-commands.spec.js +1 -2
  154. package/lib/plugin/known-commands.spec.js.map +1 -1
  155. package/lib/plugin/languages/call-hierarchy.d.ts +1 -1
  156. package/lib/plugin/languages/call-hierarchy.d.ts.map +1 -1
  157. package/lib/plugin/languages/call-hierarchy.js +8 -3
  158. package/lib/plugin/languages/call-hierarchy.js.map +1 -1
  159. package/lib/plugin/languages/rename.d.ts +1 -2
  160. package/lib/plugin/languages/rename.d.ts.map +1 -1
  161. package/lib/plugin/languages/rename.js.map +1 -1
  162. package/lib/plugin/languages.d.ts +1 -1
  163. package/lib/plugin/languages.d.ts.map +1 -1
  164. package/lib/plugin/languages.js +2 -1
  165. package/lib/plugin/languages.js.map +1 -1
  166. package/lib/plugin/message-registry.d.ts.map +1 -1
  167. package/lib/plugin/message-registry.js +3 -0
  168. package/lib/plugin/message-registry.js.map +1 -1
  169. package/lib/plugin/node/debug/debug.d.ts +7 -6
  170. package/lib/plugin/node/debug/debug.d.ts.map +1 -1
  171. package/lib/plugin/node/debug/debug.js +37 -19
  172. package/lib/plugin/node/debug/debug.js.map +1 -1
  173. package/lib/plugin/node/debug/plugin-debug-adapter-session.d.ts +7 -7
  174. package/lib/plugin/node/debug/plugin-debug-adapter-session.d.ts.map +1 -1
  175. package/lib/plugin/node/debug/plugin-debug-adapter-session.js +6 -6
  176. package/lib/plugin/node/debug/plugin-debug-adapter-session.js.map +1 -1
  177. package/lib/plugin/node/debug/plugin-debug-adapter-starter.d.ts +8 -4
  178. package/lib/plugin/node/debug/plugin-debug-adapter-starter.d.ts.map +1 -1
  179. package/lib/plugin/node/debug/plugin-debug-adapter-starter.js +16 -13
  180. package/lib/plugin/node/debug/plugin-debug-adapter-starter.js.map +1 -1
  181. package/lib/plugin/plugin-context.d.ts.map +1 -1
  182. package/lib/plugin/plugin-context.js +10 -5
  183. package/lib/plugin/plugin-context.js.map +1 -1
  184. package/lib/plugin/plugin-manager.d.ts +2 -0
  185. package/lib/plugin/plugin-manager.d.ts.map +1 -1
  186. package/lib/plugin/plugin-manager.js +24 -3
  187. package/lib/plugin/plugin-manager.js.map +1 -1
  188. package/lib/plugin/plugin-storage.d.ts +4 -0
  189. package/lib/plugin/plugin-storage.d.ts.map +1 -1
  190. package/lib/plugin/plugin-storage.js +6 -1
  191. package/lib/plugin/plugin-storage.js.map +1 -1
  192. package/lib/plugin/preference-registry.spec.js.map +1 -1
  193. package/lib/plugin/quick-open.d.ts +2 -4
  194. package/lib/plugin/quick-open.d.ts.map +1 -1
  195. package/lib/plugin/quick-open.js +12 -29
  196. package/lib/plugin/quick-open.js.map +1 -1
  197. package/lib/plugin/tasks/tasks.d.ts +1 -3
  198. package/lib/plugin/tasks/tasks.d.ts.map +1 -1
  199. package/lib/plugin/tasks/tasks.js +3 -17
  200. package/lib/plugin/tasks/tasks.js.map +1 -1
  201. package/lib/plugin/timeline.d.ts.map +1 -1
  202. package/lib/plugin/timeline.js +1 -2
  203. package/lib/plugin/timeline.js.map +1 -1
  204. package/lib/plugin/type-converters.d.ts.map +1 -1
  205. package/lib/plugin/type-converters.js +18 -11
  206. package/lib/plugin/type-converters.js.map +1 -1
  207. package/lib/plugin/types-impl.d.ts +55 -1
  208. package/lib/plugin/types-impl.d.ts.map +1 -1
  209. package/lib/plugin/types-impl.js +81 -1
  210. package/lib/plugin/types-impl.js.map +1 -1
  211. package/lib/plugin/webviews.d.ts +1 -2
  212. package/lib/plugin/webviews.d.ts.map +1 -1
  213. package/lib/plugin/webviews.js.map +1 -1
  214. package/package.json +31 -27
  215. package/src/common/arrays.ts +8 -0
  216. package/src/common/connection.ts +98 -42
  217. package/src/common/plugin-api-rpc-model.ts +4 -0
  218. package/src/common/plugin-api-rpc.ts +31 -12
  219. package/src/common/plugin-protocol.ts +3 -1
  220. package/src/hosted/browser/hosted-plugin.ts +20 -13
  221. package/src/hosted/browser/worker/debug-stub.ts +1 -0
  222. package/src/hosted/node/hosted-plugin-deployer-handler.ts +13 -40
  223. package/src/hosted/node/hosted-plugin-localization-service.ts +201 -0
  224. package/src/hosted/node/hosted-plugin-process.ts +4 -6
  225. package/src/hosted/node/plugin-ext-hosted-backend-module.ts +2 -0
  226. package/src/hosted/node/plugin-manifest-loader.ts +4 -56
  227. package/src/hosted/node/plugin-service.ts +7 -40
  228. package/src/hosted/node/scanners/scanner-theia.ts +7 -3
  229. package/src/main/browser/callhierarchy/callhierarchy-type-converters.ts +6 -2
  230. package/src/main/browser/custom-editors/custom-editor-opener.tsx +8 -4
  231. package/src/main/browser/custom-editors/custom-editors-main.ts +1 -2
  232. package/src/main/browser/debug/debug-main.ts +4 -5
  233. package/src/main/browser/debug/plugin-debug-adapter-contribution.ts +3 -3
  234. package/src/main/browser/debug/plugin-debug-service.ts +23 -0
  235. package/src/main/browser/debug/plugin-debug-session-factory.ts +6 -6
  236. package/src/main/browser/dialogs/modal-notification.ts +18 -7
  237. package/src/main/browser/dialogs/style/modal-notification.css +17 -2
  238. package/src/main/browser/editors-and-documents-main.ts +1 -2
  239. package/src/main/browser/file-system-main-impl.ts +1 -1
  240. package/src/main/browser/languages-main.ts +1 -1
  241. package/src/main/browser/main-context.ts +3 -3
  242. package/src/main/browser/message-registry-main.ts +1 -1
  243. package/src/main/browser/plugin-ext-frontend-module.ts +6 -4
  244. package/src/main/browser/quick-open-main.ts +54 -109
  245. package/src/main/browser/style/tree.css +4 -0
  246. package/src/main/browser/tasks-main.ts +7 -0
  247. package/src/main/browser/timeline-main.ts +1 -2
  248. package/src/main/browser/view/plugin-view-registry.ts +83 -28
  249. package/src/main/browser/view/plugin-view-widget.ts +7 -2
  250. package/src/main/browser/view/tree-view-widget.tsx +43 -65
  251. package/src/main/browser/webview/pre/host.js +20 -12
  252. package/src/main/browser/webview/pre/main.js +1 -2
  253. package/src/main/browser/webview/pre/service-worker.js +1 -1
  254. package/src/main/browser/webview/webview-frontend-security-warnings.ts +8 -7
  255. package/src/main/browser/webview/webview-preferences.ts +3 -2
  256. package/src/main/browser/webview/webview.ts +2 -2
  257. package/src/plugin/comments.ts +1 -2
  258. package/src/plugin/custom-editors.ts +2 -4
  259. package/src/plugin/decorations.ts +1 -2
  260. package/src/plugin/document-data.ts +1 -2
  261. package/src/plugin/documents.ts +1 -2
  262. package/src/plugin/file-system-event-service-ext-impl.ts +1 -2
  263. package/src/plugin/file-system-ext-impl.ts +1 -2
  264. package/src/plugin/known-commands.spec.ts +1 -2
  265. package/src/plugin/languages/call-hierarchy.ts +14 -5
  266. package/src/plugin/languages/rename.ts +1 -2
  267. package/src/plugin/languages.ts +5 -2
  268. package/src/plugin/message-registry.ts +3 -1
  269. package/src/plugin/node/debug/debug.ts +46 -26
  270. package/src/plugin/node/debug/plugin-debug-adapter-session.ts +9 -9
  271. package/src/plugin/node/debug/plugin-debug-adapter-starter.ts +17 -14
  272. package/src/plugin/plugin-context.ts +24 -12
  273. package/src/plugin/plugin-manager.ts +26 -4
  274. package/src/plugin/plugin-storage.ts +7 -2
  275. package/src/plugin/preference-registry.spec.ts +1 -2
  276. package/src/plugin/quick-open.ts +16 -36
  277. package/src/plugin/tasks/tasks.ts +4 -18
  278. package/src/plugin/timeline.ts +1 -2
  279. package/src/plugin/type-converters.ts +20 -13
  280. package/src/plugin/types-impl.ts +77 -1
  281. package/src/plugin/webviews.ts +1 -2
  282. package/lib/common/plugin-message-reader.d.ts +0 -46
  283. package/lib/common/plugin-message-reader.d.ts.map +0 -1
  284. package/lib/common/plugin-message-reader.js +0 -116
  285. package/lib/common/plugin-message-reader.js.map +0 -1
  286. package/lib/common/plugin-message-writer.d.ts +0 -38
  287. package/lib/common/plugin-message-writer.d.ts.map +0 -1
  288. package/lib/common/plugin-message-writer.js +0 -67
  289. package/lib/common/plugin-message-writer.js.map +0 -1
  290. package/lib/main/browser/connection-main.d.ts +0 -59
  291. package/lib/main/browser/connection-main.d.ts.map +0 -1
  292. package/lib/main/browser/connection-main.js +0 -98
  293. package/lib/main/browser/connection-main.js.map +0 -1
  294. package/lib/plugin/connection-ext.d.ts +0 -56
  295. package/lib/plugin/connection-ext.d.ts.map +0 -1
  296. package/lib/plugin/connection-ext.js +0 -88
  297. package/lib/plugin/connection-ext.js.map +0 -1
  298. package/src/common/plugin-message-reader.ts +0 -111
  299. package/src/common/plugin-message-writer.ts +0 -65
  300. package/src/main/browser/connection-main.ts +0 -107
  301. package/src/plugin/connection-ext.ts +0 -95
@@ -31,11 +31,10 @@
31
31
  import { Emitter, WaitUntilEvent, AsyncEmitter } from '@theia/core/lib/common/event';
32
32
  import { IRelativePattern, parse } from '@theia/callhierarchy/lib/common/glob';
33
33
  import { UriComponents } from '@theia/core/shared/vscode-uri';
34
- import { URI } from './types-impl';
34
+ import { Disposable, URI, WorkspaceEdit } from './types-impl';
35
35
  import { EditorsAndDocumentsExtImpl as ExtHostDocumentsAndEditors } from './editors-and-documents';
36
36
  import type * as vscode from '@theia/plugin';
37
37
  import * as typeConverter from './type-converters';
38
- import { Disposable, WorkspaceEdit } from './types-impl';
39
38
  import { FileOperation } from '@theia/filesystem/lib/common/files';
40
39
  import { flatten } from '../common/arrays';
41
40
  import { CancellationToken } from '@theia/core/lib/common/cancellation';
@@ -29,12 +29,11 @@
29
29
  /* eslint-disable @typescript-eslint/no-explicit-any */
30
30
 
31
31
  import { UriComponents } from '@theia/core/shared/vscode-uri';
32
- import { URI } from './types-impl';
32
+ import { FileChangeType, FileSystemError, URI } from './types-impl';
33
33
  import { RPCProtocol } from '../common/rpc-protocol';
34
34
  import { PLUGIN_RPC_CONTEXT, FileSystemExt, FileSystemMain, IFileChangeDto } from '../common/plugin-api-rpc';
35
35
  import * as vscode from '@theia/plugin';
36
36
  import * as files from '@theia/filesystem/lib/common/files';
37
- import { FileChangeType, FileSystemError } from './types-impl';
38
37
  import * as typeConverter from './type-converters';
39
38
  import { LanguagesExtImpl } from './languages';
40
39
  import { Schemes as Schemas } from '../common/uri-components';
@@ -16,8 +16,7 @@
16
16
 
17
17
  import * as assert from 'assert';
18
18
  import { KnownCommands } from './known-commands';
19
- import { URI } from './types-impl';
20
- import { Position } from './types-impl';
19
+ import { Position, URI } from './types-impl';
21
20
  import { fromPosition } from './type-converters';
22
21
 
23
22
  describe('Known Command Conversions', () => {
@@ -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
 
@@ -90,6 +90,7 @@ import { DeclarationAdapter } from './languages/declaration';
90
90
  import { CallHierarchyAdapter } from './languages/call-hierarchy';
91
91
  import { BinaryBuffer } from '@theia/core/lib/common/buffer';
92
92
  import { DocumentSemanticTokensAdapter, DocumentRangeSemanticTokensAdapter } from './languages/semantic-highlighting';
93
+ import { isReadonlyArray } from '../common/arrays';
93
94
 
94
95
  type Adapter = CompletionAdapter |
95
96
  SignatureHelpAdapter |
@@ -204,7 +205,7 @@ export class LanguagesExtImpl implements LanguagesExt {
204
205
  }
205
206
 
206
207
  private transformDocumentSelector(selector: theia.DocumentSelector): SerializedDocumentFilter[] {
207
- if (Array.isArray(selector)) {
208
+ if (isReadonlyArray(selector)) {
208
209
  return selector.map(sel => this.doTransformDocumentSelector(sel)!);
209
210
  }
210
211
 
@@ -582,7 +583,9 @@ export class LanguagesExtImpl implements LanguagesExt {
582
583
  return this.createDisposable(callId);
583
584
  }
584
585
 
585
- $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> {
586
589
  return this.withAdapter(handle, CallHierarchyAdapter, adapter => adapter.provideRootDefinition(URI.revive(resource), location, token), undefined);
587
590
  }
588
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,24 @@
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
- import { PluginWebSocketChannel } from '../../../common/connection';
26
24
  import { CommandRegistryImpl } from '../../command-registry';
27
- import { ConnectionExtImpl } from '../../connection-ext';
28
- import { Disposable, Breakpoint as BreakpointExt, SourceBreakpoint, FunctionBreakpoint, Location, Range } from '../../types-impl';
25
+ import { ConnectionImpl } from '../../../common/connection';
26
+ import {
27
+ Disposable, Breakpoint as BreakpointExt, SourceBreakpoint, FunctionBreakpoint, Location, Range,
28
+ DebugAdapterServer, DebugAdapterExecutable, DebugAdapterNamedPipeServer, DebugAdapterInlineImplementation
29
+ } from '../../types-impl';
29
30
  import { resolveDebugAdapterExecutable } from './plugin-debug-adapter-executable-resolver';
30
31
  import { PluginDebugAdapterSession } from './plugin-debug-adapter-session';
31
- import { connectDebugAdapter, startDebugAdapter } from './plugin-debug-adapter-starter';
32
+ import { connectInlineDebugAdapter, connectPipeDebugAdapter, connectSocketDebugAdapter, startDebugAdapter } from './plugin-debug-adapter-starter';
32
33
  import { PluginDebugAdapterTracker } from './plugin-debug-adapter-tracker';
33
34
  import uuid = require('uuid');
35
+ import { DebugAdapter } from '@theia/debug/lib/node/debug-model';
34
36
 
35
37
  /* eslint-disable @typescript-eslint/no-explicit-any */
36
38
 
@@ -43,8 +45,11 @@ export class DebugExtImpl implements DebugExt {
43
45
  // debug sessions by sessionId
44
46
  private sessions = new Map<string, PluginDebugAdapterSession>();
45
47
 
46
- // providers by type
48
+ // providers by type (initial)
47
49
  private configurationProviders = new Map<string, Set<theia.DebugConfigurationProvider>>();
50
+ // providers by type (dynamic)
51
+ private dynamicConfigurationProviders = new Map<string, Set<theia.DebugConfigurationProvider>>();
52
+
48
53
  /**
49
54
  * Only use internally, don't send it to the frontend. It's expensive!
50
55
  * It's already there as a part of the plugin metadata.
@@ -54,7 +59,7 @@ export class DebugExtImpl implements DebugExt {
54
59
  private trackerFactories: [string, theia.DebugAdapterTrackerFactory][] = [];
55
60
  private contributionPaths = new Map<string, string>();
56
61
 
57
- private connectionExt: ConnectionExtImpl;
62
+ private connectionExt: ConnectionImpl;
58
63
  private commandRegistryExt: CommandRegistryImpl;
59
64
 
60
65
  private proxy: DebugMain;
@@ -85,7 +90,7 @@ export class DebugExtImpl implements DebugExt {
85
90
  /**
86
91
  * Sets dependencies.
87
92
  */
88
- assistedInject(connectionExt: ConnectionExtImpl, commandRegistryExt: CommandRegistryImpl): void {
93
+ assistedInject(connectionExt: ConnectionImpl, commandRegistryExt: CommandRegistryImpl): void {
89
94
  this.connectionExt = connectionExt;
90
95
  this.commandRegistryExt = commandRegistryExt;
91
96
  }
@@ -182,19 +187,22 @@ export class DebugExtImpl implements DebugExt {
182
187
  });
183
188
  }
184
189
 
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);
190
+ registerDebugConfigurationProvider(debugType: string, provider: theia.DebugConfigurationProvider, trigger: theia.DebugConfigurationProviderTriggerKind): Disposable {
191
+ console.log(`Debug configuration provider has been registered: ${debugType}, trigger: ${trigger}`);
192
+ const providersByTriggerKind = trigger === DebugConfigurationProviderTriggerKind.Initial ? this.configurationProviders : this.dynamicConfigurationProviders;
193
+ let providers = providersByTriggerKind.get(debugType);
194
+ if (!providers) {
195
+ providersByTriggerKind.set(debugType, providers = new Set());
196
+ }
189
197
  providers.add(provider);
190
198
 
191
199
  return Disposable.create(() => {
192
200
  // eslint-disable-next-line @typescript-eslint/no-shadow
193
- const providers = this.configurationProviders.get(debugType);
201
+ const providers = providersByTriggerKind.get(debugType);
194
202
  if (providers) {
195
203
  providers.delete(provider);
196
204
  if (providers.size === 0) {
197
- this.configurationProviders.delete(debugType);
205
+ providersByTriggerKind.delete(debugType);
198
206
  }
199
207
  }
200
208
  });
@@ -292,13 +300,13 @@ export class DebugExtImpl implements DebugExt {
292
300
  };
293
301
 
294
302
  const tracker = await this.createDebugAdapterTracker(theiaSession);
295
- const communicationProvider = await this.createCommunicationProvider(theiaSession, debugConfiguration);
303
+ const communicationProvider = await this.createDebugAdapter(theiaSession, debugConfiguration);
296
304
 
297
305
  const debugAdapterSession = new PluginDebugAdapterSession(communicationProvider, tracker, theiaSession);
298
306
  this.sessions.set(sessionId, debugAdapterSession);
299
307
 
300
308
  const connection = await this.connectionExt!.ensureConnection(sessionId);
301
- debugAdapterSession.start(new PluginWebSocketChannel(connection));
309
+ debugAdapterSession.start(connection);
302
310
 
303
311
  return sessionId;
304
312
  }
@@ -319,10 +327,10 @@ export class DebugExtImpl implements DebugExt {
319
327
  return undefined;
320
328
  }
321
329
 
322
- async $provideDebugConfigurations(debugType: string, workspaceFolderUri: string | undefined): Promise<theia.DebugConfiguration[]> {
330
+ async $provideDebugConfigurations(debugType: string, workspaceFolderUri: string | undefined, dynamic: boolean = false): Promise<theia.DebugConfiguration[]> {
323
331
  let result: theia.DebugConfiguration[] = [];
324
332
 
325
- const providers = this.configurationProviders.get(debugType);
333
+ const providers = dynamic ? this.dynamicConfigurationProviders.get(debugType) : this.configurationProviders.get(debugType);
326
334
  if (providers) {
327
335
  for (const provider of providers) {
328
336
  if (provider.provideDebugConfigurations) {
@@ -337,7 +345,11 @@ export class DebugExtImpl implements DebugExt {
337
345
  async $resolveDebugConfigurations(debugConfiguration: theia.DebugConfiguration, workspaceFolderUri: string | undefined): Promise<theia.DebugConfiguration | undefined> {
338
346
  let current = debugConfiguration;
339
347
 
340
- for (const providers of [this.configurationProviders.get(debugConfiguration.type), this.configurationProviders.get('*')]) {
348
+ for (const providers of [
349
+ this.configurationProviders.get(debugConfiguration.type),
350
+ this.dynamicConfigurationProviders.get(debugConfiguration.type),
351
+ this.configurationProviders.get('*')
352
+ ]) {
341
353
  if (providers) {
342
354
  for (const provider of providers) {
343
355
  if (provider.resolveDebugConfiguration) {
@@ -363,7 +375,11 @@ export class DebugExtImpl implements DebugExt {
363
375
  Promise<theia.DebugConfiguration | undefined> {
364
376
  let current = debugConfiguration;
365
377
 
366
- for (const providers of [this.configurationProviders.get(debugConfiguration.type), this.configurationProviders.get('*')]) {
378
+ for (const providers of [
379
+ this.configurationProviders.get(debugConfiguration.type),
380
+ this.dynamicConfigurationProviders.get(debugConfiguration.type),
381
+ this.configurationProviders.get('*')
382
+ ]) {
367
383
  if (providers) {
368
384
  for (const provider of providers) {
369
385
  if (provider.resolveDebugConfigurationWithSubstitutedVariables) {
@@ -389,7 +405,7 @@ export class DebugExtImpl implements DebugExt {
389
405
  return PluginDebugAdapterTracker.create(session, this.trackerFactories);
390
406
  }
391
407
 
392
- protected async createCommunicationProvider(session: theia.DebugSession, debugConfiguration: theia.DebugConfiguration): Promise<CommunicationProvider> {
408
+ protected async createDebugAdapter(session: theia.DebugSession, debugConfiguration: theia.DebugConfiguration): Promise<DebugAdapter> {
393
409
  const executable = await this.resolveDebugAdapterExecutable(debugConfiguration);
394
410
  const descriptorFactory = this.descriptorFactories.get(session.type);
395
411
  if (descriptorFactory) {
@@ -409,16 +425,20 @@ export class DebugExtImpl implements DebugExt {
409
425
  // @param executable The debug adapter's executable information as specified in the package.json (or undefined if no such information exists).
410
426
  const descriptor = await descriptorFactory.createDebugAdapterDescriptor(session, executable);
411
427
  if (descriptor) {
412
- if ('port' in descriptor) {
413
- return connectDebugAdapter(descriptor);
414
- } else {
428
+ if (DebugAdapterServer.is(descriptor)) {
429
+ return connectSocketDebugAdapter(descriptor);
430
+ } else if (DebugAdapterExecutable.is(descriptor)) {
415
431
  return startDebugAdapter(descriptor);
432
+ } else if (DebugAdapterNamedPipeServer.is(descriptor)) {
433
+ return connectPipeDebugAdapter(descriptor);
434
+ } else if (DebugAdapterInlineImplementation.is(descriptor)) {
435
+ return connectInlineDebugAdapter(descriptor);
416
436
  }
417
437
  }
418
438
  }
419
439
 
420
440
  if ('debugServer' in debugConfiguration) {
421
- return connectDebugAdapter({ port: debugConfiguration.debugServer });
441
+ return connectSocketDebugAdapter({ port: debugConfiguration.debugServer });
422
442
  } else {
423
443
  if (!executable) {
424
444
  throw new Error('It is not possible to provide debug adapter executable.');
@@ -14,34 +14,34 @@
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
- import { IWebSocket } from '@theia/core/shared/vscode-ws-jsonrpc';
19
+ import { DebugAdapter } from '@theia/debug/lib/node/debug-model';
20
+ import { Channel } from '@theia/debug/lib/common/debug-service';
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 {
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 debugAdapter: DebugAdapter,
34
34
  protected readonly tracker: theia.DebugAdapterTracker,
35
35
  protected readonly theiaSession: theia.DebugSession) {
36
36
 
37
- super(theiaSession.id, communicationProvider);
37
+ super(theiaSession.id, debugAdapter);
38
38
 
39
39
  this.type = theiaSession.type;
40
40
  this.name = theiaSession.name;
41
41
  this.configuration = theiaSession.configuration;
42
42
  }
43
43
 
44
- async start(channel: IWebSocket): Promise<void> {
44
+ async start(channel: Channel): Promise<void> {
45
45
  if (this.tracker.onWillStartSession) {
46
46
  this.tracker.onWillStartSession();
47
47
  }
@@ -83,10 +83,10 @@ export class PluginDebugAdapterSession extends DebugAdapterSessionImpl implement
83
83
  super.write(message);
84
84
  }
85
85
 
86
- protected onDebugAdapterExit(exitCode: number, signal: string | undefined): void {
86
+ protected onDebugAdapterExit(): void {
87
87
  if (this.tracker.onExit) {
88
- this.tracker.onExit(exitCode, signal);
88
+ this.tracker.onExit(undefined, undefined);
89
89
  }
90
- super.onDebugAdapterExit(exitCode, signal);
90
+ super.onDebugAdapterExit();
91
91
  }
92
92
  }
@@ -15,15 +15,17 @@
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 { DebugAdapter } from '@theia/debug/lib/node/debug-model';
20
+ import { DebugAdapterExecutable, DebugAdapterInlineImplementation, DebugAdapterNamedPipeServer, DebugAdapterServer } from '../../types-impl';
21
+ import { InlineDebugAdapter } from '@theia/debug/lib/node/inline-debug-adapter';
22
+ import { ProcessDebugAdapter, SocketDebugAdapter } from '@theia/debug/lib/node/stream-debug-adapter';
21
23
  const isElectron = require('is-electron');
22
24
 
23
25
  /**
24
26
  * Starts debug adapter process.
25
27
  */
26
- export function startDebugAdapter(executable: theia.DebugAdapterExecutable): CommunicationProvider {
28
+ export function startDebugAdapter(executable: DebugAdapterExecutable): DebugAdapter {
27
29
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
28
30
  const options: any = { stdio: ['pipe', 'pipe', 2] };
29
31
 
@@ -63,21 +65,22 @@ export function startDebugAdapter(executable: theia.DebugAdapterExecutable): Com
63
65
  childProcess = spawn(command, args, options);
64
66
  }
65
67
 
66
- return {
67
- input: childProcess.stdin!,
68
- output: childProcess.stdout!,
69
- dispose: () => childProcess.kill()
70
- };
68
+ return new ProcessDebugAdapter(childProcess);
71
69
  }
72
70
 
73
71
  /**
74
72
  * Connects to a remote debug server.
75
73
  */
76
- export function connectDebugAdapter(server: theia.DebugAdapterServer): CommunicationProvider {
74
+ export function connectSocketDebugAdapter(server: DebugAdapterServer): SocketDebugAdapter {
77
75
  const socket = net.createConnection(server.port, server.host);
78
- return {
79
- input: socket,
80
- output: socket,
81
- dispose: () => socket.end()
82
- };
76
+ return new SocketDebugAdapter(socket);
77
+ }
78
+
79
+ export function connectPipeDebugAdapter(adapter: DebugAdapterNamedPipeServer): SocketDebugAdapter {
80
+ const socket = net.createConnection(adapter.path);
81
+ return new SocketDebugAdapter(socket);
82
+ }
83
+
84
+ export function connectInlineDebugAdapter(adapter: DebugAdapterInlineImplementation): InlineDebugAdapter {
85
+ return new InlineDebugAdapter(adapter.implementation);
83
86
  }
@@ -17,17 +17,19 @@
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,
32
+ PLUGIN_RPC_CONTEXT
31
33
  } from '../common/plugin-api-rpc';
32
34
  import { RPCProtocol } from '../common/rpc-protocol';
33
35
  import { MessageRegistryExt } from './message-registry';
@@ -105,6 +107,8 @@ import {
105
107
  Task2,
106
108
  DebugAdapterExecutable,
107
109
  DebugAdapterServer,
110
+ DebugAdapterNamedPipeServer,
111
+ DebugAdapterInlineImplementation,
108
112
  Breakpoint,
109
113
  SourceBreakpoint,
110
114
  FunctionBreakpoint,
@@ -134,7 +138,8 @@ import {
134
138
  ColorThemeKind,
135
139
  SourceControlInputBoxValidationType,
136
140
  URI,
137
- FileDecoration
141
+ FileDecoration,
142
+ ExtensionMode
138
143
  } from './types-impl';
139
144
  import { AuthenticationExtImpl } from './authentication-ext';
140
145
  import { SymbolKind } from '../common/plugin-api-rpc-model';
@@ -149,17 +154,15 @@ import { LanguagesExtImpl } from './languages';
149
154
  import { fromDocumentSelector, pluginToPluginInfo, fromGlobPattern } from './type-converters';
150
155
  import { DialogsExtImpl } from './dialogs';
151
156
  import { NotificationExtImpl } from './notification';
152
- import { CancellationToken } from '@theia/core/lib/common/cancellation';
153
157
  import { score } from '@theia/callhierarchy/lib/common/language-selector';
154
158
  import { MarkdownString } from './markdown-string';
155
159
  import { TreeViewsExtImpl } from './tree/tree-views';
156
- import { ConnectionExtImpl } from './connection-ext';
160
+ import { ConnectionImpl } from '../common/connection';
157
161
  import { TasksExtImpl } from './tasks/tasks';
158
162
  import { DebugExtImpl } from './node/debug/debug';
159
163
  import { FileSystemExtImpl } from './file-system-ext-impl';
160
- import { QuickPick, QuickPickItem, ResourceLabelFormatter } from '@theia/plugin';
164
+ import { QuickPick, QuickPickItem, ResourceLabelFormatter, LineChange } from '@theia/plugin';
161
165
  import { ScmExtImpl } from './scm';
162
- import { LineChange } from '@theia/plugin';
163
166
  import { DecorationsExtImpl } from './decorations';
164
167
  import { TextEditorExt } from './text-editor';
165
168
  import { ClipboardExt } from './clipboard-ext';
@@ -198,7 +201,7 @@ export function createAPIFactory(
198
201
  const languagesExt = rpc.set(MAIN_RPC_CONTEXT.LANGUAGES_EXT, new LanguagesExtImpl(rpc, documents, commandRegistry));
199
202
  const treeViewsExt = rpc.set(MAIN_RPC_CONTEXT.TREE_VIEWS_EXT, new TreeViewsExtImpl(rpc, commandRegistry));
200
203
  const tasksExt = rpc.set(MAIN_RPC_CONTEXT.TASKS_EXT, new TasksExtImpl(rpc, terminalExt));
201
- const connectionExt = rpc.set(MAIN_RPC_CONTEXT.CONNECTION_EXT, new ConnectionExtImpl(rpc));
204
+ const connectionExt = rpc.set(MAIN_RPC_CONTEXT.CONNECTION_EXT, new ConnectionImpl(rpc.getProxy(PLUGIN_RPC_CONTEXT.CONNECTION_MAIN)));
202
205
  const fileSystemExt = rpc.set(MAIN_RPC_CONTEXT.FILE_SYSTEM_EXT, new FileSystemExtImpl(rpc, languagesExt));
203
206
  const extHostFileSystemEvent = rpc.set(MAIN_RPC_CONTEXT.ExtHostFileSystemEventService, new ExtHostFileSystemEventService(rpc, editorsAndDocumentsExt));
204
207
  const scmExt = rpc.set(MAIN_RPC_CONTEXT.SCM_EXT, new ScmExtImpl(rpc, commandRegistry));
@@ -767,8 +770,12 @@ export function createAPIFactory(
767
770
  registerDebugAdapterDescriptorFactory(debugType: string, factory: theia.DebugAdapterDescriptorFactory): Disposable {
768
771
  return debugExt.registerDebugAdapterDescriptorFactory(debugType, factory);
769
772
  },
770
- registerDebugConfigurationProvider(debugType: string, provider: theia.DebugConfigurationProvider): Disposable {
771
- return debugExt.registerDebugConfigurationProvider(debugType, provider);
773
+ registerDebugConfigurationProvider(
774
+ debugType: string,
775
+ provider: theia.DebugConfigurationProvider,
776
+ triggerKind?: theia.DebugConfigurationProviderTriggerKind
777
+ ): Disposable {
778
+ return debugExt.registerDebugConfigurationProvider(debugType, provider, triggerKind || DebugConfigurationProviderTriggerKind.Initial);
772
779
  },
773
780
  registerDebugAdapterTrackerFactory(debugType: string, factory: theia.DebugAdapterTrackerFactory): Disposable {
774
781
  return debugExt.registerDebugAdapterTrackerFactory(debugType, factory);
@@ -924,6 +931,9 @@ export function createAPIFactory(
924
931
  Task2,
925
932
  DebugAdapterExecutable,
926
933
  DebugAdapterServer,
934
+ DebugAdapterNamedPipeServer,
935
+ DebugAdapterInlineImplementation,
936
+ DebugConfigurationProviderTriggerKind,
927
937
  Breakpoint,
928
938
  SourceBreakpoint,
929
939
  FunctionBreakpoint,
@@ -952,7 +962,9 @@ export function createAPIFactory(
952
962
  SemanticTokensEdit,
953
963
  ColorThemeKind,
954
964
  SourceControlInputBoxValidationType,
955
- FileDecoration
965
+ FileDecoration,
966
+ CancellationError,
967
+ ExtensionMode
956
968
  };
957
969
  };
958
970
  }
@@ -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