@theia/plugin-ext 1.45.0 → 1.46.0-next.72

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 (1138) hide show
  1. package/README.md +54 -54
  2. package/lib/common/arrays.d.ts +23 -23
  3. package/lib/common/arrays.js +60 -60
  4. package/lib/common/assert.d.ts +1 -1
  5. package/lib/common/assert.js +25 -25
  6. package/lib/common/cache.d.ts +11 -11
  7. package/lib/common/cache.js +47 -47
  8. package/lib/common/character-classifier.d.ts +18 -18
  9. package/lib/common/character-classifier.js +60 -60
  10. package/lib/common/collections.d.ts +8 -8
  11. package/lib/common/collections.js +55 -55
  12. package/lib/common/commands.d.ts +3 -3
  13. package/lib/common/commands.js +16 -16
  14. package/lib/common/connection.d.ts +54 -54
  15. package/lib/common/connection.js +107 -107
  16. package/lib/common/disposable-util.d.ts +6 -6
  17. package/lib/common/disposable-util.js +37 -37
  18. package/lib/common/editor-options.d.ts +30 -30
  19. package/lib/common/editor-options.js +72 -72
  20. package/lib/common/env.d.ts +3 -3
  21. package/lib/common/env.js +17 -17
  22. package/lib/common/errors.d.ts +17 -17
  23. package/lib/common/errors.js +58 -58
  24. package/lib/common/id-generator.d.ts +6 -6
  25. package/lib/common/id-generator.js +28 -28
  26. package/lib/common/index.d.ts +3 -3
  27. package/lib/common/index.js +33 -33
  28. package/lib/common/language-pack-service.d.ts +15 -15
  29. package/lib/common/language-pack-service.js +20 -20
  30. package/lib/common/link-computer.d.ts +41 -41
  31. package/lib/common/link-computer.js +275 -275
  32. package/lib/common/object-identifier.d.ts +8 -8
  33. package/lib/common/object-identifier.js +32 -32
  34. package/lib/common/objects.d.ts +1 -1
  35. package/lib/common/objects.js +46 -46
  36. package/lib/common/paths-util.d.ts +3 -3
  37. package/lib/common/paths-util.js +144 -144
  38. package/lib/common/plugin-api-rpc-model.d.ts +755 -755
  39. package/lib/common/plugin-api-rpc-model.d.ts.map +1 -1
  40. package/lib/common/plugin-api-rpc-model.js +178 -178
  41. package/lib/common/plugin-api-rpc.d.ts +2112 -2088
  42. package/lib/common/plugin-api-rpc.d.ts.map +1 -1
  43. package/lib/common/plugin-api-rpc.js +304 -302
  44. package/lib/common/plugin-api-rpc.js.map +1 -1
  45. package/lib/common/plugin-ext-api-contribution.d.ts +88 -58
  46. package/lib/common/plugin-ext-api-contribution.d.ts.map +1 -1
  47. package/lib/common/plugin-ext-api-contribution.js +5 -5
  48. package/lib/common/plugin-ext-api-contribution.js.map +1 -1
  49. package/lib/common/plugin-identifiers.d.ts +40 -40
  50. package/lib/common/plugin-identifiers.js +80 -80
  51. package/lib/common/plugin-protocol.d.ts +942 -929
  52. package/lib/common/plugin-protocol.d.ts.map +1 -1
  53. package/lib/common/plugin-protocol.js +75 -74
  54. package/lib/common/plugin-protocol.js.map +1 -1
  55. package/lib/common/proxy-handler.d.ts +72 -65
  56. package/lib/common/proxy-handler.d.ts.map +1 -1
  57. package/lib/common/proxy-handler.js +103 -99
  58. package/lib/common/proxy-handler.js.map +1 -1
  59. package/lib/common/reference-map.d.ts +7 -7
  60. package/lib/common/reference-map.js +39 -39
  61. package/lib/common/rpc-protocol.d.ts +75 -65
  62. package/lib/common/rpc-protocol.d.ts.map +1 -1
  63. package/lib/common/rpc-protocol.js +258 -229
  64. package/lib/common/rpc-protocol.js.map +1 -1
  65. package/lib/common/semantic-tokens-dto.d.ts +18 -18
  66. package/lib/common/semantic-tokens-dto.js +162 -162
  67. package/lib/common/test-types.d.ts +91 -91
  68. package/lib/common/test-types.js +74 -74
  69. package/lib/common/types.d.ts +37 -37
  70. package/lib/common/types.js +121 -121
  71. package/lib/common/uint.d.ts +7 -7
  72. package/lib/common/uint.js +33 -33
  73. package/lib/common/uri-components.d.ts +38 -39
  74. package/lib/common/uri-components.d.ts.map +1 -1
  75. package/lib/common/uri-components.js +62 -66
  76. package/lib/common/uri-components.js.map +1 -1
  77. package/lib/hosted/browser/hosted-plugin-watcher.d.ts +15 -15
  78. package/lib/hosted/browser/hosted-plugin-watcher.js +59 -59
  79. package/lib/hosted/browser/hosted-plugin.d.ts +99 -157
  80. package/lib/hosted/browser/hosted-plugin.d.ts.map +1 -1
  81. package/lib/hosted/browser/hosted-plugin.js +599 -871
  82. package/lib/hosted/browser/hosted-plugin.js.map +1 -1
  83. package/lib/hosted/browser/plugin-worker.d.ts +6 -6
  84. package/lib/hosted/browser/plugin-worker.js +57 -57
  85. package/lib/hosted/browser/worker/debug-stub.d.ts +3 -3
  86. package/lib/hosted/browser/worker/debug-stub.d.ts.map +1 -1
  87. package/lib/hosted/browser/worker/debug-stub.js +29 -29
  88. package/lib/hosted/browser/worker/debug-stub.js.map +1 -1
  89. package/lib/hosted/browser/worker/plugin-manifest-loader.d.ts +2 -2
  90. package/lib/hosted/browser/worker/plugin-manifest-loader.js +107 -107
  91. package/lib/hosted/browser/worker/worker-env-ext.d.ts +13 -14
  92. package/lib/hosted/browser/worker/worker-env-ext.d.ts.map +1 -1
  93. package/lib/hosted/browser/worker/worker-env-ext.js +52 -38
  94. package/lib/hosted/browser/worker/worker-env-ext.js.map +1 -1
  95. package/lib/hosted/browser/worker/worker-main.d.ts +1 -1
  96. package/lib/hosted/browser/worker/worker-main.js +182 -194
  97. package/lib/hosted/browser/worker/worker-main.js.map +1 -1
  98. package/lib/hosted/browser/worker/worker-plugin-module.d.ts +5 -0
  99. package/lib/hosted/browser/worker/worker-plugin-module.d.ts.map +1 -0
  100. package/lib/hosted/browser/worker/worker-plugin-module.js +78 -0
  101. package/lib/hosted/browser/worker/worker-plugin-module.js.map +1 -0
  102. package/lib/hosted/common/hosted-plugin.d.ts +97 -0
  103. package/lib/hosted/common/hosted-plugin.d.ts.map +1 -0
  104. package/lib/hosted/common/hosted-plugin.js +408 -0
  105. package/lib/hosted/common/hosted-plugin.js.map +1 -0
  106. package/lib/hosted/node/hosted-plugin-cli-contribution.d.ts +16 -16
  107. package/lib/hosted/node/hosted-plugin-cli-contribution.js +76 -76
  108. package/lib/hosted/node/hosted-plugin-deployer-handler.d.ts +43 -43
  109. package/lib/hosted/node/hosted-plugin-deployer-handler.js +270 -270
  110. package/lib/hosted/node/hosted-plugin-localization-service.d.ts +46 -46
  111. package/lib/hosted/node/hosted-plugin-localization-service.js +389 -389
  112. package/lib/hosted/node/hosted-plugin-process.d.ts +47 -47
  113. package/lib/hosted/node/hosted-plugin-process.d.ts.map +1 -1
  114. package/lib/hosted/node/hosted-plugin-process.js +224 -224
  115. package/lib/hosted/node/hosted-plugin-process.js.map +1 -1
  116. package/lib/hosted/node/hosted-plugin-protocol.d.ts +21 -21
  117. package/lib/hosted/node/hosted-plugin-protocol.js +36 -36
  118. package/lib/hosted/node/hosted-plugin.d.ts +36 -36
  119. package/lib/hosted/node/hosted-plugin.js +118 -118
  120. package/lib/hosted/node/metadata-scanner.d.ts +17 -17
  121. package/lib/hosted/node/metadata-scanner.js +82 -82
  122. package/lib/hosted/node/plugin-activation-events.d.ts +6 -6
  123. package/lib/hosted/node/plugin-activation-events.js +95 -95
  124. package/lib/hosted/node/plugin-ext-hosted-backend-module.d.ts +3 -3
  125. package/lib/hosted/node/plugin-ext-hosted-backend-module.d.ts.map +1 -1
  126. package/lib/hosted/node/plugin-ext-hosted-backend-module.js +82 -80
  127. package/lib/hosted/node/plugin-ext-hosted-backend-module.js.map +1 -1
  128. package/lib/hosted/node/plugin-host-module.d.ts +5 -0
  129. package/lib/hosted/node/plugin-host-module.d.ts.map +1 -0
  130. package/lib/hosted/node/plugin-host-module.js +68 -0
  131. package/lib/hosted/node/plugin-host-module.js.map +1 -0
  132. package/lib/hosted/node/plugin-host-proxy.d.ts +18 -18
  133. package/lib/hosted/node/plugin-host-proxy.js +70 -70
  134. package/lib/hosted/node/plugin-host-rpc.d.ts +107 -21
  135. package/lib/hosted/node/plugin-host-rpc.d.ts.map +1 -1
  136. package/lib/hosted/node/plugin-host-rpc.js +341 -192
  137. package/lib/hosted/node/plugin-host-rpc.js.map +1 -1
  138. package/lib/hosted/node/plugin-host.d.ts +1 -1
  139. package/lib/hosted/node/plugin-host.js +102 -101
  140. package/lib/hosted/node/plugin-host.js.map +1 -1
  141. package/lib/hosted/node/plugin-language-pack-service.d.ts +7 -7
  142. package/lib/hosted/node/plugin-language-pack-service.js +53 -53
  143. package/lib/hosted/node/plugin-manifest-loader.d.ts +2 -2
  144. package/lib/hosted/node/plugin-manifest-loader.js +35 -35
  145. package/lib/hosted/node/plugin-reader.d.ts +25 -25
  146. package/lib/hosted/node/plugin-reader.d.ts.map +1 -1
  147. package/lib/hosted/node/plugin-reader.js +146 -143
  148. package/lib/hosted/node/plugin-reader.js.map +1 -1
  149. package/lib/hosted/node/plugin-service.d.ts +47 -39
  150. package/lib/hosted/node/plugin-service.d.ts.map +1 -1
  151. package/lib/hosted/node/plugin-service.js +203 -193
  152. package/lib/hosted/node/plugin-service.js.map +1 -1
  153. package/lib/hosted/node/scanners/backend-init-theia.d.ts +2 -2
  154. package/lib/hosted/node/scanners/backend-init-theia.js +60 -60
  155. package/lib/hosted/node/scanners/file-plugin-uri-factory.d.ts +10 -10
  156. package/lib/hosted/node/scanners/file-plugin-uri-factory.js +40 -40
  157. package/lib/hosted/node/scanners/file-plugin-uri-factory.js.map +1 -1
  158. package/lib/hosted/node/scanners/grammars-reader.d.ts +5 -5
  159. package/lib/hosted/node/scanners/grammars-reader.js +63 -63
  160. package/lib/hosted/node/scanners/plugin-uri-factory.d.ts +16 -16
  161. package/lib/hosted/node/scanners/plugin-uri-factory.js +19 -19
  162. package/lib/hosted/node/scanners/scanner-theia.d.ts +68 -54
  163. package/lib/hosted/node/scanners/scanner-theia.d.ts.map +1 -1
  164. package/lib/hosted/node/scanners/scanner-theia.js +859 -824
  165. package/lib/hosted/node/scanners/scanner-theia.js.map +1 -1
  166. package/lib/hosted/node-electron/plugin-ext-hosted-electron-backend-module.d.ts +2 -2
  167. package/lib/hosted/node-electron/plugin-ext-hosted-electron-backend-module.js +26 -26
  168. package/lib/hosted/node-electron/scanner-theia-electron.d.ts +5 -5
  169. package/lib/hosted/node-electron/scanner-theia-electron.js +40 -40
  170. package/lib/main/browser/authentication-main.d.ts +51 -51
  171. package/lib/main/browser/authentication-main.d.ts.map +1 -1
  172. package/lib/main/browser/authentication-main.js +315 -313
  173. package/lib/main/browser/authentication-main.js.map +1 -1
  174. package/lib/main/browser/clipboard-main.d.ts +9 -9
  175. package/lib/main/browser/clipboard-main.js +32 -32
  176. package/lib/main/browser/command-registry-main.d.ts +26 -26
  177. package/lib/main/browser/command-registry-main.js +107 -107
  178. package/lib/main/browser/commands.d.ts +12 -12
  179. package/lib/main/browser/commands.js +102 -102
  180. package/lib/main/browser/comments/comment-glyph-widget.d.ts +12 -12
  181. package/lib/main/browser/comments/comment-glyph-widget.js +42 -42
  182. package/lib/main/browser/comments/comment-thread-widget.d.ts +153 -153
  183. package/lib/main/browser/comments/comment-thread-widget.js +470 -470
  184. package/lib/main/browser/comments/comments-context-key-service.d.ts +17 -17
  185. package/lib/main/browser/comments/comments-context-key-service.js +80 -80
  186. package/lib/main/browser/comments/comments-contribution.d.ts +31 -31
  187. package/lib/main/browser/comments/comments-contribution.d.ts.map +1 -1
  188. package/lib/main/browser/comments/comments-contribution.js +267 -264
  189. package/lib/main/browser/comments/comments-contribution.js.map +1 -1
  190. package/lib/main/browser/comments/comments-decorator.d.ts +15 -15
  191. package/lib/main/browser/comments/comments-decorator.js +107 -107
  192. package/lib/main/browser/comments/comments-main.d.ts +111 -111
  193. package/lib/main/browser/comments/comments-main.js +356 -356
  194. package/lib/main/browser/comments/comments-main.js.map +1 -1
  195. package/lib/main/browser/comments/comments-service.d.ts +75 -75
  196. package/lib/main/browser/comments/comments-service.js +120 -120
  197. package/lib/main/browser/custom-editors/custom-editor-contribution.d.ts +6 -6
  198. package/lib/main/browser/custom-editors/custom-editor-contribution.js +50 -50
  199. package/lib/main/browser/custom-editors/custom-editor-opener.d.ts +21 -21
  200. package/lib/main/browser/custom-editors/custom-editor-opener.js +111 -111
  201. package/lib/main/browser/custom-editors/custom-editor-opener.js.map +1 -1
  202. package/lib/main/browser/custom-editors/custom-editor-service.d.ts +16 -16
  203. package/lib/main/browser/custom-editors/custom-editor-service.js +102 -102
  204. package/lib/main/browser/custom-editors/custom-editor-widget-factory.d.ts +9 -9
  205. package/lib/main/browser/custom-editors/custom-editor-widget-factory.js +39 -39
  206. package/lib/main/browser/custom-editors/custom-editor-widget.d.ts +36 -36
  207. package/lib/main/browser/custom-editors/custom-editor-widget.d.ts.map +1 -1
  208. package/lib/main/browser/custom-editors/custom-editor-widget.js +120 -118
  209. package/lib/main/browser/custom-editors/custom-editor-widget.js.map +1 -1
  210. package/lib/main/browser/custom-editors/custom-editors-main.d.ts +119 -119
  211. package/lib/main/browser/custom-editors/custom-editors-main.js +436 -436
  212. package/lib/main/browser/custom-editors/custom-editors-main.js.map +1 -1
  213. package/lib/main/browser/custom-editors/plugin-custom-editor-registry.d.ts +23 -23
  214. package/lib/main/browser/custom-editors/plugin-custom-editor-registry.js +142 -142
  215. package/lib/main/browser/data-transfer/data-transfer-type-converters.d.ts +8 -8
  216. package/lib/main/browser/data-transfer/data-transfer-type-converters.d.ts.map +1 -1
  217. package/lib/main/browser/data-transfer/data-transfer-type-converters.js +62 -64
  218. package/lib/main/browser/data-transfer/data-transfer-type-converters.js.map +1 -1
  219. package/lib/main/browser/debug/debug-main.d.ts +48 -48
  220. package/lib/main/browser/debug/debug-main.js +295 -295
  221. package/lib/main/browser/debug/plugin-debug-adapter-contribution.d.ts +18 -18
  222. package/lib/main/browser/debug/plugin-debug-adapter-contribution.js +42 -42
  223. package/lib/main/browser/debug/plugin-debug-configuration-provider.d.ts +12 -12
  224. package/lib/main/browser/debug/plugin-debug-configuration-provider.js +38 -38
  225. package/lib/main/browser/debug/plugin-debug-service.d.ts +55 -55
  226. package/lib/main/browser/debug/plugin-debug-service.js +367 -367
  227. package/lib/main/browser/debug/plugin-debug-session-contribution-registry.d.ts +30 -30
  228. package/lib/main/browser/debug/plugin-debug-session-contribution-registry.js +75 -75
  229. package/lib/main/browser/debug/plugin-debug-session-factory.d.ts +55 -55
  230. package/lib/main/browser/debug/plugin-debug-session-factory.js +70 -70
  231. package/lib/main/browser/decorations/decorations-main.d.ts +15 -15
  232. package/lib/main/browser/decorations/decorations-main.js +119 -119
  233. package/lib/main/browser/dialogs/modal-notification.d.ts +18 -18
  234. package/lib/main/browser/dialogs/modal-notification.js +109 -109
  235. package/lib/main/browser/dialogs-main.d.ts +16 -16
  236. package/lib/main/browser/dialogs-main.js +162 -162
  237. package/lib/main/browser/documents-main.d.ts +50 -50
  238. package/lib/main/browser/documents-main.js +249 -249
  239. package/lib/main/browser/editors-and-documents-main.d.ts +36 -32
  240. package/lib/main/browser/editors-and-documents-main.d.ts.map +1 -1
  241. package/lib/main/browser/editors-and-documents-main.js +321 -302
  242. package/lib/main/browser/editors-and-documents-main.js.map +1 -1
  243. package/lib/main/browser/env-main.d.ts +6 -15
  244. package/lib/main/browser/env-main.d.ts.map +1 -1
  245. package/lib/main/browser/env-main.js +63 -82
  246. package/lib/main/browser/env-main.js.map +1 -1
  247. package/lib/main/browser/file-system-main-impl.d.ts +27 -27
  248. package/lib/main/browser/file-system-main-impl.js +205 -205
  249. package/lib/main/browser/hierarchy/hierarchy-types-converters.d.ts +24 -24
  250. package/lib/main/browser/hierarchy/hierarchy-types-converters.js +184 -184
  251. package/lib/main/browser/keybindings/keybindings-contribution-handler.d.ts +9 -9
  252. package/lib/main/browser/keybindings/keybindings-contribution-handler.js +77 -77
  253. package/lib/main/browser/label-service-main.d.ts +10 -10
  254. package/lib/main/browser/label-service-main.js +46 -46
  255. package/lib/main/browser/languages-main.d.ts +143 -143
  256. package/lib/main/browser/languages-main.d.ts.map +1 -1
  257. package/lib/main/browser/languages-main.js +1187 -1184
  258. package/lib/main/browser/languages-main.js.map +1 -1
  259. package/lib/main/browser/localization-main.d.ts +8 -8
  260. package/lib/main/browser/localization-main.js +31 -31
  261. package/lib/main/browser/main-context.d.ts +3 -3
  262. package/lib/main/browser/main-context.d.ts.map +1 -1
  263. package/lib/main/browser/main-context.js +159 -161
  264. package/lib/main/browser/main-context.js.map +1 -1
  265. package/lib/main/browser/main-file-system-event-service.d.ts +7 -7
  266. package/lib/main/browser/main-file-system-event-service.js +65 -65
  267. package/lib/main/browser/menus/menus-contribution-handler.d.ts +29 -29
  268. package/lib/main/browser/menus/menus-contribution-handler.d.ts.map +1 -1
  269. package/lib/main/browser/menus/menus-contribution-handler.js +201 -198
  270. package/lib/main/browser/menus/menus-contribution-handler.js.map +1 -1
  271. package/lib/main/browser/menus/plugin-menu-command-adapter.d.ts +44 -44
  272. package/lib/main/browser/menus/plugin-menu-command-adapter.js +310 -310
  273. package/lib/main/browser/menus/plugin-menu-command-adapter.js.map +1 -1
  274. package/lib/main/browser/menus/vscode-theia-menu-mappings.d.ts +18 -18
  275. package/lib/main/browser/menus/vscode-theia-menu-mappings.js +107 -107
  276. package/lib/main/browser/message-registry-main.d.ts +10 -8
  277. package/lib/main/browser/message-registry-main.d.ts.map +1 -1
  278. package/lib/main/browser/message-registry-main.js +40 -52
  279. package/lib/main/browser/message-registry-main.js.map +1 -1
  280. package/lib/main/browser/notebooks/notebook-documents-and-editors-main.d.ts +50 -51
  281. package/lib/main/browser/notebooks/notebook-documents-and-editors-main.d.ts.map +1 -1
  282. package/lib/main/browser/notebooks/notebook-documents-and-editors-main.js +199 -201
  283. package/lib/main/browser/notebooks/notebook-documents-and-editors-main.js.map +1 -1
  284. package/lib/main/browser/notebooks/notebook-documents-main.d.ts +21 -21
  285. package/lib/main/browser/notebooks/notebook-documents-main.js +131 -131
  286. package/lib/main/browser/notebooks/notebook-dto.d.ts +17 -17
  287. package/lib/main/browser/notebooks/notebook-dto.js +130 -130
  288. package/lib/main/browser/notebooks/notebook-editors-main.d.ts +19 -19
  289. package/lib/main/browser/notebooks/notebook-editors-main.js +57 -57
  290. package/lib/main/browser/notebooks/notebook-kernels-main.d.ts +42 -41
  291. package/lib/main/browser/notebooks/notebook-kernels-main.d.ts.map +1 -1
  292. package/lib/main/browser/notebooks/notebook-kernels-main.js +260 -223
  293. package/lib/main/browser/notebooks/notebook-kernels-main.js.map +1 -1
  294. package/lib/main/browser/notebooks/notebook-renderers-main.d.ts +11 -11
  295. package/lib/main/browser/notebooks/notebook-renderers-main.js +38 -38
  296. package/lib/main/browser/notebooks/notebooks-main.d.ts +30 -30
  297. package/lib/main/browser/notebooks/notebooks-main.js +102 -102
  298. package/lib/main/browser/notebooks/renderers/cell-output-webview.d.ts +39 -33
  299. package/lib/main/browser/notebooks/renderers/cell-output-webview.d.ts.map +1 -1
  300. package/lib/main/browser/notebooks/renderers/cell-output-webview.js +249 -206
  301. package/lib/main/browser/notebooks/renderers/cell-output-webview.js.map +1 -1
  302. package/lib/main/browser/notebooks/renderers/output-webview-internal.d.ts +13 -12
  303. package/lib/main/browser/notebooks/renderers/output-webview-internal.d.ts.map +1 -1
  304. package/lib/main/browser/notebooks/renderers/output-webview-internal.js +457 -376
  305. package/lib/main/browser/notebooks/renderers/output-webview-internal.js.map +1 -1
  306. package/lib/main/browser/notebooks/renderers/webview-communication.d.ts +60 -51
  307. package/lib/main/browser/notebooks/renderers/webview-communication.d.ts.map +1 -1
  308. package/lib/main/browser/notebooks/renderers/webview-communication.js +21 -21
  309. package/lib/main/browser/notification-main.d.ts +6 -18
  310. package/lib/main/browser/notification-main.d.ts.map +1 -1
  311. package/lib/main/browser/notification-main.js +26 -75
  312. package/lib/main/browser/notification-main.js.map +1 -1
  313. package/lib/main/browser/output-channel-registry-main.d.ts +10 -10
  314. package/lib/main/browser/output-channel-registry-main.js +60 -60
  315. package/lib/main/browser/plugin-authentication-service.d.ts +13 -13
  316. package/lib/main/browser/plugin-authentication-service.js +80 -80
  317. package/lib/main/browser/plugin-contribution-handler.d.ts +75 -75
  318. package/lib/main/browser/plugin-contribution-handler.d.ts.map +1 -1
  319. package/lib/main/browser/plugin-contribution-handler.js +664 -659
  320. package/lib/main/browser/plugin-contribution-handler.js.map +1 -1
  321. package/lib/main/browser/plugin-ext-frontend-module.d.ts +7 -7
  322. package/lib/main/browser/plugin-ext-frontend-module.d.ts.map +1 -1
  323. package/lib/main/browser/plugin-ext-frontend-module.js +230 -230
  324. package/lib/main/browser/plugin-ext-frontend-module.js.map +1 -1
  325. package/lib/main/browser/plugin-ext-widget.d.ts +28 -28
  326. package/lib/main/browser/plugin-ext-widget.js +129 -129
  327. package/lib/main/browser/plugin-frontend-contribution.d.ts +9 -9
  328. package/lib/main/browser/plugin-frontend-contribution.js +79 -79
  329. package/lib/main/browser/plugin-frontend-view-contribution.d.ts +6 -6
  330. package/lib/main/browser/plugin-frontend-view-contribution.js +50 -50
  331. package/lib/main/browser/plugin-icon-service.d.ts +16 -19
  332. package/lib/main/browser/plugin-icon-service.d.ts.map +1 -1
  333. package/lib/main/browser/plugin-icon-service.js +96 -155
  334. package/lib/main/browser/plugin-icon-service.js.map +1 -1
  335. package/lib/main/browser/plugin-icon-theme-service.d.ts +146 -146
  336. package/lib/main/browser/plugin-icon-theme-service.js +561 -561
  337. package/lib/main/browser/plugin-shared-style.d.ts +40 -40
  338. package/lib/main/browser/plugin-shared-style.js +144 -144
  339. package/lib/main/browser/plugin-storage.d.ts +13 -13
  340. package/lib/main/browser/plugin-storage.js +46 -46
  341. package/lib/main/browser/plugin-terminal-registry.d.ts +4 -4
  342. package/lib/main/browser/plugin-terminal-registry.js +34 -34
  343. package/lib/main/browser/preference-registry-main.d.ts +19 -19
  344. package/lib/main/browser/preference-registry-main.js +104 -104
  345. package/lib/main/browser/quick-open-main.d.ts +32 -31
  346. package/lib/main/browser/quick-open-main.d.ts.map +1 -1
  347. package/lib/main/browser/quick-open-main.js +318 -281
  348. package/lib/main/browser/quick-open-main.js.map +1 -1
  349. package/lib/main/browser/scm-main.d.ts +106 -106
  350. package/lib/main/browser/scm-main.js +346 -346
  351. package/lib/main/browser/scm-main.js.map +1 -1
  352. package/lib/main/browser/secrets-main.d.ts +12 -12
  353. package/lib/main/browser/secrets-main.js +67 -67
  354. package/lib/main/browser/selection-provider-command.d.ts +12 -12
  355. package/lib/main/browser/selection-provider-command.d.ts.map +1 -1
  356. package/lib/main/browser/selection-provider-command.js +56 -57
  357. package/lib/main/browser/selection-provider-command.js.map +1 -1
  358. package/lib/main/browser/status-bar-message-registry-main.d.ts +16 -16
  359. package/lib/main/browser/status-bar-message-registry-main.js +55 -55
  360. package/lib/main/browser/tabs/tabs-main.d.ts +47 -47
  361. package/lib/main/browser/tabs/tabs-main.js +291 -291
  362. package/lib/main/browser/tasks-main.d.ts +33 -33
  363. package/lib/main/browser/tasks-main.js +208 -208
  364. package/lib/main/browser/terminal-main.d.ts +50 -50
  365. package/lib/main/browser/terminal-main.d.ts.map +1 -1
  366. package/lib/main/browser/terminal-main.js +269 -269
  367. package/lib/main/browser/terminal-main.js.map +1 -1
  368. package/lib/main/browser/test-main.d.ts +140 -140
  369. package/lib/main/browser/test-main.js +559 -559
  370. package/lib/main/browser/text-editor-main.d.ts +47 -47
  371. package/lib/main/browser/text-editor-main.js +384 -384
  372. package/lib/main/browser/text-editor-model-service.d.ts +28 -28
  373. package/lib/main/browser/text-editor-model-service.js +108 -108
  374. package/lib/main/browser/text-editors-main.d.ts +37 -38
  375. package/lib/main/browser/text-editors-main.d.ts.map +1 -1
  376. package/lib/main/browser/text-editors-main.js +164 -158
  377. package/lib/main/browser/text-editors-main.js.map +1 -1
  378. package/lib/main/browser/theme-icon-override.d.ts +1 -1
  379. package/lib/main/browser/theme-icon-override.js +244 -250
  380. package/lib/main/browser/theme-icon-override.js.map +1 -1
  381. package/lib/main/browser/theming-main.d.ts +9 -9
  382. package/lib/main/browser/theming-main.js +35 -35
  383. package/lib/main/browser/timeline-main.d.ts +13 -13
  384. package/lib/main/browser/timeline-main.js +50 -50
  385. package/lib/main/browser/view/dnd-file-content-store.d.ts +7 -7
  386. package/lib/main/browser/view/dnd-file-content-store.js +51 -51
  387. package/lib/main/browser/view/plugin-tree-view-node-label-provider.d.ts +11 -11
  388. package/lib/main/browser/view/plugin-tree-view-node-label-provider.js +90 -90
  389. package/lib/main/browser/view/plugin-tree-view-node-label-provider.js.map +1 -1
  390. package/lib/main/browser/view/plugin-view-registry.d.ts +105 -103
  391. package/lib/main/browser/view/plugin-view-registry.d.ts.map +1 -1
  392. package/lib/main/browser/view/plugin-view-registry.js +892 -876
  393. package/lib/main/browser/view/plugin-view-registry.js.map +1 -1
  394. package/lib/main/browser/view/plugin-view-widget.d.ts +62 -62
  395. package/lib/main/browser/view/plugin-view-widget.d.ts.map +1 -1
  396. package/lib/main/browser/view/plugin-view-widget.js +206 -207
  397. package/lib/main/browser/view/plugin-view-widget.js.map +1 -1
  398. package/lib/main/browser/view/tree-view-decorator-service.d.ts +30 -30
  399. package/lib/main/browser/view/tree-view-decorator-service.js +68 -68
  400. package/lib/main/browser/view/tree-view-widget.d.ts +166 -166
  401. package/lib/main/browser/view/tree-view-widget.d.ts.map +1 -1
  402. package/lib/main/browser/view/tree-view-widget.js +843 -844
  403. package/lib/main/browser/view/tree-view-widget.js.map +1 -1
  404. package/lib/main/browser/view/tree-views-main.d.ts +34 -34
  405. package/lib/main/browser/view/tree-views-main.js +181 -181
  406. package/lib/main/browser/view/view-context-key-service.d.ts +18 -18
  407. package/lib/main/browser/view/view-context-key-service.js +74 -74
  408. package/lib/main/browser/view-column-service.d.ts +23 -23
  409. package/lib/main/browser/view-column-service.js +129 -129
  410. package/lib/main/browser/webview/webview-context-keys.d.ts +16 -12
  411. package/lib/main/browser/webview/webview-context-keys.d.ts.map +1 -1
  412. package/lib/main/browser/webview/webview-context-keys.js +72 -63
  413. package/lib/main/browser/webview/webview-context-keys.js.map +1 -1
  414. package/lib/main/browser/webview/webview-environment.d.ts +16 -16
  415. package/lib/main/browser/webview/webview-environment.js +96 -96
  416. package/lib/main/browser/webview/webview-frontend-security-warnings.d.ts +11 -11
  417. package/lib/main/browser/webview/webview-frontend-security-warnings.js +73 -73
  418. package/lib/main/browser/webview/webview-preferences.d.ts +12 -12
  419. package/lib/main/browser/webview/webview-preferences.js +57 -57
  420. package/lib/main/browser/webview/webview-resource-cache.d.ts +17 -17
  421. package/lib/main/browser/webview/webview-resource-cache.js +90 -90
  422. package/lib/main/browser/webview/webview-theme-data-provider.d.ts +30 -30
  423. package/lib/main/browser/webview/webview-theme-data-provider.js +132 -132
  424. package/lib/main/browser/webview/webview-widget-factory.d.ts +8 -8
  425. package/lib/main/browser/webview/webview-widget-factory.d.ts.map +1 -1
  426. package/lib/main/browser/webview/webview-widget-factory.js +39 -38
  427. package/lib/main/browser/webview/webview-widget-factory.js.map +1 -1
  428. package/lib/main/browser/webview/webview.d.ts +162 -161
  429. package/lib/main/browser/webview/webview.d.ts.map +1 -1
  430. package/lib/main/browser/webview/webview.js +620 -619
  431. package/lib/main/browser/webview/webview.js.map +1 -1
  432. package/lib/main/browser/webview-views/webview-views-main.d.ts +32 -32
  433. package/lib/main/browser/webview-views/webview-views-main.js +136 -136
  434. package/lib/main/browser/webview-views/webview-views.d.ts +19 -19
  435. package/lib/main/browser/webview-views/webview-views.js +22 -22
  436. package/lib/main/browser/webviews-main.d.ts +40 -40
  437. package/lib/main/browser/webviews-main.d.ts.map +1 -1
  438. package/lib/main/browser/webviews-main.js +248 -243
  439. package/lib/main/browser/webviews-main.js.map +1 -1
  440. package/lib/main/browser/window-state-main.d.ts +16 -16
  441. package/lib/main/browser/window-state-main.js +61 -61
  442. package/lib/main/browser/workspace-main.d.ts +77 -77
  443. package/lib/main/browser/workspace-main.js +348 -348
  444. package/lib/main/common/basic-message-registry-main.d.ts +14 -0
  445. package/lib/main/common/basic-message-registry-main.d.ts.map +1 -0
  446. package/lib/main/common/basic-message-registry-main.js +50 -0
  447. package/lib/main/common/basic-message-registry-main.js.map +1 -0
  448. package/lib/main/common/basic-notification-main.d.ts +19 -0
  449. package/lib/main/common/basic-notification-main.d.ts.map +1 -0
  450. package/lib/main/common/basic-notification-main.js +75 -0
  451. package/lib/main/common/basic-notification-main.js.map +1 -0
  452. package/lib/main/common/env-main.d.ts +11 -0
  453. package/lib/main/common/env-main.d.ts.map +1 -0
  454. package/lib/main/common/env-main.js +40 -0
  455. package/lib/main/common/env-main.js.map +1 -0
  456. package/lib/main/common/plugin-paths-protocol.d.ts +8 -8
  457. package/lib/main/common/plugin-paths-protocol.js +21 -21
  458. package/lib/main/common/plugin-theia-environment.d.ts +7 -7
  459. package/lib/main/common/plugin-theia-environment.js +47 -47
  460. package/lib/main/common/webview-protocol.d.ts +12 -12
  461. package/lib/main/common/webview-protocol.js +31 -31
  462. package/lib/main/electron-browser/plugin-ext-frontend-electron-module.d.ts +3 -3
  463. package/lib/main/electron-browser/plugin-ext-frontend-electron-module.js +25 -25
  464. package/lib/main/electron-browser/webview/electron-webview-widget-factory.d.ts +23 -23
  465. package/lib/main/electron-browser/webview/electron-webview-widget-factory.js +53 -53
  466. package/lib/main/node/errors.spec.d.ts +1 -1
  467. package/lib/main/node/errors.spec.js +35 -35
  468. package/lib/main/node/errors.spec.js.map +1 -1
  469. package/lib/main/node/handlers/plugin-theia-directory-handler.d.ts +18 -13
  470. package/lib/main/node/handlers/plugin-theia-directory-handler.d.ts.map +1 -1
  471. package/lib/main/node/handlers/plugin-theia-directory-handler.js +137 -119
  472. package/lib/main/node/handlers/plugin-theia-directory-handler.js.map +1 -1
  473. package/lib/main/node/handlers/plugin-theia-file-handler.d.ts +10 -10
  474. package/lib/main/node/handlers/plugin-theia-file-handler.js +74 -74
  475. package/lib/main/node/handlers/plugin-theia-file-handler.js.map +1 -1
  476. package/lib/main/node/paths/const.d.ts +5 -5
  477. package/lib/main/node/paths/const.js +24 -24
  478. package/lib/main/node/paths/plugin-paths-service.d.ts +25 -25
  479. package/lib/main/node/paths/plugin-paths-service.js +160 -160
  480. package/lib/main/node/plugin-cli-contribution.d.ts +21 -21
  481. package/lib/main/node/plugin-cli-contribution.js +84 -84
  482. package/lib/main/node/plugin-deployer-contribution.d.ts +8 -8
  483. package/lib/main/node/plugin-deployer-contribution.js +48 -48
  484. package/lib/main/node/plugin-deployer-directory-handler-context-impl.d.ts +7 -7
  485. package/lib/main/node/plugin-deployer-directory-handler-context-impl.js +44 -44
  486. package/lib/main/node/plugin-deployer-entry-impl.d.ts +34 -34
  487. package/lib/main/node/plugin-deployer-entry-impl.js +111 -111
  488. package/lib/main/node/plugin-deployer-file-handler-context-impl.d.ts +7 -7
  489. package/lib/main/node/plugin-deployer-file-handler-context-impl.js +31 -31
  490. package/lib/main/node/plugin-deployer-impl.d.ts +61 -61
  491. package/lib/main/node/plugin-deployer-impl.d.ts.map +1 -1
  492. package/lib/main/node/plugin-deployer-impl.js +338 -334
  493. package/lib/main/node/plugin-deployer-impl.js.map +1 -1
  494. package/lib/main/node/plugin-deployer-proxy-entry-impl.d.ts +29 -29
  495. package/lib/main/node/plugin-deployer-proxy-entry-impl.js +98 -98
  496. package/lib/main/node/plugin-deployer-resolver-context-impl.d.ts +15 -15
  497. package/lib/main/node/plugin-deployer-resolver-context-impl.js +42 -42
  498. package/lib/main/node/plugin-ext-backend-module.d.ts +2 -2
  499. package/lib/main/node/plugin-ext-backend-module.js +73 -73
  500. package/lib/main/node/plugin-github-resolver.d.ts +23 -23
  501. package/lib/main/node/plugin-github-resolver.js +143 -143
  502. package/lib/main/node/plugin-http-resolver.d.ts +20 -20
  503. package/lib/main/node/plugin-http-resolver.js +99 -99
  504. package/lib/main/node/plugin-localization-server.d.ts +9 -9
  505. package/lib/main/node/plugin-localization-server.js +58 -58
  506. package/lib/main/node/plugin-mgmt-cli-contribution.d.ts +12 -12
  507. package/lib/main/node/plugin-mgmt-cli-contribution.js +70 -70
  508. package/lib/main/node/plugin-server-handler.d.ts +16 -16
  509. package/lib/main/node/plugin-server-handler.js +74 -74
  510. package/lib/main/node/plugin-service.d.ts +23 -23
  511. package/lib/main/node/plugin-service.js +109 -109
  512. package/lib/main/node/plugin-theia-deployer-participant.d.ts +6 -6
  513. package/lib/main/node/plugin-theia-deployer-participant.js +43 -43
  514. package/lib/main/node/plugin-uninstallation-manager.d.ts +14 -14
  515. package/lib/main/node/plugin-uninstallation-manager.js +84 -84
  516. package/lib/main/node/plugins-key-value-storage.d.ts +28 -28
  517. package/lib/main/node/plugins-key-value-storage.js +167 -167
  518. package/lib/main/node/plugins-key-value-storage.js.map +1 -1
  519. package/lib/main/node/plugins-key-value-storage.spec.d.ts +16 -16
  520. package/lib/main/node/plugins-key-value-storage.spec.js +100 -100
  521. package/lib/main/node/resolvers/local-directory-plugin-deployer-resolver.d.ts +7 -7
  522. package/lib/main/node/resolvers/local-directory-plugin-deployer-resolver.js +43 -43
  523. package/lib/main/node/resolvers/local-plugin-deployer-resolver.d.ts +8 -8
  524. package/lib/main/node/resolvers/local-plugin-deployer-resolver.js +59 -59
  525. package/lib/main/node/temp-dir-util.d.ts +2 -2
  526. package/lib/main/node/temp-dir-util.js +39 -39
  527. package/lib/main/node/webview-backend-security-warnings.d.ts +5 -5
  528. package/lib/main/node/webview-backend-security-warnings.js +51 -51
  529. package/lib/plugin/authentication-ext.d.ts +30 -30
  530. package/lib/plugin/authentication-ext.js +94 -94
  531. package/lib/plugin/clipboard-ext.d.ts +10 -9
  532. package/lib/plugin/clipboard-ext.d.ts.map +1 -1
  533. package/lib/plugin/clipboard-ext.js +55 -31
  534. package/lib/plugin/clipboard-ext.js.map +1 -1
  535. package/lib/plugin/command-registry.d.ts +41 -41
  536. package/lib/plugin/command-registry.js +182 -182
  537. package/lib/plugin/comments.d.ts +92 -92
  538. package/lib/plugin/comments.js +392 -392
  539. package/lib/plugin/custom-editors.d.ts +47 -47
  540. package/lib/plugin/custom-editors.js +255 -255
  541. package/lib/plugin/custom-editors.js.map +1 -1
  542. package/lib/plugin/debug/debug-ext.d.ts +88 -86
  543. package/lib/plugin/debug/debug-ext.d.ts.map +1 -1
  544. package/lib/plugin/debug/debug-ext.js +421 -394
  545. package/lib/plugin/debug/debug-ext.js.map +1 -1
  546. package/lib/plugin/debug/plugin-debug-adapter-creator.d.ts +10 -10
  547. package/lib/plugin/debug/plugin-debug-adapter-creator.js +41 -41
  548. package/lib/plugin/debug/plugin-debug-adapter-session.d.ts +26 -26
  549. package/lib/plugin/debug/plugin-debug-adapter-session.js +96 -96
  550. package/lib/plugin/debug/plugin-debug-adapter-tracker.d.ts +12 -12
  551. package/lib/plugin/debug/plugin-debug-adapter-tracker.js +77 -77
  552. package/lib/plugin/decorations.d.ts +14 -14
  553. package/lib/plugin/decorations.js +112 -112
  554. package/lib/plugin/dialogs.d.ts +10 -10
  555. package/lib/plugin/dialogs.js +91 -91
  556. package/lib/plugin/document-data.d.ts +38 -38
  557. package/lib/plugin/document-data.js +309 -309
  558. package/lib/plugin/documents.d.ts +56 -56
  559. package/lib/plugin/documents.js +253 -253
  560. package/lib/plugin/documents.js.map +1 -1
  561. package/lib/plugin/editors-and-documents.d.ts +25 -26
  562. package/lib/plugin/editors-and-documents.d.ts.map +1 -1
  563. package/lib/plugin/editors-and-documents.js +154 -137
  564. package/lib/plugin/editors-and-documents.js.map +1 -1
  565. package/lib/plugin/env.d.ts +38 -34
  566. package/lib/plugin/env.d.ts.map +1 -1
  567. package/lib/plugin/env.js +118 -85
  568. package/lib/plugin/env.js.map +1 -1
  569. package/lib/plugin/file-system-event-service-ext-impl.d.ts +40 -40
  570. package/lib/plugin/file-system-event-service-ext-impl.js +203 -203
  571. package/lib/plugin/file-system-ext-impl.d.ts +56 -56
  572. package/lib/plugin/file-system-ext-impl.js +346 -346
  573. package/lib/plugin/known-commands.d.ts +5 -5
  574. package/lib/plugin/known-commands.d.ts.map +1 -1
  575. package/lib/plugin/known-commands.js +400 -399
  576. package/lib/plugin/known-commands.js.map +1 -1
  577. package/lib/plugin/known-commands.spec.d.ts +1 -1
  578. package/lib/plugin/known-commands.spec.js +42 -42
  579. package/lib/plugin/label-service.d.ts +11 -11
  580. package/lib/plugin/label-service.js +35 -35
  581. package/lib/plugin/languages/call-hierarchy.d.ts +20 -20
  582. package/lib/plugin/languages/call-hierarchy.js +101 -101
  583. package/lib/plugin/languages/code-action.d.ts +24 -24
  584. package/lib/plugin/languages/code-action.js +137 -137
  585. package/lib/plugin/languages/color.d.ts +12 -12
  586. package/lib/plugin/languages/color.js +58 -58
  587. package/lib/plugin/languages/completion.d.ts +20 -20
  588. package/lib/plugin/languages/completion.js +164 -164
  589. package/lib/plugin/languages/declaration.d.ts +11 -11
  590. package/lib/plugin/languages/declaration.js +58 -58
  591. package/lib/plugin/languages/definition.d.ts +11 -11
  592. package/lib/plugin/languages/definition.js +58 -58
  593. package/lib/plugin/languages/diagnostics.d.ts +49 -49
  594. package/lib/plugin/languages/diagnostics.js +281 -281
  595. package/lib/plugin/languages/diagnostics.js.map +1 -1
  596. package/lib/plugin/languages/document-drop-edit.d.ts +15 -15
  597. package/lib/plugin/languages/document-drop-edit.js +22 -22
  598. package/lib/plugin/languages/document-formatting.d.ts +10 -10
  599. package/lib/plugin/languages/document-formatting.js +40 -40
  600. package/lib/plugin/languages/document-highlight.d.ts +12 -12
  601. package/lib/plugin/languages/document-highlight.js +50 -50
  602. package/lib/plugin/languages/evaluatable-expression.d.ts +11 -11
  603. package/lib/plugin/languages/evaluatable-expression.js +40 -40
  604. package/lib/plugin/languages/folding.d.ts +10 -10
  605. package/lib/plugin/languages/folding.js +39 -39
  606. package/lib/plugin/languages/hover.d.ts +11 -11
  607. package/lib/plugin/languages/hover.js +48 -48
  608. package/lib/plugin/languages/implementation.d.ts +11 -11
  609. package/lib/plugin/languages/implementation.js +58 -58
  610. package/lib/plugin/languages/inlay-hints.d.ts +19 -19
  611. package/lib/plugin/languages/inlay-hints.js +127 -127
  612. package/lib/plugin/languages/inline-completion.d.ts +20 -20
  613. package/lib/plugin/languages/inline-completion.js +93 -93
  614. package/lib/plugin/languages/inline-values.d.ts +10 -10
  615. package/lib/plugin/languages/inline-values.js +44 -44
  616. package/lib/plugin/languages/lens.d.ts +19 -19
  617. package/lib/plugin/languages/lens.js +89 -89
  618. package/lib/plugin/languages/link-provider.d.ts +14 -14
  619. package/lib/plugin/languages/link-provider.d.ts.map +1 -1
  620. package/lib/plugin/languages/link-provider.js +73 -71
  621. package/lib/plugin/languages/link-provider.js.map +1 -1
  622. package/lib/plugin/languages/linked-editing-range.d.ts +11 -11
  623. package/lib/plugin/languages/linked-editing-range.js +40 -40
  624. package/lib/plugin/languages/on-type-formatting.d.ts +11 -11
  625. package/lib/plugin/languages/on-type-formatting.js +41 -41
  626. package/lib/plugin/languages/outline.d.ts +20 -20
  627. package/lib/plugin/languages/outline.js +115 -115
  628. package/lib/plugin/languages/range-formatting.d.ts +10 -10
  629. package/lib/plugin/languages/range-formatting.js +41 -41
  630. package/lib/plugin/languages/reference.d.ts +11 -11
  631. package/lib/plugin/languages/reference.js +47 -47
  632. package/lib/plugin/languages/rename.d.ts +14 -14
  633. package/lib/plugin/languages/rename.js +114 -114
  634. package/lib/plugin/languages/selection-range.d.ts +11 -11
  635. package/lib/plugin/languages/selection-range.js +65 -65
  636. package/lib/plugin/languages/semantic-highlighting.d.ts +28 -28
  637. package/lib/plugin/languages/semantic-highlighting.js +175 -175
  638. package/lib/plugin/languages/signature.d.ts +15 -15
  639. package/lib/plugin/languages/signature.js +71 -71
  640. package/lib/plugin/languages/type-definition.d.ts +11 -11
  641. package/lib/plugin/languages/type-definition.js +58 -58
  642. package/lib/plugin/languages/type-hierarchy.d.ts +18 -18
  643. package/lib/plugin/languages/type-hierarchy.js +95 -95
  644. package/lib/plugin/languages/util.d.ts +4 -4
  645. package/lib/plugin/languages/util.js +27 -27
  646. package/lib/plugin/languages/workspace-symbol.d.ts +8 -8
  647. package/lib/plugin/languages/workspace-symbol.js +61 -61
  648. package/lib/plugin/languages-utils.d.ts +6 -6
  649. package/lib/plugin/languages-utils.js +65 -65
  650. package/lib/plugin/languages.d.ts +127 -127
  651. package/lib/plugin/languages.js +712 -712
  652. package/lib/plugin/localization-ext.d.ts +17 -16
  653. package/lib/plugin/localization-ext.d.ts.map +1 -1
  654. package/lib/plugin/localization-ext.js +99 -73
  655. package/lib/plugin/localization-ext.js.map +1 -1
  656. package/lib/plugin/markdown-string.d.ts +24 -24
  657. package/lib/plugin/markdown-string.d.ts.map +1 -1
  658. package/lib/plugin/markdown-string.js +124 -124
  659. package/lib/plugin/markdown-string.js.map +1 -1
  660. package/lib/plugin/message-registry.d.ts +9 -8
  661. package/lib/plugin/message-registry.d.ts.map +1 -1
  662. package/lib/plugin/message-registry.js +84 -60
  663. package/lib/plugin/message-registry.js.map +1 -1
  664. package/lib/plugin/node/debug/debug.spec.d.ts +1 -1
  665. package/lib/plugin/node/debug/debug.spec.js +87 -67
  666. package/lib/plugin/node/debug/debug.spec.js.map +1 -1
  667. package/lib/plugin/node/debug/plugin-node-debug-adapter-creator.d.ts +17 -17
  668. package/lib/plugin/node/debug/plugin-node-debug-adapter-creator.js +154 -154
  669. package/lib/plugin/node/env-node-ext.d.ts +16 -21
  670. package/lib/plugin/node/env-node-ext.d.ts.map +1 -1
  671. package/lib/plugin/node/env-node-ext.js +71 -63
  672. package/lib/plugin/node/env-node-ext.js.map +1 -1
  673. package/lib/plugin/node/plugin-container-module.d.ts +75 -0
  674. package/lib/plugin/node/plugin-container-module.d.ts.map +1 -0
  675. package/lib/plugin/node/plugin-container-module.js +115 -0
  676. package/lib/plugin/node/plugin-container-module.js.map +1 -0
  677. package/lib/plugin/notebook/notebook-document.d.ts +61 -61
  678. package/lib/plugin/notebook/notebook-document.js +372 -372
  679. package/lib/plugin/notebook/notebook-documents.d.ts +16 -16
  680. package/lib/plugin/notebook/notebook-documents.js +47 -47
  681. package/lib/plugin/notebook/notebook-editor.d.ts +20 -20
  682. package/lib/plugin/notebook/notebook-editor.js +98 -98
  683. package/lib/plugin/notebook/notebook-editors.d.ts +13 -13
  684. package/lib/plugin/notebook/notebook-editors.js +64 -64
  685. package/lib/plugin/notebook/notebook-kernels.d.ts +35 -36
  686. package/lib/plugin/notebook/notebook-kernels.d.ts.map +1 -1
  687. package/lib/plugin/notebook/notebook-kernels.js +516 -516
  688. package/lib/plugin/notebook/notebook-kernels.js.map +1 -1
  689. package/lib/plugin/notebook/notebook-renderers.d.ts +13 -13
  690. package/lib/plugin/notebook/notebook-renderers.d.ts.map +1 -1
  691. package/lib/plugin/notebook/notebook-renderers.js +62 -62
  692. package/lib/plugin/notebook/notebook-renderers.js.map +1 -1
  693. package/lib/plugin/notebook/notebooks.d.ts +57 -56
  694. package/lib/plugin/notebook/notebooks.d.ts.map +1 -1
  695. package/lib/plugin/notebook/notebooks.js +316 -297
  696. package/lib/plugin/notebook/notebooks.js.map +1 -1
  697. package/lib/plugin/notification.d.ts +17 -17
  698. package/lib/plugin/notification.js +67 -67
  699. package/lib/plugin/output-channel/log-output-channel.d.ts +23 -23
  700. package/lib/plugin/output-channel/log-output-channel.js +91 -91
  701. package/lib/plugin/output-channel/output-channel-item.d.ts +17 -17
  702. package/lib/plugin/output-channel/output-channel-item.js +51 -51
  703. package/lib/plugin/output-channel-registry.d.ts +13 -13
  704. package/lib/plugin/output-channel-registry.js +44 -44
  705. package/lib/plugin/path.d.ts +2 -2
  706. package/lib/plugin/path.js +59 -59
  707. package/lib/plugin/path.spec.d.ts +1 -1
  708. package/lib/plugin/path.spec.js +34 -34
  709. package/lib/plugin/plugin-context.d.ts +58 -58
  710. package/lib/plugin/plugin-context.d.ts.map +1 -1
  711. package/lib/plugin/plugin-context.js +1185 -1170
  712. package/lib/plugin/plugin-context.js.map +1 -1
  713. package/lib/plugin/plugin-icon-path.d.ts +11 -11
  714. package/lib/plugin/plugin-icon-path.js +49 -49
  715. package/lib/plugin/plugin-manager.d.ts +92 -83
  716. package/lib/plugin/plugin-manager.d.ts.map +1 -1
  717. package/lib/plugin/plugin-manager.js +428 -358
  718. package/lib/plugin/plugin-manager.js.map +1 -1
  719. package/lib/plugin/plugin-storage.d.ts +44 -36
  720. package/lib/plugin/plugin-storage.d.ts.map +1 -1
  721. package/lib/plugin/plugin-storage.js +119 -99
  722. package/lib/plugin/plugin-storage.js.map +1 -1
  723. package/lib/plugin/preference-registry.d.ts +40 -39
  724. package/lib/plugin/preference-registry.d.ts.map +1 -1
  725. package/lib/plugin/preference-registry.js +317 -287
  726. package/lib/plugin/preference-registry.js.map +1 -1
  727. package/lib/plugin/preference-registry.spec.d.ts +1 -1
  728. package/lib/plugin/preference-registry.spec.js +246 -239
  729. package/lib/plugin/preference-registry.spec.js.map +1 -1
  730. package/lib/plugin/prefix-sum-computer.d.ts +30 -30
  731. package/lib/plugin/prefix-sum-computer.js +172 -172
  732. package/lib/plugin/quick-open.d.ts +195 -202
  733. package/lib/plugin/quick-open.d.ts.map +1 -1
  734. package/lib/plugin/quick-open.js +622 -638
  735. package/lib/plugin/quick-open.js.map +1 -1
  736. package/lib/plugin/scm.d.ts +53 -53
  737. package/lib/plugin/scm.js +726 -726
  738. package/lib/plugin/secrets-ext.d.ts +39 -30
  739. package/lib/plugin/secrets-ext.d.ts.map +1 -1
  740. package/lib/plugin/secrets-ext.js +88 -68
  741. package/lib/plugin/secrets-ext.js.map +1 -1
  742. package/lib/plugin/status-bar/status-bar-item.d.ts +44 -44
  743. package/lib/plugin/status-bar/status-bar-item.js +122 -122
  744. package/lib/plugin/status-bar-message-registry.d.ts +20 -20
  745. package/lib/plugin/status-bar-message-registry.js +84 -84
  746. package/lib/plugin/tabs.d.ts +22 -22
  747. package/lib/plugin/tabs.js +358 -358
  748. package/lib/plugin/tasks/task-provider.d.ts +8 -8
  749. package/lib/plugin/tasks/task-provider.js +53 -53
  750. package/lib/plugin/tasks/tasks.d.ts +46 -46
  751. package/lib/plugin/tasks/tasks.js +215 -215
  752. package/lib/plugin/telemetry-ext.d.ts +43 -43
  753. package/lib/plugin/telemetry-ext.js +251 -251
  754. package/lib/plugin/terminal-ext.d.ts +113 -113
  755. package/lib/plugin/terminal-ext.d.ts.map +1 -1
  756. package/lib/plugin/terminal-ext.js +488 -468
  757. package/lib/plugin/terminal-ext.js.map +1 -1
  758. package/lib/plugin/test-item.d.ts +46 -46
  759. package/lib/plugin/test-item.js +195 -195
  760. package/lib/plugin/tests.d.ts +121 -121
  761. package/lib/plugin/tests.js +423 -423
  762. package/lib/plugin/tests.js.map +1 -1
  763. package/lib/plugin/text-editor.d.ts +104 -104
  764. package/lib/plugin/text-editor.js +464 -464
  765. package/lib/plugin/text-editors.d.ts +39 -37
  766. package/lib/plugin/text-editors.d.ts.map +1 -1
  767. package/lib/plugin/text-editors.js +132 -126
  768. package/lib/plugin/text-editors.js.map +1 -1
  769. package/lib/plugin/theming.d.ts +15 -15
  770. package/lib/plugin/theming.js +61 -61
  771. package/lib/plugin/timeline.d.ts +20 -20
  772. package/lib/plugin/timeline.js +157 -157
  773. package/lib/plugin/tree/tree-views.d.ts +107 -107
  774. package/lib/plugin/tree/tree-views.js +590 -590
  775. package/lib/plugin/type-converters.d.ts +204 -195
  776. package/lib/plugin/type-converters.d.ts.map +1 -1
  777. package/lib/plugin/type-converters.js +1676 -1637
  778. package/lib/plugin/type-converters.js.map +1 -1
  779. package/lib/plugin/type-converters.spec.d.ts +1 -1
  780. package/lib/plugin/type-converters.spec.js +395 -395
  781. package/lib/plugin/types-impl.d.ts +1653 -1633
  782. package/lib/plugin/types-impl.d.ts.map +1 -1
  783. package/lib/plugin/types-impl.js +3185 -3169
  784. package/lib/plugin/types-impl.js.map +1 -1
  785. package/lib/plugin/types-impl.spec.d.ts +1 -1
  786. package/lib/plugin/types-impl.spec.js +78 -78
  787. package/lib/plugin/webview-views.d.ts +55 -55
  788. package/lib/plugin/webview-views.d.ts.map +1 -1
  789. package/lib/plugin/webview-views.js +156 -155
  790. package/lib/plugin/webview-views.js.map +1 -1
  791. package/lib/plugin/webviews.d.ts +110 -95
  792. package/lib/plugin/webviews.d.ts.map +1 -1
  793. package/lib/plugin/webviews.js +393 -343
  794. package/lib/plugin/webviews.js.map +1 -1
  795. package/lib/plugin/window-state.d.ts +16 -16
  796. package/lib/plugin/window-state.js +54 -54
  797. package/lib/plugin/word-helper.d.ts +21 -21
  798. package/lib/plugin/word-helper.js +125 -125
  799. package/lib/plugin/workspace.d.ts +62 -61
  800. package/lib/plugin/workspace.d.ts.map +1 -1
  801. package/lib/plugin/workspace.js +445 -411
  802. package/lib/plugin/workspace.js.map +1 -1
  803. package/lib/plugin-ext-backend-electron-module.d.ts +3 -3
  804. package/lib/plugin-ext-backend-electron-module.js +24 -24
  805. package/lib/plugin-ext-backend-module.d.ts +3 -3
  806. package/lib/plugin-ext-backend-module.js +24 -24
  807. package/lib/plugin-ext-frontend-electron-module.d.ts +2 -2
  808. package/lib/plugin-ext-frontend-electron-module.js +19 -19
  809. package/lib/plugin-ext-frontend-module.d.ts +2 -2
  810. package/lib/plugin-ext-frontend-module.js +19 -19
  811. package/package.json +30 -31
  812. package/src/common/arrays.ts +70 -70
  813. package/src/common/assert.ts +23 -23
  814. package/src/common/cache.ts +51 -51
  815. package/src/common/character-classifier.ts +73 -73
  816. package/src/common/collections.ts +54 -54
  817. package/src/common/commands.ts +19 -19
  818. package/src/common/connection.ts +137 -137
  819. package/src/common/disposable-util.ts +39 -39
  820. package/src/common/editor-options.ts +74 -74
  821. package/src/common/env.ts +19 -19
  822. package/src/common/errors.ts +63 -63
  823. package/src/common/id-generator.ts +26 -26
  824. package/src/common/index.ts +24 -24
  825. package/src/common/language-pack-service.ts +34 -34
  826. package/src/common/link-computer.ts +354 -354
  827. package/src/common/object-identifier.ts +33 -33
  828. package/src/common/objects.ts +50 -50
  829. package/src/common/paths-util.ts +158 -158
  830. package/src/common/plugin-api-rpc-model.ts +897 -897
  831. package/src/common/plugin-api-rpc.ts +2686 -2669
  832. package/src/common/plugin-ext-api-contribution.ts +115 -82
  833. package/src/common/plugin-identifiers.ts +84 -84
  834. package/src/common/plugin-protocol.ts +1091 -1075
  835. package/src/common/proxy-handler.ts +141 -128
  836. package/src/common/reference-map.ts +38 -38
  837. package/src/common/rpc-protocol.ts +310 -272
  838. package/src/common/semantic-tokens-dto.ts +182 -182
  839. package/src/common/test-types.ts +153 -153
  840. package/src/common/types.ts +129 -129
  841. package/src/common/uint.ts +37 -37
  842. package/src/common/uri-components.ts +81 -85
  843. package/src/hosted/browser/hosted-plugin-watcher.ts +54 -54
  844. package/src/hosted/browser/hosted-plugin.ts +621 -910
  845. package/src/hosted/browser/plugin-worker.ts +52 -52
  846. package/src/hosted/browser/worker/debug-stub.ts +29 -28
  847. package/src/hosted/browser/worker/plugin-manifest-loader.ts +114 -114
  848. package/src/hosted/browser/worker/worker-env-ext.ts +42 -41
  849. package/src/hosted/browser/worker/worker-main.ts +212 -224
  850. package/src/hosted/browser/worker/worker-plugin-module.ts +80 -0
  851. package/src/hosted/common/hosted-plugin.ts +456 -0
  852. package/src/hosted/node/hosted-plugin-cli-contribution.ts +75 -75
  853. package/src/hosted/node/hosted-plugin-deployer-handler.ts +268 -268
  854. package/src/hosted/node/hosted-plugin-localization-service.ts +410 -410
  855. package/src/hosted/node/hosted-plugin-process.ts +248 -248
  856. package/src/hosted/node/hosted-plugin-protocol.ts +49 -49
  857. package/src/hosted/node/hosted-plugin.ts +116 -116
  858. package/src/hosted/node/metadata-scanner.ts +64 -64
  859. package/src/hosted/node/plugin-activation-events.ts +112 -112
  860. package/src/hosted/node/plugin-ext-hosted-backend-module.ts +94 -92
  861. package/src/hosted/node/plugin-host-module.ts +69 -0
  862. package/src/hosted/node/plugin-host-proxy.ts +82 -82
  863. package/src/hosted/node/plugin-host-rpc.ts +377 -218
  864. package/src/hosted/node/plugin-host.ts +110 -108
  865. package/src/hosted/node/plugin-language-pack-service.ts +43 -43
  866. package/src/hosted/node/plugin-manifest-loader.ts +32 -32
  867. package/src/hosted/node/plugin-reader.ts +136 -133
  868. package/src/hosted/node/plugin-service.ts +192 -175
  869. package/src/hosted/node/scanners/backend-init-theia.ts +71 -71
  870. package/src/hosted/node/scanners/file-plugin-uri-factory.ts +32 -32
  871. package/src/hosted/node/scanners/grammars-reader.ts +57 -57
  872. package/src/hosted/node/scanners/plugin-uri-factory.ts +33 -33
  873. package/src/hosted/node/scanners/scanner-theia.ts +951 -911
  874. package/src/hosted/node-electron/plugin-ext-hosted-electron-backend-module.ts +26 -26
  875. package/src/hosted/node-electron/scanner-theia-electron.ts +32 -32
  876. package/src/main/browser/authentication-main.ts +388 -386
  877. package/src/main/browser/clipboard-main.ts +38 -38
  878. package/src/main/browser/command-registry-main.ts +123 -123
  879. package/src/main/browser/commands.ts +104 -104
  880. package/src/main/browser/comments/comment-glyph-widget.ts +66 -66
  881. package/src/main/browser/comments/comment-thread-widget.tsx +696 -696
  882. package/src/main/browser/comments/comments-context-key-service.ts +68 -68
  883. package/src/main/browser/comments/comments-contribution.ts +268 -264
  884. package/src/main/browser/comments/comments-decorator.ts +110 -110
  885. package/src/main/browser/comments/comments-main.ts +482 -482
  886. package/src/main/browser/comments/comments-service.ts +205 -205
  887. package/src/main/browser/custom-editors/custom-editor-contribution.ts +38 -38
  888. package/src/main/browser/custom-editors/custom-editor-opener.tsx +105 -105
  889. package/src/main/browser/custom-editors/custom-editor-service.ts +108 -108
  890. package/src/main/browser/custom-editors/custom-editor-widget-factory.ts +44 -44
  891. package/src/main/browser/custom-editors/custom-editor-widget.ts +129 -127
  892. package/src/main/browser/custom-editors/custom-editors-main.ts +595 -595
  893. package/src/main/browser/custom-editors/plugin-custom-editor-registry.ts +142 -142
  894. package/src/main/browser/data-transfer/data-transfer-type-converters.ts +68 -70
  895. package/src/main/browser/debug/debug-main.ts +373 -373
  896. package/src/main/browser/debug/plugin-debug-adapter-contribution.ts +48 -48
  897. package/src/main/browser/debug/plugin-debug-configuration-provider.ts +63 -63
  898. package/src/main/browser/debug/plugin-debug-service.ts +427 -427
  899. package/src/main/browser/debug/plugin-debug-session-contribution-registry.ts +76 -76
  900. package/src/main/browser/debug/plugin-debug-session-factory.ts +105 -105
  901. package/src/main/browser/decorations/decorations-main.ts +146 -146
  902. package/src/main/browser/dialogs/modal-notification.ts +112 -112
  903. package/src/main/browser/dialogs/style/modal-notification.css +123 -123
  904. package/src/main/browser/dialogs-main.ts +185 -185
  905. package/src/main/browser/documents-main.ts +289 -289
  906. package/src/main/browser/editors-and-documents-main.ts +417 -395
  907. package/src/main/browser/env-main.ts +60 -87
  908. package/src/main/browser/file-system-main-impl.ts +263 -263
  909. package/src/main/browser/hierarchy/hierarchy-types-converters.ts +189 -189
  910. package/src/main/browser/keybindings/keybindings-contribution-handler.ts +66 -66
  911. package/src/main/browser/label-service-main.ts +51 -51
  912. package/src/main/browser/languages-main.ts +1440 -1436
  913. package/src/main/browser/localization-main.ts +34 -34
  914. package/src/main/browser/main-context.ts +212 -214
  915. package/src/main/browser/main-file-system-event-service.ts +76 -76
  916. package/src/main/browser/menus/menus-contribution-handler.ts +171 -166
  917. package/src/main/browser/menus/plugin-menu-command-adapter.ts +295 -295
  918. package/src/main/browser/menus/vscode-theia-menu-mappings.ts +105 -105
  919. package/src/main/browser/message-registry-main.ts +43 -56
  920. package/src/main/browser/notebooks/notebook-documents-and-editors-main.ts +249 -252
  921. package/src/main/browser/notebooks/notebook-documents-main.ts +165 -165
  922. package/src/main/browser/notebooks/notebook-dto.ts +131 -131
  923. package/src/main/browser/notebooks/notebook-editors-main.ts +70 -70
  924. package/src/main/browser/notebooks/notebook-kernels-main.ts +327 -286
  925. package/src/main/browser/notebooks/notebook-renderers-main.ts +47 -47
  926. package/src/main/browser/notebooks/notebooks-main.ts +135 -135
  927. package/src/main/browser/notebooks/renderers/cell-output-webview.tsx +254 -201
  928. package/src/main/browser/notebooks/renderers/output-webview-internal.ts +577 -477
  929. package/src/main/browser/notebooks/renderers/webview-communication.ts +90 -79
  930. package/src/main/browser/notification-main.ts +26 -86
  931. package/src/main/browser/output-channel-registry-main.ts +53 -53
  932. package/src/main/browser/plugin-authentication-service.ts +71 -71
  933. package/src/main/browser/plugin-contribution-handler.ts +698 -690
  934. package/src/main/browser/plugin-ext-frontend-module.ts +269 -268
  935. package/src/main/browser/plugin-ext-widget.tsx +132 -132
  936. package/src/main/browser/plugin-frontend-contribution.ts +70 -70
  937. package/src/main/browser/plugin-frontend-view-contribution.ts +38 -38
  938. package/src/main/browser/plugin-icon-service.ts +92 -156
  939. package/src/main/browser/plugin-icon-theme-service.ts +625 -625
  940. package/src/main/browser/plugin-shared-style.ts +154 -154
  941. package/src/main/browser/plugin-storage.ts +55 -55
  942. package/src/main/browser/plugin-terminal-registry.ts +27 -27
  943. package/src/main/browser/preference-registry-main.ts +123 -123
  944. package/src/main/browser/quick-open-main.ts +373 -324
  945. package/src/main/browser/scm-main.ts +472 -472
  946. package/src/main/browser/secrets-main.ts +82 -82
  947. package/src/main/browser/selection-provider-command.ts +45 -46
  948. package/src/main/browser/status-bar-message-registry-main.ts +90 -90
  949. package/src/main/browser/style/comments.css +345 -345
  950. package/src/main/browser/style/index.css +84 -84
  951. package/src/main/browser/style/plugin-sidebar.css +73 -73
  952. package/src/main/browser/style/tree.css +54 -54
  953. package/src/main/browser/style/webview.css +55 -55
  954. package/src/main/browser/tabs/tabs-main.ts +333 -333
  955. package/src/main/browser/tasks-main.ts +268 -268
  956. package/src/main/browser/terminal-main.ts +304 -304
  957. package/src/main/browser/test-main.ts +618 -618
  958. package/src/main/browser/text-editor-main.ts +472 -472
  959. package/src/main/browser/text-editor-model-service.ts +102 -102
  960. package/src/main/browser/text-editors-main.ts +215 -207
  961. package/src/main/browser/theme-icon-override.ts +246 -252
  962. package/src/main/browser/theming-main.ts +42 -42
  963. package/src/main/browser/timeline-main.ts +80 -80
  964. package/src/main/browser/view/dnd-file-content-store.ts +42 -42
  965. package/src/main/browser/view/plugin-tree-view-node-label-provider.ts +81 -81
  966. package/src/main/browser/view/plugin-view-registry.ts +942 -924
  967. package/src/main/browser/view/plugin-view-widget.ts +221 -222
  968. package/src/main/browser/view/tree-view-decorator-service.ts +51 -51
  969. package/src/main/browser/view/tree-view-widget.tsx +931 -932
  970. package/src/main/browser/view/tree-views-main.ts +209 -209
  971. package/src/main/browser/view/view-context-key-service.ts +70 -70
  972. package/src/main/browser/view-column-service.ts +125 -125
  973. package/src/main/browser/webview/pre/fake.html +14 -14
  974. package/src/main/browser/webview/pre/host.js +130 -130
  975. package/src/main/browser/webview/pre/index.html +17 -17
  976. package/src/main/browser/webview/pre/main.js +682 -682
  977. package/src/main/browser/webview/pre/service-worker.js +295 -295
  978. package/src/main/browser/webview/webview-context-keys.ts +62 -49
  979. package/src/main/browser/webview/webview-environment.ts +87 -87
  980. package/src/main/browser/webview/webview-frontend-security-warnings.ts +59 -59
  981. package/src/main/browser/webview/webview-preferences.ts +72 -72
  982. package/src/main/browser/webview/webview-resource-cache.ts +88 -88
  983. package/src/main/browser/webview/webview-theme-data-provider.ts +124 -124
  984. package/src/main/browser/webview/webview-widget-factory.ts +2 -1
  985. package/src/main/browser/webview/webview.ts +719 -717
  986. package/src/main/browser/webview-views/webview-views-main.ts +154 -154
  987. package/src/main/browser/webview-views/webview-views.ts +43 -43
  988. package/src/main/browser/webviews-main.ts +282 -277
  989. package/src/main/browser/window-state-main.ts +76 -76
  990. package/src/main/browser/workspace-main.ts +424 -424
  991. package/src/main/common/basic-message-registry-main.ts +53 -0
  992. package/src/main/common/basic-notification-main.ts +86 -0
  993. package/src/main/common/env-main.ts +44 -0
  994. package/src/main/common/plugin-paths-protocol.ts +26 -26
  995. package/src/main/common/plugin-theia-environment.ts +36 -36
  996. package/src/main/common/webview-protocol.ts +28 -28
  997. package/src/main/electron-browser/plugin-ext-frontend-electron-module.ts +25 -25
  998. package/src/main/electron-browser/webview/electron-webview-widget-factory.ts +59 -59
  999. package/src/main/node/errors.spec.ts +37 -37
  1000. package/src/main/node/handlers/plugin-theia-directory-handler.ts +137 -115
  1001. package/src/main/node/handlers/plugin-theia-file-handler.ts +66 -66
  1002. package/src/main/node/paths/const.ts +21 -21
  1003. package/src/main/node/paths/plugin-paths-service.ts +163 -163
  1004. package/src/main/node/plugin-cli-contribution.ts +85 -85
  1005. package/src/main/node/plugin-deployer-contribution.ts +35 -35
  1006. package/src/main/node/plugin-deployer-directory-handler-context-impl.ts +45 -45
  1007. package/src/main/node/plugin-deployer-entry-impl.ts +132 -132
  1008. package/src/main/node/plugin-deployer-file-handler-context-impl.ts +33 -33
  1009. package/src/main/node/plugin-deployer-impl.ts +364 -360
  1010. package/src/main/node/plugin-deployer-proxy-entry-impl.ts +96 -96
  1011. package/src/main/node/plugin-deployer-resolver-context-impl.ts +55 -55
  1012. package/src/main/node/plugin-ext-backend-module.ts +97 -97
  1013. package/src/main/node/plugin-github-resolver.ts +139 -139
  1014. package/src/main/node/plugin-http-resolver.ts +92 -92
  1015. package/src/main/node/plugin-localization-server.ts +42 -42
  1016. package/src/main/node/plugin-mgmt-cli-contribution.ts +64 -64
  1017. package/src/main/node/plugin-server-handler.ts +69 -69
  1018. package/src/main/node/plugin-service.ts +97 -97
  1019. package/src/main/node/plugin-theia-deployer-participant.ts +32 -32
  1020. package/src/main/node/plugin-uninstallation-manager.ts +74 -74
  1021. package/src/main/node/plugins-key-value-storage.spec.ts +110 -110
  1022. package/src/main/node/plugins-key-value-storage.ts +161 -161
  1023. package/src/main/node/resolvers/local-directory-plugin-deployer-resolver.ts +37 -37
  1024. package/src/main/node/resolvers/local-plugin-deployer-resolver.ts +56 -56
  1025. package/src/main/node/temp-dir-util.ts +36 -36
  1026. package/src/main/node/webview-backend-security-warnings.ts +45 -45
  1027. package/src/main/style/status-bar.css +35 -35
  1028. package/src/plugin/authentication-ext.ts +125 -125
  1029. package/src/plugin/clipboard-ext.ts +43 -37
  1030. package/src/plugin/command-registry.ts +219 -219
  1031. package/src/plugin/comments.ts +549 -549
  1032. package/src/plugin/custom-editors.ts +336 -336
  1033. package/src/plugin/debug/debug-ext.ts +499 -490
  1034. package/src/plugin/debug/plugin-debug-adapter-creator.ts +50 -50
  1035. package/src/plugin/debug/plugin-debug-adapter-session.ts +106 -106
  1036. package/src/plugin/debug/plugin-debug-adapter-tracker.ts +85 -85
  1037. package/src/plugin/decorations.ts +140 -140
  1038. package/src/plugin/dialogs.ts +96 -96
  1039. package/src/plugin/document-data.ts +366 -366
  1040. package/src/plugin/documents.ts +283 -283
  1041. package/src/plugin/editors-and-documents.ts +172 -170
  1042. package/src/plugin/env.ts +129 -113
  1043. package/src/plugin/file-system-event-service-ext-impl.ts +256 -256
  1044. package/src/plugin/file-system-ext-impl.ts +402 -402
  1045. package/src/plugin/known-commands.spec.ts +50 -50
  1046. package/src/plugin/known-commands.ts +428 -427
  1047. package/src/plugin/label-service.ts +36 -36
  1048. package/src/plugin/languages/call-hierarchy.ts +124 -124
  1049. package/src/plugin/languages/code-action.ts +162 -162
  1050. package/src/plugin/languages/color.ts +75 -75
  1051. package/src/plugin/languages/completion.ts +183 -183
  1052. package/src/plugin/languages/declaration.ts +72 -72
  1053. package/src/plugin/languages/definition.ts +73 -73
  1054. package/src/plugin/languages/diagnostics.ts +325 -325
  1055. package/src/plugin/languages/document-drop-edit.ts +44 -44
  1056. package/src/plugin/languages/document-formatting.ts +47 -47
  1057. package/src/plugin/languages/document-highlight.ts +61 -61
  1058. package/src/plugin/languages/evaluatable-expression.ts +47 -47
  1059. package/src/plugin/languages/folding.ts +46 -46
  1060. package/src/plugin/languages/hover.ts +58 -58
  1061. package/src/plugin/languages/implementation.ts +73 -73
  1062. package/src/plugin/languages/inlay-hints.ts +149 -149
  1063. package/src/plugin/languages/inline-completion.ts +126 -126
  1064. package/src/plugin/languages/inline-values.ts +50 -50
  1065. package/src/plugin/languages/lens.ts +102 -102
  1066. package/src/plugin/languages/link-provider.ts +81 -79
  1067. package/src/plugin/languages/linked-editing-range.ts +48 -48
  1068. package/src/plugin/languages/on-type-formatting.ts +50 -50
  1069. package/src/plugin/languages/outline.ts +126 -126
  1070. package/src/plugin/languages/range-formatting.ts +48 -48
  1071. package/src/plugin/languages/reference.ts +58 -58
  1072. package/src/plugin/languages/rename.ts +130 -130
  1073. package/src/plugin/languages/selection-range.ts +80 -80
  1074. package/src/plugin/languages/semantic-highlighting.ts +211 -211
  1075. package/src/plugin/languages/signature.ts +82 -82
  1076. package/src/plugin/languages/type-definition.ts +73 -73
  1077. package/src/plugin/languages/type-hierarchy.ts +117 -117
  1078. package/src/plugin/languages/util.ts +26 -26
  1079. package/src/plugin/languages/workspace-symbol.ts +66 -66
  1080. package/src/plugin/languages-utils.ts +68 -68
  1081. package/src/plugin/languages.ts +1022 -1022
  1082. package/src/plugin/localization-ext.ts +89 -84
  1083. package/src/plugin/markdown-string.ts +115 -115
  1084. package/src/plugin/message-registry.ts +70 -65
  1085. package/src/plugin/node/debug/debug.spec.ts +98 -94
  1086. package/src/plugin/node/debug/plugin-node-debug-adapter-creator.ts +167 -167
  1087. package/src/plugin/node/env-node-ext.ts +64 -69
  1088. package/src/plugin/node/plugin-container-module.ts +165 -0
  1089. package/src/plugin/notebook/notebook-document.ts +438 -438
  1090. package/src/plugin/notebook/notebook-documents.ts +58 -58
  1091. package/src/plugin/notebook/notebook-editor.ts +116 -116
  1092. package/src/plugin/notebook/notebook-editors.ts +71 -71
  1093. package/src/plugin/notebook/notebook-kernels.ts +617 -618
  1094. package/src/plugin/notebook/notebook-renderers.ts +71 -72
  1095. package/src/plugin/notebook/notebooks.ts +405 -385
  1096. package/src/plugin/notification.ts +80 -80
  1097. package/src/plugin/output-channel/log-output-channel.ts +108 -108
  1098. package/src/plugin/output-channel/output-channel-item.ts +73 -73
  1099. package/src/plugin/output-channel-registry.ts +52 -52
  1100. package/src/plugin/path.spec.ts +40 -40
  1101. package/src/plugin/path.ts +68 -68
  1102. package/src/plugin/plugin-context.ts +1495 -1478
  1103. package/src/plugin/plugin-icon-path.ts +50 -50
  1104. package/src/plugin/plugin-manager.ts +493 -439
  1105. package/src/plugin/plugin-storage.ts +138 -120
  1106. package/src/plugin/preference-registry.spec.ts +288 -283
  1107. package/src/plugin/preference-registry.ts +335 -329
  1108. package/src/plugin/prefix-sum-computer.ts +218 -218
  1109. package/src/plugin/quick-open.ts +759 -773
  1110. package/src/plugin/scm.ts +919 -919
  1111. package/src/plugin/secrets-ext.ts +104 -84
  1112. package/src/plugin/status-bar/status-bar-item.ts +193 -193
  1113. package/src/plugin/status-bar-message-registry.ts +103 -103
  1114. package/src/plugin/tabs.ts +426 -426
  1115. package/src/plugin/tasks/task-provider.ts +57 -57
  1116. package/src/plugin/tasks/tasks.ts +252 -252
  1117. package/src/plugin/telemetry-ext.ts +298 -298
  1118. package/src/plugin/terminal-ext.ts +553 -551
  1119. package/src/plugin/test-item.ts +174 -174
  1120. package/src/plugin/tests.ts +506 -506
  1121. package/src/plugin/text-editor.ts +582 -582
  1122. package/src/plugin/text-editors.ts +157 -150
  1123. package/src/plugin/theming.ts +73 -73
  1124. package/src/plugin/timeline.ts +186 -186
  1125. package/src/plugin/tree/tree-views.ts +682 -682
  1126. package/src/plugin/type-converters.spec.ts +476 -476
  1127. package/src/plugin/type-converters.ts +1748 -1712
  1128. package/src/plugin/types-impl.spec.ts +85 -85
  1129. package/src/plugin/types-impl.ts +3724 -3696
  1130. package/src/plugin/webview-views.ts +228 -227
  1131. package/src/plugin/webviews.ts +459 -433
  1132. package/src/plugin/window-state.ts +68 -68
  1133. package/src/plugin/word-helper.ts +162 -162
  1134. package/src/plugin/workspace.ts +505 -495
  1135. package/src/plugin-ext-backend-electron-module.ts +24 -24
  1136. package/src/plugin-ext-backend-module.ts +24 -24
  1137. package/src/plugin-ext-frontend-electron-module.ts +19 -19
  1138. package/src/plugin-ext-frontend-module.ts +19 -19
@@ -1,1638 +1,1677 @@
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-only WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.fromHierarchyItem = exports.toLocation = exports.isModelCallHierarchyOutgoingCall = exports.isModelCallHierarchyIncomingCall = exports.isModelCallHierarchyItem = exports.isUriComponents = exports.isModelRange = exports.isModelLocation = exports.toSymbolTag = exports.fromSymbolTag = exports.toDocumentSymbol = exports.fromDocumentSymbol = exports.toCodeActionTriggerKind = exports.SymbolKind = exports.fromWorkspaceEdit = exports.SignatureHelp = exports.SignatureInformation = exports.ParameterInformation = exports.fromDocumentHighlight = exports.fromDocumentHighlightKind = exports.DocumentLink = exports.fromDefinitionLink = exports.fromTextDocumentShowOptions = exports.fromLocation = exports.toInlineValueContext = exports.fromInlineValue = exports.fromEvaluatableExpression = exports.fromHover = exports.convertCode = exports.convertDiagnosticToMarkerData = exports.fromTextEdit = exports.toCompletionItemKind = exports.fromCompletionItemKind = exports.fromGlobPattern = exports.fromDocumentSelector = exports.toMarkdown = exports.fromMarkdownOrString = exports.fromMarkdown = exports.fromManyMarkdown = exports.fromRangeOrRangeWithMessage = exports.isDecorationOptionsArr = exports.toPosition = exports.fromPosition = exports.fromRange = exports.toRange = exports.fromSelection = exports.toSelection = exports.toWebviewPanelShowOptions = exports.fromViewColumn = exports.toViewColumn = void 0;
19
- exports.TestItem = exports.TestMessage = exports.NotebookKernelSourceAction = exports.NotebookRange = exports.NotebookCellExecutionSummary = exports.NotebookCellOutputConverter = exports.NotebookCellOutputItem = exports.NotebookCellOutput = exports.NotebookCellKind = exports.NotebookCellData = exports.NotebookData = exports.NotebookStatusBarItem = exports.NotebookDocumentContentOptions = exports.DataTransfer = exports.DataTransferItem = exports.InlayHintKind = exports.pluginToPluginInfo = exports.pathOrURIToURI = exports.ViewColumn = exports.ThemableDecorationAttachmentRenderOptions = exports.ThemableDecorationRenderOptions = exports.DecorationRangeBehavior = exports.DecorationRenderOptions = exports.convertToTransferQuickPickItems = exports.fromColorPresentation = exports.toColor = exports.fromColor = exports.fromFoldingRangeKind = exports.fromFoldingRange = exports.fromSelectionRange = exports.toSymbolInformation = exports.fromSymbolInformation = exports.getShellExecutionOptions = exports.getShellArgs = exports.getCustomExecution = exports.getShellExecution = exports.getProcessExecution = exports.fromCustomExecution = exports.fromShellExecution = exports.fromProcessExecution = exports.toTask = exports.fromTask = exports.toWorkspaceFolder = exports.toTypeHierarchyItem = exports.fromTypeHierarchyItem = exports.isModelTypeHierarchyItem = exports.toCallHierarchyOutgoingCall = exports.toCallHierarchyIncomingCall = exports.toCallHierarchyItem = exports.fromCallHierarchyItem = void 0;
20
- const lstypes = require("@theia/core/shared/vscode-languageserver-protocol");
21
- const types_impl_1 = require("./types-impl");
22
- const rpc = require("../common/plugin-api-rpc");
23
- const plugin_api_rpc_1 = require("../common/plugin-api-rpc");
24
- const model = require("../common/plugin-api-rpc-model");
25
- const markdown_string_1 = require("./markdown-string");
26
- const types = require("./types-impl");
27
- const arrays_1 = require("../common/arrays");
28
- const common_1 = require("@theia/core/lib/common");
29
- const notebooks = require("@theia/notebook/lib/common");
30
- const buffer_1 = require("@theia/core/lib/common/buffer");
31
- const common_2 = require("@theia/notebook/lib/common");
32
- const markdown_rendering_1 = require("@theia/core/lib/common/markdown-rendering");
33
- const SIDE_GROUP = -2;
34
- const ACTIVE_GROUP = -1;
35
- function toViewColumn(ep) {
36
- if (typeof ep !== 'number') {
37
- return undefined;
38
- }
39
- if (ep === plugin_api_rpc_1.EditorPosition.ONE) {
40
- return types.ViewColumn.One;
41
- }
42
- else if (ep === plugin_api_rpc_1.EditorPosition.TWO) {
43
- return types.ViewColumn.Two;
44
- }
45
- else if (ep === plugin_api_rpc_1.EditorPosition.THREE) {
46
- return types.ViewColumn.Three;
47
- }
48
- else if (ep === plugin_api_rpc_1.EditorPosition.FOUR) {
49
- return types.ViewColumn.Four;
50
- }
51
- else if (ep === plugin_api_rpc_1.EditorPosition.FIVE) {
52
- return types.ViewColumn.Five;
53
- }
54
- else if (ep === plugin_api_rpc_1.EditorPosition.SIX) {
55
- return types.ViewColumn.Six;
56
- }
57
- else if (ep === plugin_api_rpc_1.EditorPosition.SEVEN) {
58
- return types.ViewColumn.Seven;
59
- }
60
- else if (ep === plugin_api_rpc_1.EditorPosition.EIGHT) {
61
- return types.ViewColumn.Eight;
62
- }
63
- else if (ep === plugin_api_rpc_1.EditorPosition.NINE) {
64
- return types.ViewColumn.Nine;
65
- }
66
- return undefined;
67
- }
68
- exports.toViewColumn = toViewColumn;
69
- function fromViewColumn(column) {
70
- if (typeof column === 'number' && column >= types.ViewColumn.One) {
71
- return column - 1;
72
- }
73
- if (column === types.ViewColumn.Beside) {
74
- return SIDE_GROUP;
75
- }
76
- return ACTIVE_GROUP;
77
- }
78
- exports.fromViewColumn = fromViewColumn;
79
- function toWebviewPanelShowOptions(options) {
80
- if (typeof options === 'object') {
81
- const showOptions = options;
82
- return {
83
- area: showOptions.area ? showOptions.area : types.WebviewPanelTargetArea.Main,
84
- viewColumn: showOptions.viewColumn ? fromViewColumn(showOptions.viewColumn) : undefined,
85
- preserveFocus: showOptions.preserveFocus ? showOptions.preserveFocus : false
86
- };
87
- }
88
- return {
89
- area: types.WebviewPanelTargetArea.Main,
90
- viewColumn: fromViewColumn(options),
91
- preserveFocus: false
92
- };
93
- }
94
- exports.toWebviewPanelShowOptions = toWebviewPanelShowOptions;
95
- function toSelection(selection) {
96
- const { selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn } = selection;
97
- const start = new types.Position(selectionStartLineNumber - 1, selectionStartColumn - 1);
98
- const end = new types.Position(positionLineNumber - 1, positionColumn - 1);
99
- return new types.Selection(start, end);
100
- }
101
- exports.toSelection = toSelection;
102
- function fromSelection(selection) {
103
- const { active, anchor } = selection;
104
- return {
105
- selectionStartLineNumber: anchor.line + 1,
106
- selectionStartColumn: anchor.character + 1,
107
- positionLineNumber: active.line + 1,
108
- positionColumn: active.character + 1
109
- };
110
- }
111
- exports.fromSelection = fromSelection;
112
- function toRange(range) {
113
- const { startLineNumber, startColumn, endLineNumber, endColumn } = range;
114
- return new types.Range(startLineNumber - 1, startColumn - 1, endLineNumber - 1, endColumn - 1);
115
- }
116
- exports.toRange = toRange;
117
- function fromRange(range) {
118
- if (!range) {
119
- return undefined;
120
- }
121
- const { start, end } = range;
122
- return {
123
- startLineNumber: start.line + 1,
124
- startColumn: start.character + 1,
125
- endLineNumber: end.line + 1,
126
- endColumn: end.character + 1
127
- };
128
- }
129
- exports.fromRange = fromRange;
130
- function fromPosition(position) {
131
- return { lineNumber: position.line + 1, column: position.character + 1 };
132
- }
133
- exports.fromPosition = fromPosition;
134
- function toPosition(position) {
135
- return new types.Position(position.lineNumber - 1, position.column - 1);
136
- }
137
- exports.toPosition = toPosition;
138
- function isDecorationOptions(arg) {
139
- return (0, common_1.isObject)(arg) && typeof arg.range !== 'undefined';
140
- }
141
- function isDecorationOptionsArr(something) {
142
- if (something.length === 0) {
143
- return true;
144
- }
145
- return isDecorationOptions(something[0]) ? true : false;
146
- }
147
- exports.isDecorationOptionsArr = isDecorationOptionsArr;
148
- function fromRangeOrRangeWithMessage(ranges) {
149
- if (isDecorationOptionsArr(ranges)) {
150
- return ranges.map(r => {
151
- let hoverMessage;
152
- if (Array.isArray(r.hoverMessage)) {
153
- hoverMessage = fromManyMarkdown(r.hoverMessage);
154
- }
155
- else if (r.hoverMessage) {
156
- hoverMessage = fromMarkdown(r.hoverMessage);
157
- }
158
- else {
159
- hoverMessage = undefined;
160
- }
161
- return {
162
- range: fromRange(r.range),
163
- hoverMessage: hoverMessage,
164
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
165
- renderOptions: r.renderOptions
166
- };
167
- });
168
- }
169
- else {
170
- return ranges.map(r => ({ range: fromRange(r) }));
171
- }
172
- }
173
- exports.fromRangeOrRangeWithMessage = fromRangeOrRangeWithMessage;
174
- function fromManyMarkdown(markup) {
175
- return markup.map(fromMarkdown);
176
- }
177
- exports.fromManyMarkdown = fromManyMarkdown;
178
- function isCodeblock(arg) {
179
- return (0, common_1.isObject)(arg)
180
- && typeof arg.language === 'string'
181
- && typeof arg.value === 'string';
182
- }
183
- function fromMarkdown(markup) {
184
- if (isCodeblock(markup)) {
185
- const { language, value } = markup;
186
- return { value: '```' + language + '\n' + value + '\n```\n' };
187
- }
188
- else if (markup instanceof markdown_string_1.MarkdownString) {
189
- return markup.toJSON();
190
- }
191
- else if (markdown_rendering_1.MarkdownString.is(markup)) {
192
- return markup;
193
- }
194
- else if (typeof markup === 'string') {
195
- return { value: markup };
196
- }
197
- else {
198
- return { value: '' };
199
- }
200
- }
201
- exports.fromMarkdown = fromMarkdown;
202
- function fromMarkdownOrString(value) {
203
- if (value === undefined) {
204
- return undefined;
205
- }
206
- else if (typeof value === 'string') {
207
- return value;
208
- }
209
- else {
210
- return fromMarkdown(value);
211
- }
212
- }
213
- exports.fromMarkdownOrString = fromMarkdownOrString;
214
- function toMarkdown(value) {
215
- const implemented = new markdown_string_1.MarkdownString(value.value, value.supportThemeIcons);
216
- implemented.isTrusted = value.isTrusted;
217
- implemented.supportHtml = value.supportHtml;
218
- implemented.baseUri = value.baseUri && types_impl_1.URI.revive(implemented.baseUri);
219
- return implemented;
220
- }
221
- exports.toMarkdown = toMarkdown;
222
- function fromDocumentSelector(selector) {
223
- if (!selector) {
224
- return undefined;
225
- }
226
- else if ((0, arrays_1.isReadonlyArray)(selector)) {
227
- return selector.map(fromDocumentSelector);
228
- }
229
- else if (typeof selector === 'string') {
230
- return selector;
231
- }
232
- else {
233
- return {
234
- language: selector.language,
235
- scheme: selector.scheme,
236
- pattern: fromGlobPattern(selector.pattern)
237
- };
238
- }
239
- }
240
- exports.fromDocumentSelector = fromDocumentSelector;
241
- function fromGlobPattern(pattern) {
242
- if (typeof pattern === 'string') {
243
- return pattern;
244
- }
245
- if (isRelativePattern(pattern)) {
246
- return new types.RelativePattern(pattern.baseUri, pattern.pattern);
247
- }
248
- return pattern;
249
- }
250
- exports.fromGlobPattern = fromGlobPattern;
251
- function isRelativePattern(obj) {
252
- const rp = obj;
253
- return rp && typeof rp.baseUri === 'string' && typeof rp.pattern === 'string';
254
- }
255
- function fromCompletionItemKind(kind) {
256
- switch (kind) {
257
- case types.CompletionItemKind.Method: return model.CompletionItemKind.Method;
258
- case types.CompletionItemKind.Function: return model.CompletionItemKind.Function;
259
- case types.CompletionItemKind.Constructor: return model.CompletionItemKind.Constructor;
260
- case types.CompletionItemKind.Field: return model.CompletionItemKind.Field;
261
- case types.CompletionItemKind.Variable: return model.CompletionItemKind.Variable;
262
- case types.CompletionItemKind.Class: return model.CompletionItemKind.Class;
263
- case types.CompletionItemKind.Interface: return model.CompletionItemKind.Interface;
264
- case types.CompletionItemKind.Struct: return model.CompletionItemKind.Struct;
265
- case types.CompletionItemKind.Module: return model.CompletionItemKind.Module;
266
- case types.CompletionItemKind.Property: return model.CompletionItemKind.Property;
267
- case types.CompletionItemKind.Unit: return model.CompletionItemKind.Unit;
268
- case types.CompletionItemKind.Value: return model.CompletionItemKind.Value;
269
- case types.CompletionItemKind.Constant: return model.CompletionItemKind.Constant;
270
- case types.CompletionItemKind.Enum: return model.CompletionItemKind.Enum;
271
- case types.CompletionItemKind.EnumMember: return model.CompletionItemKind.EnumMember;
272
- case types.CompletionItemKind.Keyword: return model.CompletionItemKind.Keyword;
273
- case types.CompletionItemKind.Snippet: return model.CompletionItemKind.Snippet;
274
- case types.CompletionItemKind.Text: return model.CompletionItemKind.Text;
275
- case types.CompletionItemKind.Color: return model.CompletionItemKind.Color;
276
- case types.CompletionItemKind.File: return model.CompletionItemKind.File;
277
- case types.CompletionItemKind.Reference: return model.CompletionItemKind.Reference;
278
- case types.CompletionItemKind.Folder: return model.CompletionItemKind.Folder;
279
- case types.CompletionItemKind.Event: return model.CompletionItemKind.Event;
280
- case types.CompletionItemKind.Operator: return model.CompletionItemKind.Operator;
281
- case types.CompletionItemKind.TypeParameter: return model.CompletionItemKind.TypeParameter;
282
- case types.CompletionItemKind.User: return model.CompletionItemKind.User;
283
- case types.CompletionItemKind.Issue: return model.CompletionItemKind.Issue;
284
- }
285
- return model.CompletionItemKind.Property;
286
- }
287
- exports.fromCompletionItemKind = fromCompletionItemKind;
288
- function toCompletionItemKind(kind) {
289
- switch (kind) {
290
- case model.CompletionItemKind.Method: return types.CompletionItemKind.Method;
291
- case model.CompletionItemKind.Function: return types.CompletionItemKind.Function;
292
- case model.CompletionItemKind.Constructor: return types.CompletionItemKind.Constructor;
293
- case model.CompletionItemKind.Field: return types.CompletionItemKind.Field;
294
- case model.CompletionItemKind.Variable: return types.CompletionItemKind.Variable;
295
- case model.CompletionItemKind.Class: return types.CompletionItemKind.Class;
296
- case model.CompletionItemKind.Interface: return types.CompletionItemKind.Interface;
297
- case model.CompletionItemKind.Struct: return types.CompletionItemKind.Struct;
298
- case model.CompletionItemKind.Module: return types.CompletionItemKind.Module;
299
- case model.CompletionItemKind.Property: return types.CompletionItemKind.Property;
300
- case model.CompletionItemKind.Unit: return types.CompletionItemKind.Unit;
301
- case model.CompletionItemKind.Value: return types.CompletionItemKind.Value;
302
- case model.CompletionItemKind.Constant: return types.CompletionItemKind.Constant;
303
- case model.CompletionItemKind.Enum: return types.CompletionItemKind.Enum;
304
- case model.CompletionItemKind.EnumMember: return types.CompletionItemKind.EnumMember;
305
- case model.CompletionItemKind.Keyword: return types.CompletionItemKind.Keyword;
306
- case model.CompletionItemKind.Snippet: return types.CompletionItemKind.Snippet;
307
- case model.CompletionItemKind.Text: return types.CompletionItemKind.Text;
308
- case model.CompletionItemKind.Color: return types.CompletionItemKind.Color;
309
- case model.CompletionItemKind.File: return types.CompletionItemKind.File;
310
- case model.CompletionItemKind.Reference: return types.CompletionItemKind.Reference;
311
- case model.CompletionItemKind.Folder: return types.CompletionItemKind.Folder;
312
- case model.CompletionItemKind.Event: return types.CompletionItemKind.Event;
313
- case model.CompletionItemKind.Operator: return types.CompletionItemKind.Operator;
314
- case model.CompletionItemKind.TypeParameter: return types.CompletionItemKind.TypeParameter;
315
- case model.CompletionItemKind.User: return types.CompletionItemKind.User;
316
- case model.CompletionItemKind.Issue: return types.CompletionItemKind.Issue;
317
- }
318
- return types.CompletionItemKind.Property;
319
- }
320
- exports.toCompletionItemKind = toCompletionItemKind;
321
- function fromTextEdit(edit) {
322
- return {
323
- text: edit.newText,
324
- range: fromRange(edit.range)
325
- };
326
- }
327
- exports.fromTextEdit = fromTextEdit;
328
- function fromSnippetTextEdit(edit) {
329
- return {
330
- text: edit.snippet.value,
331
- range: fromRange(edit.range),
332
- insertAsSnippet: true
333
- };
334
- }
335
- function convertDiagnosticToMarkerData(diagnostic) {
336
- return {
337
- code: convertCode(diagnostic.code),
338
- severity: convertSeverity(diagnostic.severity),
339
- message: diagnostic.message,
340
- source: diagnostic.source,
341
- startLineNumber: diagnostic.range.start.line + 1,
342
- startColumn: diagnostic.range.start.character + 1,
343
- endLineNumber: diagnostic.range.end.line + 1,
344
- endColumn: diagnostic.range.end.character + 1,
345
- relatedInformation: convertRelatedInformation(diagnostic.relatedInformation),
346
- tags: convertTags(diagnostic.tags)
347
- };
348
- }
349
- exports.convertDiagnosticToMarkerData = convertDiagnosticToMarkerData;
350
- function convertCode(code) {
351
- if (typeof code === 'number') {
352
- return String(code);
353
- }
354
- if (typeof code === 'string' || typeof code === 'undefined') {
355
- return code;
356
- }
357
- else {
358
- return String(code.value);
359
- }
360
- ;
361
- }
362
- exports.convertCode = convertCode;
363
- function convertSeverity(severity) {
364
- switch (severity) {
365
- case types.DiagnosticSeverity.Error: return types.MarkerSeverity.Error;
366
- case types.DiagnosticSeverity.Warning: return types.MarkerSeverity.Warning;
367
- case types.DiagnosticSeverity.Information: return types.MarkerSeverity.Info;
368
- case types.DiagnosticSeverity.Hint: return types.MarkerSeverity.Hint;
369
- }
370
- }
371
- function convertRelatedInformation(diagnosticsRelatedInformation) {
372
- if (!diagnosticsRelatedInformation) {
373
- return undefined;
374
- }
375
- const relatedInformation = [];
376
- for (const item of diagnosticsRelatedInformation) {
377
- relatedInformation.push({
378
- resource: item.location.uri.toString(),
379
- message: item.message,
380
- startLineNumber: item.location.range.start.line + 1,
381
- startColumn: item.location.range.start.character + 1,
382
- endLineNumber: item.location.range.end.line + 1,
383
- endColumn: item.location.range.end.character + 1
384
- });
385
- }
386
- return relatedInformation;
387
- }
388
- function convertTags(tags) {
389
- if (!tags) {
390
- return undefined;
391
- }
392
- const markerTags = [];
393
- for (const tag of tags) {
394
- switch (tag) {
395
- case types.DiagnosticTag.Unnecessary:
396
- markerTags.push(types.MarkerTag.Unnecessary);
397
- break;
398
- case types.DiagnosticTag.Deprecated:
399
- markerTags.push(types.MarkerTag.Deprecated);
400
- break;
401
- }
402
- }
403
- return markerTags;
404
- }
405
- function fromHover(hover) {
406
- return {
407
- range: fromRange(hover.range),
408
- contents: fromManyMarkdown(hover.contents)
409
- };
410
- }
411
- exports.fromHover = fromHover;
412
- function fromEvaluatableExpression(evaluatableExpression) {
413
- return {
414
- range: fromRange(evaluatableExpression.range),
415
- expression: evaluatableExpression.expression
416
- };
417
- }
418
- exports.fromEvaluatableExpression = fromEvaluatableExpression;
419
- function fromInlineValue(inlineValue) {
420
- if (inlineValue instanceof types_impl_1.InlineValueText) {
421
- return {
422
- type: 'text',
423
- range: fromRange(inlineValue.range),
424
- text: inlineValue.text
425
- };
426
- }
427
- else if (inlineValue instanceof types_impl_1.InlineValueVariableLookup) {
428
- return {
429
- type: 'variable',
430
- range: fromRange(inlineValue.range),
431
- variableName: inlineValue.variableName,
432
- caseSensitiveLookup: inlineValue.caseSensitiveLookup
433
- };
434
- }
435
- else if (inlineValue instanceof types_impl_1.InlineValueEvaluatableExpression) {
436
- return {
437
- type: 'expression',
438
- range: fromRange(inlineValue.range),
439
- expression: inlineValue.expression
440
- };
441
- }
442
- else {
443
- throw new Error('Unknown InlineValue type');
444
- }
445
- }
446
- exports.fromInlineValue = fromInlineValue;
447
- function toInlineValueContext(inlineValueContext) {
448
- const ivLocation = inlineValueContext.stoppedLocation;
449
- return {
450
- frameId: inlineValueContext.frameId,
451
- stoppedLocation: new types.Range(ivLocation.startLineNumber, ivLocation.startColumn, ivLocation.endLineNumber, ivLocation.endColumn)
452
- };
453
- }
454
- exports.toInlineValueContext = toInlineValueContext;
455
- function fromLocation(location) {
456
- if (!location) {
457
- return undefined;
458
- }
459
- return {
460
- uri: location.uri,
461
- range: fromRange(location.range)
462
- };
463
- }
464
- exports.fromLocation = fromLocation;
465
- function fromTextDocumentShowOptions(options) {
466
- if (options.selection) {
467
- return {
468
- ...options,
469
- selection: fromRange(options.selection),
470
- };
471
- }
472
- return options;
473
- }
474
- exports.fromTextDocumentShowOptions = fromTextDocumentShowOptions;
475
- function fromDefinitionLink(definitionLink) {
476
- return {
477
- uri: definitionLink.targetUri,
478
- range: fromRange(definitionLink.targetRange),
479
- originSelectionRange: definitionLink.originSelectionRange ? fromRange(definitionLink.originSelectionRange) : undefined,
480
- targetSelectionRange: definitionLink.targetSelectionRange ? fromRange(definitionLink.targetSelectionRange) : undefined
481
- };
482
- }
483
- exports.fromDefinitionLink = fromDefinitionLink;
484
- var DocumentLink;
485
- (function (DocumentLink) {
486
- function from(link) {
487
- return {
488
- range: fromRange(link.range),
489
- url: link.target,
490
- tooltip: link.tooltip
491
- };
492
- }
493
- DocumentLink.from = from;
494
- function to(link) {
495
- let target = undefined;
496
- if (link.url) {
497
- try {
498
- target = typeof link.url === 'string' ? types_impl_1.URI.parse(link.url, true) : types_impl_1.URI.revive(link.url);
499
- }
500
- catch (err) {
501
- // ignore
502
- }
503
- }
504
- return new types.DocumentLink(toRange(link.range), target);
505
- }
506
- DocumentLink.to = to;
507
- })(DocumentLink = exports.DocumentLink || (exports.DocumentLink = {}));
508
- function fromDocumentHighlightKind(kind) {
509
- switch (kind) {
510
- case types.DocumentHighlightKind.Text: return model.DocumentHighlightKind.Text;
511
- case types.DocumentHighlightKind.Read: return model.DocumentHighlightKind.Read;
512
- case types.DocumentHighlightKind.Write: return model.DocumentHighlightKind.Write;
513
- }
514
- return model.DocumentHighlightKind.Text;
515
- }
516
- exports.fromDocumentHighlightKind = fromDocumentHighlightKind;
517
- function fromDocumentHighlight(documentHighlight) {
518
- return {
519
- range: fromRange(documentHighlight.range),
520
- kind: fromDocumentHighlightKind(documentHighlight.kind)
521
- };
522
- }
523
- exports.fromDocumentHighlight = fromDocumentHighlight;
524
- var ParameterInformation;
525
- (function (ParameterInformation) {
526
- function from(info) {
527
- return {
528
- label: info.label,
529
- documentation: info.documentation ? fromMarkdown(info.documentation) : undefined
530
- };
531
- }
532
- ParameterInformation.from = from;
533
- function to(info) {
534
- return {
535
- label: info.label,
536
- documentation: markdown_rendering_1.MarkdownString.is(info.documentation) ? toMarkdown(info.documentation) : info.documentation
537
- };
538
- }
539
- ParameterInformation.to = to;
540
- })(ParameterInformation = exports.ParameterInformation || (exports.ParameterInformation = {}));
541
- var SignatureInformation;
542
- (function (SignatureInformation) {
543
- function from(info) {
544
- return {
545
- label: info.label,
546
- documentation: info.documentation ? fromMarkdown(info.documentation) : undefined,
547
- parameters: info.parameters && info.parameters.map(ParameterInformation.from),
548
- activeParameter: info.activeParameter
549
- };
550
- }
551
- SignatureInformation.from = from;
552
- function to(info) {
553
- return {
554
- label: info.label,
555
- documentation: markdown_rendering_1.MarkdownString.is(info.documentation) ? toMarkdown(info.documentation) : info.documentation,
556
- parameters: info.parameters && info.parameters.map(ParameterInformation.to),
557
- activeParameter: info.activeParameter
558
- };
559
- }
560
- SignatureInformation.to = to;
561
- })(SignatureInformation = exports.SignatureInformation || (exports.SignatureInformation = {}));
562
- var SignatureHelp;
563
- (function (SignatureHelp) {
564
- function from(id, help) {
565
- return {
566
- id,
567
- activeSignature: help.activeSignature,
568
- activeParameter: help.activeParameter,
569
- signatures: help.signatures && help.signatures.map(SignatureInformation.from)
570
- };
571
- }
572
- SignatureHelp.from = from;
573
- function to(help) {
574
- return {
575
- activeSignature: help.activeSignature,
576
- activeParameter: help.activeParameter,
577
- signatures: help.signatures && help.signatures.map(SignatureInformation.to)
578
- };
579
- }
580
- SignatureHelp.to = to;
581
- })(SignatureHelp = exports.SignatureHelp || (exports.SignatureHelp = {}));
582
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
583
- function fromWorkspaceEdit(value, documents) {
584
- const result = {
585
- edits: []
586
- };
587
- for (const entry of value._allEntries()) {
588
- if ((entry === null || entry === void 0 ? void 0 : entry._type) === 2 /* Text */) {
589
- // text edits
590
- const doc = documents ? documents.getDocument(entry.uri.toString()) : undefined;
591
- const workspaceTextEditDto = {
592
- resource: entry.uri,
593
- modelVersionId: doc === null || doc === void 0 ? void 0 : doc.version,
594
- textEdit: (entry.edit instanceof types.TextEdit) ? fromTextEdit(entry.edit) : fromSnippetTextEdit(entry.edit),
595
- metadata: entry.metadata
596
- };
597
- result.edits.push(workspaceTextEditDto);
598
- }
599
- else if ((entry === null || entry === void 0 ? void 0 : entry._type) === 1 /* File */) {
600
- // resource edits
601
- const workspaceFileEditDto = {
602
- oldResource: entry.from,
603
- newResource: entry.to,
604
- options: entry.options,
605
- metadata: entry.metadata
606
- };
607
- result.edits.push(workspaceFileEditDto);
608
- }
609
- else if ((entry === null || entry === void 0 ? void 0 : entry._type) === 3 /* Cell */) {
610
- // cell edit
611
- if (entry.edit) {
612
- result.edits.push({
613
- metadata: entry.metadata,
614
- resource: entry.uri,
615
- cellEdit: entry.edit,
616
- });
617
- }
618
- }
619
- else if ((entry === null || entry === void 0 ? void 0 : entry._type) === 5 /* CellReplace */) {
620
- // cell replace
621
- result.edits.push({
622
- metadata: entry.metadata,
623
- resource: entry.uri,
624
- cellEdit: {
625
- editType: 1 /* Replace */,
626
- index: entry.index,
627
- count: entry.count,
628
- cells: entry.cells.map(NotebookCellData.from)
629
- }
630
- });
631
- }
632
- }
633
- return result;
634
- }
635
- exports.fromWorkspaceEdit = fromWorkspaceEdit;
636
- var SymbolKind;
637
- (function (SymbolKind) {
638
- const fromMapping = Object.create(null);
639
- fromMapping[model.SymbolKind.File] = model.SymbolKind.File;
640
- fromMapping[model.SymbolKind.Module] = model.SymbolKind.Module;
641
- fromMapping[model.SymbolKind.Namespace] = model.SymbolKind.Namespace;
642
- fromMapping[model.SymbolKind.Package] = model.SymbolKind.Package;
643
- fromMapping[model.SymbolKind.Class] = model.SymbolKind.Class;
644
- fromMapping[model.SymbolKind.Method] = model.SymbolKind.Method;
645
- fromMapping[model.SymbolKind.Property] = model.SymbolKind.Property;
646
- fromMapping[model.SymbolKind.Field] = model.SymbolKind.Field;
647
- fromMapping[model.SymbolKind.Constructor] = model.SymbolKind.Constructor;
648
- fromMapping[model.SymbolKind.Enum] = model.SymbolKind.Enum;
649
- fromMapping[model.SymbolKind.Interface] = model.SymbolKind.Interface;
650
- fromMapping[model.SymbolKind.Function] = model.SymbolKind.Function;
651
- fromMapping[model.SymbolKind.Variable] = model.SymbolKind.Variable;
652
- fromMapping[model.SymbolKind.Constant] = model.SymbolKind.Constant;
653
- fromMapping[model.SymbolKind.String] = model.SymbolKind.String;
654
- fromMapping[model.SymbolKind.Number] = model.SymbolKind.Number;
655
- fromMapping[model.SymbolKind.Boolean] = model.SymbolKind.Boolean;
656
- fromMapping[model.SymbolKind.Array] = model.SymbolKind.Array;
657
- fromMapping[model.SymbolKind.Object] = model.SymbolKind.Object;
658
- fromMapping[model.SymbolKind.Key] = model.SymbolKind.Key;
659
- fromMapping[model.SymbolKind.Null] = model.SymbolKind.Null;
660
- fromMapping[model.SymbolKind.EnumMember] = model.SymbolKind.EnumMember;
661
- fromMapping[model.SymbolKind.Struct] = model.SymbolKind.Struct;
662
- fromMapping[model.SymbolKind.Event] = model.SymbolKind.Event;
663
- fromMapping[model.SymbolKind.Operator] = model.SymbolKind.Operator;
664
- fromMapping[model.SymbolKind.TypeParameter] = model.SymbolKind.TypeParameter;
665
- function fromSymbolKind(kind) {
666
- return fromMapping[kind] || model.SymbolKind.Property;
667
- }
668
- SymbolKind.fromSymbolKind = fromSymbolKind;
669
- function toSymbolKind(kind) {
670
- for (const k in fromMapping) {
671
- if (fromMapping[k] === kind) {
672
- return Number(k);
673
- }
674
- }
675
- return model.SymbolKind.Property;
676
- }
677
- SymbolKind.toSymbolKind = toSymbolKind;
678
- })(SymbolKind = exports.SymbolKind || (exports.SymbolKind = {}));
679
- function toCodeActionTriggerKind(triggerKind) {
680
- switch (triggerKind) {
681
- case model.CodeActionTriggerKind.Invoke:
682
- return types.CodeActionTriggerKind.Invoke;
683
- case model.CodeActionTriggerKind.Automatic:
684
- return types.CodeActionTriggerKind.Automatic;
685
- }
686
- }
687
- exports.toCodeActionTriggerKind = toCodeActionTriggerKind;
688
- function fromDocumentSymbol(info) {
689
- const result = {
690
- name: info.name,
691
- detail: info.detail,
692
- range: fromRange(info.range),
693
- tags: info.tags ? info.tags.map(fromSymbolTag) : [],
694
- selectionRange: fromRange(info.selectionRange),
695
- kind: SymbolKind.fromSymbolKind(info.kind)
696
- };
697
- if (info.children) {
698
- result.children = info.children.map(fromDocumentSymbol);
699
- }
700
- return result;
701
- }
702
- exports.fromDocumentSymbol = fromDocumentSymbol;
703
- function toDocumentSymbol(symbol) {
704
- return {
705
- name: symbol.name,
706
- detail: symbol.detail,
707
- range: toRange(symbol.range),
708
- tags: symbol.tags && symbol.tags.length > 0 ? symbol.tags.map(toSymbolTag) : [],
709
- selectionRange: toRange(symbol.selectionRange),
710
- children: symbol.children ? symbol.children.map(toDocumentSymbol) : [],
711
- kind: SymbolKind.toSymbolKind(symbol.kind)
712
- };
713
- }
714
- exports.toDocumentSymbol = toDocumentSymbol;
715
- function fromSymbolTag(kind) {
716
- switch (kind) {
717
- case types.SymbolTag.Deprecated: return model.SymbolTag.Deprecated;
718
- }
719
- }
720
- exports.fromSymbolTag = fromSymbolTag;
721
- function toSymbolTag(kind) {
722
- switch (kind) {
723
- case model.SymbolTag.Deprecated: return types.SymbolTag.Deprecated;
724
- }
725
- }
726
- exports.toSymbolTag = toSymbolTag;
727
- function isModelLocation(arg) {
728
- return (0, common_1.isObject)(arg) &&
729
- isModelRange(arg.range) &&
730
- isUriComponents(arg.uri);
731
- }
732
- exports.isModelLocation = isModelLocation;
733
- function isModelRange(arg) {
734
- return (0, common_1.isObject)(arg) &&
735
- typeof arg.startLineNumber === 'number' &&
736
- typeof arg.startColumn === 'number' &&
737
- typeof arg.endLineNumber === 'number' &&
738
- typeof arg.endColumn === 'number';
739
- }
740
- exports.isModelRange = isModelRange;
741
- function isUriComponents(arg) {
742
- return (0, common_1.isObject)(arg) &&
743
- typeof arg.scheme === 'string' &&
744
- typeof arg.path === 'string' &&
745
- typeof arg.query === 'string' &&
746
- typeof arg.fragment === 'string';
747
- }
748
- exports.isUriComponents = isUriComponents;
749
- function isModelCallHierarchyItem(arg) {
750
- return (0, common_1.isObject)(arg)
751
- && isModelRange(arg.range)
752
- && isModelRange(arg.selectionRange)
753
- && isUriComponents(arg.uri)
754
- && !!arg.name;
755
- }
756
- exports.isModelCallHierarchyItem = isModelCallHierarchyItem;
757
- function isModelCallHierarchyIncomingCall(arg) {
758
- return (0, common_1.isObject)(arg) &&
759
- 'from' in arg &&
760
- 'fromRanges' in arg &&
761
- isModelCallHierarchyItem(arg.from);
762
- }
763
- exports.isModelCallHierarchyIncomingCall = isModelCallHierarchyIncomingCall;
764
- function isModelCallHierarchyOutgoingCall(arg) {
765
- return (0, common_1.isObject)(arg) &&
766
- 'to' in arg &&
767
- 'fromRanges' in arg &&
768
- isModelCallHierarchyItem(arg.to);
769
- }
770
- exports.isModelCallHierarchyOutgoingCall = isModelCallHierarchyOutgoingCall;
771
- function toLocation(value) {
772
- return new types.Location(types_impl_1.URI.revive(value.uri), toRange(value.range));
773
- }
774
- exports.toLocation = toLocation;
775
- function fromHierarchyItem(item) {
776
- return {
777
- kind: SymbolKind.fromSymbolKind(item.kind),
778
- name: item.name,
779
- detail: item.detail,
780
- uri: item.uri,
781
- range: fromRange(item.range),
782
- selectionRange: fromRange(item.selectionRange),
783
- tags: item.tags,
784
- _itemId: item._itemId,
785
- _sessionId: item._sessionId,
786
- };
787
- }
788
- exports.fromHierarchyItem = fromHierarchyItem;
789
- function fromCallHierarchyItem(item) {
790
- return fromHierarchyItem(item);
791
- }
792
- exports.fromCallHierarchyItem = fromCallHierarchyItem;
793
- function toCallHierarchyItem(value) {
794
- const item = new types.CallHierarchyItem(SymbolKind.toSymbolKind(value.kind), value.name, value.detail ? value.detail : '', types_impl_1.URI.revive(value.uri), toRange(value.range), toRange(value.selectionRange));
795
- item.tags = value.tags;
796
- item._itemId = value._itemId;
797
- item._sessionId = value._sessionId;
798
- return item;
799
- }
800
- exports.toCallHierarchyItem = toCallHierarchyItem;
801
- function toCallHierarchyIncomingCall(value) {
802
- return new types.CallHierarchyIncomingCall(toCallHierarchyItem(value.from), value.fromRanges && value.fromRanges.map(toRange));
803
- }
804
- exports.toCallHierarchyIncomingCall = toCallHierarchyIncomingCall;
805
- function toCallHierarchyOutgoingCall(value) {
806
- return new types.CallHierarchyOutgoingCall(toCallHierarchyItem(value.to), value.fromRanges && value.fromRanges.map(toRange));
807
- }
808
- exports.toCallHierarchyOutgoingCall = toCallHierarchyOutgoingCall;
809
- function isModelTypeHierarchyItem(arg) {
810
- return (0, common_1.isObject)(arg)
811
- && isModelRange(arg.range)
812
- && isModelRange(arg.selectionRange)
813
- && isUriComponents(arg.uri)
814
- && !!arg.name;
815
- }
816
- exports.isModelTypeHierarchyItem = isModelTypeHierarchyItem;
817
- function fromTypeHierarchyItem(item) {
818
- return fromHierarchyItem(item);
819
- }
820
- exports.fromTypeHierarchyItem = fromTypeHierarchyItem;
821
- function toTypeHierarchyItem(value) {
822
- const item = new types.TypeHierarchyItem(SymbolKind.toSymbolKind(value.kind), value.name, value.detail ? value.detail : '', types_impl_1.URI.revive(value.uri), toRange(value.selectionRange), toRange(value.range));
823
- item.tags = value.tags;
824
- item._itemId = value._itemId;
825
- item._sessionId = value._sessionId;
826
- return item;
827
- }
828
- exports.toTypeHierarchyItem = toTypeHierarchyItem;
829
- function toWorkspaceFolder(folder) {
830
- return {
831
- uri: types_impl_1.URI.revive(folder.uri),
832
- name: folder.name,
833
- index: folder.index
834
- };
835
- }
836
- exports.toWorkspaceFolder = toWorkspaceFolder;
837
- function fromTask(task) {
838
- if (!task) {
839
- return undefined;
840
- }
841
- const taskDto = {};
842
- taskDto.label = task.name;
843
- taskDto.source = task.source;
844
- taskDto.runOptions = { reevaluateOnRerun: task.runOptions.reevaluateOnRerun };
845
- if (task.hasProblemMatchers) {
846
- taskDto.problemMatcher = task.problemMatchers;
847
- }
848
- if ('detail' in task) {
849
- taskDto.detail = task.detail;
850
- }
851
- if (typeof task.scope === 'number') {
852
- taskDto.scope = task.scope;
853
- }
854
- else if (task.scope !== undefined) {
855
- taskDto.scope = task.scope.uri.toString();
856
- }
857
- else {
858
- taskDto.scope = types.TaskScope.Workspace;
859
- }
860
- if (task.presentationOptions) {
861
- taskDto.presentation = task.presentationOptions;
862
- }
863
- if (task.group) {
864
- taskDto.group = {
865
- kind: task.group.id,
866
- isDefault: !!task.group.isDefault
867
- };
868
- }
869
- const taskDefinition = task.definition;
870
- if (!taskDefinition) {
871
- return taskDto;
872
- }
873
- taskDto.type = taskDefinition.type;
874
- const { type, ...properties } = taskDefinition;
875
- for (const key in properties) {
876
- if (properties.hasOwnProperty(key)) {
877
- taskDto[key] = properties[key];
878
- }
879
- }
880
- const execution = task.execution;
881
- if (!execution) {
882
- return taskDto;
883
- }
884
- if (types.ShellExecution.is(execution)) {
885
- return fromShellExecution(execution, taskDto);
886
- }
887
- if (types.ProcessExecution.is(execution)) {
888
- return fromProcessExecution(execution, taskDto);
889
- }
890
- if (types.CustomExecution.is(execution)) {
891
- return fromCustomExecution(execution, taskDto);
892
- }
893
- return taskDto;
894
- }
895
- exports.fromTask = fromTask;
896
- function toTask(taskDto) {
897
- if (!taskDto) {
898
- throw new Error('Task should be provided for converting');
899
- }
900
- const { type, taskType, label, source, scope, problemMatcher, detail, command, args, options, group, presentation, runOptions, ...properties } = taskDto;
901
- const result = {};
902
- result.name = label;
903
- result.source = source;
904
- result.runOptions = runOptions !== null && runOptions !== void 0 ? runOptions : {};
905
- if (detail) {
906
- result.detail = detail;
907
- }
908
- if (typeof scope === 'string') {
909
- const uri = types_impl_1.URI.parse(scope);
910
- result.scope = {
911
- uri,
912
- name: uri.toString(),
913
- index: 0
914
- };
915
- }
916
- else {
917
- result.scope = scope;
918
- }
919
- const taskDefinition = {
920
- type: type
921
- };
922
- result.definition = taskDefinition;
923
- if (taskType === 'process') {
924
- result.execution = getProcessExecution(taskDto);
925
- }
926
- const execution = { command, args, options };
927
- if (taskType === 'shell' || types.ShellExecution.is(execution)) {
928
- result.execution = getShellExecution(taskDto);
929
- }
930
- if (taskType === 'customExecution' || types.CustomExecution.is(execution)) {
931
- result.execution = getCustomExecution(taskDto);
932
- // if taskType is customExecution, we need to put all the information into taskDefinition,
933
- // because some parameters may be in taskDefinition.
934
- taskDefinition.label = label;
935
- taskDefinition.command = command;
936
- taskDefinition.args = args;
937
- taskDefinition.options = options;
938
- }
939
- if (group) {
940
- result.group = new types.TaskGroup(group.kind, group.kind, group.isDefault);
941
- }
942
- if (presentation) {
943
- result.presentationOptions = presentation;
944
- }
945
- if (!properties) {
946
- return result;
947
- }
948
- for (const key in properties) {
949
- if (properties.hasOwnProperty(key)) {
950
- taskDefinition[key] = properties[key];
951
- }
952
- }
953
- return result;
954
- }
955
- exports.toTask = toTask;
956
- function fromProcessExecution(execution, taskDto) {
957
- taskDto.taskType = 'process';
958
- taskDto.command = execution.process;
959
- taskDto.args = execution.args;
960
- const options = execution.options;
961
- if (options) {
962
- taskDto.options = options;
963
- }
964
- return taskDto;
965
- }
966
- exports.fromProcessExecution = fromProcessExecution;
967
- function fromShellExecution(execution, taskDto) {
968
- taskDto.taskType = 'shell';
969
- const options = execution.options;
970
- if (options) {
971
- taskDto.options = getShellExecutionOptions(options);
972
- }
973
- const commandLine = execution.commandLine;
974
- if (commandLine) {
975
- taskDto.command = commandLine;
976
- return taskDto;
977
- }
978
- if (execution.command) {
979
- taskDto.command = getCommand(execution.command);
980
- taskDto.args = getShellArgs(execution.args);
981
- return taskDto;
982
- }
983
- else {
984
- throw new Error('Command is undefined');
985
- }
986
- }
987
- exports.fromShellExecution = fromShellExecution;
988
- function fromCustomExecution(execution, taskDto) {
989
- taskDto.taskType = 'customExecution';
990
- const callback = execution.callback;
991
- if (callback) {
992
- taskDto.callback = callback;
993
- return taskDto;
994
- }
995
- else {
996
- throw new Error('Converting CustomExecution callback is not implemented');
997
- }
998
- }
999
- exports.fromCustomExecution = fromCustomExecution;
1000
- function getProcessExecution(taskDto) {
1001
- return new types.ProcessExecution(taskDto.command, taskDto.args || [], taskDto.options || {});
1002
- }
1003
- exports.getProcessExecution = getProcessExecution;
1004
- function getShellExecution(taskDto) {
1005
- if (taskDto.command && Array.isArray(taskDto.args) && taskDto.args.length !== 0) {
1006
- return new types.ShellExecution(taskDto.command, taskDto.args, taskDto.options || {});
1007
- }
1008
- return new types.ShellExecution(taskDto.command || taskDto.commandLine, taskDto.options || {});
1009
- }
1010
- exports.getShellExecution = getShellExecution;
1011
- function getCustomExecution(taskDto) {
1012
- return new types.CustomExecution(taskDto.callback);
1013
- }
1014
- exports.getCustomExecution = getCustomExecution;
1015
- function getShellArgs(args) {
1016
- if (!args || args.length === 0) {
1017
- return [];
1018
- }
1019
- const element = args[0];
1020
- if (typeof element === 'string') {
1021
- return args;
1022
- }
1023
- const result = [];
1024
- const shellQuotedArgs = args;
1025
- shellQuotedArgs.forEach(arg => {
1026
- result.push(arg.value);
1027
- });
1028
- return result;
1029
- }
1030
- exports.getShellArgs = getShellArgs;
1031
- function getCommand(command) {
1032
- return typeof command === 'string' ? command : command.value;
1033
- }
1034
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1035
- function getShellExecutionOptions(options) {
1036
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1037
- const result = {};
1038
- const env = options.env;
1039
- if (env) {
1040
- result['env'] = env;
1041
- }
1042
- const executable = options.executable;
1043
- if (executable) {
1044
- result['executable'] = executable;
1045
- }
1046
- const shellQuoting = options.shellQuoting;
1047
- if (shellQuoting) {
1048
- result['shellQuoting'] = shellQuoting;
1049
- }
1050
- const shellArgs = options.shellArgs;
1051
- if (shellArgs) {
1052
- result['shellArgs'] = shellArgs;
1053
- }
1054
- const cwd = options.cwd;
1055
- if (cwd) {
1056
- Object.assign(result, { cwd });
1057
- }
1058
- return result;
1059
- }
1060
- exports.getShellExecutionOptions = getShellExecutionOptions;
1061
- function fromSymbolInformation(symbolInformation) {
1062
- if (!symbolInformation) {
1063
- return undefined;
1064
- }
1065
- if (symbolInformation.location && symbolInformation.location.range) {
1066
- const p1 = lstypes.Position.create(symbolInformation.location.range.start.line, symbolInformation.location.range.start.character);
1067
- const p2 = lstypes.Position.create(symbolInformation.location.range.end.line, symbolInformation.location.range.end.character);
1068
- return lstypes.SymbolInformation.create(symbolInformation.name, symbolInformation.kind++, lstypes.Range.create(p1, p2), symbolInformation.location.uri.toString(), symbolInformation.containerName);
1069
- }
1070
- return {
1071
- name: symbolInformation.name,
1072
- containerName: symbolInformation.containerName,
1073
- kind: symbolInformation.kind++,
1074
- location: {
1075
- uri: symbolInformation.location.uri.toString(),
1076
- range: symbolInformation.location.range,
1077
- }
1078
- };
1079
- }
1080
- exports.fromSymbolInformation = fromSymbolInformation;
1081
- function toSymbolInformation(symbolInformation) {
1082
- if (!symbolInformation) {
1083
- return undefined;
1084
- }
1085
- return {
1086
- name: symbolInformation.name,
1087
- containerName: symbolInformation.containerName,
1088
- kind: symbolInformation.kind,
1089
- location: {
1090
- uri: types_impl_1.URI.parse(symbolInformation.location.uri),
1091
- range: symbolInformation.location.range
1092
- }
1093
- };
1094
- }
1095
- exports.toSymbolInformation = toSymbolInformation;
1096
- function fromSelectionRange(selectionRange) {
1097
- return { range: fromRange(selectionRange.range) };
1098
- }
1099
- exports.fromSelectionRange = fromSelectionRange;
1100
- function fromFoldingRange(foldingRange) {
1101
- const range = {
1102
- start: foldingRange.start + 1,
1103
- end: foldingRange.end + 1
1104
- };
1105
- if (foldingRange.kind) {
1106
- range.kind = fromFoldingRangeKind(foldingRange.kind);
1107
- }
1108
- return range;
1109
- }
1110
- exports.fromFoldingRange = fromFoldingRange;
1111
- function fromFoldingRangeKind(kind) {
1112
- if (kind) {
1113
- switch (kind) {
1114
- case types.FoldingRangeKind.Comment:
1115
- return model.FoldingRangeKind.Comment;
1116
- case types.FoldingRangeKind.Imports:
1117
- return model.FoldingRangeKind.Imports;
1118
- case types.FoldingRangeKind.Region:
1119
- return model.FoldingRangeKind.Region;
1120
- }
1121
- }
1122
- return undefined;
1123
- }
1124
- exports.fromFoldingRangeKind = fromFoldingRangeKind;
1125
- function fromColor(color) {
1126
- return [color.red, color.green, color.blue, color.alpha];
1127
- }
1128
- exports.fromColor = fromColor;
1129
- function toColor(color) {
1130
- return new types.Color(color[0], color[1], color[2], color[3]);
1131
- }
1132
- exports.toColor = toColor;
1133
- function fromColorPresentation(colorPresentation) {
1134
- return {
1135
- label: colorPresentation.label,
1136
- textEdit: colorPresentation.textEdit ? fromTextEdit(colorPresentation.textEdit) : undefined,
1137
- additionalTextEdits: colorPresentation.additionalTextEdits ? colorPresentation.additionalTextEdits.map(value => fromTextEdit(value)) : undefined
1138
- };
1139
- }
1140
- exports.fromColorPresentation = fromColorPresentation;
1141
- function convertToTransferQuickPickItems(items) {
1142
- return items.map((item, index) => {
1143
- if (typeof item === 'string') {
1144
- return { type: 'item', label: item, handle: index };
1145
- }
1146
- else if (item.kind === types_impl_1.QuickPickItemKind.Separator) {
1147
- return { type: 'separator', label: item.label, handle: index };
1148
- }
1149
- else {
1150
- const { label, description, iconPath, detail, picked, alwaysShow, buttons } = item;
1151
- return {
1152
- type: 'item',
1153
- label,
1154
- description,
1155
- iconPath,
1156
- detail,
1157
- picked,
1158
- alwaysShow,
1159
- buttons,
1160
- handle: index,
1161
- };
1162
- }
1163
- });
1164
- }
1165
- exports.convertToTransferQuickPickItems = convertToTransferQuickPickItems;
1166
- var DecorationRenderOptions;
1167
- (function (DecorationRenderOptions) {
1168
- function from(options) {
1169
- return {
1170
- isWholeLine: options.isWholeLine,
1171
- rangeBehavior: options.rangeBehavior ? DecorationRangeBehavior.from(options.rangeBehavior) : undefined,
1172
- overviewRulerLane: options.overviewRulerLane,
1173
- light: options.light ? ThemableDecorationRenderOptions.from(options.light) : undefined,
1174
- dark: options.dark ? ThemableDecorationRenderOptions.from(options.dark) : undefined,
1175
- backgroundColor: options.backgroundColor,
1176
- outline: options.outline,
1177
- outlineColor: options.outlineColor,
1178
- outlineStyle: options.outlineStyle,
1179
- outlineWidth: options.outlineWidth,
1180
- border: options.border,
1181
- borderColor: options.borderColor,
1182
- borderRadius: options.borderRadius,
1183
- borderSpacing: options.borderSpacing,
1184
- borderStyle: options.borderStyle,
1185
- borderWidth: options.borderWidth,
1186
- fontStyle: options.fontStyle,
1187
- fontWeight: options.fontWeight,
1188
- textDecoration: options.textDecoration,
1189
- cursor: options.cursor,
1190
- color: options.color,
1191
- opacity: options.opacity,
1192
- letterSpacing: options.letterSpacing,
1193
- gutterIconPath: options.gutterIconPath ? pathOrURIToURI(options.gutterIconPath) : undefined,
1194
- gutterIconSize: options.gutterIconSize,
1195
- overviewRulerColor: options.overviewRulerColor,
1196
- before: options.before ? ThemableDecorationAttachmentRenderOptions.from(options.before) : undefined,
1197
- after: options.after ? ThemableDecorationAttachmentRenderOptions.from(options.after) : undefined,
1198
- };
1199
- }
1200
- DecorationRenderOptions.from = from;
1201
- })(DecorationRenderOptions = exports.DecorationRenderOptions || (exports.DecorationRenderOptions = {}));
1202
- var DecorationRangeBehavior;
1203
- (function (DecorationRangeBehavior) {
1204
- function from(value) {
1205
- if (typeof value === 'undefined') {
1206
- return value;
1207
- }
1208
- switch (value) {
1209
- case types.DecorationRangeBehavior.OpenOpen:
1210
- return rpc.TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges;
1211
- case types.DecorationRangeBehavior.ClosedClosed:
1212
- return rpc.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges;
1213
- case types.DecorationRangeBehavior.OpenClosed:
1214
- return rpc.TrackedRangeStickiness.GrowsOnlyWhenTypingBefore;
1215
- case types.DecorationRangeBehavior.ClosedOpen:
1216
- return rpc.TrackedRangeStickiness.GrowsOnlyWhenTypingAfter;
1217
- }
1218
- }
1219
- DecorationRangeBehavior.from = from;
1220
- })(DecorationRangeBehavior = exports.DecorationRangeBehavior || (exports.DecorationRangeBehavior = {}));
1221
- var ThemableDecorationRenderOptions;
1222
- (function (ThemableDecorationRenderOptions) {
1223
- function from(options) {
1224
- if (typeof options === 'undefined') {
1225
- return options;
1226
- }
1227
- return {
1228
- backgroundColor: options.backgroundColor,
1229
- outline: options.outline,
1230
- outlineColor: options.outlineColor,
1231
- outlineStyle: options.outlineStyle,
1232
- outlineWidth: options.outlineWidth,
1233
- border: options.border,
1234
- borderColor: options.borderColor,
1235
- borderRadius: options.borderRadius,
1236
- borderSpacing: options.borderSpacing,
1237
- borderStyle: options.borderStyle,
1238
- borderWidth: options.borderWidth,
1239
- fontStyle: options.fontStyle,
1240
- fontWeight: options.fontWeight,
1241
- textDecoration: options.textDecoration,
1242
- cursor: options.cursor,
1243
- color: options.color,
1244
- opacity: options.opacity,
1245
- letterSpacing: options.letterSpacing,
1246
- gutterIconPath: options.gutterIconPath ? pathOrURIToURI(options.gutterIconPath) : undefined,
1247
- gutterIconSize: options.gutterIconSize,
1248
- overviewRulerColor: options.overviewRulerColor,
1249
- before: options.before ? ThemableDecorationAttachmentRenderOptions.from(options.before) : undefined,
1250
- after: options.after ? ThemableDecorationAttachmentRenderOptions.from(options.after) : undefined,
1251
- };
1252
- }
1253
- ThemableDecorationRenderOptions.from = from;
1254
- })(ThemableDecorationRenderOptions = exports.ThemableDecorationRenderOptions || (exports.ThemableDecorationRenderOptions = {}));
1255
- var ThemableDecorationAttachmentRenderOptions;
1256
- (function (ThemableDecorationAttachmentRenderOptions) {
1257
- function from(options) {
1258
- if (typeof options === 'undefined') {
1259
- return options;
1260
- }
1261
- return {
1262
- contentText: options.contentText,
1263
- contentIconPath: options.contentIconPath ? pathOrURIToURI(options.contentIconPath) : undefined,
1264
- border: options.border,
1265
- borderColor: options.borderColor,
1266
- fontStyle: options.fontStyle,
1267
- fontWeight: options.fontWeight,
1268
- textDecoration: options.textDecoration,
1269
- color: options.color,
1270
- backgroundColor: options.backgroundColor,
1271
- margin: options.margin,
1272
- width: options.width,
1273
- height: options.height,
1274
- };
1275
- }
1276
- ThemableDecorationAttachmentRenderOptions.from = from;
1277
- })(ThemableDecorationAttachmentRenderOptions = exports.ThemableDecorationAttachmentRenderOptions || (exports.ThemableDecorationAttachmentRenderOptions = {}));
1278
- var ViewColumn;
1279
- (function (ViewColumn) {
1280
- function from(column) {
1281
- if (typeof column === 'number' && column >= types.ViewColumn.One) {
1282
- return column - 1; // adjust zero index (ViewColumn.ONE => 0)
1283
- }
1284
- if (column === types.ViewColumn.Beside) {
1285
- return SIDE_GROUP;
1286
- }
1287
- return ACTIVE_GROUP; // default is always the active group
1288
- }
1289
- ViewColumn.from = from;
1290
- function to(position) {
1291
- if (typeof position === 'number' && position >= 0) {
1292
- return position + 1; // adjust to index (ViewColumn.ONE => 1)
1293
- }
1294
- throw new Error('invalid \'EditorGroupColumn\'');
1295
- }
1296
- ViewColumn.to = to;
1297
- })(ViewColumn = exports.ViewColumn || (exports.ViewColumn = {}));
1298
- function pathOrURIToURI(value) {
1299
- if (typeof value === 'undefined') {
1300
- return value;
1301
- }
1302
- if (typeof value === 'string') {
1303
- return types_impl_1.URI.file(value);
1304
- }
1305
- else {
1306
- return value;
1307
- }
1308
- }
1309
- exports.pathOrURIToURI = pathOrURIToURI;
1310
- function pluginToPluginInfo(plugin) {
1311
- return {
1312
- id: plugin.model.id,
1313
- name: plugin.model.name,
1314
- displayName: plugin.model.displayName
1315
- };
1316
- }
1317
- exports.pluginToPluginInfo = pluginToPluginInfo;
1318
- var InlayHintKind;
1319
- (function (InlayHintKind) {
1320
- function from(kind) {
1321
- return kind;
1322
- }
1323
- InlayHintKind.from = from;
1324
- function to(kind) {
1325
- return kind;
1326
- }
1327
- InlayHintKind.to = to;
1328
- })(InlayHintKind = exports.InlayHintKind || (exports.InlayHintKind = {}));
1329
- var DataTransferItem;
1330
- (function (DataTransferItem) {
1331
- function to(mime, item, resolveFileData) {
1332
- const file = item.fileData;
1333
- if (file) {
1334
- return new class extends types.DataTransferItem {
1335
- asFile() {
1336
- return {
1337
- name: file.name,
1338
- uri: types_impl_1.URI.revive(file.uri),
1339
- data: () => resolveFileData(item.id),
1340
- };
1341
- }
1342
- }('');
1343
- }
1344
- if (mime === 'text/uri-list' && item.uriListData) {
1345
- return new types.DataTransferItem(reviveUriList(item.uriListData));
1346
- }
1347
- return new types.DataTransferItem(item.asString);
1348
- }
1349
- DataTransferItem.to = to;
1350
- function reviveUriList(parts) {
1351
- return parts.map(part => typeof part === 'string' ? part : types_impl_1.URI.revive(part).toString()).join('\r\n');
1352
- }
1353
- })(DataTransferItem = exports.DataTransferItem || (exports.DataTransferItem = {}));
1354
- var DataTransfer;
1355
- (function (DataTransfer) {
1356
- function toDataTransfer(value, resolveFileData) {
1357
- const dataTransfer = new types.DataTransfer();
1358
- for (const [mimeType, item] of value.items) {
1359
- dataTransfer.set(mimeType, DataTransferItem.to(mimeType, item, resolveFileData));
1360
- }
1361
- return dataTransfer;
1362
- }
1363
- DataTransfer.toDataTransfer = toDataTransfer;
1364
- })(DataTransfer = exports.DataTransfer || (exports.DataTransfer = {}));
1365
- var NotebookDocumentContentOptions;
1366
- (function (NotebookDocumentContentOptions) {
1367
- function from(options) {
1368
- var _a, _b, _c;
1369
- return {
1370
- transientOutputs: (_a = options === null || options === void 0 ? void 0 : options.transientOutputs) !== null && _a !== void 0 ? _a : false,
1371
- transientCellMetadata: (_b = options === null || options === void 0 ? void 0 : options.transientCellMetadata) !== null && _b !== void 0 ? _b : {},
1372
- transientDocumentMetadata: (_c = options === null || options === void 0 ? void 0 : options.transientDocumentMetadata) !== null && _c !== void 0 ? _c : {},
1373
- };
1374
- }
1375
- NotebookDocumentContentOptions.from = from;
1376
- })(NotebookDocumentContentOptions = exports.NotebookDocumentContentOptions || (exports.NotebookDocumentContentOptions = {}));
1377
- var NotebookStatusBarItem;
1378
- (function (NotebookStatusBarItem) {
1379
- function from(item, commandsConverter, disposables) {
1380
- const command = typeof item.command === 'string' ? { title: '', command: item.command } : item.command;
1381
- return {
1382
- alignment: item.alignment === types.NotebookCellStatusBarAlignment.Left ? 1 /* Left */ : 2 /* Right */,
1383
- command: commandsConverter.toSafeCommand(command, disposables),
1384
- text: item.text,
1385
- tooltip: item.tooltip,
1386
- priority: item.priority
1387
- };
1388
- }
1389
- NotebookStatusBarItem.from = from;
1390
- })(NotebookStatusBarItem = exports.NotebookStatusBarItem || (exports.NotebookStatusBarItem = {}));
1391
- var NotebookData;
1392
- (function (NotebookData) {
1393
- function from(data) {
1394
- var _a;
1395
- const res = {
1396
- metadata: (_a = data.metadata) !== null && _a !== void 0 ? _a : Object.create(null),
1397
- cells: [],
1398
- };
1399
- for (const cell of data.cells) {
1400
- // types.NotebookCellData.validate(cell);
1401
- res.cells.push(NotebookCellData.from(cell));
1402
- }
1403
- return res;
1404
- }
1405
- NotebookData.from = from;
1406
- function to(data) {
1407
- const res = new types.NotebookData(data.cells.map(NotebookCellData.to));
1408
- if (!(0, common_1.isEmptyObject)(data.metadata)) {
1409
- res.metadata = data.metadata;
1410
- }
1411
- return res;
1412
- }
1413
- NotebookData.to = to;
1414
- })(NotebookData = exports.NotebookData || (exports.NotebookData = {}));
1415
- var NotebookCellData;
1416
- (function (NotebookCellData) {
1417
- function from(data) {
1418
- return {
1419
- cellKind: NotebookCellKind.from(data.kind),
1420
- language: data.languageId,
1421
- source: data.value,
1422
- // metadata: data.metadata,
1423
- // internalMetadata: NotebookCellExecutionSummary.from(data.executionSummary ?? {}),
1424
- outputs: data.outputs ? data.outputs.map(NotebookCellOutputConverter.from) : []
1425
- };
1426
- }
1427
- NotebookCellData.from = from;
1428
- function to(data) {
1429
- return new types.NotebookCellData(NotebookCellKind.to(data.cellKind), data.source, data.language, data.outputs ? data.outputs.map(NotebookCellOutput.to) : undefined, data.metadata, data.internalMetadata ? NotebookCellExecutionSummary.to(data.internalMetadata) : undefined);
1430
- }
1431
- NotebookCellData.to = to;
1432
- })(NotebookCellData = exports.NotebookCellData || (exports.NotebookCellData = {}));
1433
- var NotebookCellKind;
1434
- (function (NotebookCellKind) {
1435
- function from(data) {
1436
- switch (data) {
1437
- case types.NotebookCellKind.Markup:
1438
- return notebooks.CellKind.Markup;
1439
- case types.NotebookCellKind.Code:
1440
- default:
1441
- return notebooks.CellKind.Code;
1442
- }
1443
- }
1444
- NotebookCellKind.from = from;
1445
- function to(data) {
1446
- switch (data) {
1447
- case notebooks.CellKind.Markup:
1448
- return types.NotebookCellKind.Markup;
1449
- case notebooks.CellKind.Code:
1450
- default:
1451
- return types.NotebookCellKind.Code;
1452
- }
1453
- }
1454
- NotebookCellKind.to = to;
1455
- })(NotebookCellKind = exports.NotebookCellKind || (exports.NotebookCellKind = {}));
1456
- var NotebookCellOutput;
1457
- (function (NotebookCellOutput) {
1458
- function from(output) {
1459
- return {
1460
- outputId: output.outputId,
1461
- items: output.items.map(NotebookCellOutputItem.from),
1462
- metadata: output.metadata
1463
- };
1464
- }
1465
- NotebookCellOutput.from = from;
1466
- function to(output) {
1467
- const items = output.items.map(NotebookCellOutputItem.to);
1468
- return new types.NotebookCellOutput(items, output.outputId, output.metadata);
1469
- }
1470
- NotebookCellOutput.to = to;
1471
- })(NotebookCellOutput = exports.NotebookCellOutput || (exports.NotebookCellOutput = {}));
1472
- var NotebookCellOutputItem;
1473
- (function (NotebookCellOutputItem) {
1474
- function from(item) {
1475
- return {
1476
- mime: item.mime,
1477
- valueBytes: buffer_1.BinaryBuffer.wrap(item.data),
1478
- };
1479
- }
1480
- NotebookCellOutputItem.from = from;
1481
- function to(item) {
1482
- return new types.NotebookCellOutputItem(item.valueBytes.buffer, item.mime);
1483
- }
1484
- NotebookCellOutputItem.to = to;
1485
- })(NotebookCellOutputItem = exports.NotebookCellOutputItem || (exports.NotebookCellOutputItem = {}));
1486
- var NotebookCellOutputConverter;
1487
- (function (NotebookCellOutputConverter) {
1488
- function from(output) {
1489
- return {
1490
- outputId: output.outputId,
1491
- items: output.items.map(NotebookCellOutputItem.from),
1492
- metadata: output.metadata
1493
- };
1494
- }
1495
- NotebookCellOutputConverter.from = from;
1496
- function to(output) {
1497
- const items = output.items.map(NotebookCellOutputItem.to);
1498
- return new types.NotebookCellOutput(items, output.outputId, output.metadata);
1499
- }
1500
- NotebookCellOutputConverter.to = to;
1501
- function ensureUniqueMimeTypes(items, warn = false) {
1502
- const seen = new Set();
1503
- const removeIdx = new Set();
1504
- for (let i = 0; i < items.length; i++) {
1505
- const item = items[i];
1506
- // We can have multiple text stream mime types in the same output.
1507
- if (!seen.has(item.mime) || (0, common_2.isTextStreamMime)(item.mime)) {
1508
- seen.add(item.mime);
1509
- continue;
1510
- }
1511
- // duplicated mime types... first has won
1512
- removeIdx.add(i);
1513
- if (warn) {
1514
- console.warn(`DUPLICATED mime type '${item.mime}' will be dropped`);
1515
- }
1516
- }
1517
- if (removeIdx.size === 0) {
1518
- return items;
1519
- }
1520
- return items.filter((_, index) => !removeIdx.has(index));
1521
- }
1522
- NotebookCellOutputConverter.ensureUniqueMimeTypes = ensureUniqueMimeTypes;
1523
- })(NotebookCellOutputConverter = exports.NotebookCellOutputConverter || (exports.NotebookCellOutputConverter = {}));
1524
- var NotebookCellExecutionSummary;
1525
- (function (NotebookCellExecutionSummary) {
1526
- function to(data) {
1527
- return {
1528
- timing: typeof data.runStartTime === 'number' && typeof data.runEndTime === 'number' ? { startTime: data.runStartTime, endTime: data.runEndTime } : undefined,
1529
- executionOrder: data.executionOrder,
1530
- success: data.lastRunSuccess
1531
- };
1532
- }
1533
- NotebookCellExecutionSummary.to = to;
1534
- function from(data) {
1535
- var _a, _b;
1536
- return {
1537
- lastRunSuccess: data.success,
1538
- runStartTime: (_a = data.timing) === null || _a === void 0 ? void 0 : _a.startTime,
1539
- runEndTime: (_b = data.timing) === null || _b === void 0 ? void 0 : _b.endTime,
1540
- executionOrder: data.executionOrder
1541
- };
1542
- }
1543
- NotebookCellExecutionSummary.from = from;
1544
- })(NotebookCellExecutionSummary = exports.NotebookCellExecutionSummary || (exports.NotebookCellExecutionSummary = {}));
1545
- var NotebookRange;
1546
- (function (NotebookRange) {
1547
- function from(range) {
1548
- return { start: range.start, end: range.end };
1549
- }
1550
- NotebookRange.from = from;
1551
- function to(range) {
1552
- return new types.NotebookRange(range.start, range.end);
1553
- }
1554
- NotebookRange.to = to;
1555
- })(NotebookRange = exports.NotebookRange || (exports.NotebookRange = {}));
1556
- var NotebookKernelSourceAction;
1557
- (function (NotebookKernelSourceAction) {
1558
- function from(item, commandsConverter, disposables) {
1559
- const command = typeof item.command === 'string' ? { title: '', command: item.command } : item.command;
1560
- return {
1561
- command: commandsConverter.toSafeCommand(command, disposables),
1562
- label: item.label,
1563
- description: item.description,
1564
- detail: item.detail,
1565
- documentation: item.documentation
1566
- };
1567
- }
1568
- NotebookKernelSourceAction.from = from;
1569
- })(NotebookKernelSourceAction = exports.NotebookKernelSourceAction || (exports.NotebookKernelSourceAction = {}));
1570
- var TestMessage;
1571
- (function (TestMessage) {
1572
- function from(message) {
1573
- if ((0, arrays_1.isReadonlyArray)(message)) {
1574
- return message.map(msg => TestMessage.from(msg)[0]);
1575
- }
1576
- return [{
1577
- location: fromLocation(message.location),
1578
- message: fromMarkdown(message.message),
1579
- expected: message.expectedOutput,
1580
- actual: message.actualOutput,
1581
- contextValue: message.contextValue
1582
- }];
1583
- }
1584
- TestMessage.from = from;
1585
- })(TestMessage = exports.TestMessage || (exports.TestMessage = {}));
1586
- var TestItem;
1587
- (function (TestItem) {
1588
- function from(test) {
1589
- return TestItem.fromPartial(test);
1590
- }
1591
- TestItem.from = from;
1592
- function fromPartial(test) {
1593
- const result = {};
1594
- if ('id' in test) {
1595
- result.id = test.id;
1596
- }
1597
- if ('uri' in test) {
1598
- result.uri = test.uri;
1599
- }
1600
- if ('label' in test) {
1601
- result.label = test.label;
1602
- }
1603
- if ('range' in test) {
1604
- result.range = fromRange(test.range);
1605
- }
1606
- if ('sortKey' in test) {
1607
- result.sortKey = test.sortText;
1608
- }
1609
- if ('tags' in test) {
1610
- result.tags = test.tags ? test.tags.map(tag => tag.id) : [];
1611
- }
1612
- if ('busy' in test) {
1613
- result.busy = test.busy;
1614
- }
1615
- if ('sortKey' in test) {
1616
- result.sortKey = test.sortText;
1617
- }
1618
- if ('canResolveChildren' in test) {
1619
- result.canResolveChildren = test.canResolveChildren;
1620
- }
1621
- if ('description' in test) {
1622
- result.description = test.description;
1623
- }
1624
- if ('description' in test) {
1625
- result.error = test.error;
1626
- }
1627
- if (test.children) {
1628
- const children = [];
1629
- test.children.forEach(item => {
1630
- children.push(TestItem.from(item));
1631
- });
1632
- result.children = children;
1633
- }
1634
- return result;
1635
- }
1636
- TestItem.fromPartial = fromPartial;
1637
- })(TestItem = exports.TestItem || (exports.TestItem = {}));
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-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.fromHierarchyItem = exports.toLocation = exports.isModelCallHierarchyOutgoingCall = exports.isModelCallHierarchyIncomingCall = exports.isModelCallHierarchyItem = exports.isUriComponents = exports.isModelRange = exports.isModelLocation = exports.toSymbolTag = exports.fromSymbolTag = exports.toDocumentSymbol = exports.fromDocumentSymbol = exports.toCodeActionTriggerKind = exports.SymbolKind = exports.fromWorkspaceEdit = exports.SignatureHelp = exports.SignatureInformation = exports.ParameterInformation = exports.fromDocumentHighlight = exports.fromDocumentHighlightKind = exports.DocumentLink = exports.fromDefinitionLink = exports.fromTextDocumentShowOptions = exports.fromLocation = exports.toInlineValueContext = exports.fromInlineValue = exports.fromEvaluatableExpression = exports.fromHover = exports.convertCode = exports.convertDiagnosticToMarkerData = exports.fromTextEdit = exports.toCompletionItemKind = exports.fromCompletionItemKind = exports.fromGlobPattern = exports.fromDocumentSelector = exports.toMarkdown = exports.fromMarkdownOrString = exports.fromMarkdown = exports.fromManyMarkdown = exports.fromRangeOrRangeWithMessage = exports.isDecorationOptionsArr = exports.toPosition = exports.fromPosition = exports.fromRange = exports.toRange = exports.fromSelection = exports.toSelection = exports.toWebviewPanelShowOptions = exports.fromViewColumn = exports.toViewColumn = void 0;
19
+ exports.NotebookKernelSourceAction = exports.NotebookRange = exports.NotebookCellExecutionSummary = exports.NotebookCellOutputConverter = exports.NotebookCellOutputItem = exports.NotebookCellOutput = exports.NotebookCellKind = exports.NotebookCellData = exports.NotebookData = exports.NotebookStatusBarItem = exports.NotebookDocumentContentOptions = exports.DataTransfer = exports.DataTransferItem = exports.InlayHintKind = exports.pluginToPluginInfo = exports.pathOrURIToURI = exports.ViewColumn = exports.ThemableDecorationAttachmentRenderOptions = exports.ThemableDecorationRenderOptions = exports.DecorationRangeBehavior = exports.DecorationRenderOptions = exports.convertToTransferQuickPickItems = exports.convertQuickInputButton = exports.convertIconPath = exports.fromColorPresentation = exports.toColor = exports.fromColor = exports.fromFoldingRangeKind = exports.fromFoldingRange = exports.fromSelectionRange = exports.toSymbolInformation = exports.fromSymbolInformation = exports.getShellExecutionOptions = exports.getShellArgs = exports.getCustomExecution = exports.getShellExecution = exports.getProcessExecution = exports.fromCustomExecution = exports.fromShellExecution = exports.fromProcessExecution = exports.toTask = exports.fromTask = exports.toWorkspaceFolder = exports.toTypeHierarchyItem = exports.fromTypeHierarchyItem = exports.isModelTypeHierarchyItem = exports.toCallHierarchyOutgoingCall = exports.toCallHierarchyIncomingCall = exports.toCallHierarchyItem = exports.fromCallHierarchyItem = void 0;
20
+ exports.TestItem = exports.TestMessage = void 0;
21
+ const lstypes = require("@theia/core/shared/vscode-languageserver-protocol");
22
+ const types_impl_1 = require("./types-impl");
23
+ const rpc = require("../common/plugin-api-rpc");
24
+ const plugin_api_rpc_1 = require("../common/plugin-api-rpc");
25
+ const model = require("../common/plugin-api-rpc-model");
26
+ const markdown_string_1 = require("./markdown-string");
27
+ const types = require("./types-impl");
28
+ const arrays_1 = require("../common/arrays");
29
+ const common_1 = require("@theia/core/lib/common");
30
+ const notebooks = require("@theia/notebook/lib/common");
31
+ const buffer_1 = require("@theia/core/lib/common/buffer");
32
+ const common_2 = require("@theia/notebook/lib/common");
33
+ const markdown_rendering_1 = require("@theia/core/lib/common/markdown-rendering");
34
+ const themables_1 = require("@theia/monaco-editor-core/esm/vs/base/common/themables");
35
+ const SIDE_GROUP = -2;
36
+ const ACTIVE_GROUP = -1;
37
+ function toViewColumn(ep) {
38
+ if (typeof ep !== 'number') {
39
+ return undefined;
40
+ }
41
+ if (ep === plugin_api_rpc_1.EditorPosition.ONE) {
42
+ return types.ViewColumn.One;
43
+ }
44
+ else if (ep === plugin_api_rpc_1.EditorPosition.TWO) {
45
+ return types.ViewColumn.Two;
46
+ }
47
+ else if (ep === plugin_api_rpc_1.EditorPosition.THREE) {
48
+ return types.ViewColumn.Three;
49
+ }
50
+ else if (ep === plugin_api_rpc_1.EditorPosition.FOUR) {
51
+ return types.ViewColumn.Four;
52
+ }
53
+ else if (ep === plugin_api_rpc_1.EditorPosition.FIVE) {
54
+ return types.ViewColumn.Five;
55
+ }
56
+ else if (ep === plugin_api_rpc_1.EditorPosition.SIX) {
57
+ return types.ViewColumn.Six;
58
+ }
59
+ else if (ep === plugin_api_rpc_1.EditorPosition.SEVEN) {
60
+ return types.ViewColumn.Seven;
61
+ }
62
+ else if (ep === plugin_api_rpc_1.EditorPosition.EIGHT) {
63
+ return types.ViewColumn.Eight;
64
+ }
65
+ else if (ep === plugin_api_rpc_1.EditorPosition.NINE) {
66
+ return types.ViewColumn.Nine;
67
+ }
68
+ return undefined;
69
+ }
70
+ exports.toViewColumn = toViewColumn;
71
+ function fromViewColumn(column) {
72
+ if (typeof column === 'number' && column >= types.ViewColumn.One) {
73
+ return column - 1;
74
+ }
75
+ if (column === types.ViewColumn.Beside) {
76
+ return SIDE_GROUP;
77
+ }
78
+ return ACTIVE_GROUP;
79
+ }
80
+ exports.fromViewColumn = fromViewColumn;
81
+ function toWebviewPanelShowOptions(options) {
82
+ if (typeof options === 'object') {
83
+ const showOptions = options;
84
+ return {
85
+ area: showOptions.area ? showOptions.area : types.WebviewPanelTargetArea.Main,
86
+ viewColumn: showOptions.viewColumn ? fromViewColumn(showOptions.viewColumn) : undefined,
87
+ preserveFocus: showOptions.preserveFocus ? showOptions.preserveFocus : false
88
+ };
89
+ }
90
+ return {
91
+ area: types.WebviewPanelTargetArea.Main,
92
+ viewColumn: fromViewColumn(options),
93
+ preserveFocus: false
94
+ };
95
+ }
96
+ exports.toWebviewPanelShowOptions = toWebviewPanelShowOptions;
97
+ function toSelection(selection) {
98
+ const { selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn } = selection;
99
+ const start = new types.Position(selectionStartLineNumber - 1, selectionStartColumn - 1);
100
+ const end = new types.Position(positionLineNumber - 1, positionColumn - 1);
101
+ return new types.Selection(start, end);
102
+ }
103
+ exports.toSelection = toSelection;
104
+ function fromSelection(selection) {
105
+ const { active, anchor } = selection;
106
+ return {
107
+ selectionStartLineNumber: anchor.line + 1,
108
+ selectionStartColumn: anchor.character + 1,
109
+ positionLineNumber: active.line + 1,
110
+ positionColumn: active.character + 1
111
+ };
112
+ }
113
+ exports.fromSelection = fromSelection;
114
+ function toRange(range) {
115
+ const { startLineNumber, startColumn, endLineNumber, endColumn } = range;
116
+ return new types.Range(startLineNumber - 1, startColumn - 1, endLineNumber - 1, endColumn - 1);
117
+ }
118
+ exports.toRange = toRange;
119
+ function fromRange(range) {
120
+ if (!range) {
121
+ return undefined;
122
+ }
123
+ const { start, end } = range;
124
+ return {
125
+ startLineNumber: start.line + 1,
126
+ startColumn: start.character + 1,
127
+ endLineNumber: end.line + 1,
128
+ endColumn: end.character + 1
129
+ };
130
+ }
131
+ exports.fromRange = fromRange;
132
+ function fromPosition(position) {
133
+ return { lineNumber: position.line + 1, column: position.character + 1 };
134
+ }
135
+ exports.fromPosition = fromPosition;
136
+ function toPosition(position) {
137
+ return new types.Position(position.lineNumber - 1, position.column - 1);
138
+ }
139
+ exports.toPosition = toPosition;
140
+ function isDecorationOptions(arg) {
141
+ return (0, common_1.isObject)(arg) && typeof arg.range !== 'undefined';
142
+ }
143
+ function isDecorationOptionsArr(something) {
144
+ if (something.length === 0) {
145
+ return true;
146
+ }
147
+ return isDecorationOptions(something[0]) ? true : false;
148
+ }
149
+ exports.isDecorationOptionsArr = isDecorationOptionsArr;
150
+ function fromRangeOrRangeWithMessage(ranges) {
151
+ if (isDecorationOptionsArr(ranges)) {
152
+ return ranges.map(r => {
153
+ let hoverMessage;
154
+ if (Array.isArray(r.hoverMessage)) {
155
+ hoverMessage = fromManyMarkdown(r.hoverMessage);
156
+ }
157
+ else if (r.hoverMessage) {
158
+ hoverMessage = fromMarkdown(r.hoverMessage);
159
+ }
160
+ else {
161
+ hoverMessage = undefined;
162
+ }
163
+ return {
164
+ range: fromRange(r.range),
165
+ hoverMessage: hoverMessage,
166
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
167
+ renderOptions: r.renderOptions
168
+ };
169
+ });
170
+ }
171
+ else {
172
+ return ranges.map(r => ({ range: fromRange(r) }));
173
+ }
174
+ }
175
+ exports.fromRangeOrRangeWithMessage = fromRangeOrRangeWithMessage;
176
+ function fromManyMarkdown(markup) {
177
+ return markup.map(fromMarkdown);
178
+ }
179
+ exports.fromManyMarkdown = fromManyMarkdown;
180
+ function isCodeblock(arg) {
181
+ return (0, common_1.isObject)(arg)
182
+ && typeof arg.language === 'string'
183
+ && typeof arg.value === 'string';
184
+ }
185
+ function fromMarkdown(markup) {
186
+ if (isCodeblock(markup)) {
187
+ const { language, value } = markup;
188
+ return { value: '```' + language + '\n' + value + '\n```\n' };
189
+ }
190
+ else if (markup instanceof markdown_string_1.MarkdownString) {
191
+ return markup.toJSON();
192
+ }
193
+ else if (markdown_rendering_1.MarkdownString.is(markup)) {
194
+ return markup;
195
+ }
196
+ else if (typeof markup === 'string') {
197
+ return { value: markup };
198
+ }
199
+ else {
200
+ return { value: '' };
201
+ }
202
+ }
203
+ exports.fromMarkdown = fromMarkdown;
204
+ function fromMarkdownOrString(value) {
205
+ if (value === undefined) {
206
+ return undefined;
207
+ }
208
+ else if (typeof value === 'string') {
209
+ return value;
210
+ }
211
+ else {
212
+ return fromMarkdown(value);
213
+ }
214
+ }
215
+ exports.fromMarkdownOrString = fromMarkdownOrString;
216
+ function toMarkdown(value) {
217
+ const implemented = new markdown_string_1.MarkdownString(value.value, value.supportThemeIcons);
218
+ implemented.isTrusted = value.isTrusted;
219
+ implemented.supportHtml = value.supportHtml;
220
+ implemented.baseUri = value.baseUri && types_impl_1.URI.revive(implemented.baseUri);
221
+ return implemented;
222
+ }
223
+ exports.toMarkdown = toMarkdown;
224
+ function fromDocumentSelector(selector) {
225
+ if (!selector) {
226
+ return undefined;
227
+ }
228
+ else if ((0, arrays_1.isReadonlyArray)(selector)) {
229
+ return selector.map(fromDocumentSelector);
230
+ }
231
+ else if (typeof selector === 'string') {
232
+ return selector;
233
+ }
234
+ else {
235
+ return {
236
+ language: selector.language,
237
+ scheme: selector.scheme,
238
+ pattern: fromGlobPattern(selector.pattern)
239
+ };
240
+ }
241
+ }
242
+ exports.fromDocumentSelector = fromDocumentSelector;
243
+ function fromGlobPattern(pattern) {
244
+ if (typeof pattern === 'string') {
245
+ return pattern;
246
+ }
247
+ if (isRelativePattern(pattern)) {
248
+ return new types.RelativePattern(pattern.baseUri, pattern.pattern);
249
+ }
250
+ return pattern;
251
+ }
252
+ exports.fromGlobPattern = fromGlobPattern;
253
+ function isRelativePattern(obj) {
254
+ const rp = obj;
255
+ return rp && typeof rp.baseUri === 'string' && typeof rp.pattern === 'string';
256
+ }
257
+ function fromCompletionItemKind(kind) {
258
+ switch (kind) {
259
+ case types.CompletionItemKind.Method: return model.CompletionItemKind.Method;
260
+ case types.CompletionItemKind.Function: return model.CompletionItemKind.Function;
261
+ case types.CompletionItemKind.Constructor: return model.CompletionItemKind.Constructor;
262
+ case types.CompletionItemKind.Field: return model.CompletionItemKind.Field;
263
+ case types.CompletionItemKind.Variable: return model.CompletionItemKind.Variable;
264
+ case types.CompletionItemKind.Class: return model.CompletionItemKind.Class;
265
+ case types.CompletionItemKind.Interface: return model.CompletionItemKind.Interface;
266
+ case types.CompletionItemKind.Struct: return model.CompletionItemKind.Struct;
267
+ case types.CompletionItemKind.Module: return model.CompletionItemKind.Module;
268
+ case types.CompletionItemKind.Property: return model.CompletionItemKind.Property;
269
+ case types.CompletionItemKind.Unit: return model.CompletionItemKind.Unit;
270
+ case types.CompletionItemKind.Value: return model.CompletionItemKind.Value;
271
+ case types.CompletionItemKind.Constant: return model.CompletionItemKind.Constant;
272
+ case types.CompletionItemKind.Enum: return model.CompletionItemKind.Enum;
273
+ case types.CompletionItemKind.EnumMember: return model.CompletionItemKind.EnumMember;
274
+ case types.CompletionItemKind.Keyword: return model.CompletionItemKind.Keyword;
275
+ case types.CompletionItemKind.Snippet: return model.CompletionItemKind.Snippet;
276
+ case types.CompletionItemKind.Text: return model.CompletionItemKind.Text;
277
+ case types.CompletionItemKind.Color: return model.CompletionItemKind.Color;
278
+ case types.CompletionItemKind.File: return model.CompletionItemKind.File;
279
+ case types.CompletionItemKind.Reference: return model.CompletionItemKind.Reference;
280
+ case types.CompletionItemKind.Folder: return model.CompletionItemKind.Folder;
281
+ case types.CompletionItemKind.Event: return model.CompletionItemKind.Event;
282
+ case types.CompletionItemKind.Operator: return model.CompletionItemKind.Operator;
283
+ case types.CompletionItemKind.TypeParameter: return model.CompletionItemKind.TypeParameter;
284
+ case types.CompletionItemKind.User: return model.CompletionItemKind.User;
285
+ case types.CompletionItemKind.Issue: return model.CompletionItemKind.Issue;
286
+ }
287
+ return model.CompletionItemKind.Property;
288
+ }
289
+ exports.fromCompletionItemKind = fromCompletionItemKind;
290
+ function toCompletionItemKind(kind) {
291
+ switch (kind) {
292
+ case model.CompletionItemKind.Method: return types.CompletionItemKind.Method;
293
+ case model.CompletionItemKind.Function: return types.CompletionItemKind.Function;
294
+ case model.CompletionItemKind.Constructor: return types.CompletionItemKind.Constructor;
295
+ case model.CompletionItemKind.Field: return types.CompletionItemKind.Field;
296
+ case model.CompletionItemKind.Variable: return types.CompletionItemKind.Variable;
297
+ case model.CompletionItemKind.Class: return types.CompletionItemKind.Class;
298
+ case model.CompletionItemKind.Interface: return types.CompletionItemKind.Interface;
299
+ case model.CompletionItemKind.Struct: return types.CompletionItemKind.Struct;
300
+ case model.CompletionItemKind.Module: return types.CompletionItemKind.Module;
301
+ case model.CompletionItemKind.Property: return types.CompletionItemKind.Property;
302
+ case model.CompletionItemKind.Unit: return types.CompletionItemKind.Unit;
303
+ case model.CompletionItemKind.Value: return types.CompletionItemKind.Value;
304
+ case model.CompletionItemKind.Constant: return types.CompletionItemKind.Constant;
305
+ case model.CompletionItemKind.Enum: return types.CompletionItemKind.Enum;
306
+ case model.CompletionItemKind.EnumMember: return types.CompletionItemKind.EnumMember;
307
+ case model.CompletionItemKind.Keyword: return types.CompletionItemKind.Keyword;
308
+ case model.CompletionItemKind.Snippet: return types.CompletionItemKind.Snippet;
309
+ case model.CompletionItemKind.Text: return types.CompletionItemKind.Text;
310
+ case model.CompletionItemKind.Color: return types.CompletionItemKind.Color;
311
+ case model.CompletionItemKind.File: return types.CompletionItemKind.File;
312
+ case model.CompletionItemKind.Reference: return types.CompletionItemKind.Reference;
313
+ case model.CompletionItemKind.Folder: return types.CompletionItemKind.Folder;
314
+ case model.CompletionItemKind.Event: return types.CompletionItemKind.Event;
315
+ case model.CompletionItemKind.Operator: return types.CompletionItemKind.Operator;
316
+ case model.CompletionItemKind.TypeParameter: return types.CompletionItemKind.TypeParameter;
317
+ case model.CompletionItemKind.User: return types.CompletionItemKind.User;
318
+ case model.CompletionItemKind.Issue: return types.CompletionItemKind.Issue;
319
+ }
320
+ return types.CompletionItemKind.Property;
321
+ }
322
+ exports.toCompletionItemKind = toCompletionItemKind;
323
+ function fromTextEdit(edit) {
324
+ return {
325
+ text: edit.newText,
326
+ range: fromRange(edit.range)
327
+ };
328
+ }
329
+ exports.fromTextEdit = fromTextEdit;
330
+ function fromSnippetTextEdit(edit) {
331
+ return {
332
+ text: edit.snippet.value,
333
+ range: fromRange(edit.range),
334
+ insertAsSnippet: true
335
+ };
336
+ }
337
+ function convertDiagnosticToMarkerData(diagnostic) {
338
+ return {
339
+ code: convertCode(diagnostic.code),
340
+ severity: convertSeverity(diagnostic.severity),
341
+ message: diagnostic.message,
342
+ source: diagnostic.source,
343
+ startLineNumber: diagnostic.range.start.line + 1,
344
+ startColumn: diagnostic.range.start.character + 1,
345
+ endLineNumber: diagnostic.range.end.line + 1,
346
+ endColumn: diagnostic.range.end.character + 1,
347
+ relatedInformation: convertRelatedInformation(diagnostic.relatedInformation),
348
+ tags: convertTags(diagnostic.tags)
349
+ };
350
+ }
351
+ exports.convertDiagnosticToMarkerData = convertDiagnosticToMarkerData;
352
+ function convertCode(code) {
353
+ if (typeof code === 'number') {
354
+ return String(code);
355
+ }
356
+ if (typeof code === 'string' || typeof code === 'undefined') {
357
+ return code;
358
+ }
359
+ else {
360
+ return String(code.value);
361
+ }
362
+ ;
363
+ }
364
+ exports.convertCode = convertCode;
365
+ function convertSeverity(severity) {
366
+ switch (severity) {
367
+ case types.DiagnosticSeverity.Error: return types.MarkerSeverity.Error;
368
+ case types.DiagnosticSeverity.Warning: return types.MarkerSeverity.Warning;
369
+ case types.DiagnosticSeverity.Information: return types.MarkerSeverity.Info;
370
+ case types.DiagnosticSeverity.Hint: return types.MarkerSeverity.Hint;
371
+ }
372
+ }
373
+ function convertRelatedInformation(diagnosticsRelatedInformation) {
374
+ if (!diagnosticsRelatedInformation) {
375
+ return undefined;
376
+ }
377
+ const relatedInformation = [];
378
+ for (const item of diagnosticsRelatedInformation) {
379
+ relatedInformation.push({
380
+ resource: item.location.uri.toString(),
381
+ message: item.message,
382
+ startLineNumber: item.location.range.start.line + 1,
383
+ startColumn: item.location.range.start.character + 1,
384
+ endLineNumber: item.location.range.end.line + 1,
385
+ endColumn: item.location.range.end.character + 1
386
+ });
387
+ }
388
+ return relatedInformation;
389
+ }
390
+ function convertTags(tags) {
391
+ if (!tags) {
392
+ return undefined;
393
+ }
394
+ const markerTags = [];
395
+ for (const tag of tags) {
396
+ switch (tag) {
397
+ case types.DiagnosticTag.Unnecessary:
398
+ markerTags.push(types.MarkerTag.Unnecessary);
399
+ break;
400
+ case types.DiagnosticTag.Deprecated:
401
+ markerTags.push(types.MarkerTag.Deprecated);
402
+ break;
403
+ }
404
+ }
405
+ return markerTags;
406
+ }
407
+ function fromHover(hover) {
408
+ return {
409
+ range: fromRange(hover.range),
410
+ contents: fromManyMarkdown(hover.contents)
411
+ };
412
+ }
413
+ exports.fromHover = fromHover;
414
+ function fromEvaluatableExpression(evaluatableExpression) {
415
+ return {
416
+ range: fromRange(evaluatableExpression.range),
417
+ expression: evaluatableExpression.expression
418
+ };
419
+ }
420
+ exports.fromEvaluatableExpression = fromEvaluatableExpression;
421
+ function fromInlineValue(inlineValue) {
422
+ if (inlineValue instanceof types_impl_1.InlineValueText) {
423
+ return {
424
+ type: 'text',
425
+ range: fromRange(inlineValue.range),
426
+ text: inlineValue.text
427
+ };
428
+ }
429
+ else if (inlineValue instanceof types_impl_1.InlineValueVariableLookup) {
430
+ return {
431
+ type: 'variable',
432
+ range: fromRange(inlineValue.range),
433
+ variableName: inlineValue.variableName,
434
+ caseSensitiveLookup: inlineValue.caseSensitiveLookup
435
+ };
436
+ }
437
+ else if (inlineValue instanceof types_impl_1.InlineValueEvaluatableExpression) {
438
+ return {
439
+ type: 'expression',
440
+ range: fromRange(inlineValue.range),
441
+ expression: inlineValue.expression
442
+ };
443
+ }
444
+ else {
445
+ throw new Error('Unknown InlineValue type');
446
+ }
447
+ }
448
+ exports.fromInlineValue = fromInlineValue;
449
+ function toInlineValueContext(inlineValueContext) {
450
+ const ivLocation = inlineValueContext.stoppedLocation;
451
+ return {
452
+ frameId: inlineValueContext.frameId,
453
+ stoppedLocation: new types.Range(ivLocation.startLineNumber, ivLocation.startColumn, ivLocation.endLineNumber, ivLocation.endColumn)
454
+ };
455
+ }
456
+ exports.toInlineValueContext = toInlineValueContext;
457
+ function fromLocation(location) {
458
+ if (!location) {
459
+ return undefined;
460
+ }
461
+ return {
462
+ uri: location.uri,
463
+ range: fromRange(location.range)
464
+ };
465
+ }
466
+ exports.fromLocation = fromLocation;
467
+ function fromTextDocumentShowOptions(options) {
468
+ if (options.selection) {
469
+ return {
470
+ ...options,
471
+ selection: fromRange(options.selection),
472
+ };
473
+ }
474
+ return options;
475
+ }
476
+ exports.fromTextDocumentShowOptions = fromTextDocumentShowOptions;
477
+ function fromDefinitionLink(definitionLink) {
478
+ return {
479
+ uri: definitionLink.targetUri,
480
+ range: fromRange(definitionLink.targetRange),
481
+ originSelectionRange: definitionLink.originSelectionRange ? fromRange(definitionLink.originSelectionRange) : undefined,
482
+ targetSelectionRange: definitionLink.targetSelectionRange ? fromRange(definitionLink.targetSelectionRange) : undefined
483
+ };
484
+ }
485
+ exports.fromDefinitionLink = fromDefinitionLink;
486
+ var DocumentLink;
487
+ (function (DocumentLink) {
488
+ function from(link) {
489
+ return {
490
+ range: fromRange(link.range),
491
+ url: link.target,
492
+ tooltip: link.tooltip
493
+ };
494
+ }
495
+ DocumentLink.from = from;
496
+ function to(link) {
497
+ let target = undefined;
498
+ if (link.url) {
499
+ try {
500
+ target = typeof link.url === 'string' ? types_impl_1.URI.parse(link.url, true) : types_impl_1.URI.revive(link.url);
501
+ }
502
+ catch (err) {
503
+ // ignore
504
+ }
505
+ }
506
+ return new types.DocumentLink(toRange(link.range), target);
507
+ }
508
+ DocumentLink.to = to;
509
+ })(DocumentLink = exports.DocumentLink || (exports.DocumentLink = {}));
510
+ function fromDocumentHighlightKind(kind) {
511
+ switch (kind) {
512
+ case types.DocumentHighlightKind.Text: return model.DocumentHighlightKind.Text;
513
+ case types.DocumentHighlightKind.Read: return model.DocumentHighlightKind.Read;
514
+ case types.DocumentHighlightKind.Write: return model.DocumentHighlightKind.Write;
515
+ }
516
+ return model.DocumentHighlightKind.Text;
517
+ }
518
+ exports.fromDocumentHighlightKind = fromDocumentHighlightKind;
519
+ function fromDocumentHighlight(documentHighlight) {
520
+ return {
521
+ range: fromRange(documentHighlight.range),
522
+ kind: fromDocumentHighlightKind(documentHighlight.kind)
523
+ };
524
+ }
525
+ exports.fromDocumentHighlight = fromDocumentHighlight;
526
+ var ParameterInformation;
527
+ (function (ParameterInformation) {
528
+ function from(info) {
529
+ return {
530
+ label: info.label,
531
+ documentation: info.documentation ? fromMarkdown(info.documentation) : undefined
532
+ };
533
+ }
534
+ ParameterInformation.from = from;
535
+ function to(info) {
536
+ return {
537
+ label: info.label,
538
+ documentation: markdown_rendering_1.MarkdownString.is(info.documentation) ? toMarkdown(info.documentation) : info.documentation
539
+ };
540
+ }
541
+ ParameterInformation.to = to;
542
+ })(ParameterInformation = exports.ParameterInformation || (exports.ParameterInformation = {}));
543
+ var SignatureInformation;
544
+ (function (SignatureInformation) {
545
+ function from(info) {
546
+ return {
547
+ label: info.label,
548
+ documentation: info.documentation ? fromMarkdown(info.documentation) : undefined,
549
+ parameters: info.parameters && info.parameters.map(ParameterInformation.from),
550
+ activeParameter: info.activeParameter
551
+ };
552
+ }
553
+ SignatureInformation.from = from;
554
+ function to(info) {
555
+ return {
556
+ label: info.label,
557
+ documentation: markdown_rendering_1.MarkdownString.is(info.documentation) ? toMarkdown(info.documentation) : info.documentation,
558
+ parameters: info.parameters && info.parameters.map(ParameterInformation.to),
559
+ activeParameter: info.activeParameter
560
+ };
561
+ }
562
+ SignatureInformation.to = to;
563
+ })(SignatureInformation = exports.SignatureInformation || (exports.SignatureInformation = {}));
564
+ var SignatureHelp;
565
+ (function (SignatureHelp) {
566
+ function from(id, help) {
567
+ return {
568
+ id,
569
+ activeSignature: help.activeSignature,
570
+ activeParameter: help.activeParameter,
571
+ signatures: help.signatures && help.signatures.map(SignatureInformation.from)
572
+ };
573
+ }
574
+ SignatureHelp.from = from;
575
+ function to(help) {
576
+ return {
577
+ activeSignature: help.activeSignature,
578
+ activeParameter: help.activeParameter,
579
+ signatures: help.signatures && help.signatures.map(SignatureInformation.to)
580
+ };
581
+ }
582
+ SignatureHelp.to = to;
583
+ })(SignatureHelp = exports.SignatureHelp || (exports.SignatureHelp = {}));
584
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
585
+ function fromWorkspaceEdit(value, documents) {
586
+ const result = {
587
+ edits: []
588
+ };
589
+ for (const entry of value._allEntries()) {
590
+ if ((entry === null || entry === void 0 ? void 0 : entry._type) === 2 /* Text */) {
591
+ // text edits
592
+ const doc = documents ? documents.getDocument(entry.uri.toString()) : undefined;
593
+ const workspaceTextEditDto = {
594
+ resource: entry.uri,
595
+ modelVersionId: doc === null || doc === void 0 ? void 0 : doc.version,
596
+ textEdit: (entry.edit instanceof types.TextEdit) ? fromTextEdit(entry.edit) : fromSnippetTextEdit(entry.edit),
597
+ metadata: entry.metadata
598
+ };
599
+ result.edits.push(workspaceTextEditDto);
600
+ }
601
+ else if ((entry === null || entry === void 0 ? void 0 : entry._type) === 1 /* File */) {
602
+ // resource edits
603
+ const workspaceFileEditDto = {
604
+ oldResource: entry.from,
605
+ newResource: entry.to,
606
+ options: entry.options,
607
+ metadata: entry.metadata
608
+ };
609
+ result.edits.push(workspaceFileEditDto);
610
+ }
611
+ else if ((entry === null || entry === void 0 ? void 0 : entry._type) === 3 /* Cell */) {
612
+ // cell edit
613
+ if (entry.edit) {
614
+ result.edits.push({
615
+ metadata: entry.metadata,
616
+ resource: entry.uri,
617
+ cellEdit: entry.edit,
618
+ });
619
+ }
620
+ }
621
+ else if ((entry === null || entry === void 0 ? void 0 : entry._type) === 5 /* CellReplace */) {
622
+ // cell replace
623
+ result.edits.push({
624
+ metadata: entry.metadata,
625
+ resource: entry.uri,
626
+ cellEdit: {
627
+ editType: 1 /* Replace */,
628
+ index: entry.index,
629
+ count: entry.count,
630
+ cells: entry.cells.map(NotebookCellData.from)
631
+ }
632
+ });
633
+ }
634
+ }
635
+ return result;
636
+ }
637
+ exports.fromWorkspaceEdit = fromWorkspaceEdit;
638
+ var SymbolKind;
639
+ (function (SymbolKind) {
640
+ const fromMapping = Object.create(null);
641
+ fromMapping[model.SymbolKind.File] = model.SymbolKind.File;
642
+ fromMapping[model.SymbolKind.Module] = model.SymbolKind.Module;
643
+ fromMapping[model.SymbolKind.Namespace] = model.SymbolKind.Namespace;
644
+ fromMapping[model.SymbolKind.Package] = model.SymbolKind.Package;
645
+ fromMapping[model.SymbolKind.Class] = model.SymbolKind.Class;
646
+ fromMapping[model.SymbolKind.Method] = model.SymbolKind.Method;
647
+ fromMapping[model.SymbolKind.Property] = model.SymbolKind.Property;
648
+ fromMapping[model.SymbolKind.Field] = model.SymbolKind.Field;
649
+ fromMapping[model.SymbolKind.Constructor] = model.SymbolKind.Constructor;
650
+ fromMapping[model.SymbolKind.Enum] = model.SymbolKind.Enum;
651
+ fromMapping[model.SymbolKind.Interface] = model.SymbolKind.Interface;
652
+ fromMapping[model.SymbolKind.Function] = model.SymbolKind.Function;
653
+ fromMapping[model.SymbolKind.Variable] = model.SymbolKind.Variable;
654
+ fromMapping[model.SymbolKind.Constant] = model.SymbolKind.Constant;
655
+ fromMapping[model.SymbolKind.String] = model.SymbolKind.String;
656
+ fromMapping[model.SymbolKind.Number] = model.SymbolKind.Number;
657
+ fromMapping[model.SymbolKind.Boolean] = model.SymbolKind.Boolean;
658
+ fromMapping[model.SymbolKind.Array] = model.SymbolKind.Array;
659
+ fromMapping[model.SymbolKind.Object] = model.SymbolKind.Object;
660
+ fromMapping[model.SymbolKind.Key] = model.SymbolKind.Key;
661
+ fromMapping[model.SymbolKind.Null] = model.SymbolKind.Null;
662
+ fromMapping[model.SymbolKind.EnumMember] = model.SymbolKind.EnumMember;
663
+ fromMapping[model.SymbolKind.Struct] = model.SymbolKind.Struct;
664
+ fromMapping[model.SymbolKind.Event] = model.SymbolKind.Event;
665
+ fromMapping[model.SymbolKind.Operator] = model.SymbolKind.Operator;
666
+ fromMapping[model.SymbolKind.TypeParameter] = model.SymbolKind.TypeParameter;
667
+ function fromSymbolKind(kind) {
668
+ return fromMapping[kind] || model.SymbolKind.Property;
669
+ }
670
+ SymbolKind.fromSymbolKind = fromSymbolKind;
671
+ function toSymbolKind(kind) {
672
+ for (const k in fromMapping) {
673
+ if (fromMapping[k] === kind) {
674
+ return Number(k);
675
+ }
676
+ }
677
+ return model.SymbolKind.Property;
678
+ }
679
+ SymbolKind.toSymbolKind = toSymbolKind;
680
+ })(SymbolKind = exports.SymbolKind || (exports.SymbolKind = {}));
681
+ function toCodeActionTriggerKind(triggerKind) {
682
+ switch (triggerKind) {
683
+ case model.CodeActionTriggerKind.Invoke:
684
+ return types.CodeActionTriggerKind.Invoke;
685
+ case model.CodeActionTriggerKind.Automatic:
686
+ return types.CodeActionTriggerKind.Automatic;
687
+ }
688
+ }
689
+ exports.toCodeActionTriggerKind = toCodeActionTriggerKind;
690
+ function fromDocumentSymbol(info) {
691
+ const result = {
692
+ name: info.name,
693
+ detail: info.detail,
694
+ range: fromRange(info.range),
695
+ tags: info.tags ? info.tags.map(fromSymbolTag) : [],
696
+ selectionRange: fromRange(info.selectionRange),
697
+ kind: SymbolKind.fromSymbolKind(info.kind)
698
+ };
699
+ if (info.children) {
700
+ result.children = info.children.map(fromDocumentSymbol);
701
+ }
702
+ return result;
703
+ }
704
+ exports.fromDocumentSymbol = fromDocumentSymbol;
705
+ function toDocumentSymbol(symbol) {
706
+ return {
707
+ name: symbol.name,
708
+ detail: symbol.detail,
709
+ range: toRange(symbol.range),
710
+ tags: symbol.tags && symbol.tags.length > 0 ? symbol.tags.map(toSymbolTag) : [],
711
+ selectionRange: toRange(symbol.selectionRange),
712
+ children: symbol.children ? symbol.children.map(toDocumentSymbol) : [],
713
+ kind: SymbolKind.toSymbolKind(symbol.kind)
714
+ };
715
+ }
716
+ exports.toDocumentSymbol = toDocumentSymbol;
717
+ function fromSymbolTag(kind) {
718
+ switch (kind) {
719
+ case types.SymbolTag.Deprecated: return model.SymbolTag.Deprecated;
720
+ }
721
+ }
722
+ exports.fromSymbolTag = fromSymbolTag;
723
+ function toSymbolTag(kind) {
724
+ switch (kind) {
725
+ case model.SymbolTag.Deprecated: return types.SymbolTag.Deprecated;
726
+ }
727
+ }
728
+ exports.toSymbolTag = toSymbolTag;
729
+ function isModelLocation(arg) {
730
+ return (0, common_1.isObject)(arg) &&
731
+ isModelRange(arg.range) &&
732
+ isUriComponents(arg.uri);
733
+ }
734
+ exports.isModelLocation = isModelLocation;
735
+ function isModelRange(arg) {
736
+ return (0, common_1.isObject)(arg) &&
737
+ typeof arg.startLineNumber === 'number' &&
738
+ typeof arg.startColumn === 'number' &&
739
+ typeof arg.endLineNumber === 'number' &&
740
+ typeof arg.endColumn === 'number';
741
+ }
742
+ exports.isModelRange = isModelRange;
743
+ function isUriComponents(arg) {
744
+ return (0, common_1.isObject)(arg) &&
745
+ typeof arg.scheme === 'string' &&
746
+ (arg['$mid'] === 1 || (typeof arg.path === 'string' &&
747
+ typeof arg.query === 'string' &&
748
+ typeof arg.fragment === 'string'));
749
+ }
750
+ exports.isUriComponents = isUriComponents;
751
+ function isModelCallHierarchyItem(arg) {
752
+ return (0, common_1.isObject)(arg)
753
+ && isModelRange(arg.range)
754
+ && isModelRange(arg.selectionRange)
755
+ && isUriComponents(arg.uri)
756
+ && !!arg.name;
757
+ }
758
+ exports.isModelCallHierarchyItem = isModelCallHierarchyItem;
759
+ function isModelCallHierarchyIncomingCall(arg) {
760
+ return (0, common_1.isObject)(arg) &&
761
+ 'from' in arg &&
762
+ 'fromRanges' in arg &&
763
+ isModelCallHierarchyItem(arg.from);
764
+ }
765
+ exports.isModelCallHierarchyIncomingCall = isModelCallHierarchyIncomingCall;
766
+ function isModelCallHierarchyOutgoingCall(arg) {
767
+ return (0, common_1.isObject)(arg) &&
768
+ 'to' in arg &&
769
+ 'fromRanges' in arg &&
770
+ isModelCallHierarchyItem(arg.to);
771
+ }
772
+ exports.isModelCallHierarchyOutgoingCall = isModelCallHierarchyOutgoingCall;
773
+ function toLocation(value) {
774
+ return new types.Location(types_impl_1.URI.revive(value.uri), toRange(value.range));
775
+ }
776
+ exports.toLocation = toLocation;
777
+ function fromHierarchyItem(item) {
778
+ return {
779
+ kind: SymbolKind.fromSymbolKind(item.kind),
780
+ name: item.name,
781
+ detail: item.detail,
782
+ uri: item.uri,
783
+ range: fromRange(item.range),
784
+ selectionRange: fromRange(item.selectionRange),
785
+ tags: item.tags,
786
+ _itemId: item._itemId,
787
+ _sessionId: item._sessionId,
788
+ };
789
+ }
790
+ exports.fromHierarchyItem = fromHierarchyItem;
791
+ function fromCallHierarchyItem(item) {
792
+ return fromHierarchyItem(item);
793
+ }
794
+ exports.fromCallHierarchyItem = fromCallHierarchyItem;
795
+ function toCallHierarchyItem(value) {
796
+ const item = new types.CallHierarchyItem(SymbolKind.toSymbolKind(value.kind), value.name, value.detail ? value.detail : '', types_impl_1.URI.revive(value.uri), toRange(value.range), toRange(value.selectionRange));
797
+ item.tags = value.tags;
798
+ item._itemId = value._itemId;
799
+ item._sessionId = value._sessionId;
800
+ return item;
801
+ }
802
+ exports.toCallHierarchyItem = toCallHierarchyItem;
803
+ function toCallHierarchyIncomingCall(value) {
804
+ return new types.CallHierarchyIncomingCall(toCallHierarchyItem(value.from), value.fromRanges && value.fromRanges.map(toRange));
805
+ }
806
+ exports.toCallHierarchyIncomingCall = toCallHierarchyIncomingCall;
807
+ function toCallHierarchyOutgoingCall(value) {
808
+ return new types.CallHierarchyOutgoingCall(toCallHierarchyItem(value.to), value.fromRanges && value.fromRanges.map(toRange));
809
+ }
810
+ exports.toCallHierarchyOutgoingCall = toCallHierarchyOutgoingCall;
811
+ function isModelTypeHierarchyItem(arg) {
812
+ return (0, common_1.isObject)(arg)
813
+ && isModelRange(arg.range)
814
+ && isModelRange(arg.selectionRange)
815
+ && isUriComponents(arg.uri)
816
+ && !!arg.name;
817
+ }
818
+ exports.isModelTypeHierarchyItem = isModelTypeHierarchyItem;
819
+ function fromTypeHierarchyItem(item) {
820
+ return fromHierarchyItem(item);
821
+ }
822
+ exports.fromTypeHierarchyItem = fromTypeHierarchyItem;
823
+ function toTypeHierarchyItem(value) {
824
+ const item = new types.TypeHierarchyItem(SymbolKind.toSymbolKind(value.kind), value.name, value.detail ? value.detail : '', types_impl_1.URI.revive(value.uri), toRange(value.selectionRange), toRange(value.range));
825
+ item.tags = value.tags;
826
+ item._itemId = value._itemId;
827
+ item._sessionId = value._sessionId;
828
+ return item;
829
+ }
830
+ exports.toTypeHierarchyItem = toTypeHierarchyItem;
831
+ function toWorkspaceFolder(folder) {
832
+ return {
833
+ uri: types_impl_1.URI.revive(folder.uri),
834
+ name: folder.name,
835
+ index: folder.index
836
+ };
837
+ }
838
+ exports.toWorkspaceFolder = toWorkspaceFolder;
839
+ function fromTask(task) {
840
+ if (!task) {
841
+ return undefined;
842
+ }
843
+ const taskDto = {};
844
+ taskDto.label = task.name;
845
+ taskDto.source = task.source;
846
+ taskDto.runOptions = { reevaluateOnRerun: task.runOptions.reevaluateOnRerun };
847
+ if (task.hasProblemMatchers) {
848
+ taskDto.problemMatcher = task.problemMatchers;
849
+ }
850
+ if ('detail' in task) {
851
+ taskDto.detail = task.detail;
852
+ }
853
+ if (typeof task.scope === 'number') {
854
+ taskDto.scope = task.scope;
855
+ }
856
+ else if (task.scope !== undefined) {
857
+ taskDto.scope = task.scope.uri.toString();
858
+ }
859
+ else {
860
+ taskDto.scope = types.TaskScope.Workspace;
861
+ }
862
+ if (task.presentationOptions) {
863
+ taskDto.presentation = task.presentationOptions;
864
+ }
865
+ if (task.group) {
866
+ taskDto.group = {
867
+ kind: task.group.id,
868
+ isDefault: !!task.group.isDefault
869
+ };
870
+ }
871
+ const taskDefinition = task.definition;
872
+ if (!taskDefinition) {
873
+ return taskDto;
874
+ }
875
+ taskDto.type = taskDefinition.type;
876
+ const { type, ...properties } = taskDefinition;
877
+ for (const key in properties) {
878
+ if (properties.hasOwnProperty(key)) {
879
+ taskDto[key] = properties[key];
880
+ }
881
+ }
882
+ const execution = task.execution;
883
+ if (!execution) {
884
+ return taskDto;
885
+ }
886
+ if (types.ShellExecution.is(execution)) {
887
+ return fromShellExecution(execution, taskDto);
888
+ }
889
+ if (types.ProcessExecution.is(execution)) {
890
+ return fromProcessExecution(execution, taskDto);
891
+ }
892
+ if (types.CustomExecution.is(execution)) {
893
+ return fromCustomExecution(execution, taskDto);
894
+ }
895
+ return taskDto;
896
+ }
897
+ exports.fromTask = fromTask;
898
+ function toTask(taskDto) {
899
+ if (!taskDto) {
900
+ throw new Error('Task should be provided for converting');
901
+ }
902
+ const { type, taskType, label, source, scope, problemMatcher, detail, command, args, options, group, presentation, runOptions, ...properties } = taskDto;
903
+ const result = {};
904
+ result.name = label;
905
+ result.source = source;
906
+ result.runOptions = runOptions !== null && runOptions !== void 0 ? runOptions : {};
907
+ if (detail) {
908
+ result.detail = detail;
909
+ }
910
+ if (typeof scope === 'string') {
911
+ const uri = types_impl_1.URI.parse(scope);
912
+ result.scope = {
913
+ uri,
914
+ name: uri.toString(),
915
+ index: 0
916
+ };
917
+ }
918
+ else {
919
+ result.scope = scope;
920
+ }
921
+ const taskDefinition = {
922
+ type: type
923
+ };
924
+ result.definition = taskDefinition;
925
+ if (taskType === 'process') {
926
+ result.execution = getProcessExecution(taskDto);
927
+ }
928
+ const execution = { command, args, options };
929
+ if (taskType === 'shell' || types.ShellExecution.is(execution)) {
930
+ result.execution = getShellExecution(taskDto);
931
+ }
932
+ if (taskType === 'customExecution' || types.CustomExecution.is(execution)) {
933
+ result.execution = getCustomExecution(taskDto);
934
+ // if taskType is customExecution, we need to put all the information into taskDefinition,
935
+ // because some parameters may be in taskDefinition.
936
+ taskDefinition.label = label;
937
+ taskDefinition.command = command;
938
+ taskDefinition.args = args;
939
+ taskDefinition.options = options;
940
+ }
941
+ if (group) {
942
+ result.group = new types.TaskGroup(group.kind, group.kind, group.isDefault);
943
+ }
944
+ if (presentation) {
945
+ result.presentationOptions = presentation;
946
+ }
947
+ if (!properties) {
948
+ return result;
949
+ }
950
+ for (const key in properties) {
951
+ if (properties.hasOwnProperty(key)) {
952
+ taskDefinition[key] = properties[key];
953
+ }
954
+ }
955
+ return result;
956
+ }
957
+ exports.toTask = toTask;
958
+ function fromProcessExecution(execution, taskDto) {
959
+ taskDto.taskType = 'process';
960
+ taskDto.command = execution.process;
961
+ taskDto.args = execution.args;
962
+ const options = execution.options;
963
+ if (options) {
964
+ taskDto.options = options;
965
+ }
966
+ return taskDto;
967
+ }
968
+ exports.fromProcessExecution = fromProcessExecution;
969
+ function fromShellExecution(execution, taskDto) {
970
+ taskDto.taskType = 'shell';
971
+ const options = execution.options;
972
+ if (options) {
973
+ taskDto.options = getShellExecutionOptions(options);
974
+ }
975
+ const commandLine = execution.commandLine;
976
+ if (commandLine) {
977
+ taskDto.command = commandLine;
978
+ return taskDto;
979
+ }
980
+ if (execution.command) {
981
+ taskDto.command = getCommand(execution.command);
982
+ taskDto.args = getShellArgs(execution.args);
983
+ return taskDto;
984
+ }
985
+ else {
986
+ throw new Error('Command is undefined');
987
+ }
988
+ }
989
+ exports.fromShellExecution = fromShellExecution;
990
+ function fromCustomExecution(execution, taskDto) {
991
+ taskDto.taskType = 'customExecution';
992
+ const callback = execution.callback;
993
+ if (callback) {
994
+ taskDto.callback = callback;
995
+ return taskDto;
996
+ }
997
+ else {
998
+ throw new Error('Converting CustomExecution callback is not implemented');
999
+ }
1000
+ }
1001
+ exports.fromCustomExecution = fromCustomExecution;
1002
+ function getProcessExecution(taskDto) {
1003
+ return new types.ProcessExecution(taskDto.command, taskDto.args || [], taskDto.options || {});
1004
+ }
1005
+ exports.getProcessExecution = getProcessExecution;
1006
+ function getShellExecution(taskDto) {
1007
+ if (taskDto.command && Array.isArray(taskDto.args) && taskDto.args.length !== 0) {
1008
+ return new types.ShellExecution(taskDto.command, taskDto.args, taskDto.options || {});
1009
+ }
1010
+ return new types.ShellExecution(taskDto.command || taskDto.commandLine, taskDto.options || {});
1011
+ }
1012
+ exports.getShellExecution = getShellExecution;
1013
+ function getCustomExecution(taskDto) {
1014
+ return new types.CustomExecution(taskDto.callback);
1015
+ }
1016
+ exports.getCustomExecution = getCustomExecution;
1017
+ function getShellArgs(args) {
1018
+ if (!args || args.length === 0) {
1019
+ return [];
1020
+ }
1021
+ const element = args[0];
1022
+ if (typeof element === 'string') {
1023
+ return args;
1024
+ }
1025
+ const result = [];
1026
+ const shellQuotedArgs = args;
1027
+ shellQuotedArgs.forEach(arg => {
1028
+ result.push(arg.value);
1029
+ });
1030
+ return result;
1031
+ }
1032
+ exports.getShellArgs = getShellArgs;
1033
+ function getCommand(command) {
1034
+ return typeof command === 'string' ? command : command.value;
1035
+ }
1036
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1037
+ function getShellExecutionOptions(options) {
1038
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1039
+ const result = {};
1040
+ const env = options.env;
1041
+ if (env) {
1042
+ result['env'] = env;
1043
+ }
1044
+ const executable = options.executable;
1045
+ if (executable) {
1046
+ result['executable'] = executable;
1047
+ }
1048
+ const shellQuoting = options.shellQuoting;
1049
+ if (shellQuoting) {
1050
+ result['shellQuoting'] = shellQuoting;
1051
+ }
1052
+ const shellArgs = options.shellArgs;
1053
+ if (shellArgs) {
1054
+ result['shellArgs'] = shellArgs;
1055
+ }
1056
+ const cwd = options.cwd;
1057
+ if (cwd) {
1058
+ Object.assign(result, { cwd });
1059
+ }
1060
+ return result;
1061
+ }
1062
+ exports.getShellExecutionOptions = getShellExecutionOptions;
1063
+ function fromSymbolInformation(symbolInformation) {
1064
+ if (!symbolInformation) {
1065
+ return undefined;
1066
+ }
1067
+ if (symbolInformation.location && symbolInformation.location.range) {
1068
+ const p1 = lstypes.Position.create(symbolInformation.location.range.start.line, symbolInformation.location.range.start.character);
1069
+ const p2 = lstypes.Position.create(symbolInformation.location.range.end.line, symbolInformation.location.range.end.character);
1070
+ return lstypes.SymbolInformation.create(symbolInformation.name, symbolInformation.kind++, lstypes.Range.create(p1, p2), symbolInformation.location.uri.toString(), symbolInformation.containerName);
1071
+ }
1072
+ return {
1073
+ name: symbolInformation.name,
1074
+ containerName: symbolInformation.containerName,
1075
+ kind: symbolInformation.kind++,
1076
+ location: {
1077
+ uri: symbolInformation.location.uri.toString(),
1078
+ range: symbolInformation.location.range,
1079
+ }
1080
+ };
1081
+ }
1082
+ exports.fromSymbolInformation = fromSymbolInformation;
1083
+ function toSymbolInformation(symbolInformation) {
1084
+ if (!symbolInformation) {
1085
+ return undefined;
1086
+ }
1087
+ return {
1088
+ name: symbolInformation.name,
1089
+ containerName: symbolInformation.containerName,
1090
+ kind: symbolInformation.kind,
1091
+ location: {
1092
+ uri: types_impl_1.URI.parse(symbolInformation.location.uri),
1093
+ range: symbolInformation.location.range
1094
+ }
1095
+ };
1096
+ }
1097
+ exports.toSymbolInformation = toSymbolInformation;
1098
+ function fromSelectionRange(selectionRange) {
1099
+ return { range: fromRange(selectionRange.range) };
1100
+ }
1101
+ exports.fromSelectionRange = fromSelectionRange;
1102
+ function fromFoldingRange(foldingRange) {
1103
+ const range = {
1104
+ start: foldingRange.start + 1,
1105
+ end: foldingRange.end + 1
1106
+ };
1107
+ if (foldingRange.kind) {
1108
+ range.kind = fromFoldingRangeKind(foldingRange.kind);
1109
+ }
1110
+ return range;
1111
+ }
1112
+ exports.fromFoldingRange = fromFoldingRange;
1113
+ function fromFoldingRangeKind(kind) {
1114
+ if (kind) {
1115
+ switch (kind) {
1116
+ case types.FoldingRangeKind.Comment:
1117
+ return model.FoldingRangeKind.Comment;
1118
+ case types.FoldingRangeKind.Imports:
1119
+ return model.FoldingRangeKind.Imports;
1120
+ case types.FoldingRangeKind.Region:
1121
+ return model.FoldingRangeKind.Region;
1122
+ }
1123
+ }
1124
+ return undefined;
1125
+ }
1126
+ exports.fromFoldingRangeKind = fromFoldingRangeKind;
1127
+ function fromColor(color) {
1128
+ return [color.red, color.green, color.blue, color.alpha];
1129
+ }
1130
+ exports.fromColor = fromColor;
1131
+ function toColor(color) {
1132
+ return new types.Color(color[0], color[1], color[2], color[3]);
1133
+ }
1134
+ exports.toColor = toColor;
1135
+ function fromColorPresentation(colorPresentation) {
1136
+ return {
1137
+ label: colorPresentation.label,
1138
+ textEdit: colorPresentation.textEdit ? fromTextEdit(colorPresentation.textEdit) : undefined,
1139
+ additionalTextEdits: colorPresentation.additionalTextEdits ? colorPresentation.additionalTextEdits.map(value => fromTextEdit(value)) : undefined
1140
+ };
1141
+ }
1142
+ exports.fromColorPresentation = fromColorPresentation;
1143
+ function convertIconPath(iconPath) {
1144
+ var _a;
1145
+ if (!iconPath) {
1146
+ return undefined;
1147
+ }
1148
+ if (iconPath instanceof types.URI) {
1149
+ return iconPath.toJSON();
1150
+ }
1151
+ else if ('dark' in iconPath) {
1152
+ return {
1153
+ dark: iconPath.dark.toJSON(),
1154
+ light: (_a = iconPath.light) === null || _a === void 0 ? void 0 : _a.toJSON()
1155
+ };
1156
+ }
1157
+ else if (themables_1.ThemeIcon.isThemeIcon(iconPath)) {
1158
+ return {
1159
+ id: iconPath.id,
1160
+ color: iconPath.color ? { id: iconPath.color.id } : undefined
1161
+ };
1162
+ }
1163
+ else {
1164
+ return undefined;
1165
+ }
1166
+ }
1167
+ exports.convertIconPath = convertIconPath;
1168
+ function convertQuickInputButton(button, index) {
1169
+ const iconPath = convertIconPath(button.iconPath);
1170
+ if (!iconPath) {
1171
+ throw new Error(`Could not convert icon path: '${button.iconPath}'`);
1172
+ }
1173
+ return {
1174
+ handle: index,
1175
+ iconPath: iconPath,
1176
+ tooltip: button.tooltip
1177
+ };
1178
+ }
1179
+ exports.convertQuickInputButton = convertQuickInputButton;
1180
+ function convertToTransferQuickPickItems(items) {
1181
+ return items.map((item, index) => {
1182
+ if (typeof item === 'string') {
1183
+ return { kind: 'item', label: item, handle: index };
1184
+ }
1185
+ else if (item.kind === types_impl_1.QuickPickItemKind.Separator) {
1186
+ return { kind: 'separator', label: item.label, handle: index };
1187
+ }
1188
+ else {
1189
+ const { label, description, iconPath, detail, picked, alwaysShow, buttons } = item;
1190
+ return {
1191
+ kind: 'item',
1192
+ label,
1193
+ description,
1194
+ iconPath: convertIconPath(iconPath),
1195
+ detail,
1196
+ picked,
1197
+ alwaysShow,
1198
+ buttons: buttons ? buttons.map(convertQuickInputButton) : undefined,
1199
+ handle: index,
1200
+ };
1201
+ }
1202
+ });
1203
+ }
1204
+ exports.convertToTransferQuickPickItems = convertToTransferQuickPickItems;
1205
+ var DecorationRenderOptions;
1206
+ (function (DecorationRenderOptions) {
1207
+ function from(options) {
1208
+ return {
1209
+ isWholeLine: options.isWholeLine,
1210
+ rangeBehavior: options.rangeBehavior ? DecorationRangeBehavior.from(options.rangeBehavior) : undefined,
1211
+ overviewRulerLane: options.overviewRulerLane,
1212
+ light: options.light ? ThemableDecorationRenderOptions.from(options.light) : undefined,
1213
+ dark: options.dark ? ThemableDecorationRenderOptions.from(options.dark) : undefined,
1214
+ backgroundColor: options.backgroundColor,
1215
+ outline: options.outline,
1216
+ outlineColor: options.outlineColor,
1217
+ outlineStyle: options.outlineStyle,
1218
+ outlineWidth: options.outlineWidth,
1219
+ border: options.border,
1220
+ borderColor: options.borderColor,
1221
+ borderRadius: options.borderRadius,
1222
+ borderSpacing: options.borderSpacing,
1223
+ borderStyle: options.borderStyle,
1224
+ borderWidth: options.borderWidth,
1225
+ fontStyle: options.fontStyle,
1226
+ fontWeight: options.fontWeight,
1227
+ textDecoration: options.textDecoration,
1228
+ cursor: options.cursor,
1229
+ color: options.color,
1230
+ opacity: options.opacity,
1231
+ letterSpacing: options.letterSpacing,
1232
+ gutterIconPath: options.gutterIconPath ? pathOrURIToURI(options.gutterIconPath) : undefined,
1233
+ gutterIconSize: options.gutterIconSize,
1234
+ overviewRulerColor: options.overviewRulerColor,
1235
+ before: options.before ? ThemableDecorationAttachmentRenderOptions.from(options.before) : undefined,
1236
+ after: options.after ? ThemableDecorationAttachmentRenderOptions.from(options.after) : undefined,
1237
+ };
1238
+ }
1239
+ DecorationRenderOptions.from = from;
1240
+ })(DecorationRenderOptions = exports.DecorationRenderOptions || (exports.DecorationRenderOptions = {}));
1241
+ var DecorationRangeBehavior;
1242
+ (function (DecorationRangeBehavior) {
1243
+ function from(value) {
1244
+ if (typeof value === 'undefined') {
1245
+ return value;
1246
+ }
1247
+ switch (value) {
1248
+ case types.DecorationRangeBehavior.OpenOpen:
1249
+ return rpc.TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges;
1250
+ case types.DecorationRangeBehavior.ClosedClosed:
1251
+ return rpc.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges;
1252
+ case types.DecorationRangeBehavior.OpenClosed:
1253
+ return rpc.TrackedRangeStickiness.GrowsOnlyWhenTypingBefore;
1254
+ case types.DecorationRangeBehavior.ClosedOpen:
1255
+ return rpc.TrackedRangeStickiness.GrowsOnlyWhenTypingAfter;
1256
+ }
1257
+ }
1258
+ DecorationRangeBehavior.from = from;
1259
+ })(DecorationRangeBehavior = exports.DecorationRangeBehavior || (exports.DecorationRangeBehavior = {}));
1260
+ var ThemableDecorationRenderOptions;
1261
+ (function (ThemableDecorationRenderOptions) {
1262
+ function from(options) {
1263
+ if (typeof options === 'undefined') {
1264
+ return options;
1265
+ }
1266
+ return {
1267
+ backgroundColor: options.backgroundColor,
1268
+ outline: options.outline,
1269
+ outlineColor: options.outlineColor,
1270
+ outlineStyle: options.outlineStyle,
1271
+ outlineWidth: options.outlineWidth,
1272
+ border: options.border,
1273
+ borderColor: options.borderColor,
1274
+ borderRadius: options.borderRadius,
1275
+ borderSpacing: options.borderSpacing,
1276
+ borderStyle: options.borderStyle,
1277
+ borderWidth: options.borderWidth,
1278
+ fontStyle: options.fontStyle,
1279
+ fontWeight: options.fontWeight,
1280
+ textDecoration: options.textDecoration,
1281
+ cursor: options.cursor,
1282
+ color: options.color,
1283
+ opacity: options.opacity,
1284
+ letterSpacing: options.letterSpacing,
1285
+ gutterIconPath: options.gutterIconPath ? pathOrURIToURI(options.gutterIconPath) : undefined,
1286
+ gutterIconSize: options.gutterIconSize,
1287
+ overviewRulerColor: options.overviewRulerColor,
1288
+ before: options.before ? ThemableDecorationAttachmentRenderOptions.from(options.before) : undefined,
1289
+ after: options.after ? ThemableDecorationAttachmentRenderOptions.from(options.after) : undefined,
1290
+ };
1291
+ }
1292
+ ThemableDecorationRenderOptions.from = from;
1293
+ })(ThemableDecorationRenderOptions = exports.ThemableDecorationRenderOptions || (exports.ThemableDecorationRenderOptions = {}));
1294
+ var ThemableDecorationAttachmentRenderOptions;
1295
+ (function (ThemableDecorationAttachmentRenderOptions) {
1296
+ function from(options) {
1297
+ if (typeof options === 'undefined') {
1298
+ return options;
1299
+ }
1300
+ return {
1301
+ contentText: options.contentText,
1302
+ contentIconPath: options.contentIconPath ? pathOrURIToURI(options.contentIconPath) : undefined,
1303
+ border: options.border,
1304
+ borderColor: options.borderColor,
1305
+ fontStyle: options.fontStyle,
1306
+ fontWeight: options.fontWeight,
1307
+ textDecoration: options.textDecoration,
1308
+ color: options.color,
1309
+ backgroundColor: options.backgroundColor,
1310
+ margin: options.margin,
1311
+ width: options.width,
1312
+ height: options.height,
1313
+ };
1314
+ }
1315
+ ThemableDecorationAttachmentRenderOptions.from = from;
1316
+ })(ThemableDecorationAttachmentRenderOptions = exports.ThemableDecorationAttachmentRenderOptions || (exports.ThemableDecorationAttachmentRenderOptions = {}));
1317
+ var ViewColumn;
1318
+ (function (ViewColumn) {
1319
+ function from(column) {
1320
+ if (typeof column === 'number' && column >= types.ViewColumn.One) {
1321
+ return column - 1; // adjust zero index (ViewColumn.ONE => 0)
1322
+ }
1323
+ if (column === types.ViewColumn.Beside) {
1324
+ return SIDE_GROUP;
1325
+ }
1326
+ return ACTIVE_GROUP; // default is always the active group
1327
+ }
1328
+ ViewColumn.from = from;
1329
+ function to(position) {
1330
+ if (typeof position === 'number' && position >= 0) {
1331
+ return position + 1; // adjust to index (ViewColumn.ONE => 1)
1332
+ }
1333
+ throw new Error('invalid \'EditorGroupColumn\'');
1334
+ }
1335
+ ViewColumn.to = to;
1336
+ })(ViewColumn = exports.ViewColumn || (exports.ViewColumn = {}));
1337
+ function pathOrURIToURI(value) {
1338
+ if (typeof value === 'undefined') {
1339
+ return value;
1340
+ }
1341
+ if (typeof value === 'string') {
1342
+ return types_impl_1.URI.file(value);
1343
+ }
1344
+ else {
1345
+ return value;
1346
+ }
1347
+ }
1348
+ exports.pathOrURIToURI = pathOrURIToURI;
1349
+ function pluginToPluginInfo(plugin) {
1350
+ return {
1351
+ id: plugin.model.id,
1352
+ name: plugin.model.name,
1353
+ displayName: plugin.model.displayName
1354
+ };
1355
+ }
1356
+ exports.pluginToPluginInfo = pluginToPluginInfo;
1357
+ var InlayHintKind;
1358
+ (function (InlayHintKind) {
1359
+ function from(kind) {
1360
+ return kind;
1361
+ }
1362
+ InlayHintKind.from = from;
1363
+ function to(kind) {
1364
+ return kind;
1365
+ }
1366
+ InlayHintKind.to = to;
1367
+ })(InlayHintKind = exports.InlayHintKind || (exports.InlayHintKind = {}));
1368
+ var DataTransferItem;
1369
+ (function (DataTransferItem) {
1370
+ function to(mime, item, resolveFileData) {
1371
+ const file = item.fileData;
1372
+ if (file) {
1373
+ return new class extends types.DataTransferItem {
1374
+ asFile() {
1375
+ return {
1376
+ name: file.name,
1377
+ uri: types_impl_1.URI.revive(file.uri),
1378
+ data: () => resolveFileData(file.id),
1379
+ };
1380
+ }
1381
+ }('');
1382
+ }
1383
+ if (mime === 'text/uri-list' && item.uriListData) {
1384
+ return new types.DataTransferItem(reviveUriList(item.uriListData));
1385
+ }
1386
+ return new types.DataTransferItem(item.asString);
1387
+ }
1388
+ DataTransferItem.to = to;
1389
+ function reviveUriList(parts) {
1390
+ return parts.map(part => typeof part === 'string' ? part : types_impl_1.URI.revive(part).toString()).join('\r\n');
1391
+ }
1392
+ })(DataTransferItem = exports.DataTransferItem || (exports.DataTransferItem = {}));
1393
+ var DataTransfer;
1394
+ (function (DataTransfer) {
1395
+ function toDataTransfer(value, resolveFileData) {
1396
+ const dataTransfer = new types.DataTransfer();
1397
+ for (const [mimeType, item] of value.items) {
1398
+ dataTransfer.set(mimeType, DataTransferItem.to(mimeType, item, resolveFileData));
1399
+ }
1400
+ return dataTransfer;
1401
+ }
1402
+ DataTransfer.toDataTransfer = toDataTransfer;
1403
+ })(DataTransfer = exports.DataTransfer || (exports.DataTransfer = {}));
1404
+ var NotebookDocumentContentOptions;
1405
+ (function (NotebookDocumentContentOptions) {
1406
+ function from(options) {
1407
+ var _a, _b, _c;
1408
+ return {
1409
+ transientOutputs: (_a = options === null || options === void 0 ? void 0 : options.transientOutputs) !== null && _a !== void 0 ? _a : false,
1410
+ transientCellMetadata: (_b = options === null || options === void 0 ? void 0 : options.transientCellMetadata) !== null && _b !== void 0 ? _b : {},
1411
+ transientDocumentMetadata: (_c = options === null || options === void 0 ? void 0 : options.transientDocumentMetadata) !== null && _c !== void 0 ? _c : {},
1412
+ };
1413
+ }
1414
+ NotebookDocumentContentOptions.from = from;
1415
+ })(NotebookDocumentContentOptions = exports.NotebookDocumentContentOptions || (exports.NotebookDocumentContentOptions = {}));
1416
+ var NotebookStatusBarItem;
1417
+ (function (NotebookStatusBarItem) {
1418
+ function from(item, commandsConverter, disposables) {
1419
+ const command = typeof item.command === 'string' ? { title: '', command: item.command } : item.command;
1420
+ return {
1421
+ alignment: item.alignment === types.NotebookCellStatusBarAlignment.Left ? 1 /* Left */ : 2 /* Right */,
1422
+ command: commandsConverter.toSafeCommand(command, disposables),
1423
+ text: item.text,
1424
+ tooltip: item.tooltip,
1425
+ priority: item.priority
1426
+ };
1427
+ }
1428
+ NotebookStatusBarItem.from = from;
1429
+ })(NotebookStatusBarItem = exports.NotebookStatusBarItem || (exports.NotebookStatusBarItem = {}));
1430
+ var NotebookData;
1431
+ (function (NotebookData) {
1432
+ function from(data) {
1433
+ var _a;
1434
+ const res = {
1435
+ metadata: (_a = data.metadata) !== null && _a !== void 0 ? _a : Object.create(null),
1436
+ cells: [],
1437
+ };
1438
+ for (const cell of data.cells) {
1439
+ // types.NotebookCellData.validate(cell);
1440
+ res.cells.push(NotebookCellData.from(cell));
1441
+ }
1442
+ return res;
1443
+ }
1444
+ NotebookData.from = from;
1445
+ function to(data) {
1446
+ const res = new types.NotebookData(data.cells.map(NotebookCellData.to));
1447
+ if (!(0, common_1.isEmptyObject)(data.metadata)) {
1448
+ res.metadata = data.metadata;
1449
+ }
1450
+ return res;
1451
+ }
1452
+ NotebookData.to = to;
1453
+ })(NotebookData = exports.NotebookData || (exports.NotebookData = {}));
1454
+ var NotebookCellData;
1455
+ (function (NotebookCellData) {
1456
+ function from(data) {
1457
+ return {
1458
+ cellKind: NotebookCellKind.from(data.kind),
1459
+ language: data.languageId,
1460
+ source: data.value,
1461
+ // metadata: data.metadata,
1462
+ // internalMetadata: NotebookCellExecutionSummary.from(data.executionSummary ?? {}),
1463
+ outputs: data.outputs ? data.outputs.map(NotebookCellOutputConverter.from) : []
1464
+ };
1465
+ }
1466
+ NotebookCellData.from = from;
1467
+ function to(data) {
1468
+ return new types.NotebookCellData(NotebookCellKind.to(data.cellKind), data.source, data.language, data.outputs ? data.outputs.map(NotebookCellOutput.to) : undefined, data.metadata, data.internalMetadata ? NotebookCellExecutionSummary.to(data.internalMetadata) : undefined);
1469
+ }
1470
+ NotebookCellData.to = to;
1471
+ })(NotebookCellData = exports.NotebookCellData || (exports.NotebookCellData = {}));
1472
+ var NotebookCellKind;
1473
+ (function (NotebookCellKind) {
1474
+ function from(data) {
1475
+ switch (data) {
1476
+ case types.NotebookCellKind.Markup:
1477
+ return notebooks.CellKind.Markup;
1478
+ case types.NotebookCellKind.Code:
1479
+ default:
1480
+ return notebooks.CellKind.Code;
1481
+ }
1482
+ }
1483
+ NotebookCellKind.from = from;
1484
+ function to(data) {
1485
+ switch (data) {
1486
+ case notebooks.CellKind.Markup:
1487
+ return types.NotebookCellKind.Markup;
1488
+ case notebooks.CellKind.Code:
1489
+ default:
1490
+ return types.NotebookCellKind.Code;
1491
+ }
1492
+ }
1493
+ NotebookCellKind.to = to;
1494
+ })(NotebookCellKind = exports.NotebookCellKind || (exports.NotebookCellKind = {}));
1495
+ var NotebookCellOutput;
1496
+ (function (NotebookCellOutput) {
1497
+ function from(output) {
1498
+ return {
1499
+ outputId: output.outputId,
1500
+ items: output.items.map(NotebookCellOutputItem.from),
1501
+ metadata: output.metadata
1502
+ };
1503
+ }
1504
+ NotebookCellOutput.from = from;
1505
+ function to(output) {
1506
+ const items = output.items.map(NotebookCellOutputItem.to);
1507
+ return new types.NotebookCellOutput(items, output.outputId, output.metadata);
1508
+ }
1509
+ NotebookCellOutput.to = to;
1510
+ })(NotebookCellOutput = exports.NotebookCellOutput || (exports.NotebookCellOutput = {}));
1511
+ var NotebookCellOutputItem;
1512
+ (function (NotebookCellOutputItem) {
1513
+ function from(item) {
1514
+ return {
1515
+ mime: item.mime,
1516
+ valueBytes: buffer_1.BinaryBuffer.wrap(item.data),
1517
+ };
1518
+ }
1519
+ NotebookCellOutputItem.from = from;
1520
+ function to(item) {
1521
+ return new types.NotebookCellOutputItem(item.valueBytes.buffer, item.mime);
1522
+ }
1523
+ NotebookCellOutputItem.to = to;
1524
+ })(NotebookCellOutputItem = exports.NotebookCellOutputItem || (exports.NotebookCellOutputItem = {}));
1525
+ var NotebookCellOutputConverter;
1526
+ (function (NotebookCellOutputConverter) {
1527
+ function from(output) {
1528
+ return {
1529
+ outputId: output.outputId,
1530
+ items: output.items.map(NotebookCellOutputItem.from),
1531
+ metadata: output.metadata
1532
+ };
1533
+ }
1534
+ NotebookCellOutputConverter.from = from;
1535
+ function to(output) {
1536
+ const items = output.items.map(NotebookCellOutputItem.to);
1537
+ return new types.NotebookCellOutput(items, output.outputId, output.metadata);
1538
+ }
1539
+ NotebookCellOutputConverter.to = to;
1540
+ function ensureUniqueMimeTypes(items, warn = false) {
1541
+ const seen = new Set();
1542
+ const removeIdx = new Set();
1543
+ for (let i = 0; i < items.length; i++) {
1544
+ const item = items[i];
1545
+ // We can have multiple text stream mime types in the same output.
1546
+ if (!seen.has(item.mime) || (0, common_2.isTextStreamMime)(item.mime)) {
1547
+ seen.add(item.mime);
1548
+ continue;
1549
+ }
1550
+ // duplicated mime types... first has won
1551
+ removeIdx.add(i);
1552
+ if (warn) {
1553
+ console.warn(`DUPLICATED mime type '${item.mime}' will be dropped`);
1554
+ }
1555
+ }
1556
+ if (removeIdx.size === 0) {
1557
+ return items;
1558
+ }
1559
+ return items.filter((_, index) => !removeIdx.has(index));
1560
+ }
1561
+ NotebookCellOutputConverter.ensureUniqueMimeTypes = ensureUniqueMimeTypes;
1562
+ })(NotebookCellOutputConverter = exports.NotebookCellOutputConverter || (exports.NotebookCellOutputConverter = {}));
1563
+ var NotebookCellExecutionSummary;
1564
+ (function (NotebookCellExecutionSummary) {
1565
+ function to(data) {
1566
+ return {
1567
+ timing: typeof data.runStartTime === 'number' && typeof data.runEndTime === 'number' ? { startTime: data.runStartTime, endTime: data.runEndTime } : undefined,
1568
+ executionOrder: data.executionOrder,
1569
+ success: data.lastRunSuccess
1570
+ };
1571
+ }
1572
+ NotebookCellExecutionSummary.to = to;
1573
+ function from(data) {
1574
+ var _a, _b;
1575
+ return {
1576
+ lastRunSuccess: data.success,
1577
+ runStartTime: (_a = data.timing) === null || _a === void 0 ? void 0 : _a.startTime,
1578
+ runEndTime: (_b = data.timing) === null || _b === void 0 ? void 0 : _b.endTime,
1579
+ executionOrder: data.executionOrder
1580
+ };
1581
+ }
1582
+ NotebookCellExecutionSummary.from = from;
1583
+ })(NotebookCellExecutionSummary = exports.NotebookCellExecutionSummary || (exports.NotebookCellExecutionSummary = {}));
1584
+ var NotebookRange;
1585
+ (function (NotebookRange) {
1586
+ function from(range) {
1587
+ return { start: range.start, end: range.end };
1588
+ }
1589
+ NotebookRange.from = from;
1590
+ function to(range) {
1591
+ return new types.NotebookRange(range.start, range.end);
1592
+ }
1593
+ NotebookRange.to = to;
1594
+ })(NotebookRange = exports.NotebookRange || (exports.NotebookRange = {}));
1595
+ var NotebookKernelSourceAction;
1596
+ (function (NotebookKernelSourceAction) {
1597
+ function from(item, commandsConverter, disposables) {
1598
+ const command = typeof item.command === 'string' ? { title: '', command: item.command } : item.command;
1599
+ return {
1600
+ command: commandsConverter.toSafeCommand(command, disposables),
1601
+ label: item.label,
1602
+ description: item.description,
1603
+ detail: item.detail,
1604
+ documentation: item.documentation
1605
+ };
1606
+ }
1607
+ NotebookKernelSourceAction.from = from;
1608
+ })(NotebookKernelSourceAction = exports.NotebookKernelSourceAction || (exports.NotebookKernelSourceAction = {}));
1609
+ var TestMessage;
1610
+ (function (TestMessage) {
1611
+ function from(message) {
1612
+ if ((0, arrays_1.isReadonlyArray)(message)) {
1613
+ return message.map(msg => TestMessage.from(msg)[0]);
1614
+ }
1615
+ return [{
1616
+ location: fromLocation(message.location),
1617
+ message: fromMarkdown(message.message),
1618
+ expected: message.expectedOutput,
1619
+ actual: message.actualOutput,
1620
+ contextValue: message.contextValue
1621
+ }];
1622
+ }
1623
+ TestMessage.from = from;
1624
+ })(TestMessage = exports.TestMessage || (exports.TestMessage = {}));
1625
+ var TestItem;
1626
+ (function (TestItem) {
1627
+ function from(test) {
1628
+ return TestItem.fromPartial(test);
1629
+ }
1630
+ TestItem.from = from;
1631
+ function fromPartial(test) {
1632
+ const result = {};
1633
+ if ('id' in test) {
1634
+ result.id = test.id;
1635
+ }
1636
+ if ('uri' in test) {
1637
+ result.uri = test.uri;
1638
+ }
1639
+ if ('label' in test) {
1640
+ result.label = test.label;
1641
+ }
1642
+ if ('range' in test) {
1643
+ result.range = fromRange(test.range);
1644
+ }
1645
+ if ('sortKey' in test) {
1646
+ result.sortKey = test.sortText;
1647
+ }
1648
+ if ('tags' in test) {
1649
+ result.tags = test.tags ? test.tags.map(tag => tag.id) : [];
1650
+ }
1651
+ if ('busy' in test) {
1652
+ result.busy = test.busy;
1653
+ }
1654
+ if ('sortKey' in test) {
1655
+ result.sortKey = test.sortText;
1656
+ }
1657
+ if ('canResolveChildren' in test) {
1658
+ result.canResolveChildren = test.canResolveChildren;
1659
+ }
1660
+ if ('description' in test) {
1661
+ result.description = test.description;
1662
+ }
1663
+ if ('description' in test) {
1664
+ result.error = test.error;
1665
+ }
1666
+ if (test.children) {
1667
+ const children = [];
1668
+ test.children.forEach(item => {
1669
+ children.push(TestItem.from(item));
1670
+ });
1671
+ result.children = children;
1672
+ }
1673
+ return result;
1674
+ }
1675
+ TestItem.fromPartial = fromPartial;
1676
+ })(TestItem = exports.TestItem || (exports.TestItem = {}));
1638
1677
  //# sourceMappingURL=type-converters.js.map