@theia/plugin-ext 1.27.0-next.9 → 1.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (273) hide show
  1. package/lib/common/connection.d.ts +3 -3
  2. package/lib/common/connection.d.ts.map +1 -1
  3. package/lib/common/connection.js +0 -1
  4. package/lib/common/connection.js.map +1 -1
  5. package/lib/common/plugin-api-rpc.d.ts +18 -8
  6. package/lib/common/plugin-api-rpc.d.ts.map +1 -1
  7. package/lib/common/plugin-api-rpc.js.map +1 -1
  8. package/lib/common/plugin-identifiers.d.ts +41 -0
  9. package/lib/common/plugin-identifiers.d.ts.map +1 -0
  10. package/lib/common/plugin-identifiers.js +81 -0
  11. package/lib/common/plugin-identifiers.js.map +1 -0
  12. package/lib/common/plugin-protocol.d.ts +50 -11
  13. package/lib/common/plugin-protocol.d.ts.map +1 -1
  14. package/lib/common/plugin-protocol.js +3 -1
  15. package/lib/common/plugin-protocol.js.map +1 -1
  16. package/lib/hosted/browser/hosted-plugin.d.ts +2 -2
  17. package/lib/hosted/browser/hosted-plugin.d.ts.map +1 -1
  18. package/lib/hosted/browser/hosted-plugin.js +26 -18
  19. package/lib/hosted/browser/hosted-plugin.js.map +1 -1
  20. package/lib/hosted/browser/worker/debug-stub.d.ts +1 -1
  21. package/lib/hosted/browser/worker/debug-stub.d.ts.map +1 -1
  22. package/lib/hosted/browser/worker/debug-stub.js +2 -2
  23. package/lib/hosted/browser/worker/debug-stub.js.map +1 -1
  24. package/lib/hosted/browser/worker/plugin-manifest-loader.d.ts.map +1 -1
  25. package/lib/hosted/browser/worker/plugin-manifest-loader.js +4 -1
  26. package/lib/hosted/browser/worker/plugin-manifest-loader.js.map +1 -1
  27. package/lib/hosted/node/hosted-plugin-deployer-handler.d.ts +17 -9
  28. package/lib/hosted/node/hosted-plugin-deployer-handler.d.ts.map +1 -1
  29. package/lib/hosted/node/hosted-plugin-deployer-handler.js +99 -18
  30. package/lib/hosted/node/hosted-plugin-deployer-handler.js.map +1 -1
  31. package/lib/hosted/node/hosted-plugin-localization-service.d.ts.map +1 -1
  32. package/lib/hosted/node/hosted-plugin-localization-service.js +2 -4
  33. package/lib/hosted/node/hosted-plugin-localization-service.js.map +1 -1
  34. package/lib/hosted/node/hosted-plugin-process.d.ts +2 -2
  35. package/lib/hosted/node/hosted-plugin-process.d.ts.map +1 -1
  36. package/lib/hosted/node/hosted-plugin-process.js.map +1 -1
  37. package/lib/hosted/node/hosted-plugin.d.ts +2 -2
  38. package/lib/hosted/node/hosted-plugin.d.ts.map +1 -1
  39. package/lib/hosted/node/hosted-plugin.js.map +1 -1
  40. package/lib/hosted/node/metadata-scanner.d.ts +3 -2
  41. package/lib/hosted/node/metadata-scanner.d.ts.map +1 -1
  42. package/lib/hosted/node/metadata-scanner.js +8 -3
  43. package/lib/hosted/node/metadata-scanner.js.map +1 -1
  44. package/lib/hosted/node/plugin-host-rpc.js +2 -2
  45. package/lib/hosted/node/plugin-host-rpc.js.map +1 -1
  46. package/lib/hosted/node/plugin-manifest-loader.d.ts.map +1 -1
  47. package/lib/hosted/node/plugin-manifest-loader.js +3 -0
  48. package/lib/hosted/node/plugin-manifest-loader.js.map +1 -1
  49. package/lib/hosted/node/plugin-service.d.ts +18 -4
  50. package/lib/hosted/node/plugin-service.d.ts.map +1 -1
  51. package/lib/hosted/node/plugin-service.js +73 -18
  52. package/lib/hosted/node/plugin-service.js.map +1 -1
  53. package/lib/hosted/node/scanners/scanner-theia.d.ts.map +1 -1
  54. package/lib/hosted/node/scanners/scanner-theia.js +6 -3
  55. package/lib/hosted/node/scanners/scanner-theia.js.map +1 -1
  56. package/lib/main/browser/custom-editors/custom-editor-opener.d.ts.map +1 -1
  57. package/lib/main/browser/custom-editors/custom-editor-opener.js +2 -2
  58. package/lib/main/browser/custom-editors/custom-editor-opener.js.map +1 -1
  59. package/lib/main/browser/debug/plugin-debug-session-factory.d.ts +3 -3
  60. package/lib/main/browser/debug/plugin-debug-session-factory.d.ts.map +1 -1
  61. package/lib/main/browser/debug/plugin-debug-session-factory.js.map +1 -1
  62. package/lib/main/browser/documents-main.d.ts +1 -2
  63. package/lib/main/browser/documents-main.d.ts.map +1 -1
  64. package/lib/main/browser/documents-main.js +26 -6
  65. package/lib/main/browser/documents-main.js.map +1 -1
  66. package/lib/main/browser/editors-and-documents-main.d.ts +2 -0
  67. package/lib/main/browser/editors-and-documents-main.d.ts.map +1 -1
  68. package/lib/main/browser/editors-and-documents-main.js +14 -2
  69. package/lib/main/browser/editors-and-documents-main.js.map +1 -1
  70. package/lib/main/browser/languages-main.d.ts.map +1 -1
  71. package/lib/main/browser/languages-main.js +2 -1
  72. package/lib/main/browser/languages-main.js.map +1 -1
  73. package/lib/main/browser/main-context.d.ts.map +1 -1
  74. package/lib/main/browser/main-context.js +5 -4
  75. package/lib/main/browser/main-context.js.map +1 -1
  76. package/lib/main/browser/plugin-contribution-handler.d.ts +2 -0
  77. package/lib/main/browser/plugin-contribution-handler.d.ts.map +1 -1
  78. package/lib/main/browser/plugin-contribution-handler.js +36 -1
  79. package/lib/main/browser/plugin-contribution-handler.js.map +1 -1
  80. package/lib/main/browser/plugin-shared-style.d.ts +4 -2
  81. package/lib/main/browser/plugin-shared-style.d.ts.map +1 -1
  82. package/lib/main/browser/plugin-shared-style.js +15 -4
  83. package/lib/main/browser/plugin-shared-style.js.map +1 -1
  84. package/lib/main/browser/text-editors-main.d.ts +6 -3
  85. package/lib/main/browser/text-editors-main.d.ts.map +1 -1
  86. package/lib/main/browser/text-editors-main.js +8 -1
  87. package/lib/main/browser/text-editors-main.js.map +1 -1
  88. package/lib/main/browser/theming-main.d.ts +2 -1
  89. package/lib/main/browser/theming-main.d.ts.map +1 -1
  90. package/lib/main/browser/theming-main.js +3 -6
  91. package/lib/main/browser/theming-main.js.map +1 -1
  92. package/lib/main/browser/view/plugin-tree-view-node-label-provider.d.ts.map +1 -1
  93. package/lib/main/browser/view/plugin-tree-view-node-label-provider.js +7 -5
  94. package/lib/main/browser/view/plugin-tree-view-node-label-provider.js.map +1 -1
  95. package/lib/main/browser/view/plugin-view-registry.d.ts +1 -1
  96. package/lib/main/browser/view/plugin-view-registry.d.ts.map +1 -1
  97. package/lib/main/browser/view/plugin-view-registry.js +11 -6
  98. package/lib/main/browser/view/plugin-view-registry.js.map +1 -1
  99. package/lib/main/browser/view/tree-view-widget.d.ts +10 -5
  100. package/lib/main/browser/view/tree-view-widget.d.ts.map +1 -1
  101. package/lib/main/browser/view/tree-view-widget.js +40 -14
  102. package/lib/main/browser/view/tree-view-widget.js.map +1 -1
  103. package/lib/main/browser/webview/webview-theme-data-provider.d.ts +3 -1
  104. package/lib/main/browser/webview/webview-theme-data-provider.d.ts.map +1 -1
  105. package/lib/main/browser/webview/webview-theme-data-provider.js +5 -1
  106. package/lib/main/browser/webview/webview-theme-data-provider.js.map +1 -1
  107. package/lib/main/node/handlers/plugin-theia-directory-handler.d.ts +6 -1
  108. package/lib/main/node/handlers/plugin-theia-directory-handler.d.ts.map +1 -1
  109. package/lib/main/node/handlers/plugin-theia-directory-handler.js +61 -20
  110. package/lib/main/node/handlers/plugin-theia-directory-handler.js.map +1 -1
  111. package/lib/main/node/handlers/plugin-theia-file-handler.d.ts +4 -0
  112. package/lib/main/node/handlers/plugin-theia-file-handler.d.ts.map +1 -1
  113. package/lib/main/node/handlers/plugin-theia-file-handler.js +26 -4
  114. package/lib/main/node/handlers/plugin-theia-file-handler.js.map +1 -1
  115. package/lib/main/node/plugin-cli-contribution.d.ts +3 -0
  116. package/lib/main/node/plugin-cli-contribution.d.ts.map +1 -1
  117. package/lib/main/node/plugin-cli-contribution.js +13 -0
  118. package/lib/main/node/plugin-cli-contribution.js.map +1 -1
  119. package/lib/main/node/plugin-deployer-directory-handler-context-impl.d.ts +1 -0
  120. package/lib/main/node/plugin-deployer-directory-handler-context-impl.d.ts.map +1 -1
  121. package/lib/main/node/plugin-deployer-directory-handler-context-impl.js +17 -0
  122. package/lib/main/node/plugin-deployer-directory-handler-context-impl.js.map +1 -1
  123. package/lib/main/node/plugin-deployer-file-handler-context-impl.d.ts.map +1 -1
  124. package/lib/main/node/plugin-deployer-file-handler-context-impl.js +0 -1
  125. package/lib/main/node/plugin-deployer-file-handler-context-impl.js.map +1 -1
  126. package/lib/main/node/plugin-deployer-impl.d.ts +10 -7
  127. package/lib/main/node/plugin-deployer-impl.d.ts.map +1 -1
  128. package/lib/main/node/plugin-deployer-impl.js +84 -38
  129. package/lib/main/node/plugin-deployer-impl.js.map +1 -1
  130. package/lib/main/node/plugin-ext-backend-module.d.ts.map +1 -1
  131. package/lib/main/node/plugin-ext-backend-module.js +2 -0
  132. package/lib/main/node/plugin-ext-backend-module.js.map +1 -1
  133. package/lib/main/node/plugin-server-handler.d.ts +5 -4
  134. package/lib/main/node/plugin-server-handler.d.ts.map +1 -1
  135. package/lib/main/node/plugin-server-handler.js +12 -5
  136. package/lib/main/node/plugin-server-handler.js.map +1 -1
  137. package/lib/main/node/plugin-uninstallation-manager.d.ts +15 -0
  138. package/lib/main/node/plugin-uninstallation-manager.d.ts.map +1 -0
  139. package/lib/main/node/plugin-uninstallation-manager.js +85 -0
  140. package/lib/main/node/plugin-uninstallation-manager.js.map +1 -0
  141. package/lib/plugin/{node/debug/debug.d.ts → debug/debug-ext.d.ts} +15 -13
  142. package/lib/plugin/debug/debug-ext.d.ts.map +1 -0
  143. package/lib/plugin/{node/debug/debug.js → debug/debug-ext.js} +17 -51
  144. package/lib/plugin/debug/debug-ext.js.map +1 -0
  145. package/lib/plugin/debug/plugin-debug-adapter-creator.d.ts +11 -0
  146. package/lib/plugin/debug/plugin-debug-adapter-creator.d.ts.map +1 -0
  147. package/lib/plugin/debug/plugin-debug-adapter-creator.js +42 -0
  148. package/lib/plugin/debug/plugin-debug-adapter-creator.js.map +1 -0
  149. package/lib/plugin/{node/debug → debug}/plugin-debug-adapter-session.d.ts +4 -4
  150. package/lib/plugin/debug/plugin-debug-adapter-session.d.ts.map +1 -0
  151. package/lib/plugin/{node/debug → debug}/plugin-debug-adapter-session.js +1 -1
  152. package/lib/plugin/debug/plugin-debug-adapter-session.js.map +1 -0
  153. package/lib/plugin/{node/debug → debug}/plugin-debug-adapter-tracker.d.ts +0 -0
  154. package/lib/plugin/debug/plugin-debug-adapter-tracker.d.ts.map +1 -0
  155. package/lib/plugin/{node/debug → debug}/plugin-debug-adapter-tracker.js +0 -0
  156. package/lib/plugin/debug/plugin-debug-adapter-tracker.js.map +1 -0
  157. package/lib/plugin/languages-utils.d.ts.map +1 -1
  158. package/lib/plugin/languages-utils.js +3 -2
  159. package/lib/plugin/languages-utils.js.map +1 -1
  160. package/lib/plugin/node/debug/plugin-node-debug-adapter-creator.d.ts +18 -0
  161. package/lib/plugin/node/debug/plugin-node-debug-adapter-creator.d.ts.map +1 -0
  162. package/lib/plugin/node/debug/plugin-node-debug-adapter-creator.js +155 -0
  163. package/lib/plugin/node/debug/plugin-node-debug-adapter-creator.js.map +1 -0
  164. package/lib/plugin/plugin-context.d.ts +1 -1
  165. package/lib/plugin/plugin-context.d.ts.map +1 -1
  166. package/lib/plugin/plugin-context.js +1 -2
  167. package/lib/plugin/plugin-context.js.map +1 -1
  168. package/lib/plugin/plugin-manager.d.ts.map +1 -1
  169. package/lib/plugin/plugin-manager.js +5 -9
  170. package/lib/plugin/plugin-manager.js.map +1 -1
  171. package/lib/plugin/text-editor.d.ts +2 -0
  172. package/lib/plugin/text-editor.d.ts.map +1 -1
  173. package/lib/plugin/text-editor.js +9 -0
  174. package/lib/plugin/text-editor.js.map +1 -1
  175. package/lib/plugin/theming.d.ts +1 -1
  176. package/lib/plugin/theming.d.ts.map +1 -1
  177. package/lib/plugin/tree/tree-views.d.ts +1 -0
  178. package/lib/plugin/tree/tree-views.d.ts.map +1 -1
  179. package/lib/plugin/tree/tree-views.js +10 -9
  180. package/lib/plugin/tree/tree-views.js.map +1 -1
  181. package/lib/plugin/types-impl.d.ts +1 -0
  182. package/lib/plugin/types-impl.d.ts.map +1 -1
  183. package/lib/plugin/types-impl.js +3 -2
  184. package/lib/plugin/types-impl.js.map +1 -1
  185. package/package.json +26 -25
  186. package/src/common/connection.ts +3 -4
  187. package/src/common/plugin-api-rpc.ts +20 -12
  188. package/src/common/plugin-identifiers.ts +84 -0
  189. package/src/common/plugin-protocol.ts +57 -12
  190. package/src/hosted/browser/hosted-plugin.ts +28 -21
  191. package/src/hosted/browser/worker/debug-stub.ts +1 -1
  192. package/src/hosted/browser/worker/plugin-manifest-loader.ts +4 -2
  193. package/src/hosted/node/hosted-plugin-deployer-handler.ts +109 -28
  194. package/src/hosted/node/hosted-plugin-localization-service.ts +4 -6
  195. package/src/hosted/node/hosted-plugin-process.ts +4 -4
  196. package/src/hosted/node/hosted-plugin.ts +2 -2
  197. package/src/hosted/node/metadata-scanner.ts +8 -6
  198. package/src/hosted/node/plugin-host-rpc.ts +2 -2
  199. package/src/hosted/node/plugin-manifest-loader.ts +2 -0
  200. package/src/hosted/node/plugin-service.ts +79 -23
  201. package/src/hosted/node/scanners/scanner-theia.ts +7 -4
  202. package/src/main/browser/custom-editors/custom-editor-opener.tsx +2 -2
  203. package/src/main/browser/debug/plugin-debug-session-factory.ts +2 -2
  204. package/src/main/browser/documents-main.ts +26 -8
  205. package/src/main/browser/editors-and-documents-main.ts +16 -2
  206. package/src/main/browser/languages-main.ts +2 -1
  207. package/src/main/browser/main-context.ts +4 -3
  208. package/src/main/browser/plugin-contribution-handler.ts +41 -3
  209. package/src/main/browser/plugin-icon-theme-service.ts +1 -1
  210. package/src/main/browser/plugin-shared-style.ts +9 -5
  211. package/src/main/browser/text-editors-main.ts +12 -2
  212. package/src/main/browser/theming-main.ts +3 -7
  213. package/src/main/browser/view/plugin-tree-view-node-label-provider.ts +7 -5
  214. package/src/main/browser/view/plugin-view-registry.ts +12 -7
  215. package/src/main/browser/view/tree-view-widget.tsx +45 -17
  216. package/src/main/browser/webview/webview-theme-data-provider.ts +7 -10
  217. package/src/main/node/handlers/plugin-theia-directory-handler.ts +56 -28
  218. package/src/main/node/handlers/plugin-theia-file-handler.ts +26 -4
  219. package/src/main/node/plugin-cli-contribution.ts +12 -0
  220. package/src/main/node/plugin-deployer-directory-handler-context-impl.ts +17 -1
  221. package/src/main/node/plugin-deployer-file-handler-context-impl.ts +0 -1
  222. package/src/main/node/plugin-deployer-impl.ts +88 -41
  223. package/src/main/node/plugin-ext-backend-module.ts +3 -0
  224. package/src/main/node/plugin-server-handler.ts +15 -7
  225. package/src/main/node/plugin-uninstallation-manager.ts +74 -0
  226. package/src/plugin/{node/debug/debug.ts → debug/debug-ext.ts} +25 -56
  227. package/src/plugin/debug/plugin-debug-adapter-creator.ts +50 -0
  228. package/src/plugin/{node/debug → debug}/plugin-debug-adapter-session.ts +4 -4
  229. package/src/plugin/{node/debug → debug}/plugin-debug-adapter-tracker.ts +0 -0
  230. package/src/plugin/languages-utils.ts +3 -2
  231. package/src/plugin/node/debug/plugin-node-debug-adapter-creator.ts +167 -0
  232. package/src/plugin/plugin-context.ts +2 -3
  233. package/src/plugin/plugin-manager.ts +5 -9
  234. package/src/plugin/text-editor.ts +16 -5
  235. package/src/plugin/theming.ts +1 -1
  236. package/src/plugin/tree/tree-views.ts +15 -12
  237. package/src/plugin/types-impl.ts +1 -1
  238. package/lib/main/browser/custom-editors/glob.d.ts +0 -51
  239. package/lib/main/browser/custom-editors/glob.d.ts.map +0 -1
  240. package/lib/main/browser/custom-editors/glob.js +0 -593
  241. package/lib/main/browser/custom-editors/glob.js.map +0 -1
  242. package/lib/main/browser/custom-editors/paths.d.ts +0 -25
  243. package/lib/main/browser/custom-editors/paths.d.ts.map +0 -1
  244. package/lib/main/browser/custom-editors/paths.js +0 -227
  245. package/lib/main/browser/custom-editors/paths.js.map +0 -1
  246. package/lib/main/browser/editor/untitled-resource.d.ts +0 -3
  247. package/lib/main/browser/editor/untitled-resource.d.ts.map +0 -1
  248. package/lib/main/browser/editor/untitled-resource.js +0 -24
  249. package/lib/main/browser/editor/untitled-resource.js.map +0 -1
  250. package/lib/plugin/node/debug/debug.d.ts.map +0 -1
  251. package/lib/plugin/node/debug/debug.js.map +0 -1
  252. package/lib/plugin/node/debug/plugin-debug-adapter-executable-resolver.d.ts +0 -7
  253. package/lib/plugin/node/debug/plugin-debug-adapter-executable-resolver.d.ts.map +0 -1
  254. package/lib/plugin/node/debug/plugin-debug-adapter-executable-resolver.js +0 -57
  255. package/lib/plugin/node/debug/plugin-debug-adapter-executable-resolver.js.map +0 -1
  256. package/lib/plugin/node/debug/plugin-debug-adapter-session.d.ts.map +0 -1
  257. package/lib/plugin/node/debug/plugin-debug-adapter-session.js.map +0 -1
  258. package/lib/plugin/node/debug/plugin-debug-adapter-starter.d.ts +0 -15
  259. package/lib/plugin/node/debug/plugin-debug-adapter-starter.d.ts.map +0 -1
  260. package/lib/plugin/node/debug/plugin-debug-adapter-starter.js +0 -85
  261. package/lib/plugin/node/debug/plugin-debug-adapter-starter.js.map +0 -1
  262. package/lib/plugin/node/debug/plugin-debug-adapter-tracker.d.ts.map +0 -1
  263. package/lib/plugin/node/debug/plugin-debug-adapter-tracker.js.map +0 -1
  264. package/lib/plugin/node/debug/plugin-inline-debug-adapter.d.ts +0 -19
  265. package/lib/plugin/node/debug/plugin-inline-debug-adapter.d.ts.map +0 -1
  266. package/lib/plugin/node/debug/plugin-inline-debug-adapter.js +0 -45
  267. package/lib/plugin/node/debug/plugin-inline-debug-adapter.js.map +0 -1
  268. package/src/main/browser/custom-editors/glob.ts +0 -743
  269. package/src/main/browser/custom-editors/paths.ts +0 -250
  270. package/src/main/browser/editor/untitled-resource.ts +0 -18
  271. package/src/plugin/node/debug/plugin-debug-adapter-executable-resolver.ts +0 -58
  272. package/src/plugin/node/debug/plugin-debug-adapter-starter.ts +0 -86
  273. package/src/plugin/node/debug/plugin-inline-debug-adapter.ts +0 -47
@@ -0,0 +1,167 @@
1
+ // *****************************************************************************
2
+ // Copyright (C) 2022 Arm 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
+
17
+ import { PluginDebugAdapterCreator } from '../../debug/plugin-debug-adapter-creator';
18
+ import * as path from 'path';
19
+ import * as theia from '@theia/plugin';
20
+ import { PlatformSpecificAdapterContribution, PluginPackageDebuggersContribution } from '../../../common';
21
+ import { isWindows, isOSX } from '@theia/core/lib/common/os';
22
+ import * as net from 'net';
23
+ import { ChildProcess, spawn, fork, ForkOptions } from 'child_process';
24
+ import { DebugAdapter } from '@theia/debug/lib/common/debug-model';
25
+ import { DebugAdapterExecutable, DebugAdapterInlineImplementation, DebugAdapterNamedPipeServer, DebugAdapterServer } from '../../types-impl';
26
+ import { ProcessDebugAdapter, SocketDebugAdapter } from '@theia/debug/lib/node/stream-debug-adapter';
27
+ const isElectron = require('is-electron');
28
+
29
+ export class NodeDebugAdapterCreator extends PluginDebugAdapterCreator {
30
+ public override async resolveDebugAdapterExecutable(
31
+ pluginPath: string,
32
+ debuggerContribution: PluginPackageDebuggersContribution
33
+ ): Promise<theia.DebugAdapterExecutable | undefined> {
34
+ const info = this.toPlatformInfo(debuggerContribution);
35
+ let program = (info && info.program || debuggerContribution.program);
36
+ if (!program) {
37
+ return undefined;
38
+ }
39
+ program = path.join(pluginPath, program);
40
+ const programArgs = info && info.args || debuggerContribution.args || [];
41
+ let runtime = info && info.runtime || debuggerContribution.runtime;
42
+ if (runtime && runtime.indexOf('./') === 0) {
43
+ runtime = path.join(pluginPath, runtime);
44
+ }
45
+ const runtimeArgs = info && info.runtimeArgs || debuggerContribution.runtimeArgs || [];
46
+ const command = runtime ? runtime : program;
47
+ const args = runtime ? [...runtimeArgs, program, ...programArgs] : programArgs;
48
+ return {
49
+ command,
50
+ args
51
+ };
52
+ }
53
+
54
+ public override async createDebugAdapter(
55
+ session: theia.DebugSession,
56
+ debugConfiguration: theia.DebugConfiguration,
57
+ executable: theia.DebugAdapterExecutable | undefined,
58
+ descriptorFactory: theia.DebugAdapterDescriptorFactory | undefined
59
+ ): Promise<DebugAdapter> {
60
+ if (descriptorFactory) {
61
+ // 'createDebugAdapterDescriptor' is called at the start of a debug session to provide details about the debug adapter to use.
62
+ // These details must be returned as objects of type [DebugAdapterDescriptor](#DebugAdapterDescriptor).
63
+ // Currently two types of debug adapters are supported:
64
+ // - a debug adapter executable is specified as a command path and arguments (see [DebugAdapterExecutable](#DebugAdapterExecutable)),
65
+ // - a debug adapter server reachable via a communication port (see [DebugAdapterServer](#DebugAdapterServer)).
66
+ // If the method is not implemented the default behavior is this:
67
+ // createDebugAdapter(session: DebugSession, executable: DebugAdapterExecutable) {
68
+ // if (typeof session.configuration.debugServer === 'number') {
69
+ // return new DebugAdapterServer(session.configuration.debugServer);
70
+ // }
71
+ // return executable;
72
+ // }
73
+ // @param session The [debug session](#DebugSession) for which the debug adapter will be used.
74
+ // @param executable The debug adapter's executable information as specified in the package.json (or undefined if no such information exists).
75
+ const descriptor = await descriptorFactory.createDebugAdapterDescriptor(session, executable);
76
+ if (descriptor) {
77
+ if (DebugAdapterServer.is(descriptor)) {
78
+ return this.connectSocketDebugAdapter(descriptor);
79
+ } else if (DebugAdapterExecutable.is(descriptor)) {
80
+ return this.startDebugAdapter(descriptor);
81
+ } else if (DebugAdapterNamedPipeServer.is(descriptor)) {
82
+ return this.connectPipeDebugAdapter(descriptor);
83
+ } else if (DebugAdapterInlineImplementation.is(descriptor)) {
84
+ return this.connectInlineDebugAdapter(descriptor);
85
+ }
86
+ }
87
+ }
88
+
89
+ if ('debugServer' in debugConfiguration) {
90
+ return this.connectSocketDebugAdapter({ port: debugConfiguration.debugServer });
91
+ } else {
92
+ if (!executable) {
93
+ throw new Error('It is not possible to provide debug adapter executable.');
94
+ }
95
+ return this.startDebugAdapter(executable);
96
+ }
97
+ }
98
+
99
+ protected toPlatformInfo(executable: PluginPackageDebuggersContribution): PlatformSpecificAdapterContribution | undefined {
100
+ if (isWindows && !process.env.hasOwnProperty('PROCESSOR_ARCHITEW6432')) {
101
+ return executable.winx86 || executable.win || executable.windows;
102
+ }
103
+ if (isWindows) {
104
+ return executable.win || executable.windows;
105
+ }
106
+ if (isOSX) {
107
+ return executable.osx;
108
+ }
109
+ return executable.linux;
110
+ }
111
+
112
+ public startDebugAdapter(executable: DebugAdapterExecutable): DebugAdapter {
113
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
114
+ const options: any = { stdio: ['pipe', 'pipe', 2] };
115
+
116
+ if (executable.options) {
117
+ options.cwd = executable.options.cwd;
118
+
119
+ // The additional environment of the executed program or shell. If omitted
120
+ // the parent process' environment is used. If provided it is merged with
121
+ // the parent process' environment.
122
+ options.env = Object.assign({}, process.env);
123
+ Object.assign(options.env, executable.options.env);
124
+ }
125
+
126
+ let childProcess: ChildProcess;
127
+ const { command, args } = executable;
128
+ if (command === 'node') {
129
+ if (Array.isArray(args) && args.length > 0) {
130
+ const forkOptions: ForkOptions = {
131
+ env: options.env,
132
+ // When running in Electron, fork will automatically add ELECTRON_RUN_AS_NODE=1 to the env,
133
+ // but this will cause issues when debugging Electron apps, so we'll remove it.
134
+ execArgv: isElectron()
135
+ ? ['-e', 'delete process.env.ELECTRON_RUN_AS_NODE;require(process.argv[1])']
136
+ : [],
137
+ silent: true
138
+ };
139
+ if (options.cwd) {
140
+ forkOptions.cwd = options.cwd;
141
+ }
142
+ options.stdio.push('ipc');
143
+ forkOptions.stdio = options.stdio;
144
+ childProcess = fork(args[0], args.slice(1), forkOptions);
145
+ } else {
146
+ throw new Error(`It is not possible to launch debug adapter with the command: ${JSON.stringify(executable)}`);
147
+ }
148
+ } else {
149
+ childProcess = spawn(command, args, options);
150
+ }
151
+
152
+ return new ProcessDebugAdapter(childProcess);
153
+ }
154
+
155
+ /**
156
+ * Connects to a remote debug server.
157
+ */
158
+ public connectSocketDebugAdapter(server: DebugAdapterServer): SocketDebugAdapter {
159
+ const socket = net.createConnection(server.port, server.host);
160
+ return new SocketDebugAdapter(socket);
161
+ }
162
+
163
+ public connectPipeDebugAdapter(adapter: DebugAdapterNamedPipeServer): SocketDebugAdapter {
164
+ const socket = net.createConnection(adapter.path);
165
+ return new SocketDebugAdapter(socket);
166
+ }
167
+ }
@@ -163,7 +163,7 @@ import { MarkdownString } from './markdown-string';
163
163
  import { TreeViewsExtImpl } from './tree/tree-views';
164
164
  import { ConnectionImpl } from '../common/connection';
165
165
  import { TasksExtImpl } from './tasks/tasks';
166
- import { DebugExtImpl } from './node/debug/debug';
166
+ import { DebugExtImpl } from './debug/debug-ext';
167
167
  import { FileSystemExtImpl } from './file-system-ext-impl';
168
168
  import { QuickPick, QuickPickItem, ResourceLabelFormatter, LineChange } from '@theia/plugin';
169
169
  import { ScmExtImpl } from './scm';
@@ -811,7 +811,7 @@ export function createAPIFactory(
811
811
 
812
812
  const debuggersContributions = plugin.rawModel.contributes && plugin.rawModel.contributes.debuggers || [];
813
813
  debugExt.assistedInject(connectionExt, commandRegistry);
814
- debugExt.registerDebuggersContributions(plugin.pluginFolder, debuggersContributions);
814
+ debugExt.registerDebuggersContributions(plugin.pluginFolder, plugin.model.entryPoint.frontend ? 'frontend' : 'backend', debuggersContributions);
815
815
  const debug: typeof theia.debug = {
816
816
  get activeDebugSession(): theia.DebugSession | undefined {
817
817
  return debugExt.activeDebugSession;
@@ -991,7 +991,6 @@ export function createAPIFactory(
991
991
  TextDocumentSaveReason,
992
992
  CodeAction,
993
993
  TreeItem,
994
- TreeItem2: TreeItem,
995
994
  TreeItemCollapsibleState,
996
995
  SymbolKind,
997
996
  SymbolTag,
@@ -240,10 +240,10 @@ export class PluginManagerExtImpl implements PluginManagerExt, PluginManager {
240
240
 
241
241
  protected registerPlugin(plugin: Plugin): void {
242
242
  if (plugin.model.id === 'vscode.json-language-features' && this.jsonValidation.length) {
243
- // VS Code contribute all built-in validations via vscode.json-language-features
244
- // we enrich them with Theia validations registered on the startup
245
- // dynamic validations can be provided only via VS Code extensions
246
- // content is fetched by the extension later via vscode.workspace.openTextDocument
243
+ // VS Code contributes all built-in validations via vscode.json-language-features;
244
+ // we enrich them with Theia validations registered on startup.
245
+ // Dynamic validations can be provided only via VS Code extensions.
246
+ // Content is fetched by the extension later via vscode.workspace.openTextDocument.
247
247
  const contributes = plugin.rawModel.contributes = (plugin.rawModel.contributes || {});
248
248
  contributes.jsonValidation = (contributes.jsonValidation || []).concat(this.jsonValidation);
249
249
  }
@@ -337,11 +337,7 @@ export class PluginManagerExtImpl implements PluginManagerExt, PluginManager {
337
337
  }
338
338
 
339
339
  protected async activateByBaseEvent(baseEvent: string): Promise<void> {
340
- await Promise.all(Array.from(this.activations.keys(), activation => {
341
- if (activation.startsWith(baseEvent)) {
342
- return this.activateBySingleEvent(activation);
343
- }
344
- }));
340
+ await Promise.all(Array.from(this.activations.keys(), activation => activation.startsWith(baseEvent) && this.activateBySingleEvent(activation)));
345
341
  }
346
342
 
347
343
  protected async activateBySingleEvent(activationEvent: string): Promise<void> {
@@ -236,11 +236,11 @@ export class TextEditorExt implements theia.TextEditor {
236
236
 
237
237
  // prepare data for serialization
238
238
  const edits: SingleEditOperation[] = editData.edits.map(e =>
239
- ({
240
- range: Converter.fromRange(e.range)!,
241
- text: e.text,
242
- forceMoveMarkers: e.forceMoveMarkers
243
- }));
239
+ ({
240
+ range: Converter.fromRange(e.range)!,
241
+ text: e.text,
242
+ forceMoveMarkers: e.forceMoveMarkers
243
+ }));
244
244
 
245
245
  return this.proxy.$tryApplyEdits(this.id, editData.documentVersionId, edits, {
246
246
  setEndOfLine: editData.setEndOfLine,
@@ -263,6 +263,17 @@ export class TextEditorExt implements theia.TextEditor {
263
263
  return undefined;
264
264
  });
265
265
  }
266
+
267
+ show(column?: theia.ViewColumn): void {
268
+ this.proxy.$tryShowTextDocument(this.document.uri, {
269
+ viewColumn: column,
270
+ preview: true,
271
+ });
272
+ }
273
+
274
+ hide(): void {
275
+ this.proxy.$tryHideEditor(this.id);
276
+ }
266
277
  }
267
278
 
268
279
  export class TextEditorOptionsExt implements theia.TextEditorOptions {
@@ -18,7 +18,7 @@ import { ColorTheme, ColorThemeKind } from './types-impl';
18
18
  import { Emitter, Event } from '@theia/core/lib/common/event';
19
19
  import { ThemingExt } from '../common';
20
20
  import { RPCProtocol } from '../common/rpc-protocol';
21
- import { ThemeType } from '@theia/core/lib/browser/theming';
21
+ import { ThemeType } from '@theia/core/lib/common/theme';
22
22
 
23
23
  /*---------------------------------------------------------------------------------------------
24
24
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -17,7 +17,7 @@
17
17
  /* eslint-disable @typescript-eslint/no-explicit-any */
18
18
 
19
19
  import {
20
- TreeDataProvider, TreeView, TreeViewExpansionEvent, TreeItem2, TreeItemLabel,
20
+ TreeDataProvider, TreeView, TreeViewExpansionEvent, TreeItem, TreeItemLabel,
21
21
  TreeViewSelectionChangeEvent, TreeViewVisibilityChangeEvent
22
22
  } from '@theia/plugin';
23
23
  // TODO: extract `@theia/util` for event, disposable, cancellation and common types
@@ -295,16 +295,17 @@ class TreeViewExtImpl<T> implements Disposable {
295
295
  return undefined;
296
296
  }
297
297
 
298
- private getTreeItemLabel(treeItem: TreeItem2): string | undefined {
298
+ private getTreeItemLabel(treeItem: TreeItem): string | undefined {
299
299
  const treeItemLabel: string | TreeItemLabel | undefined = treeItem.label;
300
- if (typeof treeItemLabel === 'object' && typeof treeItemLabel.label === 'string') {
301
- return treeItemLabel.label;
302
- } else {
303
- return treeItem.label;
304
- }
300
+ return typeof treeItemLabel === 'object' ? treeItemLabel.label : treeItemLabel;
301
+ }
302
+
303
+ private getTreeItemLabelHighlights(treeItem: TreeItem): [number, number][] | undefined {
304
+ const treeItemLabel: string | TreeItemLabel | undefined = treeItem.label;
305
+ return typeof treeItemLabel === 'object' ? treeItemLabel.highlights : undefined;
305
306
  }
306
307
 
307
- private getTreeItemIdLabel(treeItem: TreeItem2): string | undefined {
308
+ private getTreeItemIdLabel(treeItem: TreeItem): string | undefined {
308
309
  let idLabel = this.getTreeItemLabel(treeItem);
309
310
  // Use resource URI if label is not set
310
311
  if (idLabel === undefined && treeItem.resourceUri) {
@@ -341,10 +342,11 @@ class TreeViewExtImpl<T> implements Disposable {
341
342
 
342
343
  // Ask data provider for a tree item for the value
343
344
  // Data provider must return theia.TreeItem
344
- const treeItem: TreeItem2 = await this.treeDataProvider.getTreeItem(value);
345
+ const treeItem = await this.treeDataProvider.getTreeItem(value);
345
346
  // Convert theia.TreeItem to the TreeViewItem
346
347
 
347
348
  const label = this.getTreeItemLabel(treeItem);
349
+ const highlights = this.getTreeItemLabelHighlights(treeItem);
348
350
  const idLabel = this.getTreeItemIdLabel(treeItem);
349
351
 
350
352
  // Generate the ID
@@ -366,12 +368,12 @@ class TreeViewExtImpl<T> implements Disposable {
366
368
 
367
369
  let icon;
368
370
  let iconUrl;
369
- let themeIconId;
371
+ let themeIcon;
370
372
  const { iconPath } = treeItem;
371
373
  if (typeof iconPath === 'string' && iconPath.indexOf('fa-') !== -1) {
372
374
  icon = iconPath;
373
375
  } else if (ThemeIcon.is(iconPath)) {
374
- themeIconId = iconPath.id;
376
+ themeIcon = iconPath;
375
377
  } else {
376
378
  iconUrl = PluginIconPath.toUrl(<PluginIconPath | undefined>iconPath, this.plugin);
377
379
  }
@@ -379,9 +381,10 @@ class TreeViewExtImpl<T> implements Disposable {
379
381
  const treeViewItem = {
380
382
  id,
381
383
  label,
384
+ highlights,
382
385
  icon,
383
386
  iconUrl,
384
- themeIconId,
387
+ themeIcon,
385
388
  description: treeItem.description,
386
389
  resourceUri: treeItem.resourceUri,
387
390
  tooltip: treeItem.tooltip,
@@ -732,7 +732,7 @@ export class ThemeIcon {
732
732
 
733
733
  static readonly Folder: ThemeIcon = new ThemeIcon('folder');
734
734
 
735
- private constructor(public id: string) {
735
+ private constructor(public id: string, public color?: ThemeColor) {
736
736
  }
737
737
 
738
738
  }
@@ -1,51 +0,0 @@
1
- export interface IExpression {
2
- [pattern: string]: boolean | SiblingClause | any;
3
- }
4
- export interface IRelativePattern {
5
- base: string;
6
- pattern: string;
7
- pathToRelative(from: string, to: string): string;
8
- }
9
- export declare function getEmptyExpression(): IExpression;
10
- export interface SiblingClause {
11
- when: string;
12
- }
13
- export declare function splitGlobAware(pattern: string, splitChar: string): string[];
14
- export declare type ParsedPattern = (path: string, basename?: string) => boolean;
15
- export declare type ParsedExpression = (path: string, basename?: string, hasSibling?: (name: string) => boolean | Promise<boolean>) => string | Promise<string>;
16
- export interface IGlobOptions {
17
- /**
18
- * Simplify patterns for use as exclusion filters during tree traversal to skip entire subtrees. Cannot be used outside of a tree traversal.
19
- */
20
- trimForExclusions?: boolean;
21
- }
22
- /**
23
- * Simplified glob matching. Supports a subset of glob patterns:
24
- * - * matches anything inside a path segment
25
- * - ? matches 1 character inside a path segment
26
- * - ** matches anything including an empty path segment
27
- * - simple brace expansion ({js,ts} => js or ts)
28
- * - character ranges (using [...])
29
- */
30
- export declare function match(pattern: string | IRelativePattern, path: string): boolean;
31
- export declare function match(expression: IExpression, path: string, hasSibling?: (name: string) => boolean): string;
32
- /**
33
- * Simplified glob matching. Supports a subset of glob patterns:
34
- * - * matches anything inside a path segment
35
- * - ? matches 1 character inside a path segment
36
- * - ** matches anything including an empty path segment
37
- * - simple brace expansion ({js,ts} => js or ts)
38
- * - character ranges (using [...])
39
- */
40
- export declare function parse(pattern: string | IRelativePattern, options?: IGlobOptions): ParsedPattern;
41
- export declare function parse(expression: IExpression, options?: IGlobOptions): ParsedExpression;
42
- export declare function hasSiblingPromiseFn(siblingsFn?: () => Promise<string[]>): ((name: string) => Promise<boolean>) | undefined;
43
- export declare function hasSiblingFn(siblingsFn?: () => string[]): ((name: string) => boolean) | undefined;
44
- export declare function isRelativePattern(obj: any): obj is IRelativePattern;
45
- /**
46
- * Same as `parse`, but the ParsedExpression is guaranteed to return a Promise
47
- */
48
- export declare function parseToAsync(expression: IExpression, options?: IGlobOptions): ParsedExpression;
49
- export declare function getBasenameTerms(patternOrExpression: ParsedPattern | ParsedExpression): string[];
50
- export declare function getPathTerms(patternOrExpression: ParsedPattern | ParsedExpression): string[];
51
- //# sourceMappingURL=glob.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"glob.d.ts","sourceRoot":"","sources":["../../../../src/main/browser/custom-editors/glob.ts"],"names":[],"mappings":"AA4BA,MAAM,WAAW,WAAW;IAExB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,GAAG,aAAa,GAAG,GAAG,CAAC;CACpD;AAED,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;CACpD;AAED,wBAAgB,kBAAkB,IAAI,WAAW,CAEhD;AAED,MAAM,WAAW,aAAa;IAC1B,IAAI,EAAE,MAAM,CAAC;CAChB;AAsBD,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CA+C3E;AA2JD,oBAAY,aAAa,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC;AAIzE,oBAAY,gBAAgB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAA4B;AAEnL,MAAM,WAAW,YAAY;IACzB;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AA+KD;;;;;;;GAOG;AACH,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;AACjF,wBAAgB,KAAK,CAAC,UAAU,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,GAAG,MAAM,CAA4B;AAUxI;;;;;;;GAOG;AACH,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,aAAa,CAAC;AACjG,wBAAgB,KAAK,CAAC,UAAU,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,gBAAgB,CAAC;AA+BzF,wBAAgB,mBAAmB,CAAC,UAAU,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,SAAS,CAa1H;AAED,wBAAgB,YAAY,CAAC,UAAU,CAAC,EAAE,MAAM,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,SAAS,CAajG;AAWD,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,gBAAgB,CAInE;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,UAAU,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,gBAAgB,CAO9F;AAED,wBAAgB,gBAAgB,CAAC,mBAAmB,EAAE,aAAa,GAAG,gBAAgB,GAAG,MAAM,EAAE,CAEhG;AAED,wBAAgB,YAAY,CAAC,mBAAmB,EAAE,aAAa,GAAG,gBAAgB,GAAG,MAAM,EAAE,CAE5F"}