@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
@@ -16,7 +16,7 @@
16
16
  /* eslint-disable @typescript-eslint/no-explicit-any */
17
17
  import {
18
18
  QuickOpenExt, PLUGIN_RPC_CONTEXT as Ext, QuickOpenMain, TransferInputBox, Plugin,
19
- Item, TransferQuickInputButton, TransferQuickPickItems, TransferQuickInput, TransferQuickPick
19
+ Item, TransferQuickInputButton, TransferQuickPickItems, TransferQuickInput
20
20
  } from '../common/plugin-api-rpc';
21
21
  import * as theia from '@theia/plugin';
22
22
  import { QuickPickItem, InputBoxOptions, InputBox, QuickPick, QuickInput } from '@theia/plugin';
@@ -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
 
@@ -178,10 +175,6 @@ export class QuickOpenExtImpl implements QuickOpenExt {
178
175
  return session;
179
176
  }
180
177
 
181
- showCustomQuickPick<T extends QuickPickItem>(options: TransferQuickPick<T>): void {
182
- this.proxy.$showCustomQuickPick(options);
183
- }
184
-
185
178
  hide(): void {
186
179
  this.proxy.$hide();
187
180
  }
@@ -263,7 +256,7 @@ export class QuickInputExt implements QuickInput {
263
256
  private onDidHideEmitter: Emitter<void>;
264
257
  private onDidTriggerButtonEmitter: Emitter<theia.QuickInputButton>;
265
258
  private _updateTimeout: any;
266
- private _pendingUpdate: TransferQuickInput<any> = { id: this._id };
259
+ private _pendingUpdate: TransferQuickInput = { id: this._id };
267
260
 
268
261
  constructor(readonly quickOpen: QuickOpenExtImpl, readonly quickOpenMain: QuickOpenMain, readonly plugin: Plugin, private _onDidDispose: () => void) {
269
262
  this.title = undefined;
@@ -389,6 +382,7 @@ export class QuickInputExt implements QuickInput {
389
382
  this._fireHide();
390
383
  this.disposableCollection.dispose();
391
384
  this._onDidDispose();
385
+ this.quickOpenMain.$dispose(this._id);
392
386
  }
393
387
 
394
388
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -617,7 +611,15 @@ export class QuickPickExt<T extends theia.QuickPickItem> extends QuickInputExt i
617
611
  this._itemsToHandles.set(item, i);
618
612
  });
619
613
  this.update({
620
- 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
+ }))
621
623
  });
622
624
  }
623
625
 
@@ -690,26 +692,4 @@ export class QuickPickExt<T extends theia.QuickPickItem> extends QuickInputExt i
690
692
  this._selectedItems = items;
691
693
  this._onDidChangeSelectionEmitter.fire(items);
692
694
  }
693
-
694
- show(): void {
695
- super.show();
696
- this.quickOpen.showCustomQuickPick({
697
- id: this._id,
698
- title: this.title,
699
- step: this.step,
700
- totalSteps: this.totalSteps,
701
- enabled: this.enabled,
702
- busy: this.busy,
703
- ignoreFocusOut: this.ignoreFocusOut,
704
- value: this.value,
705
- placeholder: this.placeholder,
706
- buttons: this.buttons,
707
- items: convertToTransferQuickPickItems(this.items),
708
- canSelectMany: this.canSelectMany,
709
- matchOnDescription: this.matchOnDescription,
710
- matchOnDetail: this.matchOnDetail,
711
- activeItems: this.activeItems,
712
- selectedItems: this.selectedItems
713
- });
714
- }
715
695
  }
@@ -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 {
@@ -26,7 +26,7 @@ import { LanguageFilter, LanguageSelector, RelativePattern } from '@theia/callhi
26
26
  import { isMarkdownString, MarkdownString } from './markdown-string';
27
27
  import * as types from './types-impl';
28
28
  import { UriComponents } from '../common/uri-components';
29
- import { TaskGroup } from './types-impl';
29
+ import { isReadonlyArray } from '../common/arrays';
30
30
 
31
31
  const SIDE_GROUP = -2;
32
32
  const ACTIVE_GROUP = -1;
@@ -168,10 +168,7 @@ export function fromRangeOrRangeWithMessage(ranges: theia.Range[] | theia.Decora
168
168
  };
169
169
  });
170
170
  } else {
171
- return ranges.map((r): DecorationOptions =>
172
- ({
173
- range: fromRange(r)!
174
- }));
171
+ return ranges.map(r => ({ range: fromRange(r) }));
175
172
  }
176
173
  }
177
174
 
@@ -213,7 +210,7 @@ export function toMarkdown(value: model.MarkdownString): MarkdownString {
213
210
  export function fromDocumentSelector(selector: theia.DocumentSelector | undefined): LanguageSelector | undefined {
214
211
  if (!selector) {
215
212
  return undefined;
216
- } else if (Array.isArray(selector)) {
213
+ } else if (isReadonlyArray(selector)) {
217
214
  return <LanguageSelector>selector.map(fromDocumentSelector);
218
215
  } else if (typeof selector === 'string') {
219
216
  return selector;
@@ -271,6 +268,8 @@ export function fromCompletionItemKind(kind?: types.CompletionItemKind): model.C
271
268
  case types.CompletionItemKind.Event: return model.CompletionItemKind.Event;
272
269
  case types.CompletionItemKind.Operator: return model.CompletionItemKind.Operator;
273
270
  case types.CompletionItemKind.TypeParameter: return model.CompletionItemKind.TypeParameter;
271
+ case types.CompletionItemKind.User: return model.CompletionItemKind.User;
272
+ case types.CompletionItemKind.Issue: return model.CompletionItemKind.Issue;
274
273
  }
275
274
  return model.CompletionItemKind.Property;
276
275
  }
@@ -302,6 +301,8 @@ export function toCompletionItemKind(kind?: model.CompletionItemKind): types.Com
302
301
  case model.CompletionItemKind.Event: return types.CompletionItemKind.Event;
303
302
  case model.CompletionItemKind.Operator: return types.CompletionItemKind.Operator;
304
303
  case model.CompletionItemKind.TypeParameter: return types.CompletionItemKind.TypeParameter;
304
+ case model.CompletionItemKind.User: return types.CompletionItemKind.User;
305
+ case model.CompletionItemKind.Issue: return types.CompletionItemKind.Issue;
305
306
  }
306
307
  return types.CompletionItemKind.Property;
307
308
  }
@@ -681,18 +682,24 @@ export function fromCallHierarchyItem(item: theia.CallHierarchyItem): model.Call
681
682
  detail: item.detail,
682
683
  uri: item.uri,
683
684
  range: fromRange(item.range),
684
- selectionRange: fromRange(item.selectionRange)
685
+ selectionRange: fromRange(item.selectionRange),
686
+ tags: item.tags,
687
+ data: item.data,
685
688
  };
686
689
  }
687
690
 
688
691
  export function toCallHierarchyItem(value: model.CallHierarchyItem): types.CallHierarchyItem {
689
- return new types.CallHierarchyItem(
692
+ const item = new types.CallHierarchyItem(
690
693
  SymbolKind.toSymbolKind(value.kind),
691
694
  value.name,
692
695
  value.detail ? value.detail : '',
693
696
  URI.revive(value.uri),
694
697
  toRange(value.range),
695
- toRange(value.selectionRange));
698
+ toRange(value.selectionRange),
699
+ );
700
+ item.tags = value.tags;
701
+ item.data = value.data;
702
+ return item;
696
703
  }
697
704
 
698
705
  export function toCallHierarchyIncomingCall(value: model.CallHierarchyIncomingCall): types.CallHierarchyIncomingCall {
@@ -741,9 +748,9 @@ export function fromTask(task: theia.Task): TaskDto | undefined {
741
748
  }
742
749
 
743
750
  const group = task.group;
744
- if (group === TaskGroup.Build) {
751
+ if (group === types.TaskGroup.Build) {
745
752
  taskDto.group = BUILD_GROUP;
746
- } else if (group === TaskGroup.Test) {
753
+ } else if (group === types.TaskGroup.Test) {
747
754
  taskDto.group = TEST_GROUP;
748
755
  }
749
756
 
@@ -830,9 +837,9 @@ export function toTask(taskDto: TaskDto): theia.Task {
830
837
 
831
838
  if (group) {
832
839
  if (group === BUILD_GROUP) {
833
- result.group = TaskGroup.Build;
840
+ result.group = types.TaskGroup.Build;
834
841
  } else if (group === TEST_GROUP) {
835
- result.group = TaskGroup.Test;
842
+ result.group = types.TaskGroup.Test;
836
843
  }
837
844
  }
838
845
 
@@ -189,6 +189,26 @@ export enum ColorThemeKind {
189
189
  HighContrast = 3
190
190
  }
191
191
 
192
+ export enum ExtensionMode {
193
+ /**
194
+ * The extension is installed normally (for example, from the marketplace
195
+ * or VSIX) in the editor.
196
+ */
197
+ Production = 1,
198
+
199
+ /**
200
+ * The extension is running from an `--extensionDevelopmentPath` provided
201
+ * when launching the editor.
202
+ */
203
+ Development = 2,
204
+
205
+ /**
206
+ * The extension is running from an `--extensionTestsPath` and
207
+ * the extension host is running unit tests.
208
+ */
209
+ Test = 3,
210
+ }
211
+
192
212
  /**
193
213
  * Represents the validation type of the Source Control input.
194
214
  */
@@ -892,7 +912,9 @@ export enum CompletionItemKind {
892
912
  Struct = 21,
893
913
  Event = 22,
894
914
  Operator = 23,
895
- TypeParameter = 24
915
+ TypeParameter = 24,
916
+ User = 25,
917
+ Issue = 26
896
918
  }
897
919
 
898
920
  @es5ClassCompat
@@ -2098,6 +2120,12 @@ export class DebugAdapterExecutable {
2098
2120
  }
2099
2121
  }
2100
2122
 
2123
+ export namespace DebugAdapterExecutable {
2124
+ export function is(adapter: theia.DebugAdapterDescriptor | undefined): adapter is theia.DebugAdapterExecutable {
2125
+ return !!adapter && 'command' in adapter;
2126
+ }
2127
+ }
2128
+
2101
2129
  /**
2102
2130
  * Represents a debug adapter running as a socket based server.
2103
2131
  */
@@ -2123,6 +2151,52 @@ export class DebugAdapterServer {
2123
2151
  }
2124
2152
  }
2125
2153
 
2154
+ export namespace DebugAdapterServer {
2155
+ export function is(adapter: theia.DebugAdapterDescriptor | undefined): adapter is DebugAdapterServer {
2156
+ return !!adapter && 'port' in adapter;
2157
+ }
2158
+ }
2159
+
2160
+ /**
2161
+ * Represents a debug adapter running as a Named Pipe (on Windows)/UNIX Domain Socket (on non-Windows) based server.
2162
+ */
2163
+ @es5ClassCompat
2164
+ export class DebugAdapterNamedPipeServer {
2165
+ /**
2166
+ * Create a description for a debug adapter running as a Named Pipe (on Windows)/UNIX Domain Socket (on non-Windows) based server.
2167
+ */
2168
+ constructor(readonly path: string) { }
2169
+ }
2170
+
2171
+ export namespace DebugAdapterNamedPipeServer {
2172
+ export function is(adapter: theia.DebugAdapterDescriptor | undefined): adapter is DebugAdapterNamedPipeServer {
2173
+ return !!adapter && 'path' in adapter;
2174
+ }
2175
+ }
2176
+
2177
+ /**
2178
+ * A debug adapter descriptor for an inline implementation.
2179
+ */
2180
+ @es5ClassCompat
2181
+ export class DebugAdapterInlineImplementation {
2182
+ implementation: theia.DebugAdapter;
2183
+
2184
+ /**
2185
+ * Create a descriptor for an inline implementation of a debug adapter.
2186
+ */
2187
+ constructor(impl: theia.DebugAdapter) {
2188
+ this.implementation = impl;
2189
+ }
2190
+ }
2191
+
2192
+ export namespace DebugAdapterInlineImplementation {
2193
+ export function is(adapter: theia.DebugAdapterDescriptor | undefined): adapter is DebugAdapterInlineImplementation {
2194
+ return !!adapter && 'implementation' in adapter;
2195
+ }
2196
+ }
2197
+
2198
+ export type DebugAdapterDescriptor = DebugAdapterExecutable | DebugAdapterServer | DebugAdapterNamedPipeServer | DebugAdapterInlineImplementation;
2199
+
2126
2200
  export enum LogLevel {
2127
2201
  Trace = 1,
2128
2202
  Debug = 2,
@@ -2344,6 +2418,8 @@ export class CallHierarchyItem {
2344
2418
  uri: URI;
2345
2419
  range: Range;
2346
2420
  selectionRange: Range;
2421
+ tags?: readonly SymbolTag[];
2422
+ data?: unknown;
2347
2423
 
2348
2424
  constructor(kind: SymbolKind, name: string, detail: string, uri: URI, range: Range, selectionRange: Range) {
2349
2425
  this.kind = kind;
@@ -15,10 +15,9 @@
15
15
  ********************************************************************************/
16
16
 
17
17
  import { v4 } from 'uuid';
18
- import { WebviewsExt, WebviewPanelViewState, WebviewsMain, PLUGIN_RPC_CONTEXT, WebviewInitData, /* WebviewsMain, PLUGIN_RPC_CONTEXT */ } from '../common/plugin-api-rpc';
18
+ import { Plugin, WebviewsExt, WebviewPanelViewState, WebviewsMain, PLUGIN_RPC_CONTEXT, WebviewInitData, /* WebviewsMain, PLUGIN_RPC_CONTEXT */ } from '../common/plugin-api-rpc';
19
19
  import * as theia from '@theia/plugin';
20
20
  import { RPCProtocol } from '../common/rpc-protocol';
21
- import { Plugin } from '../common/plugin-api-rpc';
22
21
  import { Emitter, Event } from '@theia/core/lib/common/event';
23
22
  import { fromViewColumn, toViewColumn, toWebviewPanelShowOptions } from './type-converters';
24
23
  import { Disposable, WebviewPanelTargetArea, URI } from './types-impl';
@@ -1,46 +0,0 @@
1
- /********************************************************************************
2
- * Copyright (C) 2018 Red Hat, Inc. and others.
3
- *
4
- * This program and the accompanying materials are made available under the
5
- * terms of the Eclipse Public License v. 2.0 which is available at
6
- * http://www.eclipse.org/legal/epl-2.0.
7
- *
8
- * This Source Code may also be made available under the following Secondary
9
- * Licenses when the conditions for such availability set forth in the Eclipse
10
- * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- * with the GNU Classpath Exception which is available at
12
- * https://www.gnu.org/software/classpath/license.html.
13
- *
14
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
- ********************************************************************************/
16
- import { DataCallback, Emitter, Event, PartialMessageInfo } from '@theia/core/shared/vscode-ws-jsonrpc';
17
- export declare abstract class AbstractMessageReader {
18
- protected errorEmitter: Emitter<Error>;
19
- protected closeEmitter: Emitter<void>;
20
- protected partialMessageEmitter: Emitter<PartialMessageInfo>;
21
- dispose(): void;
22
- get onError(): Event<Error>;
23
- fireError(error: Error): void;
24
- get onClose(): Event<void>;
25
- fireClose(): void;
26
- get onPartialMessage(): Event<PartialMessageInfo>;
27
- firePartialMessage(info: PartialMessageInfo): void;
28
- asError(error: any): Error;
29
- }
30
- /**
31
- * Support for reading string message through RPC protocol.
32
- */
33
- export declare class PluginMessageReader extends AbstractMessageReader {
34
- protected state: 'initial' | 'listening' | 'closed';
35
- protected callback: DataCallback | undefined;
36
- protected readonly events: {
37
- message?: any;
38
- error?: any;
39
- }[];
40
- constructor();
41
- listen(callback: DataCallback): void;
42
- readMessage(message: string): void;
43
- fireError(error: any): void;
44
- fireClose(): void;
45
- }
46
- //# sourceMappingURL=plugin-message-reader.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin-message-reader.d.ts","sourceRoot":"","sources":["../../src/common/plugin-message-reader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAExG,8BAAsB,qBAAqB;IACvC,SAAS,CAAC,YAAY,iBAAwB;IAC9C,SAAS,CAAC,YAAY,gBAAuB;IAC7C,SAAS,CAAC,qBAAqB,8BAAqC;IACpE,OAAO,IAAI,IAAI;IAIf,IAAI,OAAO,IAAI,KAAK,CAAC,KAAK,CAAC,CAE1B;IACD,SAAS,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAG7B,IAAI,OAAO,IAAI,KAAK,CAAC,IAAI,CAAC,CAEzB;IACD,SAAS,IAAI,IAAI;IAGjB,IAAI,gBAAgB,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAEhD;IACD,kBAAkB,CAAC,IAAI,EAAE,kBAAkB,GAAG,IAAI;IAIlD,OAAO,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK;CAO7B;AAED;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,qBAAqB;IAC1D,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAa;IAChE,SAAS,CAAC,QAAQ,EAAE,YAAY,GAAG,SAAS,CAAC;IAE7C,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE;QAAE,OAAO,CAAC,EAAE,GAAG,CAAC;QAAC,KAAK,CAAC,EAAE,GAAG,CAAA;KAAE,EAAE,CAAM;;IAMjE,MAAM,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI;IAiBpC,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAUlC,SAAS,CAAC,KAAK,EAAE,GAAG,GAAG,IAAI;IAQ3B,SAAS,IAAI,IAAI;CAQpB"}
@@ -1,116 +0,0 @@
1
- "use strict";
2
- /********************************************************************************
3
- * Copyright (C) 2018 Red Hat, Inc. and others.
4
- *
5
- * This program and the accompanying materials are made available under the
6
- * terms of the Eclipse Public License v. 2.0 which is available at
7
- * http://www.eclipse.org/legal/epl-2.0.
8
- *
9
- * This Source Code may also be made available under the following Secondary
10
- * Licenses when the conditions for such availability set forth in the Eclipse
11
- * Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- * with the GNU Classpath Exception which is available at
13
- * https://www.gnu.org/software/classpath/license.html.
14
- *
15
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
- ********************************************************************************/
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.PluginMessageReader = exports.AbstractMessageReader = void 0;
19
- const vscode_ws_jsonrpc_1 = require("@theia/core/shared/vscode-ws-jsonrpc");
20
- class AbstractMessageReader {
21
- constructor() {
22
- this.errorEmitter = new vscode_ws_jsonrpc_1.Emitter();
23
- this.closeEmitter = new vscode_ws_jsonrpc_1.Emitter();
24
- this.partialMessageEmitter = new vscode_ws_jsonrpc_1.Emitter();
25
- }
26
- dispose() {
27
- this.errorEmitter.dispose();
28
- this.closeEmitter.dispose();
29
- }
30
- get onError() {
31
- return this.errorEmitter.event;
32
- }
33
- fireError(error) {
34
- this.errorEmitter.fire(this.asError(error));
35
- }
36
- get onClose() {
37
- return this.closeEmitter.event;
38
- }
39
- fireClose() {
40
- this.closeEmitter.fire(undefined);
41
- }
42
- get onPartialMessage() {
43
- return this.partialMessageEmitter.event;
44
- }
45
- firePartialMessage(info) {
46
- this.partialMessageEmitter.fire(info);
47
- }
48
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
49
- asError(error) {
50
- if (error instanceof Error) {
51
- return error;
52
- }
53
- else {
54
- return new Error(`Reader received error. Reason: ${typeof error.message === 'string' ? error.message : 'unknown'}`);
55
- }
56
- }
57
- }
58
- exports.AbstractMessageReader = AbstractMessageReader;
59
- /**
60
- * Support for reading string message through RPC protocol.
61
- */
62
- class PluginMessageReader extends AbstractMessageReader {
63
- constructor() {
64
- super();
65
- this.state = 'initial';
66
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
67
- this.events = [];
68
- }
69
- listen(callback) {
70
- if (this.state === 'initial') {
71
- this.state = 'listening';
72
- this.callback = callback;
73
- while (this.events.length !== 0) {
74
- const event = this.events.pop();
75
- if (event.message) {
76
- this.readMessage(event.message);
77
- }
78
- else if (event.error) {
79
- this.fireError(event.error);
80
- }
81
- else {
82
- this.fireClose();
83
- }
84
- }
85
- }
86
- }
87
- readMessage(message) {
88
- if (this.state === 'initial') {
89
- this.events.splice(0, 0, { message });
90
- }
91
- else if (this.state === 'listening') {
92
- const data = JSON.parse(message);
93
- this.callback(data);
94
- }
95
- }
96
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
97
- fireError(error) {
98
- if (this.state === 'initial') {
99
- this.events.splice(0, 0, { error });
100
- }
101
- else if (this.state === 'listening') {
102
- super.fireError(error);
103
- }
104
- }
105
- fireClose() {
106
- if (this.state === 'initial') {
107
- this.events.splice(0, 0, {});
108
- }
109
- else if (this.state === 'listening') {
110
- super.fireClose();
111
- }
112
- this.state = 'closed';
113
- }
114
- }
115
- exports.PluginMessageReader = PluginMessageReader;
116
- //# sourceMappingURL=plugin-message-reader.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin-message-reader.js","sourceRoot":"","sources":["../../src/common/plugin-message-reader.ts"],"names":[],"mappings":"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"}
@@ -1,38 +0,0 @@
1
- /********************************************************************************
2
- * Copyright (C) 2018 Red Hat, Inc. and others.
3
- *
4
- * This program and the accompanying materials are made available under the
5
- * terms of the Eclipse Public License v. 2.0 which is available at
6
- * http://www.eclipse.org/legal/epl-2.0.
7
- *
8
- * This Source Code may also be made available under the following Secondary
9
- * Licenses when the conditions for such availability set forth in the Eclipse
10
- * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- * with the GNU Classpath Exception which is available at
12
- * https://www.gnu.org/software/classpath/license.html.
13
- *
14
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
- ********************************************************************************/
16
- import { Message, MessageWriter, Emitter, Event } from '@theia/core/shared/vscode-ws-jsonrpc';
17
- import { ConnectionMain, ConnectionExt } from './plugin-api-rpc';
18
- export declare abstract class AbstractMessageWriter {
19
- protected errorEmitter: Emitter<[Error, Message | undefined, number | undefined]>;
20
- protected closeEmitter: Emitter<void>;
21
- dispose(): void;
22
- get onError(): Event<[Error, Message | undefined, number | undefined]>;
23
- fireError(error: Error, message: Message | undefined, count: number | undefined): void;
24
- get onClose(): Event<void>;
25
- fireClose(): void;
26
- asError(error: any): Error;
27
- }
28
- /**
29
- * Support for writing string message through RPC protocol.
30
- */
31
- export declare class PluginMessageWriter extends AbstractMessageWriter implements MessageWriter {
32
- protected readonly id: string;
33
- protected readonly proxy: ConnectionMain | ConnectionExt;
34
- constructor(id: string, proxy: ConnectionMain | ConnectionExt);
35
- write(message: string): void;
36
- write(message: Message): void;
37
- }
38
- //# sourceMappingURL=plugin-message-writer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin-message-writer.d.ts","sourceRoot":"","sources":["../../src/common/plugin-message-writer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;AAC9F,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjE,8BAAsB,qBAAqB;IACvC,SAAS,CAAC,YAAY,4DAAmE;IACzF,SAAS,CAAC,YAAY,gBAAuB;IAC7C,OAAO,IAAI,IAAI;IAIf,IAAI,OAAO,IAAI,KAAK,CAAC,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAErE;IACD,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,GAAG,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI;IAGtF,IAAI,OAAO,IAAI,KAAK,CAAC,IAAI,CAAC,CAEzB;IACD,SAAS,IAAI,IAAI;IAIjB,OAAO,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK;CAO7B;AAED;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,qBAAsB,YAAW,aAAa;IAE/E,SAAS,CAAC,QAAQ,CAAC,EAAE,EAAE,MAAM;IAC7B,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,cAAc,GAAG,aAAa;gBADrC,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,cAAc,GAAG,aAAa;IAI5D,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAC5B,KAAK,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;CAKhC"}