@difizen/libro-language-client 0.1.18

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 (298) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +0 -0
  3. package/es/common/api.d.ts +38 -0
  4. package/es/common/api.d.ts.map +1 -0
  5. package/es/common/api.js +9 -0
  6. package/es/common/callHierarchy.d.ts +39 -0
  7. package/es/common/callHierarchy.d.ts.map +1 -0
  8. package/es/common/callHierarchy.js +139 -0
  9. package/es/common/client.d.ts +482 -0
  10. package/es/common/client.d.ts.map +1 -0
  11. package/es/common/client.js +2731 -0
  12. package/es/common/codeAction.d.ts +22 -0
  13. package/es/common/codeAction.d.ts.map +1 -0
  14. package/es/common/codeAction.js +149 -0
  15. package/es/common/codeConverter.d.ts +81 -0
  16. package/es/common/codeConverter.d.ts.map +1 -0
  17. package/es/common/codeConverter.js +1040 -0
  18. package/es/common/codeLens.d.ts +26 -0
  19. package/es/common/codeLens.d.ts.map +1 -0
  20. package/es/common/codeLens.js +125 -0
  21. package/es/common/colorProvider.d.ts +27 -0
  22. package/es/common/colorProvider.d.ts.map +1 -0
  23. package/es/common/colorProvider.js +104 -0
  24. package/es/common/completion.d.ts +22 -0
  25. package/es/common/completion.d.ts.map +1 -0
  26. package/es/common/completion.js +130 -0
  27. package/es/common/configuration.d.ts +71 -0
  28. package/es/common/configuration.d.ts.map +1 -0
  29. package/es/common/configuration.js +292 -0
  30. package/es/common/declaration.d.ts +18 -0
  31. package/es/common/declaration.d.ts.map +1 -0
  32. package/es/common/declaration.js +88 -0
  33. package/es/common/definition.d.ts +18 -0
  34. package/es/common/definition.d.ts.map +1 -0
  35. package/es/common/definition.js +80 -0
  36. package/es/common/diagnostic.d.ts +125 -0
  37. package/es/common/diagnostic.d.ts.map +1 -0
  38. package/es/common/diagnostic.js +1442 -0
  39. package/es/common/documentHighlight.d.ts +17 -0
  40. package/es/common/documentHighlight.d.ts.map +1 -0
  41. package/es/common/documentHighlight.js +73 -0
  42. package/es/common/documentLink.d.ts +21 -0
  43. package/es/common/documentLink.d.ts.map +1 -0
  44. package/es/common/documentLink.js +90 -0
  45. package/es/common/documentSymbol.d.ts +20 -0
  46. package/es/common/documentSymbol.d.ts.map +1 -0
  47. package/es/common/documentSymbol.js +134 -0
  48. package/es/common/executeCommand.d.ts +22 -0
  49. package/es/common/executeCommand.d.ts.map +1 -0
  50. package/es/common/executeCommand.js +117 -0
  51. package/es/common/features.d.ts +421 -0
  52. package/es/common/features.d.ts.map +1 -0
  53. package/es/common/features.js +576 -0
  54. package/es/common/fileOperations.d.ts +118 -0
  55. package/es/common/fileOperations.d.ts.map +1 -0
  56. package/es/common/fileOperations.js +705 -0
  57. package/es/common/fileSystemWatcher.d.ts +19 -0
  58. package/es/common/fileSystemWatcher.d.ts.map +1 -0
  59. package/es/common/fileSystemWatcher.js +173 -0
  60. package/es/common/foldingRange.d.ts +22 -0
  61. package/es/common/foldingRange.d.ts.map +1 -0
  62. package/es/common/foldingRange.js +127 -0
  63. package/es/common/formatting.d.ts +41 -0
  64. package/es/common/formatting.d.ts.map +1 -0
  65. package/es/common/formatting.js +233 -0
  66. package/es/common/hover.d.ts +18 -0
  67. package/es/common/hover.d.ts.map +1 -0
  68. package/es/common/hover.js +80 -0
  69. package/es/common/implementation.d.ts +18 -0
  70. package/es/common/implementation.d.ts.map +1 -0
  71. package/es/common/implementation.js +88 -0
  72. package/es/common/inlayHint.d.ts +23 -0
  73. package/es/common/inlayHint.d.ts.map +1 -0
  74. package/es/common/inlayHint.js +187 -0
  75. package/es/common/inlineCompletion.d.ts +20 -0
  76. package/es/common/inlineCompletion.d.ts.map +1 -0
  77. package/es/common/inlineCompletion.js +74 -0
  78. package/es/common/inlineValue.d.ts +21 -0
  79. package/es/common/inlineValue.d.ts.map +1 -0
  80. package/es/common/inlineValue.js +124 -0
  81. package/es/common/linkedEditingRange.d.ts +23 -0
  82. package/es/common/linkedEditingRange.d.ts.map +1 -0
  83. package/es/common/linkedEditingRange.js +94 -0
  84. package/es/common/notebook.d.ts +97 -0
  85. package/es/common/notebook.d.ts.map +1 -0
  86. package/es/common/notebook.js +1444 -0
  87. package/es/common/progress.d.ts +12 -0
  88. package/es/common/progress.d.ts.map +1 -0
  89. package/es/common/progress.js +75 -0
  90. package/es/common/progressPart.d.ts +25 -0
  91. package/es/common/progressPart.d.ts.map +1 -0
  92. package/es/common/progressPart.js +147 -0
  93. package/es/common/protocolCallHierarchyItem.d.ts +9 -0
  94. package/es/common/protocolCallHierarchyItem.d.ts.map +1 -0
  95. package/es/common/protocolCallHierarchyItem.js +34 -0
  96. package/es/common/protocolCodeAction.d.ts +7 -0
  97. package/es/common/protocolCodeAction.d.ts.map +1 -0
  98. package/es/common/protocolCodeAction.js +32 -0
  99. package/es/common/protocolCodeLens.d.ts +7 -0
  100. package/es/common/protocolCodeLens.d.ts.map +1 -0
  101. package/es/common/protocolCodeLens.js +29 -0
  102. package/es/common/protocolCompletionItem.d.ts +13 -0
  103. package/es/common/protocolCompletionItem.d.ts.map +1 -0
  104. package/es/common/protocolCompletionItem.js +29 -0
  105. package/es/common/protocolConverter.d.ts +174 -0
  106. package/es/common/protocolConverter.d.ts.map +1 -0
  107. package/es/common/protocolConverter.js +1982 -0
  108. package/es/common/protocolDiagnostic.d.ts +20 -0
  109. package/es/common/protocolDiagnostic.d.ts.map +1 -0
  110. package/es/common/protocolDiagnostic.js +46 -0
  111. package/es/common/protocolDocumentLink.d.ts +8 -0
  112. package/es/common/protocolDocumentLink.d.ts.map +1 -0
  113. package/es/common/protocolDocumentLink.js +29 -0
  114. package/es/common/protocolInlayHint.d.ts +8 -0
  115. package/es/common/protocolInlayHint.d.ts.map +1 -0
  116. package/es/common/protocolInlayHint.js +29 -0
  117. package/es/common/protocolTypeHierarchyItem.d.ts +9 -0
  118. package/es/common/protocolTypeHierarchyItem.d.ts.map +1 -0
  119. package/es/common/protocolTypeHierarchyItem.js +34 -0
  120. package/es/common/protocolWorkspaceSymbol.d.ts +9 -0
  121. package/es/common/protocolWorkspaceSymbol.d.ts.map +1 -0
  122. package/es/common/protocolWorkspaceSymbol.js +36 -0
  123. package/es/common/reference.d.ts +22 -0
  124. package/es/common/reference.d.ts.map +1 -0
  125. package/es/common/reference.js +78 -0
  126. package/es/common/rename.d.ts +29 -0
  127. package/es/common/rename.d.ts.map +1 -0
  128. package/es/common/rename.js +132 -0
  129. package/es/common/selectionRange.d.ts +18 -0
  130. package/es/common/selectionRange.d.ts.map +1 -0
  131. package/es/common/selectionRange.js +108 -0
  132. package/es/common/semanticTokens.d.ts +36 -0
  133. package/es/common/semanticTokens.d.ts.map +1 -0
  134. package/es/common/semanticTokens.js +226 -0
  135. package/es/common/signatureHelp.d.ts +18 -0
  136. package/es/common/signatureHelp.d.ts.map +1 -0
  137. package/es/common/signatureHelp.js +103 -0
  138. package/es/common/textSynchronization.d.ts +104 -0
  139. package/es/common/textSynchronization.d.ts.map +1 -0
  140. package/es/common/textSynchronization.js +771 -0
  141. package/es/common/typeDefinition.d.ts +18 -0
  142. package/es/common/typeDefinition.d.ts.map +1 -0
  143. package/es/common/typeDefinition.js +89 -0
  144. package/es/common/typeHierarchy.d.ts +33 -0
  145. package/es/common/typeHierarchy.d.ts.map +1 -0
  146. package/es/common/typeHierarchy.js +138 -0
  147. package/es/common/utils/async.d.ts +42 -0
  148. package/es/common/utils/async.d.ts.map +1 -0
  149. package/es/common/utils/async.js +441 -0
  150. package/es/common/utils/is.d.ts +13 -0
  151. package/es/common/utils/is.d.ts.map +1 -0
  152. package/es/common/utils/is.js +52 -0
  153. package/es/common/utils/uuid.d.ts +23 -0
  154. package/es/common/utils/uuid.d.ts.map +1 -0
  155. package/es/common/utils/uuid.js +85 -0
  156. package/es/common/vscodeAdaptor/convertor.d.ts +7 -0
  157. package/es/common/vscodeAdaptor/convertor.d.ts.map +1 -0
  158. package/es/common/vscodeAdaptor/convertor.js +66 -0
  159. package/es/common/vscodeAdaptor/diagnosticCollection.d.ts +33 -0
  160. package/es/common/vscodeAdaptor/diagnosticCollection.d.ts.map +1 -0
  161. package/es/common/vscodeAdaptor/diagnosticCollection.js +310 -0
  162. package/es/common/vscodeAdaptor/extHostTypes.d.ts +1496 -0
  163. package/es/common/vscodeAdaptor/extHostTypes.d.ts.map +1 -0
  164. package/es/common/vscodeAdaptor/extHostTypes.js +3825 -0
  165. package/es/common/vscodeAdaptor/fileWatcher.d.ts +19 -0
  166. package/es/common/vscodeAdaptor/fileWatcher.d.ts.map +1 -0
  167. package/es/common/vscodeAdaptor/fileWatcher.js +45 -0
  168. package/es/common/vscodeAdaptor/hostTypeUtil.d.ts +192 -0
  169. package/es/common/vscodeAdaptor/hostTypeUtil.d.ts.map +1 -0
  170. package/es/common/vscodeAdaptor/hostTypeUtil.js +566 -0
  171. package/es/common/vscodeAdaptor/libro-fs.d.ts +21 -0
  172. package/es/common/vscodeAdaptor/libro-fs.d.ts.map +1 -0
  173. package/es/common/vscodeAdaptor/libro-fs.js +64 -0
  174. package/es/common/vscodeAdaptor/libroWindow.d.ts +21 -0
  175. package/es/common/vscodeAdaptor/libroWindow.d.ts.map +1 -0
  176. package/es/common/vscodeAdaptor/libroWindow.js +75 -0
  177. package/es/common/vscodeAdaptor/libroWorkspace.d.ts +33 -0
  178. package/es/common/vscodeAdaptor/libroWorkspace.d.ts.map +1 -0
  179. package/es/common/vscodeAdaptor/libroWorkspace.js +250 -0
  180. package/es/common/vscodeAdaptor/lspEnv.d.ts +8 -0
  181. package/es/common/vscodeAdaptor/lspEnv.d.ts.map +1 -0
  182. package/es/common/vscodeAdaptor/lspEnv.js +31 -0
  183. package/es/common/vscodeAdaptor/monaco-converter.d.ts +229 -0
  184. package/es/common/vscodeAdaptor/monaco-converter.d.ts.map +1 -0
  185. package/es/common/vscodeAdaptor/monaco-converter.js +1613 -0
  186. package/es/common/vscodeAdaptor/monacoLanguages.d.ts +48 -0
  187. package/es/common/vscodeAdaptor/monacoLanguages.d.ts.map +1 -0
  188. package/es/common/vscodeAdaptor/monacoLanguages.js +484 -0
  189. package/es/common/vscodeAdaptor/services.d.ts +85 -0
  190. package/es/common/vscodeAdaptor/services.d.ts.map +1 -0
  191. package/es/common/vscodeAdaptor/services.js +3 -0
  192. package/es/common/vscodeAdaptor/typings.d.ts +10 -0
  193. package/es/common/vscodeAdaptor/util.d.ts +3 -0
  194. package/es/common/vscodeAdaptor/util.d.ts.map +1 -0
  195. package/es/common/vscodeAdaptor/util.js +6 -0
  196. package/es/common/vscodeAdaptor/vscodeAdaptor.d.ts +77 -0
  197. package/es/common/vscodeAdaptor/vscodeAdaptor.d.ts.map +1 -0
  198. package/es/common/vscodeAdaptor/vscodeAdaptor.js +124 -0
  199. package/es/common/workspaceFolder.d.ts +32 -0
  200. package/es/common/workspaceFolder.d.ts.map +1 -0
  201. package/es/common/workspaceFolder.js +204 -0
  202. package/es/common/workspaceSymbol.d.ts +21 -0
  203. package/es/common/workspaceSymbol.d.ts.map +1 -0
  204. package/es/common/workspaceSymbol.js +101 -0
  205. package/es/constants.d.ts +2 -0
  206. package/es/constants.d.ts.map +1 -0
  207. package/es/constants.js +1 -0
  208. package/es/index.d.ts +6 -0
  209. package/es/index.d.ts.map +1 -0
  210. package/es/index.js +5 -0
  211. package/es/libro-language-client-contribution.d.ts +10 -0
  212. package/es/libro-language-client-contribution.d.ts.map +1 -0
  213. package/es/libro-language-client-contribution.js +143 -0
  214. package/es/libro-language-client-manager.d.ts +34 -0
  215. package/es/libro-language-client-manager.d.ts.map +1 -0
  216. package/es/libro-language-client-manager.js +277 -0
  217. package/es/libro-language-client.d.ts +27 -0
  218. package/es/libro-language-client.d.ts.map +1 -0
  219. package/es/libro-language-client.js +141 -0
  220. package/es/module.d.ts +3 -0
  221. package/es/module.d.ts.map +1 -0
  222. package/es/module.js +13 -0
  223. package/package.json +69 -0
  224. package/src/common/api.ts +155 -0
  225. package/src/common/callHierarchy.ts +269 -0
  226. package/src/common/client.ts +3192 -0
  227. package/src/common/codeAction.ts +237 -0
  228. package/src/common/codeConverter.ts +1409 -0
  229. package/src/common/codeLens.ts +188 -0
  230. package/src/common/colorProvider.ts +192 -0
  231. package/src/common/completion.ts +281 -0
  232. package/src/common/configuration.ts +338 -0
  233. package/src/common/declaration.ts +140 -0
  234. package/src/common/definition.ts +138 -0
  235. package/src/common/diagnostic.ts +1408 -0
  236. package/src/common/documentHighlight.ts +140 -0
  237. package/src/common/documentLink.ts +180 -0
  238. package/src/common/documentSymbol.ts +186 -0
  239. package/src/common/executeCommand.ts +129 -0
  240. package/src/common/features.ts +1157 -0
  241. package/src/common/fileOperations.ts +635 -0
  242. package/src/common/fileSystemWatcher.ts +184 -0
  243. package/src/common/foldingRange.ts +160 -0
  244. package/src/common/formatting.ts +465 -0
  245. package/src/common/hover.ts +133 -0
  246. package/src/common/implementation.ts +142 -0
  247. package/src/common/inlayHint.ts +201 -0
  248. package/src/common/inlineCompletion.ts +160 -0
  249. package/src/common/inlineValue.ts +158 -0
  250. package/src/common/linkedEditingRange.ts +141 -0
  251. package/src/common/notebook.ts +1443 -0
  252. package/src/common/progress.ts +61 -0
  253. package/src/common/progressPart.ts +151 -0
  254. package/src/common/protocolCallHierarchyItem.ts +29 -0
  255. package/src/common/protocolCodeAction.ts +17 -0
  256. package/src/common/protocolCodeLens.ts +15 -0
  257. package/src/common/protocolCompletionItem.ts +22 -0
  258. package/src/common/protocolConverter.ts +2627 -0
  259. package/src/common/protocolDiagnostic.ts +47 -0
  260. package/src/common/protocolDocumentLink.ts +17 -0
  261. package/src/common/protocolInlayHint.ts +21 -0
  262. package/src/common/protocolTypeHierarchyItem.ts +29 -0
  263. package/src/common/protocolWorkspaceSymbol.ts +39 -0
  264. package/src/common/reference.ts +144 -0
  265. package/src/common/rename.ts +230 -0
  266. package/src/common/selectionRange.ts +136 -0
  267. package/src/common/semanticTokens.ts +383 -0
  268. package/src/common/signatureHelp.ts +170 -0
  269. package/src/common/textSynchronization.ts +819 -0
  270. package/src/common/typeDefinition.ts +146 -0
  271. package/src/common/typeHierarchy.ts +248 -0
  272. package/src/common/utils/async.ts +354 -0
  273. package/src/common/utils/is.ts +63 -0
  274. package/src/common/utils/uuid.ts +136 -0
  275. package/src/common/vscodeAdaptor/convertor.ts +73 -0
  276. package/src/common/vscodeAdaptor/diagnosticCollection.ts +238 -0
  277. package/src/common/vscodeAdaptor/extHostTypes.ts +4498 -0
  278. package/src/common/vscodeAdaptor/fileWatcher.ts +36 -0
  279. package/src/common/vscodeAdaptor/hostTypeUtil.ts +539 -0
  280. package/src/common/vscodeAdaptor/libro-fs.ts +51 -0
  281. package/src/common/vscodeAdaptor/libroWindow.ts +85 -0
  282. package/src/common/vscodeAdaptor/libroWorkspace.ts +261 -0
  283. package/src/common/vscodeAdaptor/lspEnv.ts +16 -0
  284. package/src/common/vscodeAdaptor/monaco-converter.ts +1800 -0
  285. package/src/common/vscodeAdaptor/monacoLanguages.ts +511 -0
  286. package/src/common/vscodeAdaptor/services.ts +278 -0
  287. package/src/common/vscodeAdaptor/typings.d.ts +10 -0
  288. package/src/common/vscodeAdaptor/util.ts +7 -0
  289. package/src/common/vscodeAdaptor/vscodeAdaptor.ts +122 -0
  290. package/src/common/workspaceFolder.ts +236 -0
  291. package/src/common/workspaceSymbol.ts +166 -0
  292. package/src/constants.ts +1 -0
  293. package/src/index.spec.ts +7 -0
  294. package/src/index.ts +5 -0
  295. package/src/libro-language-client-contribution.ts +49 -0
  296. package/src/libro-language-client-manager.ts +131 -0
  297. package/src/libro-language-client.ts +100 -0
  298. package/src/module.ts +19 -0
@@ -0,0 +1,3825 @@
1
+ var _Symbol$iterator;
2
+ var _TaskGroup;
3
+ function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
4
+ function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
5
+ function _isNativeFunction(fn) { try { return Function.toString.call(fn).indexOf("[native code]") !== -1; } catch (e) { return typeof fn === "function"; } }
6
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
7
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
8
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
9
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
10
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
11
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
12
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
13
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
14
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
15
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
16
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
17
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
18
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
19
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
20
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
21
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
22
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
23
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
24
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
25
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
26
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
27
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
28
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
29
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
30
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
31
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
32
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
33
+ function _classPrivateFieldLooseBase(receiver, privateKey) { if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) { throw new TypeError("attempted to use private field on non-instance"); } return receiver; }
34
+ var id = 0;
35
+ function _classPrivateFieldLooseKey(name) { return "__private_" + id++ + "_" + name; }
36
+ /* eslint-disable no-useless-escape */
37
+ /* eslint-disable @typescript-eslint/no-empty-function */
38
+ /* eslint-disable @typescript-eslint/ban-types */
39
+ /* eslint-disable no-console */
40
+ /*---------------------------------------------------------------------------------------------
41
+ * Copyright (c) Microsoft Corporation. All rights reserved.
42
+ * Licensed under the MIT License. See License.txt in the project root for license information.
43
+ *--------------------------------------------------------------------------------------------*/
44
+
45
+ // src/vs/workbench/api/common/extHostTypes.ts
46
+
47
+ import { v4 as generateUuid } from 'uuid';
48
+ import { URI } from 'vscode-uri';
49
+ import { FileSystemProviderErrorCode, markAsFileSystemProviderError } from "./hostTypeUtil.js";
50
+ import { CellEditType, isTextStreamMime } from "./hostTypeUtil.js";
51
+ import { isNumber, isObject, isString, isStringArray } from "./hostTypeUtil.js";
52
+ import { Mimes, normalizeMimeType } from "./hostTypeUtil.js";
53
+ import { ResourceMap } from "./hostTypeUtil.js";
54
+ import { MarkdownString as BaseMarkdownString } from "./hostTypeUtil.js";
55
+ import { illegalArgument } from "./hostTypeUtil.js";
56
+ import { asArray, coalesceInPlace, equals } from "./hostTypeUtil.js";
57
+ export var TerminalOutputAnchor = /*#__PURE__*/function (TerminalOutputAnchor) {
58
+ TerminalOutputAnchor[TerminalOutputAnchor["Top"] = 0] = "Top";
59
+ TerminalOutputAnchor[TerminalOutputAnchor["Bottom"] = 1] = "Bottom";
60
+ return TerminalOutputAnchor;
61
+ }({});
62
+ export var TerminalQuickFixType = /*#__PURE__*/function (TerminalQuickFixType) {
63
+ TerminalQuickFixType[TerminalQuickFixType["TerminalCommand"] = 0] = "TerminalCommand";
64
+ TerminalQuickFixType[TerminalQuickFixType["Opener"] = 1] = "Opener";
65
+ TerminalQuickFixType[TerminalQuickFixType["Command"] = 3] = "Command";
66
+ return TerminalQuickFixType;
67
+ }({});
68
+ var _callOnDispose = /*#__PURE__*/_classPrivateFieldLooseKey("callOnDispose");
69
+ export var Disposable = /*#__PURE__*/function () {
70
+ function Disposable(callOnDispose) {
71
+ _classCallCheck(this, Disposable);
72
+ Object.defineProperty(this, _callOnDispose, {
73
+ writable: true,
74
+ value: void 0
75
+ });
76
+ _classPrivateFieldLooseBase(this, _callOnDispose)[_callOnDispose] = callOnDispose;
77
+ }
78
+ _createClass(Disposable, [{
79
+ key: "dispose",
80
+ value: function dispose() {
81
+ if (typeof _classPrivateFieldLooseBase(this, _callOnDispose)[_callOnDispose] === 'function') {
82
+ _classPrivateFieldLooseBase(this, _callOnDispose)[_callOnDispose]();
83
+ _classPrivateFieldLooseBase(this, _callOnDispose)[_callOnDispose] = undefined;
84
+ }
85
+ }
86
+ }], [{
87
+ key: "from",
88
+ value: function from() {
89
+ for (var _len = arguments.length, inDisposables = new Array(_len), _key = 0; _key < _len; _key++) {
90
+ inDisposables[_key] = arguments[_key];
91
+ }
92
+ var disposables = inDisposables;
93
+ return new Disposable(function () {
94
+ if (disposables) {
95
+ for (var _i = 0, _disposables = disposables; _i < _disposables.length; _i++) {
96
+ var disposable = _disposables[_i];
97
+ if (disposable && typeof disposable.dispose === 'function') {
98
+ disposable.dispose();
99
+ }
100
+ }
101
+ disposables = undefined;
102
+ }
103
+ });
104
+ }
105
+ }]);
106
+ return Disposable;
107
+ }();
108
+ export var Position = /*#__PURE__*/function () {
109
+ function Position(line, character) {
110
+ _classCallCheck(this, Position);
111
+ if (line < 0) {
112
+ throw illegalArgument('line must be non-negative');
113
+ }
114
+ if (character < 0) {
115
+ throw illegalArgument('character must be non-negative');
116
+ }
117
+ this._line = line;
118
+ this._character = character;
119
+ }
120
+ _createClass(Position, [{
121
+ key: "line",
122
+ get: function get() {
123
+ return this._line;
124
+ }
125
+ }, {
126
+ key: "character",
127
+ get: function get() {
128
+ return this._character;
129
+ }
130
+ }, {
131
+ key: "isBefore",
132
+ value: function isBefore(other) {
133
+ if (this._line < other._line) {
134
+ return true;
135
+ }
136
+ if (other._line < this._line) {
137
+ return false;
138
+ }
139
+ return this._character < other._character;
140
+ }
141
+ }, {
142
+ key: "isBeforeOrEqual",
143
+ value: function isBeforeOrEqual(other) {
144
+ if (this._line < other._line) {
145
+ return true;
146
+ }
147
+ if (other._line < this._line) {
148
+ return false;
149
+ }
150
+ return this._character <= other._character;
151
+ }
152
+ }, {
153
+ key: "isAfter",
154
+ value: function isAfter(other) {
155
+ return !this.isBeforeOrEqual(other);
156
+ }
157
+ }, {
158
+ key: "isAfterOrEqual",
159
+ value: function isAfterOrEqual(other) {
160
+ return !this.isBefore(other);
161
+ }
162
+ }, {
163
+ key: "isEqual",
164
+ value: function isEqual(other) {
165
+ return this._line === other._line && this._character === other._character;
166
+ }
167
+ }, {
168
+ key: "compareTo",
169
+ value: function compareTo(other) {
170
+ if (this._line < other._line) {
171
+ return -1;
172
+ } else if (this._line > other.line) {
173
+ return 1;
174
+ } else {
175
+ // equal line
176
+ if (this._character < other._character) {
177
+ return -1;
178
+ } else if (this._character > other._character) {
179
+ return 1;
180
+ } else {
181
+ // equal line and character
182
+ return 0;
183
+ }
184
+ }
185
+ }
186
+ }, {
187
+ key: "translate",
188
+ value: function translate(lineDeltaOrChange) {
189
+ var characterDelta = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
190
+ if (lineDeltaOrChange === null || characterDelta === null) {
191
+ throw illegalArgument();
192
+ }
193
+ var lineDelta;
194
+ if (typeof lineDeltaOrChange === 'undefined') {
195
+ lineDelta = 0;
196
+ } else if (typeof lineDeltaOrChange === 'number') {
197
+ lineDelta = lineDeltaOrChange;
198
+ } else {
199
+ lineDelta = typeof lineDeltaOrChange.lineDelta === 'number' ? lineDeltaOrChange.lineDelta : 0;
200
+ characterDelta = typeof lineDeltaOrChange.characterDelta === 'number' ? lineDeltaOrChange.characterDelta : 0;
201
+ }
202
+ if (lineDelta === 0 && characterDelta === 0) {
203
+ return this;
204
+ }
205
+ return new Position(this.line + lineDelta, this.character + characterDelta);
206
+ }
207
+ }, {
208
+ key: "with",
209
+ value: function _with(lineOrChange) {
210
+ var character = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.character;
211
+ if (lineOrChange === null || character === null) {
212
+ throw illegalArgument();
213
+ }
214
+ var line;
215
+ if (typeof lineOrChange === 'undefined') {
216
+ line = this.line;
217
+ } else if (typeof lineOrChange === 'number') {
218
+ line = lineOrChange;
219
+ } else {
220
+ line = typeof lineOrChange.line === 'number' ? lineOrChange.line : this.line;
221
+ character = typeof lineOrChange.character === 'number' ? lineOrChange.character : this.character;
222
+ }
223
+ if (line === this.line && character === this.character) {
224
+ return this;
225
+ }
226
+ return new Position(line, character);
227
+ }
228
+ }, {
229
+ key: "toJSON",
230
+ value: function toJSON() {
231
+ return {
232
+ line: this.line,
233
+ character: this.character
234
+ };
235
+ }
236
+ }], [{
237
+ key: "Min",
238
+ value: function Min() {
239
+ if (arguments.length === 0) {
240
+ throw new TypeError();
241
+ }
242
+ var result = arguments.length <= 0 ? undefined : arguments[0];
243
+ for (var i = 1; i < arguments.length; i++) {
244
+ var p = i < 0 || arguments.length <= i ? undefined : arguments[i];
245
+ if (p.isBefore(result)) {
246
+ result = p;
247
+ }
248
+ }
249
+ return result;
250
+ }
251
+ }, {
252
+ key: "Max",
253
+ value: function Max() {
254
+ if (arguments.length === 0) {
255
+ throw new TypeError();
256
+ }
257
+ var result = arguments.length <= 0 ? undefined : arguments[0];
258
+ for (var i = 1; i < arguments.length; i++) {
259
+ var p = i < 0 || arguments.length <= i ? undefined : arguments[i];
260
+ if (p.isAfter(result)) {
261
+ result = p;
262
+ }
263
+ }
264
+ return result;
265
+ }
266
+ }, {
267
+ key: "isPosition",
268
+ value: function isPosition(other) {
269
+ if (!other) {
270
+ return false;
271
+ }
272
+ if (other instanceof Position) {
273
+ return true;
274
+ }
275
+ var _ref = other,
276
+ line = _ref.line,
277
+ character = _ref.character;
278
+ if (typeof line === 'number' && typeof character === 'number') {
279
+ return true;
280
+ }
281
+ return false;
282
+ }
283
+ }, {
284
+ key: "of",
285
+ value: function of(obj) {
286
+ if (obj instanceof Position) {
287
+ return obj;
288
+ } else if (this.isPosition(obj)) {
289
+ return new Position(obj.line, obj.character);
290
+ }
291
+ throw new Error('Invalid argument, is NOT a position-like object');
292
+ }
293
+ }]);
294
+ return Position;
295
+ }();
296
+ export var Range = /*#__PURE__*/function () {
297
+ function Range(startLineOrStart, startColumnOrEnd, endLine, endColumn) {
298
+ _classCallCheck(this, Range);
299
+ var start;
300
+ var end;
301
+ if (typeof startLineOrStart === 'number' && typeof startColumnOrEnd === 'number' && typeof endLine === 'number' && typeof endColumn === 'number') {
302
+ start = new Position(startLineOrStart, startColumnOrEnd);
303
+ end = new Position(endLine, endColumn);
304
+ } else if (Position.isPosition(startLineOrStart) && Position.isPosition(startColumnOrEnd)) {
305
+ start = Position.of(startLineOrStart);
306
+ end = Position.of(startColumnOrEnd);
307
+ }
308
+ if (!start || !end) {
309
+ throw new Error('Invalid arguments');
310
+ }
311
+ if (start.isBefore(end)) {
312
+ this._start = start;
313
+ this._end = end;
314
+ } else {
315
+ this._start = end;
316
+ this._end = start;
317
+ }
318
+ }
319
+ _createClass(Range, [{
320
+ key: "start",
321
+ get: function get() {
322
+ return this._start;
323
+ }
324
+ }, {
325
+ key: "end",
326
+ get: function get() {
327
+ return this._end;
328
+ }
329
+ }, {
330
+ key: "contains",
331
+ value: function contains(positionOrRange) {
332
+ if (Range.isRange(positionOrRange)) {
333
+ return this.contains(positionOrRange.start) && this.contains(positionOrRange.end);
334
+ } else if (Position.isPosition(positionOrRange)) {
335
+ if (Position.of(positionOrRange).isBefore(this._start)) {
336
+ return false;
337
+ }
338
+ if (this._end.isBefore(positionOrRange)) {
339
+ return false;
340
+ }
341
+ return true;
342
+ }
343
+ return false;
344
+ }
345
+ }, {
346
+ key: "isEqual",
347
+ value: function isEqual(other) {
348
+ return this._start.isEqual(other._start) && this._end.isEqual(other._end);
349
+ }
350
+ }, {
351
+ key: "intersection",
352
+ value: function intersection(other) {
353
+ var start = Position.Max(other.start, this._start);
354
+ var end = Position.Min(other.end, this._end);
355
+ if (start.isAfter(end)) {
356
+ // this happens when there is no overlap:
357
+ // |-----|
358
+ // |----|
359
+ return undefined;
360
+ }
361
+ return new Range(start, end);
362
+ }
363
+ }, {
364
+ key: "union",
365
+ value: function union(other) {
366
+ if (this.contains(other)) {
367
+ return this;
368
+ } else if (other.contains(this)) {
369
+ return other;
370
+ }
371
+ var start = Position.Min(other.start, this._start);
372
+ var end = Position.Max(other.end, this.end);
373
+ return new Range(start, end);
374
+ }
375
+ }, {
376
+ key: "isEmpty",
377
+ get: function get() {
378
+ return this._start.isEqual(this._end);
379
+ }
380
+ }, {
381
+ key: "isSingleLine",
382
+ get: function get() {
383
+ return this._start.line === this._end.line;
384
+ }
385
+ }, {
386
+ key: "with",
387
+ value: function _with(startOrChange) {
388
+ var end = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.end;
389
+ if (startOrChange === null || end === null) {
390
+ throw illegalArgument();
391
+ }
392
+ var start;
393
+ if (!startOrChange) {
394
+ start = this.start;
395
+ } else if (Position.isPosition(startOrChange)) {
396
+ start = startOrChange;
397
+ } else {
398
+ start = startOrChange.start || this.start;
399
+ end = startOrChange.end || this.end;
400
+ }
401
+ if (start.isEqual(this._start) && end.isEqual(this.end)) {
402
+ return this;
403
+ }
404
+ return new Range(start, end);
405
+ }
406
+ }, {
407
+ key: "toJSON",
408
+ value: function toJSON() {
409
+ return [this.start, this.end];
410
+ }
411
+ }], [{
412
+ key: "isRange",
413
+ value: function isRange(thing) {
414
+ if (thing instanceof Range) {
415
+ return true;
416
+ }
417
+ if (!thing) {
418
+ return false;
419
+ }
420
+ return Position.isPosition(thing.start) && Position.isPosition(thing.end);
421
+ }
422
+ }, {
423
+ key: "of",
424
+ value: function of(obj) {
425
+ if (obj instanceof Range) {
426
+ return obj;
427
+ }
428
+ if (this.isRange(obj)) {
429
+ return new Range(obj.start, obj.end);
430
+ }
431
+ throw new Error('Invalid argument, is NOT a range-like object');
432
+ }
433
+ }]);
434
+ return Range;
435
+ }();
436
+ export var Selection = /*#__PURE__*/function (_Range) {
437
+ _inherits(Selection, _Range);
438
+ var _super = _createSuper(Selection);
439
+ function Selection(anchorLineOrAnchor, anchorColumnOrActive, activeLine, activeColumn) {
440
+ var _this;
441
+ _classCallCheck(this, Selection);
442
+ var anchor;
443
+ var active;
444
+ if (typeof anchorLineOrAnchor === 'number' && typeof anchorColumnOrActive === 'number' && typeof activeLine === 'number' && typeof activeColumn === 'number') {
445
+ anchor = new Position(anchorLineOrAnchor, anchorColumnOrActive);
446
+ active = new Position(activeLine, activeColumn);
447
+ } else if (Position.isPosition(anchorLineOrAnchor) && Position.isPosition(anchorColumnOrActive)) {
448
+ anchor = Position.of(anchorLineOrAnchor);
449
+ active = Position.of(anchorColumnOrActive);
450
+ }
451
+ if (!anchor || !active) {
452
+ throw new Error('Invalid arguments');
453
+ }
454
+ _this = _super.call(this, anchor, active);
455
+ _this._anchor = anchor;
456
+ _this._active = active;
457
+ return _this;
458
+ }
459
+ _createClass(Selection, [{
460
+ key: "anchor",
461
+ get: function get() {
462
+ return this._anchor;
463
+ }
464
+ }, {
465
+ key: "active",
466
+ get: function get() {
467
+ return this._active;
468
+ }
469
+ }, {
470
+ key: "isReversed",
471
+ get: function get() {
472
+ return this._anchor === this._end;
473
+ }
474
+ }, {
475
+ key: "toJSON",
476
+ value: function toJSON() {
477
+ return {
478
+ start: this.start,
479
+ end: this.end,
480
+ active: this.active,
481
+ anchor: this.anchor
482
+ };
483
+ }
484
+ }], [{
485
+ key: "isSelection",
486
+ value: function isSelection(thing) {
487
+ if (thing instanceof Selection) {
488
+ return true;
489
+ }
490
+ if (!thing) {
491
+ return false;
492
+ }
493
+ return Range.isRange(thing) && Position.isPosition(thing.anchor) && Position.isPosition(thing.active) && typeof thing.isReversed === 'boolean';
494
+ }
495
+ }]);
496
+ return Selection;
497
+ }(Range);
498
+ var validateConnectionToken = function validateConnectionToken(connectionToken) {
499
+ if (typeof connectionToken !== 'string' || connectionToken.length === 0 || !/^[0-9A-Za-z_\-]+$/.test(connectionToken)) {
500
+ throw illegalArgument('connectionToken');
501
+ }
502
+ };
503
+ export var ResolvedAuthority = /*#__PURE__*/function () {
504
+ function ResolvedAuthority(host, port, connectionToken) {
505
+ _classCallCheck(this, ResolvedAuthority);
506
+ if (typeof host !== 'string' || host.length === 0) {
507
+ throw illegalArgument('host');
508
+ }
509
+ if (typeof port !== 'number' || port === 0 || Math.round(port) !== port) {
510
+ throw illegalArgument('port');
511
+ }
512
+ if (typeof connectionToken !== 'undefined') {
513
+ validateConnectionToken(connectionToken);
514
+ }
515
+ this.host = host;
516
+ this.port = Math.round(port);
517
+ this.connectionToken = connectionToken;
518
+ }
519
+ _createClass(ResolvedAuthority, null, [{
520
+ key: "isResolvedAuthority",
521
+ value: function isResolvedAuthority(resolvedAuthority) {
522
+ return resolvedAuthority && _typeof(resolvedAuthority) === 'object' && typeof resolvedAuthority.host === 'string' && typeof resolvedAuthority.port === 'number' && (resolvedAuthority.connectionToken === undefined || typeof resolvedAuthority.connectionToken === 'string');
523
+ }
524
+ }]);
525
+ return ResolvedAuthority;
526
+ }();
527
+ export var EndOfLine = /*#__PURE__*/function (EndOfLine) {
528
+ EndOfLine[EndOfLine["LF"] = 1] = "LF";
529
+ EndOfLine[EndOfLine["CRLF"] = 2] = "CRLF";
530
+ return EndOfLine;
531
+ }({});
532
+ export var EnvironmentVariableMutatorType = /*#__PURE__*/function (EnvironmentVariableMutatorType) {
533
+ EnvironmentVariableMutatorType[EnvironmentVariableMutatorType["Replace"] = 1] = "Replace";
534
+ EnvironmentVariableMutatorType[EnvironmentVariableMutatorType["Append"] = 2] = "Append";
535
+ EnvironmentVariableMutatorType[EnvironmentVariableMutatorType["Prepend"] = 3] = "Prepend";
536
+ return EnvironmentVariableMutatorType;
537
+ }({});
538
+ export var TextEdit = /*#__PURE__*/function () {
539
+ function TextEdit(range, newText) {
540
+ _classCallCheck(this, TextEdit);
541
+ this._range = range;
542
+ this._newText = newText;
543
+ }
544
+ _createClass(TextEdit, [{
545
+ key: "range",
546
+ get: function get() {
547
+ return this._range;
548
+ },
549
+ set: function set(value) {
550
+ if (value && !Range.isRange(value)) {
551
+ throw illegalArgument('range');
552
+ }
553
+ this._range = value;
554
+ }
555
+ }, {
556
+ key: "newText",
557
+ get: function get() {
558
+ return this._newText || '';
559
+ },
560
+ set: function set(value) {
561
+ if (value && typeof value !== 'string') {
562
+ throw illegalArgument('newText');
563
+ }
564
+ this._newText = value;
565
+ }
566
+ }, {
567
+ key: "newEol",
568
+ get: function get() {
569
+ return this._newEol;
570
+ },
571
+ set: function set(value) {
572
+ if (value && typeof value !== 'number') {
573
+ throw illegalArgument('newEol');
574
+ }
575
+ this._newEol = value;
576
+ }
577
+ }, {
578
+ key: "toJSON",
579
+ value: function toJSON() {
580
+ return {
581
+ range: this.range,
582
+ newText: this.newText,
583
+ newEol: this._newEol
584
+ };
585
+ }
586
+ }], [{
587
+ key: "isTextEdit",
588
+ value: function isTextEdit(thing) {
589
+ if (thing instanceof TextEdit) {
590
+ return true;
591
+ }
592
+ if (!thing) {
593
+ return false;
594
+ }
595
+ return Range.isRange(thing) && typeof thing.newText === 'string';
596
+ }
597
+ }, {
598
+ key: "replace",
599
+ value: function replace(range, newText) {
600
+ return new TextEdit(range, newText);
601
+ }
602
+ }, {
603
+ key: "insert",
604
+ value: function insert(position, newText) {
605
+ return TextEdit.replace(new Range(position, position), newText);
606
+ }
607
+ }, {
608
+ key: "delete",
609
+ value: function _delete(range) {
610
+ return TextEdit.replace(range, '');
611
+ }
612
+ }, {
613
+ key: "setEndOfLine",
614
+ value: function setEndOfLine(eol) {
615
+ var ret = new TextEdit(new Range(new Position(0, 0), new Position(0, 0)), '');
616
+ ret.newEol = eol;
617
+ return ret;
618
+ }
619
+ }]);
620
+ return TextEdit;
621
+ }();
622
+ export var NotebookEdit = /*#__PURE__*/function () {
623
+ function NotebookEdit(range, newCells) {
624
+ _classCallCheck(this, NotebookEdit);
625
+ this.range = range;
626
+ this.newCells = newCells;
627
+ }
628
+ _createClass(NotebookEdit, null, [{
629
+ key: "isNotebookCellEdit",
630
+ value: function isNotebookCellEdit(thing) {
631
+ if (thing instanceof NotebookEdit) {
632
+ return true;
633
+ }
634
+ if (!thing) {
635
+ return false;
636
+ }
637
+ return NotebookRange.isNotebookRange(thing) && Array.isArray(thing.newCells);
638
+ }
639
+ }, {
640
+ key: "replaceCells",
641
+ value: function replaceCells(range, newCells) {
642
+ return new NotebookEdit(range, newCells);
643
+ }
644
+ }, {
645
+ key: "insertCells",
646
+ value: function insertCells(index, newCells) {
647
+ return new NotebookEdit(new NotebookRange(index, index), newCells);
648
+ }
649
+ }, {
650
+ key: "deleteCells",
651
+ value: function deleteCells(range) {
652
+ return new NotebookEdit(range, []);
653
+ }
654
+ }, {
655
+ key: "updateCellMetadata",
656
+ value: function updateCellMetadata(index, newMetadata) {
657
+ var edit = new NotebookEdit(new NotebookRange(index, index), []);
658
+ edit.newCellMetadata = newMetadata;
659
+ return edit;
660
+ }
661
+ }, {
662
+ key: "updateNotebookMetadata",
663
+ value: function updateNotebookMetadata(newMetadata) {
664
+ var edit = new NotebookEdit(new NotebookRange(0, 0), []);
665
+ edit.newNotebookMetadata = newMetadata;
666
+ return edit;
667
+ }
668
+ }]);
669
+ return NotebookEdit;
670
+ }();
671
+ export var SnippetTextEdit = /*#__PURE__*/function () {
672
+ function SnippetTextEdit(range, snippet) {
673
+ _classCallCheck(this, SnippetTextEdit);
674
+ this.range = range;
675
+ this.snippet = snippet;
676
+ }
677
+ _createClass(SnippetTextEdit, null, [{
678
+ key: "isSnippetTextEdit",
679
+ value: function isSnippetTextEdit(thing) {
680
+ if (thing instanceof SnippetTextEdit) {
681
+ return true;
682
+ }
683
+ if (!thing) {
684
+ return false;
685
+ }
686
+ return Range.isRange(thing.range) && SnippetString.isSnippetString(thing.snippet);
687
+ }
688
+ }, {
689
+ key: "replace",
690
+ value: function replace(range, snippet) {
691
+ return new SnippetTextEdit(range, snippet);
692
+ }
693
+ }, {
694
+ key: "insert",
695
+ value: function insert(position, snippet) {
696
+ return SnippetTextEdit.replace(new Range(position, position), snippet);
697
+ }
698
+ }]);
699
+ return SnippetTextEdit;
700
+ }();
701
+ export var FileEditType = /*#__PURE__*/function (FileEditType) {
702
+ FileEditType[FileEditType["File"] = 1] = "File";
703
+ FileEditType[FileEditType["Text"] = 2] = "Text";
704
+ FileEditType[FileEditType["Cell"] = 3] = "Cell";
705
+ FileEditType[FileEditType["CellReplace"] = 5] = "CellReplace";
706
+ FileEditType[FileEditType["Snippet"] = 6] = "Snippet";
707
+ return FileEditType;
708
+ }({});
709
+ export var WorkspaceEdit = /*#__PURE__*/function () {
710
+ function WorkspaceEdit() {
711
+ _classCallCheck(this, WorkspaceEdit);
712
+ this._edits = [];
713
+ }
714
+ _createClass(WorkspaceEdit, [{
715
+ key: "_allEntries",
716
+ value: function _allEntries() {
717
+ return this._edits;
718
+ }
719
+
720
+ // --- file
721
+ }, {
722
+ key: "renameFile",
723
+ value: function renameFile(from, to, options, metadata) {
724
+ this._edits.push({
725
+ _type: FileEditType.File,
726
+ from: from,
727
+ to: to,
728
+ options: options,
729
+ metadata: metadata
730
+ });
731
+ }
732
+ }, {
733
+ key: "createFile",
734
+ value: function createFile(uri, options, metadata) {
735
+ this._edits.push({
736
+ _type: FileEditType.File,
737
+ from: undefined,
738
+ to: uri,
739
+ options: options,
740
+ metadata: metadata
741
+ });
742
+ }
743
+ }, {
744
+ key: "deleteFile",
745
+ value: function deleteFile(uri, options, metadata) {
746
+ this._edits.push({
747
+ _type: FileEditType.File,
748
+ from: uri,
749
+ to: undefined,
750
+ options: options,
751
+ metadata: metadata
752
+ });
753
+ }
754
+
755
+ // --- notebook
756
+ }, {
757
+ key: "replaceNotebookMetadata",
758
+ value: function replaceNotebookMetadata(uri, value, metadata) {
759
+ this._edits.push({
760
+ _type: FileEditType.Cell,
761
+ metadata: metadata,
762
+ uri: uri,
763
+ edit: {
764
+ editType: CellEditType.DocumentMetadata,
765
+ metadata: value
766
+ },
767
+ notebookMetadata: value
768
+ });
769
+ }
770
+ }, {
771
+ key: "replaceNotebookCells",
772
+ value: function replaceNotebookCells(uri, startOrRange, cellData, metadata) {
773
+ var start = startOrRange.start;
774
+ var end = startOrRange.end;
775
+ if (start !== end || cellData.length > 0) {
776
+ this._edits.push({
777
+ _type: FileEditType.CellReplace,
778
+ uri: uri,
779
+ index: start,
780
+ count: end - start,
781
+ cells: cellData,
782
+ metadata: metadata
783
+ });
784
+ }
785
+ }
786
+ }, {
787
+ key: "replaceNotebookCellMetadata",
788
+ value: function replaceNotebookCellMetadata(uri, index, cellMetadata, metadata) {
789
+ this._edits.push({
790
+ _type: FileEditType.Cell,
791
+ metadata: metadata,
792
+ uri: uri,
793
+ edit: {
794
+ editType: CellEditType.Metadata,
795
+ index: index,
796
+ metadata: cellMetadata
797
+ }
798
+ });
799
+ }
800
+
801
+ // --- text
802
+ }, {
803
+ key: "replace",
804
+ value: function replace(uri, range, newText, metadata) {
805
+ this._edits.push({
806
+ _type: FileEditType.Text,
807
+ uri: uri,
808
+ edit: new TextEdit(range, newText),
809
+ metadata: metadata
810
+ });
811
+ }
812
+ }, {
813
+ key: "insert",
814
+ value: function insert(resource, position, newText, metadata) {
815
+ this.replace(resource, new Range(position, position), newText, metadata);
816
+ }
817
+ }, {
818
+ key: "delete",
819
+ value: function _delete(resource, range, metadata) {
820
+ this.replace(resource, range, '', metadata);
821
+ }
822
+
823
+ // --- text (Maplike)
824
+ }, {
825
+ key: "has",
826
+ value: function has(uri) {
827
+ return this._edits.some(function (edit) {
828
+ return edit._type === FileEditType.Text && edit.uri.toString() === uri.toString();
829
+ });
830
+ }
831
+ }, {
832
+ key: "set",
833
+ value: function set(uri, edits) {
834
+ if (!edits) {
835
+ // remove all text, snippet, or notebook edits for `uri`
836
+ for (var i = 0; i < this._edits.length; i++) {
837
+ var element = this._edits[i];
838
+ switch (element._type) {
839
+ case FileEditType.Text:
840
+ case FileEditType.Snippet:
841
+ case FileEditType.Cell:
842
+ case FileEditType.CellReplace:
843
+ if (element.uri.toString() === uri.toString()) {
844
+ this._edits[i] = undefined; // will be coalesced down below
845
+ }
846
+ break;
847
+ }
848
+ }
849
+ coalesceInPlace(this._edits);
850
+ } else {
851
+ // append edit to the end
852
+ var _iterator = _createForOfIteratorHelper(edits),
853
+ _step;
854
+ try {
855
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
856
+ var editOrTuple = _step.value;
857
+ if (!editOrTuple) {
858
+ continue;
859
+ }
860
+ var edit = void 0;
861
+ var metadata = void 0;
862
+ if (Array.isArray(editOrTuple)) {
863
+ edit = editOrTuple[0];
864
+ metadata = editOrTuple[1];
865
+ } else {
866
+ edit = editOrTuple;
867
+ }
868
+ if (NotebookEdit.isNotebookCellEdit(edit)) {
869
+ if (edit.newCellMetadata) {
870
+ this.replaceNotebookCellMetadata(uri, edit.range.start, edit.newCellMetadata, metadata);
871
+ } else if (edit.newNotebookMetadata) {
872
+ this.replaceNotebookMetadata(uri, edit.newNotebookMetadata, metadata);
873
+ } else {
874
+ this.replaceNotebookCells(uri, edit.range, edit.newCells, metadata);
875
+ }
876
+ } else if (SnippetTextEdit.isSnippetTextEdit(edit)) {
877
+ this._edits.push({
878
+ _type: FileEditType.Snippet,
879
+ uri: uri,
880
+ range: edit.range,
881
+ edit: edit.snippet,
882
+ metadata: metadata
883
+ });
884
+ } else {
885
+ this._edits.push({
886
+ _type: FileEditType.Text,
887
+ uri: uri,
888
+ edit: edit,
889
+ metadata: metadata
890
+ });
891
+ }
892
+ }
893
+ } catch (err) {
894
+ _iterator.e(err);
895
+ } finally {
896
+ _iterator.f();
897
+ }
898
+ }
899
+ }
900
+ }, {
901
+ key: "get",
902
+ value: function get(uri) {
903
+ var res = [];
904
+ var _iterator2 = _createForOfIteratorHelper(this._edits),
905
+ _step2;
906
+ try {
907
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
908
+ var candidate = _step2.value;
909
+ if (candidate._type === FileEditType.Text && candidate.uri.toString() === uri.toString()) {
910
+ res.push(candidate.edit);
911
+ }
912
+ }
913
+ } catch (err) {
914
+ _iterator2.e(err);
915
+ } finally {
916
+ _iterator2.f();
917
+ }
918
+ return res;
919
+ }
920
+ }, {
921
+ key: "entries",
922
+ value: function entries() {
923
+ var textEdits = new ResourceMap();
924
+ var _iterator3 = _createForOfIteratorHelper(this._edits),
925
+ _step3;
926
+ try {
927
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
928
+ var candidate = _step3.value;
929
+ if (candidate._type === FileEditType.Text) {
930
+ var textEdit = textEdits.get(candidate.uri);
931
+ if (!textEdit) {
932
+ textEdit = [candidate.uri, []];
933
+ textEdits.set(candidate.uri, textEdit);
934
+ }
935
+ textEdit[1].push(candidate.edit);
936
+ }
937
+ }
938
+ } catch (err) {
939
+ _iterator3.e(err);
940
+ } finally {
941
+ _iterator3.f();
942
+ }
943
+ return _toConsumableArray(textEdits.values());
944
+ }
945
+ }, {
946
+ key: "size",
947
+ get: function get() {
948
+ return this.entries().length;
949
+ }
950
+ }, {
951
+ key: "toJSON",
952
+ value: function toJSON() {
953
+ return this.entries();
954
+ }
955
+ }]);
956
+ return WorkspaceEdit;
957
+ }();
958
+ export var SnippetString = /*#__PURE__*/function () {
959
+ function SnippetString(value) {
960
+ _classCallCheck(this, SnippetString);
961
+ this._tabstop = 1;
962
+ this.value = value || '';
963
+ }
964
+ _createClass(SnippetString, [{
965
+ key: "appendText",
966
+ value: function appendText(string) {
967
+ this.value += SnippetString._escape(string);
968
+ return this;
969
+ }
970
+ }, {
971
+ key: "appendTabstop",
972
+ value: function appendTabstop() {
973
+ var number = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this._tabstop++;
974
+ this.value += '$';
975
+ this.value += number;
976
+ return this;
977
+ }
978
+ }, {
979
+ key: "appendPlaceholder",
980
+ value: function appendPlaceholder(value) {
981
+ var number = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this._tabstop++;
982
+ if (typeof value === 'function') {
983
+ var nested = new SnippetString();
984
+ nested._tabstop = this._tabstop;
985
+ value(nested);
986
+ this._tabstop = nested._tabstop;
987
+ value = nested.value;
988
+ } else {
989
+ value = SnippetString._escape(value);
990
+ }
991
+ this.value += '${';
992
+ this.value += number;
993
+ this.value += ':';
994
+ this.value += value;
995
+ this.value += '}';
996
+ return this;
997
+ }
998
+ }, {
999
+ key: "appendChoice",
1000
+ value: function appendChoice(values) {
1001
+ var number = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this._tabstop++;
1002
+ var value = values.map(function (s) {
1003
+ return s.replaceAll(/[|\\,]/g, '\\$&');
1004
+ }).join(',');
1005
+ this.value += '${';
1006
+ this.value += number;
1007
+ this.value += '|';
1008
+ this.value += value;
1009
+ this.value += '|}';
1010
+ return this;
1011
+ }
1012
+ }, {
1013
+ key: "appendVariable",
1014
+ value: function appendVariable(name, defaultValue) {
1015
+ if (typeof defaultValue === 'function') {
1016
+ var nested = new SnippetString();
1017
+ nested._tabstop = this._tabstop;
1018
+ defaultValue(nested);
1019
+ this._tabstop = nested._tabstop;
1020
+ defaultValue = nested.value;
1021
+ } else if (typeof defaultValue === 'string') {
1022
+ defaultValue = defaultValue.replace(/\$|}/g, '\\$&'); // CodeQL [SM02383] I do not want to escape backslashes here
1023
+ }
1024
+ this.value += '${';
1025
+ this.value += name;
1026
+ if (defaultValue) {
1027
+ this.value += ':';
1028
+ this.value += defaultValue;
1029
+ }
1030
+ this.value += '}';
1031
+ return this;
1032
+ }
1033
+ }], [{
1034
+ key: "isSnippetString",
1035
+ value: function isSnippetString(thing) {
1036
+ if (thing instanceof SnippetString) {
1037
+ return true;
1038
+ }
1039
+ if (!thing) {
1040
+ return false;
1041
+ }
1042
+ return typeof thing.value === 'string';
1043
+ }
1044
+ }, {
1045
+ key: "_escape",
1046
+ value: function _escape(value) {
1047
+ return value.replace(/\$|}|\\/g, '\\$&');
1048
+ }
1049
+ }]);
1050
+ return SnippetString;
1051
+ }();
1052
+ export var DiagnosticTag = /*#__PURE__*/function (DiagnosticTag) {
1053
+ DiagnosticTag[DiagnosticTag["Unnecessary"] = 1] = "Unnecessary";
1054
+ DiagnosticTag[DiagnosticTag["Deprecated"] = 2] = "Deprecated";
1055
+ return DiagnosticTag;
1056
+ }({});
1057
+ export var DiagnosticSeverity = /*#__PURE__*/function (DiagnosticSeverity) {
1058
+ DiagnosticSeverity[DiagnosticSeverity["Hint"] = 3] = "Hint";
1059
+ DiagnosticSeverity[DiagnosticSeverity["Information"] = 2] = "Information";
1060
+ DiagnosticSeverity[DiagnosticSeverity["Warning"] = 1] = "Warning";
1061
+ DiagnosticSeverity[DiagnosticSeverity["Error"] = 0] = "Error";
1062
+ return DiagnosticSeverity;
1063
+ }({});
1064
+ export var Location = /*#__PURE__*/function () {
1065
+ function Location(uri, rangeOrPosition) {
1066
+ _classCallCheck(this, Location);
1067
+ this.uri = uri;
1068
+ if (!rangeOrPosition) {
1069
+ //that's OK
1070
+ } else if (Range.isRange(rangeOrPosition)) {
1071
+ this.range = Range.of(rangeOrPosition);
1072
+ } else if (Position.isPosition(rangeOrPosition)) {
1073
+ this.range = new Range(rangeOrPosition, rangeOrPosition);
1074
+ } else {
1075
+ throw new Error('Illegal argument');
1076
+ }
1077
+ }
1078
+ _createClass(Location, [{
1079
+ key: "toJSON",
1080
+ value: function toJSON() {
1081
+ return {
1082
+ uri: this.uri,
1083
+ range: this.range
1084
+ };
1085
+ }
1086
+ }], [{
1087
+ key: "isLocation",
1088
+ value: function isLocation(thing) {
1089
+ if (thing instanceof Location) {
1090
+ return true;
1091
+ }
1092
+ if (!thing) {
1093
+ return false;
1094
+ }
1095
+ return Range.isRange(thing.range) && URI.isUri(thing.uri);
1096
+ }
1097
+ }]);
1098
+ return Location;
1099
+ }();
1100
+ export var DiagnosticRelatedInformation = /*#__PURE__*/function () {
1101
+ function DiagnosticRelatedInformation(location, message) {
1102
+ _classCallCheck(this, DiagnosticRelatedInformation);
1103
+ this.location = location;
1104
+ this.message = message;
1105
+ }
1106
+ _createClass(DiagnosticRelatedInformation, null, [{
1107
+ key: "is",
1108
+ value: function is(thing) {
1109
+ if (!thing) {
1110
+ return false;
1111
+ }
1112
+ return typeof thing.message === 'string' && thing.location && Range.isRange(thing.location.range) && URI.isUri(thing.location.uri);
1113
+ }
1114
+ }, {
1115
+ key: "isEqual",
1116
+ value: function isEqual(a, b) {
1117
+ if (a === b) {
1118
+ return true;
1119
+ }
1120
+ if (!a || !b) {
1121
+ return false;
1122
+ }
1123
+ return a.message === b.message && a.location.range.isEqual(b.location.range) && a.location.uri.toString() === b.location.uri.toString();
1124
+ }
1125
+ }]);
1126
+ return DiagnosticRelatedInformation;
1127
+ }();
1128
+ export var Diagnostic = /*#__PURE__*/function () {
1129
+ function Diagnostic(range, message) {
1130
+ var severity = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DiagnosticSeverity.Error;
1131
+ _classCallCheck(this, Diagnostic);
1132
+ if (!Range.isRange(range)) {
1133
+ throw new TypeError('range must be set');
1134
+ }
1135
+ if (!message) {
1136
+ throw new TypeError('message must be set');
1137
+ }
1138
+ this.range = range;
1139
+ this.message = message;
1140
+ this.severity = severity;
1141
+ }
1142
+ _createClass(Diagnostic, [{
1143
+ key: "toJSON",
1144
+ value: function toJSON() {
1145
+ return {
1146
+ severity: DiagnosticSeverity[this.severity],
1147
+ message: this.message,
1148
+ range: this.range,
1149
+ source: this.source,
1150
+ code: this.code
1151
+ };
1152
+ }
1153
+ }], [{
1154
+ key: "isEqual",
1155
+ value: function isEqual(a, b) {
1156
+ if (a === b) {
1157
+ return true;
1158
+ }
1159
+ if (!a || !b) {
1160
+ return false;
1161
+ }
1162
+ return a.message === b.message && a.severity === b.severity && a.code === b.code && a.severity === b.severity && a.source === b.source && a.range.isEqual(b.range) && equals(a.tags, b.tags) && equals(a.relatedInformation, b.relatedInformation, DiagnosticRelatedInformation.isEqual);
1163
+ }
1164
+ }]);
1165
+ return Diagnostic;
1166
+ }();
1167
+ export var Hover = /*#__PURE__*/_createClass(function Hover(contents, range) {
1168
+ _classCallCheck(this, Hover);
1169
+ if (!contents) {
1170
+ throw new Error('Illegal argument, contents must be defined');
1171
+ }
1172
+ if (Array.isArray(contents)) {
1173
+ this.contents = contents;
1174
+ } else {
1175
+ this.contents = [contents];
1176
+ }
1177
+ this.range = range;
1178
+ });
1179
+ export var DocumentHighlightKind = /*#__PURE__*/function (DocumentHighlightKind) {
1180
+ DocumentHighlightKind[DocumentHighlightKind["Text"] = 0] = "Text";
1181
+ DocumentHighlightKind[DocumentHighlightKind["Read"] = 1] = "Read";
1182
+ DocumentHighlightKind[DocumentHighlightKind["Write"] = 2] = "Write";
1183
+ return DocumentHighlightKind;
1184
+ }({});
1185
+ export var DocumentHighlight = /*#__PURE__*/function () {
1186
+ function DocumentHighlight(range) {
1187
+ var kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DocumentHighlightKind.Text;
1188
+ _classCallCheck(this, DocumentHighlight);
1189
+ this.range = range;
1190
+ this.kind = kind;
1191
+ }
1192
+ _createClass(DocumentHighlight, [{
1193
+ key: "toJSON",
1194
+ value: function toJSON() {
1195
+ return {
1196
+ range: this.range,
1197
+ kind: DocumentHighlightKind[this.kind]
1198
+ };
1199
+ }
1200
+ }]);
1201
+ return DocumentHighlight;
1202
+ }();
1203
+ export var MultiDocumentHighlight = /*#__PURE__*/function () {
1204
+ function MultiDocumentHighlight(uri, highlights) {
1205
+ _classCallCheck(this, MultiDocumentHighlight);
1206
+ this.uri = uri;
1207
+ this.highlights = highlights;
1208
+ }
1209
+ _createClass(MultiDocumentHighlight, [{
1210
+ key: "toJSON",
1211
+ value: function toJSON() {
1212
+ return {
1213
+ uri: this.uri,
1214
+ highlights: this.highlights.map(function (h) {
1215
+ return h.toJSON();
1216
+ })
1217
+ };
1218
+ }
1219
+ }]);
1220
+ return MultiDocumentHighlight;
1221
+ }();
1222
+ export var SymbolKind = /*#__PURE__*/function (SymbolKind) {
1223
+ SymbolKind[SymbolKind["File"] = 0] = "File";
1224
+ SymbolKind[SymbolKind["Module"] = 1] = "Module";
1225
+ SymbolKind[SymbolKind["Namespace"] = 2] = "Namespace";
1226
+ SymbolKind[SymbolKind["Package"] = 3] = "Package";
1227
+ SymbolKind[SymbolKind["Class"] = 4] = "Class";
1228
+ SymbolKind[SymbolKind["Method"] = 5] = "Method";
1229
+ SymbolKind[SymbolKind["Property"] = 6] = "Property";
1230
+ SymbolKind[SymbolKind["Field"] = 7] = "Field";
1231
+ SymbolKind[SymbolKind["Constructor"] = 8] = "Constructor";
1232
+ SymbolKind[SymbolKind["Enum"] = 9] = "Enum";
1233
+ SymbolKind[SymbolKind["Interface"] = 10] = "Interface";
1234
+ SymbolKind[SymbolKind["Function"] = 11] = "Function";
1235
+ SymbolKind[SymbolKind["Variable"] = 12] = "Variable";
1236
+ SymbolKind[SymbolKind["Constant"] = 13] = "Constant";
1237
+ SymbolKind[SymbolKind["String"] = 14] = "String";
1238
+ SymbolKind[SymbolKind["Number"] = 15] = "Number";
1239
+ SymbolKind[SymbolKind["Boolean"] = 16] = "Boolean";
1240
+ SymbolKind[SymbolKind["Array"] = 17] = "Array";
1241
+ SymbolKind[SymbolKind["Object"] = 18] = "Object";
1242
+ SymbolKind[SymbolKind["Key"] = 19] = "Key";
1243
+ SymbolKind[SymbolKind["Null"] = 20] = "Null";
1244
+ SymbolKind[SymbolKind["EnumMember"] = 21] = "EnumMember";
1245
+ SymbolKind[SymbolKind["Struct"] = 22] = "Struct";
1246
+ SymbolKind[SymbolKind["Event"] = 23] = "Event";
1247
+ SymbolKind[SymbolKind["Operator"] = 24] = "Operator";
1248
+ SymbolKind[SymbolKind["TypeParameter"] = 25] = "TypeParameter";
1249
+ return SymbolKind;
1250
+ }({});
1251
+ export var SymbolTag = /*#__PURE__*/function (SymbolTag) {
1252
+ SymbolTag[SymbolTag["Deprecated"] = 1] = "Deprecated";
1253
+ return SymbolTag;
1254
+ }({});
1255
+ export var SymbolInformation = /*#__PURE__*/function () {
1256
+ function SymbolInformation(name, kind, rangeOrContainer, locationOrUri, containerName) {
1257
+ _classCallCheck(this, SymbolInformation);
1258
+ this.name = name;
1259
+ this.kind = kind;
1260
+ this.containerName = containerName !== null && containerName !== void 0 ? containerName : '';
1261
+ if (typeof rangeOrContainer === 'string') {
1262
+ this.containerName = rangeOrContainer;
1263
+ }
1264
+ if (locationOrUri instanceof Location) {
1265
+ this.location = locationOrUri;
1266
+ } else if (rangeOrContainer instanceof Range) {
1267
+ this.location = new Location(locationOrUri, rangeOrContainer);
1268
+ }
1269
+ SymbolInformation.validate(this);
1270
+ }
1271
+ _createClass(SymbolInformation, [{
1272
+ key: "toJSON",
1273
+ value: function toJSON() {
1274
+ return {
1275
+ name: this.name,
1276
+ kind: SymbolKind[this.kind],
1277
+ location: this.location,
1278
+ containerName: this.containerName
1279
+ };
1280
+ }
1281
+ }], [{
1282
+ key: "validate",
1283
+ value: function validate(candidate) {
1284
+ if (!candidate.name) {
1285
+ throw new Error('name must not be falsy');
1286
+ }
1287
+ }
1288
+ }]);
1289
+ return SymbolInformation;
1290
+ }();
1291
+ export var DocumentSymbol = /*#__PURE__*/function () {
1292
+ function DocumentSymbol(name, detail, kind, range, selectionRange) {
1293
+ _classCallCheck(this, DocumentSymbol);
1294
+ this.name = name;
1295
+ this.detail = detail;
1296
+ this.kind = kind;
1297
+ this.range = range;
1298
+ this.selectionRange = selectionRange;
1299
+ this.children = [];
1300
+ DocumentSymbol.validate(this);
1301
+ }
1302
+ _createClass(DocumentSymbol, null, [{
1303
+ key: "validate",
1304
+ value: function validate(candidate) {
1305
+ var _candidate$children;
1306
+ if (!candidate.name) {
1307
+ throw new Error('name must not be falsy');
1308
+ }
1309
+ if (!candidate.range.contains(candidate.selectionRange)) {
1310
+ throw new Error('selectionRange must be contained in fullRange');
1311
+ }
1312
+ (_candidate$children = candidate.children) === null || _candidate$children === void 0 || _candidate$children.forEach(DocumentSymbol.validate);
1313
+ }
1314
+ }]);
1315
+ return DocumentSymbol;
1316
+ }();
1317
+ export var CodeActionTriggerKind = /*#__PURE__*/function (CodeActionTriggerKind) {
1318
+ CodeActionTriggerKind[CodeActionTriggerKind["Invoke"] = 1] = "Invoke";
1319
+ CodeActionTriggerKind[CodeActionTriggerKind["Automatic"] = 2] = "Automatic";
1320
+ return CodeActionTriggerKind;
1321
+ }({});
1322
+ export var CodeAction = /*#__PURE__*/_createClass(function CodeAction(title, kind) {
1323
+ _classCallCheck(this, CodeAction);
1324
+ this.title = title;
1325
+ this.kind = kind;
1326
+ });
1327
+ export var CodeActionKind = /*#__PURE__*/function () {
1328
+ function CodeActionKind(value) {
1329
+ _classCallCheck(this, CodeActionKind);
1330
+ this.value = value;
1331
+ }
1332
+ _createClass(CodeActionKind, [{
1333
+ key: "append",
1334
+ value: function append(parts) {
1335
+ return new CodeActionKind(this.value ? this.value + CodeActionKind.sep + parts : parts);
1336
+ }
1337
+ }, {
1338
+ key: "intersects",
1339
+ value: function intersects(other) {
1340
+ return this.contains(other) || other.contains(this);
1341
+ }
1342
+ }, {
1343
+ key: "contains",
1344
+ value: function contains(other) {
1345
+ return this.value === other.value || other.value.startsWith(this.value + CodeActionKind.sep);
1346
+ }
1347
+ }]);
1348
+ return CodeActionKind;
1349
+ }();
1350
+ CodeActionKind.sep = '.';
1351
+ CodeActionKind.Empty = new CodeActionKind('');
1352
+ CodeActionKind.QuickFix = CodeActionKind.Empty.append('quickfix');
1353
+ CodeActionKind.Refactor = CodeActionKind.Empty.append('refactor');
1354
+ CodeActionKind.RefactorExtract = CodeActionKind.Refactor.append('extract');
1355
+ CodeActionKind.RefactorInline = CodeActionKind.Refactor.append('inline');
1356
+ CodeActionKind.RefactorMove = CodeActionKind.Refactor.append('move');
1357
+ CodeActionKind.RefactorRewrite = CodeActionKind.Refactor.append('rewrite');
1358
+ CodeActionKind.Source = CodeActionKind.Empty.append('source');
1359
+ CodeActionKind.SourceOrganizeImports = CodeActionKind.Source.append('organizeImports');
1360
+ CodeActionKind.SourceFixAll = CodeActionKind.Source.append('fixAll');
1361
+ CodeActionKind.Notebook = CodeActionKind.Empty.append('notebook');
1362
+ export var SelectionRange = /*#__PURE__*/_createClass(function SelectionRange(range, parent) {
1363
+ _classCallCheck(this, SelectionRange);
1364
+ this.range = range;
1365
+ this.parent = parent;
1366
+ if (parent && !parent.range.contains(this.range)) {
1367
+ throw new Error('Invalid argument: parent must contain this range');
1368
+ }
1369
+ });
1370
+ export var CallHierarchyItem = /*#__PURE__*/_createClass(function CallHierarchyItem(kind, name, detail, uri, range, selectionRange) {
1371
+ _classCallCheck(this, CallHierarchyItem);
1372
+ this.kind = kind;
1373
+ this.name = name;
1374
+ this.detail = detail;
1375
+ this.uri = uri;
1376
+ this.range = range;
1377
+ this.selectionRange = selectionRange;
1378
+ });
1379
+ export var CallHierarchyIncomingCall = /*#__PURE__*/_createClass(function CallHierarchyIncomingCall(item, fromRanges) {
1380
+ _classCallCheck(this, CallHierarchyIncomingCall);
1381
+ this.fromRanges = fromRanges;
1382
+ this.from = item;
1383
+ });
1384
+ export var CallHierarchyOutgoingCall = /*#__PURE__*/_createClass(function CallHierarchyOutgoingCall(item, fromRanges) {
1385
+ _classCallCheck(this, CallHierarchyOutgoingCall);
1386
+ this.fromRanges = fromRanges;
1387
+ this.to = item;
1388
+ });
1389
+ export var LanguageStatusSeverity = /*#__PURE__*/function (LanguageStatusSeverity) {
1390
+ LanguageStatusSeverity[LanguageStatusSeverity["Information"] = 0] = "Information";
1391
+ LanguageStatusSeverity[LanguageStatusSeverity["Warning"] = 1] = "Warning";
1392
+ LanguageStatusSeverity[LanguageStatusSeverity["Error"] = 2] = "Error";
1393
+ return LanguageStatusSeverity;
1394
+ }({});
1395
+ export var CodeLens = /*#__PURE__*/function () {
1396
+ function CodeLens(range, command) {
1397
+ _classCallCheck(this, CodeLens);
1398
+ this.range = range;
1399
+ this.command = command;
1400
+ }
1401
+ _createClass(CodeLens, [{
1402
+ key: "isResolved",
1403
+ get: function get() {
1404
+ return !!this.command;
1405
+ }
1406
+ }]);
1407
+ return CodeLens;
1408
+ }();
1409
+ var _delegate = /*#__PURE__*/_classPrivateFieldLooseKey("delegate");
1410
+ export var MarkdownString = /*#__PURE__*/function () {
1411
+ function MarkdownString(value) {
1412
+ var supportThemeIcons = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1413
+ _classCallCheck(this, MarkdownString);
1414
+ Object.defineProperty(this, _delegate, {
1415
+ writable: true,
1416
+ value: void 0
1417
+ });
1418
+ _classPrivateFieldLooseBase(this, _delegate)[_delegate] = new BaseMarkdownString(value, {
1419
+ supportThemeIcons: supportThemeIcons
1420
+ });
1421
+ }
1422
+ _createClass(MarkdownString, [{
1423
+ key: "value",
1424
+ get: function get() {
1425
+ return _classPrivateFieldLooseBase(this, _delegate)[_delegate].value;
1426
+ },
1427
+ set: function set(value) {
1428
+ _classPrivateFieldLooseBase(this, _delegate)[_delegate].value = value;
1429
+ }
1430
+ }, {
1431
+ key: "isTrusted",
1432
+ get: function get() {
1433
+ return _classPrivateFieldLooseBase(this, _delegate)[_delegate].isTrusted;
1434
+ },
1435
+ set: function set(value) {
1436
+ _classPrivateFieldLooseBase(this, _delegate)[_delegate].isTrusted = value;
1437
+ }
1438
+ }, {
1439
+ key: "supportThemeIcons",
1440
+ get: function get() {
1441
+ return _classPrivateFieldLooseBase(this, _delegate)[_delegate].supportThemeIcons;
1442
+ },
1443
+ set: function set(value) {
1444
+ _classPrivateFieldLooseBase(this, _delegate)[_delegate].supportThemeIcons = value;
1445
+ }
1446
+ }, {
1447
+ key: "supportHtml",
1448
+ get: function get() {
1449
+ return _classPrivateFieldLooseBase(this, _delegate)[_delegate].supportHtml;
1450
+ },
1451
+ set: function set(value) {
1452
+ _classPrivateFieldLooseBase(this, _delegate)[_delegate].supportHtml = value;
1453
+ }
1454
+ }, {
1455
+ key: "baseUri",
1456
+ get: function get() {
1457
+ return _classPrivateFieldLooseBase(this, _delegate)[_delegate].baseUri;
1458
+ },
1459
+ set: function set(value) {
1460
+ _classPrivateFieldLooseBase(this, _delegate)[_delegate].baseUri = value;
1461
+ }
1462
+ }, {
1463
+ key: "appendText",
1464
+ value: function appendText(value) {
1465
+ _classPrivateFieldLooseBase(this, _delegate)[_delegate].appendText(value);
1466
+ return this;
1467
+ }
1468
+ }, {
1469
+ key: "appendMarkdown",
1470
+ value: function appendMarkdown(value) {
1471
+ _classPrivateFieldLooseBase(this, _delegate)[_delegate].appendMarkdown(value);
1472
+ return this;
1473
+ }
1474
+ }, {
1475
+ key: "appendCodeblock",
1476
+ value: function appendCodeblock(value, language) {
1477
+ _classPrivateFieldLooseBase(this, _delegate)[_delegate].appendCodeblock(language !== null && language !== void 0 ? language : '', value);
1478
+ return this;
1479
+ }
1480
+ }], [{
1481
+ key: "isMarkdownString",
1482
+ value: function isMarkdownString(thing) {
1483
+ if (thing instanceof MarkdownString) {
1484
+ return true;
1485
+ }
1486
+ return thing && thing.appendCodeblock && thing.appendMarkdown && thing.appendText && thing.value !== undefined;
1487
+ }
1488
+ }]);
1489
+ return MarkdownString;
1490
+ }();
1491
+ export var ParameterInformation = /*#__PURE__*/_createClass(function ParameterInformation(label, documentation) {
1492
+ _classCallCheck(this, ParameterInformation);
1493
+ this.label = label;
1494
+ this.documentation = documentation;
1495
+ });
1496
+ export var SignatureInformation = /*#__PURE__*/_createClass(function SignatureInformation(label, documentation) {
1497
+ _classCallCheck(this, SignatureInformation);
1498
+ this.label = label;
1499
+ this.documentation = documentation;
1500
+ this.parameters = [];
1501
+ });
1502
+ export var SignatureHelp = /*#__PURE__*/_createClass(function SignatureHelp() {
1503
+ _classCallCheck(this, SignatureHelp);
1504
+ this.activeSignature = 0;
1505
+ this.activeParameter = 0;
1506
+ this.signatures = [];
1507
+ });
1508
+ export var SignatureHelpTriggerKind = /*#__PURE__*/function (SignatureHelpTriggerKind) {
1509
+ SignatureHelpTriggerKind[SignatureHelpTriggerKind["Invoke"] = 1] = "Invoke";
1510
+ SignatureHelpTriggerKind[SignatureHelpTriggerKind["TriggerCharacter"] = 2] = "TriggerCharacter";
1511
+ SignatureHelpTriggerKind[SignatureHelpTriggerKind["ContentChange"] = 3] = "ContentChange";
1512
+ return SignatureHelpTriggerKind;
1513
+ }({});
1514
+ export var InlayHintKind = /*#__PURE__*/function (InlayHintKind) {
1515
+ InlayHintKind[InlayHintKind["Type"] = 1] = "Type";
1516
+ InlayHintKind[InlayHintKind["Parameter"] = 2] = "Parameter";
1517
+ return InlayHintKind;
1518
+ }({});
1519
+ export var InlayHintLabelPart = /*#__PURE__*/_createClass(function InlayHintLabelPart(value) {
1520
+ _classCallCheck(this, InlayHintLabelPart);
1521
+ this.value = value;
1522
+ });
1523
+ export var InlayHint = /*#__PURE__*/_createClass(function InlayHint(position, label, kind) {
1524
+ _classCallCheck(this, InlayHint);
1525
+ this.position = position;
1526
+ this.label = label;
1527
+ this.kind = kind;
1528
+ });
1529
+ export var CompletionTriggerKind = /*#__PURE__*/function (CompletionTriggerKind) {
1530
+ CompletionTriggerKind[CompletionTriggerKind["Invoke"] = 0] = "Invoke";
1531
+ CompletionTriggerKind[CompletionTriggerKind["TriggerCharacter"] = 1] = "TriggerCharacter";
1532
+ CompletionTriggerKind[CompletionTriggerKind["TriggerForIncompleteCompletions"] = 2] = "TriggerForIncompleteCompletions";
1533
+ return CompletionTriggerKind;
1534
+ }({});
1535
+ export var CompletionItemKind = /*#__PURE__*/function (CompletionItemKind) {
1536
+ CompletionItemKind[CompletionItemKind["Text"] = 0] = "Text";
1537
+ CompletionItemKind[CompletionItemKind["Method"] = 1] = "Method";
1538
+ CompletionItemKind[CompletionItemKind["Function"] = 2] = "Function";
1539
+ CompletionItemKind[CompletionItemKind["Constructor"] = 3] = "Constructor";
1540
+ CompletionItemKind[CompletionItemKind["Field"] = 4] = "Field";
1541
+ CompletionItemKind[CompletionItemKind["Variable"] = 5] = "Variable";
1542
+ CompletionItemKind[CompletionItemKind["Class"] = 6] = "Class";
1543
+ CompletionItemKind[CompletionItemKind["Interface"] = 7] = "Interface";
1544
+ CompletionItemKind[CompletionItemKind["Module"] = 8] = "Module";
1545
+ CompletionItemKind[CompletionItemKind["Property"] = 9] = "Property";
1546
+ CompletionItemKind[CompletionItemKind["Unit"] = 10] = "Unit";
1547
+ CompletionItemKind[CompletionItemKind["Value"] = 11] = "Value";
1548
+ CompletionItemKind[CompletionItemKind["Enum"] = 12] = "Enum";
1549
+ CompletionItemKind[CompletionItemKind["Keyword"] = 13] = "Keyword";
1550
+ CompletionItemKind[CompletionItemKind["Snippet"] = 14] = "Snippet";
1551
+ CompletionItemKind[CompletionItemKind["Color"] = 15] = "Color";
1552
+ CompletionItemKind[CompletionItemKind["File"] = 16] = "File";
1553
+ CompletionItemKind[CompletionItemKind["Reference"] = 17] = "Reference";
1554
+ CompletionItemKind[CompletionItemKind["Folder"] = 18] = "Folder";
1555
+ CompletionItemKind[CompletionItemKind["EnumMember"] = 19] = "EnumMember";
1556
+ CompletionItemKind[CompletionItemKind["Constant"] = 20] = "Constant";
1557
+ CompletionItemKind[CompletionItemKind["Struct"] = 21] = "Struct";
1558
+ CompletionItemKind[CompletionItemKind["Event"] = 22] = "Event";
1559
+ CompletionItemKind[CompletionItemKind["Operator"] = 23] = "Operator";
1560
+ CompletionItemKind[CompletionItemKind["TypeParameter"] = 24] = "TypeParameter";
1561
+ CompletionItemKind[CompletionItemKind["User"] = 25] = "User";
1562
+ CompletionItemKind[CompletionItemKind["Issue"] = 26] = "Issue";
1563
+ return CompletionItemKind;
1564
+ }({});
1565
+ export var CompletionItemTag = /*#__PURE__*/function (CompletionItemTag) {
1566
+ CompletionItemTag[CompletionItemTag["Deprecated"] = 1] = "Deprecated";
1567
+ return CompletionItemTag;
1568
+ }({});
1569
+ export var CompletionItem = /*#__PURE__*/function () {
1570
+ function CompletionItem(label, kind) {
1571
+ _classCallCheck(this, CompletionItem);
1572
+ this.label = label;
1573
+ this.kind = kind;
1574
+ }
1575
+ _createClass(CompletionItem, [{
1576
+ key: "toJSON",
1577
+ value: function toJSON() {
1578
+ return {
1579
+ label: this.label,
1580
+ kind: this.kind && CompletionItemKind[this.kind],
1581
+ detail: this.detail,
1582
+ documentation: this.documentation,
1583
+ sortText: this.sortText,
1584
+ filterText: this.filterText,
1585
+ preselect: this.preselect,
1586
+ insertText: this.insertText,
1587
+ textEdit: this.textEdit
1588
+ };
1589
+ }
1590
+ }]);
1591
+ return CompletionItem;
1592
+ }();
1593
+ export var CompletionList = /*#__PURE__*/_createClass(function CompletionList() {
1594
+ var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
1595
+ var isIncomplete = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1596
+ _classCallCheck(this, CompletionList);
1597
+ this.items = items;
1598
+ this.isIncomplete = isIncomplete;
1599
+ });
1600
+ export var InlineSuggestion = /*#__PURE__*/_createClass(function InlineSuggestion(insertText, range, command) {
1601
+ _classCallCheck(this, InlineSuggestion);
1602
+ this.insertText = insertText;
1603
+ this.range = range;
1604
+ this.command = command;
1605
+ });
1606
+ export var InlineSuggestionList = /*#__PURE__*/_createClass(function InlineSuggestionList(items) {
1607
+ _classCallCheck(this, InlineSuggestionList);
1608
+ this.commands = undefined;
1609
+ this.suppressSuggestions = undefined;
1610
+ this.items = items;
1611
+ });
1612
+ export var ViewColumn = /*#__PURE__*/function (ViewColumn) {
1613
+ ViewColumn[ViewColumn["Active"] = -1] = "Active";
1614
+ ViewColumn[ViewColumn["Beside"] = -2] = "Beside";
1615
+ ViewColumn[ViewColumn["One"] = 1] = "One";
1616
+ ViewColumn[ViewColumn["Two"] = 2] = "Two";
1617
+ ViewColumn[ViewColumn["Three"] = 3] = "Three";
1618
+ ViewColumn[ViewColumn["Four"] = 4] = "Four";
1619
+ ViewColumn[ViewColumn["Five"] = 5] = "Five";
1620
+ ViewColumn[ViewColumn["Six"] = 6] = "Six";
1621
+ ViewColumn[ViewColumn["Seven"] = 7] = "Seven";
1622
+ ViewColumn[ViewColumn["Eight"] = 8] = "Eight";
1623
+ ViewColumn[ViewColumn["Nine"] = 9] = "Nine";
1624
+ return ViewColumn;
1625
+ }({});
1626
+ export var StatusBarAlignment = /*#__PURE__*/function (StatusBarAlignment) {
1627
+ StatusBarAlignment[StatusBarAlignment["Left"] = 1] = "Left";
1628
+ StatusBarAlignment[StatusBarAlignment["Right"] = 2] = "Right";
1629
+ return StatusBarAlignment;
1630
+ }({});
1631
+ export var TextEditorLineNumbersStyle = /*#__PURE__*/function (TextEditorLineNumbersStyle) {
1632
+ TextEditorLineNumbersStyle[TextEditorLineNumbersStyle["Off"] = 0] = "Off";
1633
+ TextEditorLineNumbersStyle[TextEditorLineNumbersStyle["On"] = 1] = "On";
1634
+ TextEditorLineNumbersStyle[TextEditorLineNumbersStyle["Relative"] = 2] = "Relative";
1635
+ return TextEditorLineNumbersStyle;
1636
+ }({});
1637
+ export var TextDocumentSaveReason = /*#__PURE__*/function (TextDocumentSaveReason) {
1638
+ TextDocumentSaveReason[TextDocumentSaveReason["Manual"] = 1] = "Manual";
1639
+ TextDocumentSaveReason[TextDocumentSaveReason["AfterDelay"] = 2] = "AfterDelay";
1640
+ TextDocumentSaveReason[TextDocumentSaveReason["FocusOut"] = 3] = "FocusOut";
1641
+ return TextDocumentSaveReason;
1642
+ }({});
1643
+ export var TextEditorRevealType = /*#__PURE__*/function (TextEditorRevealType) {
1644
+ TextEditorRevealType[TextEditorRevealType["Default"] = 0] = "Default";
1645
+ TextEditorRevealType[TextEditorRevealType["InCenter"] = 1] = "InCenter";
1646
+ TextEditorRevealType[TextEditorRevealType["InCenterIfOutsideViewport"] = 2] = "InCenterIfOutsideViewport";
1647
+ TextEditorRevealType[TextEditorRevealType["AtTop"] = 3] = "AtTop";
1648
+ return TextEditorRevealType;
1649
+ }({});
1650
+ export var TextEditorSelectionChangeKind = /*#__PURE__*/function (TextEditorSelectionChangeKind) {
1651
+ TextEditorSelectionChangeKind[TextEditorSelectionChangeKind["Keyboard"] = 1] = "Keyboard";
1652
+ TextEditorSelectionChangeKind[TextEditorSelectionChangeKind["Mouse"] = 2] = "Mouse";
1653
+ TextEditorSelectionChangeKind[TextEditorSelectionChangeKind["Command"] = 3] = "Command";
1654
+ return TextEditorSelectionChangeKind;
1655
+ }({});
1656
+ export var TextDocumentChangeReason = /*#__PURE__*/function (TextDocumentChangeReason) {
1657
+ TextDocumentChangeReason[TextDocumentChangeReason["Undo"] = 1] = "Undo";
1658
+ TextDocumentChangeReason[TextDocumentChangeReason["Redo"] = 2] = "Redo";
1659
+ return TextDocumentChangeReason;
1660
+ }({});
1661
+
1662
+ /**
1663
+ * These values match very carefully the values of `TrackedRangeStickiness`
1664
+ */
1665
+ export var DecorationRangeBehavior = /*#__PURE__*/function (DecorationRangeBehavior) {
1666
+ DecorationRangeBehavior[DecorationRangeBehavior["OpenOpen"] = 0] = "OpenOpen";
1667
+ DecorationRangeBehavior[DecorationRangeBehavior["ClosedClosed"] = 1] = "ClosedClosed";
1668
+ DecorationRangeBehavior[DecorationRangeBehavior["OpenClosed"] = 2] = "OpenClosed";
1669
+ DecorationRangeBehavior[DecorationRangeBehavior["ClosedOpen"] = 3] = "ClosedOpen";
1670
+ return DecorationRangeBehavior;
1671
+ }({});
1672
+ (function (_TextEditorSelectionChangeKind) {
1673
+ function fromValue(s) {
1674
+ switch (s) {
1675
+ case 'keyboard':
1676
+ return TextEditorSelectionChangeKind.Keyboard;
1677
+ case 'mouse':
1678
+ return TextEditorSelectionChangeKind.Mouse;
1679
+ case 'api':
1680
+ return TextEditorSelectionChangeKind.Command;
1681
+ }
1682
+ return undefined;
1683
+ }
1684
+ _TextEditorSelectionChangeKind.fromValue = fromValue;
1685
+ })(TextEditorSelectionChangeKind || (TextEditorSelectionChangeKind = {}));
1686
+ export var SyntaxTokenType = /*#__PURE__*/function (SyntaxTokenType) {
1687
+ SyntaxTokenType[SyntaxTokenType["Other"] = 0] = "Other";
1688
+ SyntaxTokenType[SyntaxTokenType["Comment"] = 1] = "Comment";
1689
+ SyntaxTokenType[SyntaxTokenType["String"] = 2] = "String";
1690
+ SyntaxTokenType[SyntaxTokenType["RegEx"] = 3] = "RegEx";
1691
+ return SyntaxTokenType;
1692
+ }({});
1693
+ (function (_SyntaxTokenType) {
1694
+ function toString(v) {
1695
+ switch (v) {
1696
+ case SyntaxTokenType.Other:
1697
+ return 'other';
1698
+ case SyntaxTokenType.Comment:
1699
+ return 'comment';
1700
+ case SyntaxTokenType.String:
1701
+ return 'string';
1702
+ case SyntaxTokenType.RegEx:
1703
+ return 'regex';
1704
+ }
1705
+ return 'other';
1706
+ }
1707
+ _SyntaxTokenType.toString = toString;
1708
+ })(SyntaxTokenType || (SyntaxTokenType = {}));
1709
+ export var DocumentLink = /*#__PURE__*/_createClass(function DocumentLink(range, target) {
1710
+ _classCallCheck(this, DocumentLink);
1711
+ if (target && !URI.isUri(target)) {
1712
+ throw illegalArgument('target');
1713
+ }
1714
+ if (!Range.isRange(range) || range.isEmpty) {
1715
+ throw illegalArgument('range');
1716
+ }
1717
+ this.range = range;
1718
+ this.target = target;
1719
+ });
1720
+ export var Color = /*#__PURE__*/_createClass(function Color(red, green, blue, alpha) {
1721
+ _classCallCheck(this, Color);
1722
+ this.red = red;
1723
+ this.green = green;
1724
+ this.blue = blue;
1725
+ this.alpha = alpha;
1726
+ });
1727
+ export var ColorInformation = /*#__PURE__*/_createClass(function ColorInformation(range, color) {
1728
+ _classCallCheck(this, ColorInformation);
1729
+ if (color && !(color instanceof Color)) {
1730
+ throw illegalArgument('color');
1731
+ }
1732
+ if (!Range.isRange(range) || range.isEmpty) {
1733
+ throw illegalArgument('range');
1734
+ }
1735
+ this.range = range;
1736
+ this.color = color;
1737
+ });
1738
+ export var ColorPresentation = /*#__PURE__*/_createClass(function ColorPresentation(label) {
1739
+ _classCallCheck(this, ColorPresentation);
1740
+ if (!label || typeof label !== 'string') {
1741
+ throw illegalArgument('label');
1742
+ }
1743
+ this.label = label;
1744
+ });
1745
+ export var ColorFormat = /*#__PURE__*/function (ColorFormat) {
1746
+ ColorFormat[ColorFormat["RGB"] = 0] = "RGB";
1747
+ ColorFormat[ColorFormat["HEX"] = 1] = "HEX";
1748
+ ColorFormat[ColorFormat["HSL"] = 2] = "HSL";
1749
+ return ColorFormat;
1750
+ }({});
1751
+ export var SourceControlInputBoxValidationType = /*#__PURE__*/function (SourceControlInputBoxValidationType) {
1752
+ SourceControlInputBoxValidationType[SourceControlInputBoxValidationType["Error"] = 0] = "Error";
1753
+ SourceControlInputBoxValidationType[SourceControlInputBoxValidationType["Warning"] = 1] = "Warning";
1754
+ SourceControlInputBoxValidationType[SourceControlInputBoxValidationType["Information"] = 2] = "Information";
1755
+ return SourceControlInputBoxValidationType;
1756
+ }({});
1757
+ export var TerminalExitReason = /*#__PURE__*/function (TerminalExitReason) {
1758
+ TerminalExitReason[TerminalExitReason["Unknown"] = 0] = "Unknown";
1759
+ TerminalExitReason[TerminalExitReason["Shutdown"] = 1] = "Shutdown";
1760
+ TerminalExitReason[TerminalExitReason["Process"] = 2] = "Process";
1761
+ TerminalExitReason[TerminalExitReason["User"] = 3] = "User";
1762
+ TerminalExitReason[TerminalExitReason["Extension"] = 4] = "Extension";
1763
+ return TerminalExitReason;
1764
+ }({});
1765
+ export var TerminalLink = /*#__PURE__*/_createClass(function TerminalLink(startIndex, length, tooltip) {
1766
+ _classCallCheck(this, TerminalLink);
1767
+ this.startIndex = startIndex;
1768
+ this.length = length;
1769
+ this.tooltip = tooltip;
1770
+ if (typeof startIndex !== 'number' || startIndex < 0) {
1771
+ throw illegalArgument('startIndex');
1772
+ }
1773
+ if (typeof length !== 'number' || length < 1) {
1774
+ throw illegalArgument('length');
1775
+ }
1776
+ if (tooltip !== undefined && typeof tooltip !== 'string') {
1777
+ throw illegalArgument('tooltip');
1778
+ }
1779
+ });
1780
+ export var TerminalQuickFixOpener = /*#__PURE__*/_createClass(function TerminalQuickFixOpener(uri) {
1781
+ _classCallCheck(this, TerminalQuickFixOpener);
1782
+ this.uri = uri;
1783
+ });
1784
+ export var TerminalQuickFixCommand = /*#__PURE__*/_createClass(function TerminalQuickFixCommand(terminalCommand) {
1785
+ _classCallCheck(this, TerminalQuickFixCommand);
1786
+ this.terminalCommand = terminalCommand;
1787
+ });
1788
+ export var TerminalLocation = /*#__PURE__*/function (TerminalLocation) {
1789
+ TerminalLocation[TerminalLocation["Panel"] = 1] = "Panel";
1790
+ TerminalLocation[TerminalLocation["Editor"] = 2] = "Editor";
1791
+ return TerminalLocation;
1792
+ }({});
1793
+ export var TerminalProfile = /*#__PURE__*/_createClass(function TerminalProfile(options) {
1794
+ _classCallCheck(this, TerminalProfile);
1795
+ this.options = options;
1796
+ if (_typeof(options) !== 'object') {
1797
+ throw illegalArgument('options');
1798
+ }
1799
+ });
1800
+ export var TaskRevealKind = /*#__PURE__*/function (TaskRevealKind) {
1801
+ TaskRevealKind[TaskRevealKind["Always"] = 1] = "Always";
1802
+ TaskRevealKind[TaskRevealKind["Silent"] = 2] = "Silent";
1803
+ TaskRevealKind[TaskRevealKind["Never"] = 3] = "Never";
1804
+ return TaskRevealKind;
1805
+ }({});
1806
+ export var TaskPanelKind = /*#__PURE__*/function (TaskPanelKind) {
1807
+ TaskPanelKind[TaskPanelKind["Shared"] = 1] = "Shared";
1808
+ TaskPanelKind[TaskPanelKind["Dedicated"] = 2] = "Dedicated";
1809
+ TaskPanelKind[TaskPanelKind["New"] = 3] = "New";
1810
+ return TaskPanelKind;
1811
+ }({});
1812
+ export var TaskGroup = /*#__PURE__*/function () {
1813
+ function TaskGroup(id, label) {
1814
+ _classCallCheck(this, TaskGroup);
1815
+ this.label = label;
1816
+ if (typeof id !== 'string') {
1817
+ throw illegalArgument('name');
1818
+ }
1819
+ if (typeof label !== 'string') {
1820
+ throw illegalArgument('name');
1821
+ }
1822
+ this._id = id;
1823
+ }
1824
+ _createClass(TaskGroup, [{
1825
+ key: "id",
1826
+ get: function get() {
1827
+ return this._id;
1828
+ }
1829
+ }], [{
1830
+ key: "from",
1831
+ value: function from(value) {
1832
+ switch (value) {
1833
+ case 'clean':
1834
+ return TaskGroup.Clean;
1835
+ case 'build':
1836
+ return TaskGroup.Build;
1837
+ case 'rebuild':
1838
+ return TaskGroup.Rebuild;
1839
+ case 'test':
1840
+ return TaskGroup.Test;
1841
+ default:
1842
+ return undefined;
1843
+ }
1844
+ }
1845
+ }]);
1846
+ return TaskGroup;
1847
+ }();
1848
+ _TaskGroup = TaskGroup;
1849
+ TaskGroup.Clean = new _TaskGroup('clean', 'Clean');
1850
+ TaskGroup.Build = new _TaskGroup('build', 'Build');
1851
+ TaskGroup.Rebuild = new _TaskGroup('rebuild', 'Rebuild');
1852
+ TaskGroup.Test = new _TaskGroup('test', 'Test');
1853
+ function computeTaskExecutionId(values) {
1854
+ var id = '';
1855
+ for (var i = 0; i < values.length; i++) {
1856
+ id += values[i].replace(/,/g, ',,') + ',';
1857
+ }
1858
+ return id;
1859
+ }
1860
+ export var ProcessExecution = /*#__PURE__*/function () {
1861
+ function ProcessExecution(process, varg1, varg2) {
1862
+ _classCallCheck(this, ProcessExecution);
1863
+ if (typeof process !== 'string') {
1864
+ throw illegalArgument('process');
1865
+ }
1866
+ this._args = [];
1867
+ this._process = process;
1868
+ if (varg1 !== undefined) {
1869
+ if (Array.isArray(varg1)) {
1870
+ this._args = varg1;
1871
+ this._options = varg2;
1872
+ } else {
1873
+ this._options = varg1;
1874
+ }
1875
+ }
1876
+ }
1877
+ _createClass(ProcessExecution, [{
1878
+ key: "process",
1879
+ get: function get() {
1880
+ return this._process;
1881
+ },
1882
+ set: function set(value) {
1883
+ if (typeof value !== 'string') {
1884
+ throw illegalArgument('process');
1885
+ }
1886
+ this._process = value;
1887
+ }
1888
+ }, {
1889
+ key: "args",
1890
+ get: function get() {
1891
+ return this._args;
1892
+ },
1893
+ set: function set(value) {
1894
+ if (!Array.isArray(value)) {
1895
+ value = [];
1896
+ }
1897
+ this._args = value;
1898
+ }
1899
+ }, {
1900
+ key: "options",
1901
+ get: function get() {
1902
+ return this._options;
1903
+ },
1904
+ set: function set(value) {
1905
+ this._options = value;
1906
+ }
1907
+ }, {
1908
+ key: "computeId",
1909
+ value: function computeId() {
1910
+ var props = [];
1911
+ props.push('process');
1912
+ if (this._process !== undefined) {
1913
+ props.push(this._process);
1914
+ }
1915
+ if (this._args && this._args.length > 0) {
1916
+ var _iterator4 = _createForOfIteratorHelper(this._args),
1917
+ _step4;
1918
+ try {
1919
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
1920
+ var arg = _step4.value;
1921
+ props.push(arg);
1922
+ }
1923
+ } catch (err) {
1924
+ _iterator4.e(err);
1925
+ } finally {
1926
+ _iterator4.f();
1927
+ }
1928
+ }
1929
+ return computeTaskExecutionId(props);
1930
+ }
1931
+ }]);
1932
+ return ProcessExecution;
1933
+ }();
1934
+ export var ShellExecution = /*#__PURE__*/function () {
1935
+ function ShellExecution(arg0, arg1, arg2) {
1936
+ _classCallCheck(this, ShellExecution);
1937
+ this._args = [];
1938
+ if (Array.isArray(arg1)) {
1939
+ if (!arg0) {
1940
+ throw illegalArgument("command can't be undefined or null");
1941
+ }
1942
+ if (typeof arg0 !== 'string' && typeof arg0.value !== 'string') {
1943
+ throw illegalArgument('command');
1944
+ }
1945
+ this._command = arg0;
1946
+ this._args = arg1;
1947
+ this._options = arg2;
1948
+ } else {
1949
+ if (typeof arg0 !== 'string') {
1950
+ throw illegalArgument('commandLine');
1951
+ }
1952
+ this._commandLine = arg0;
1953
+ this._options = arg1;
1954
+ }
1955
+ }
1956
+ _createClass(ShellExecution, [{
1957
+ key: "commandLine",
1958
+ get: function get() {
1959
+ return this._commandLine;
1960
+ },
1961
+ set: function set(value) {
1962
+ if (typeof value !== 'string') {
1963
+ throw illegalArgument('commandLine');
1964
+ }
1965
+ this._commandLine = value;
1966
+ }
1967
+ }, {
1968
+ key: "command",
1969
+ get: function get() {
1970
+ return this._command ? this._command : '';
1971
+ },
1972
+ set: function set(value) {
1973
+ if (typeof value !== 'string' && typeof value.value !== 'string') {
1974
+ throw illegalArgument('command');
1975
+ }
1976
+ this._command = value;
1977
+ }
1978
+ }, {
1979
+ key: "args",
1980
+ get: function get() {
1981
+ return this._args;
1982
+ },
1983
+ set: function set(value) {
1984
+ this._args = value || [];
1985
+ }
1986
+ }, {
1987
+ key: "options",
1988
+ get: function get() {
1989
+ return this._options;
1990
+ },
1991
+ set: function set(value) {
1992
+ this._options = value;
1993
+ }
1994
+ }, {
1995
+ key: "computeId",
1996
+ value: function computeId() {
1997
+ var props = [];
1998
+ props.push('shell');
1999
+ if (this._commandLine !== undefined) {
2000
+ props.push(this._commandLine);
2001
+ }
2002
+ if (this._command !== undefined) {
2003
+ props.push(typeof this._command === 'string' ? this._command : this._command.value);
2004
+ }
2005
+ if (this._args && this._args.length > 0) {
2006
+ var _iterator5 = _createForOfIteratorHelper(this._args),
2007
+ _step5;
2008
+ try {
2009
+ for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
2010
+ var arg = _step5.value;
2011
+ props.push(typeof arg === 'string' ? arg : arg.value);
2012
+ }
2013
+ } catch (err) {
2014
+ _iterator5.e(err);
2015
+ } finally {
2016
+ _iterator5.f();
2017
+ }
2018
+ }
2019
+ return computeTaskExecutionId(props);
2020
+ }
2021
+ }]);
2022
+ return ShellExecution;
2023
+ }();
2024
+ export var ShellQuoting = /*#__PURE__*/function (ShellQuoting) {
2025
+ ShellQuoting[ShellQuoting["Escape"] = 1] = "Escape";
2026
+ ShellQuoting[ShellQuoting["Strong"] = 2] = "Strong";
2027
+ ShellQuoting[ShellQuoting["Weak"] = 3] = "Weak";
2028
+ return ShellQuoting;
2029
+ }({});
2030
+ export var TaskScope = /*#__PURE__*/function (TaskScope) {
2031
+ TaskScope[TaskScope["Global"] = 1] = "Global";
2032
+ TaskScope[TaskScope["Workspace"] = 2] = "Workspace";
2033
+ return TaskScope;
2034
+ }({});
2035
+ export var CustomExecution = /*#__PURE__*/function () {
2036
+ function CustomExecution(callback) {
2037
+ _classCallCheck(this, CustomExecution);
2038
+ this._callback = callback;
2039
+ }
2040
+ _createClass(CustomExecution, [{
2041
+ key: "computeId",
2042
+ value: function computeId() {
2043
+ return 'customExecution' + generateUuid();
2044
+ }
2045
+ }, {
2046
+ key: "callback",
2047
+ get: function get() {
2048
+ return this._callback;
2049
+ },
2050
+ set: function set(value) {
2051
+ this._callback = value;
2052
+ }
2053
+ }]);
2054
+ return CustomExecution;
2055
+ }();
2056
+ export var Task = /*#__PURE__*/function () {
2057
+ function Task(definition, arg2, arg3, arg4, arg5, arg6) {
2058
+ _classCallCheck(this, Task);
2059
+ this.__deprecated = false;
2060
+ this._definition = this.definition = definition;
2061
+ var problemMatchers;
2062
+ if (typeof arg2 === 'string') {
2063
+ this._name = this.name = arg2;
2064
+ this._source = this.source = arg3;
2065
+ this.execution = arg4;
2066
+ problemMatchers = arg5;
2067
+ this.__deprecated = true;
2068
+ } else if (arg2 === TaskScope.Global || arg2 === TaskScope.Workspace) {
2069
+ this.target = arg2;
2070
+ this._name = this.name = arg3;
2071
+ this._source = this.source = arg4;
2072
+ this.execution = arg5;
2073
+ problemMatchers = arg6;
2074
+ } else {
2075
+ this.target = arg2;
2076
+ this._name = this.name = arg3;
2077
+ this._source = this.source = arg4;
2078
+ this.execution = arg5;
2079
+ problemMatchers = arg6;
2080
+ }
2081
+ if (typeof problemMatchers === 'string') {
2082
+ this._problemMatchers = [problemMatchers];
2083
+ this._hasDefinedMatchers = true;
2084
+ } else if (Array.isArray(problemMatchers)) {
2085
+ this._problemMatchers = problemMatchers;
2086
+ this._hasDefinedMatchers = true;
2087
+ } else {
2088
+ this._problemMatchers = [];
2089
+ this._hasDefinedMatchers = false;
2090
+ }
2091
+ this._isBackground = false;
2092
+ this._presentationOptions = Object.create(null);
2093
+ this._runOptions = Object.create(null);
2094
+ }
2095
+ _createClass(Task, [{
2096
+ key: "_id",
2097
+ get: function get() {
2098
+ return this.__id;
2099
+ },
2100
+ set: function set(value) {
2101
+ this.__id = value;
2102
+ }
2103
+ }, {
2104
+ key: "_deprecated",
2105
+ get: function get() {
2106
+ return this.__deprecated;
2107
+ }
2108
+ }, {
2109
+ key: "clear",
2110
+ value: function clear() {
2111
+ if (this.__id === undefined) {
2112
+ return;
2113
+ }
2114
+ this.__id = undefined;
2115
+ this._scope = undefined;
2116
+ this.computeDefinitionBasedOnExecution();
2117
+ }
2118
+ }, {
2119
+ key: "computeDefinitionBasedOnExecution",
2120
+ value: function computeDefinitionBasedOnExecution() {
2121
+ if (this._execution instanceof ProcessExecution) {
2122
+ this._definition = {
2123
+ type: Task.ProcessType,
2124
+ id: this._execution.computeId()
2125
+ };
2126
+ } else if (this._execution instanceof ShellExecution) {
2127
+ this._definition = {
2128
+ type: Task.ShellType,
2129
+ id: this._execution.computeId()
2130
+ };
2131
+ } else if (this._execution instanceof CustomExecution) {
2132
+ this._definition = {
2133
+ type: Task.ExtensionCallbackType,
2134
+ id: this._execution.computeId()
2135
+ };
2136
+ } else {
2137
+ this._definition = {
2138
+ type: Task.EmptyType,
2139
+ id: generateUuid()
2140
+ };
2141
+ }
2142
+ }
2143
+ }, {
2144
+ key: "definition",
2145
+ get: function get() {
2146
+ return this._definition;
2147
+ },
2148
+ set: function set(value) {
2149
+ if (value === undefined || value === null) {
2150
+ throw illegalArgument("Kind can't be undefined or null");
2151
+ }
2152
+ this.clear();
2153
+ this._definition = value;
2154
+ }
2155
+ }, {
2156
+ key: "scope",
2157
+ get: function get() {
2158
+ return this._scope;
2159
+ }
2160
+ }, {
2161
+ key: "target",
2162
+ set: function set(value) {
2163
+ this.clear();
2164
+ this._scope = value;
2165
+ }
2166
+ }, {
2167
+ key: "name",
2168
+ get: function get() {
2169
+ return this._name;
2170
+ },
2171
+ set: function set(value) {
2172
+ if (typeof value !== 'string') {
2173
+ throw illegalArgument('name');
2174
+ }
2175
+ this.clear();
2176
+ this._name = value;
2177
+ }
2178
+ }, {
2179
+ key: "execution",
2180
+ get: function get() {
2181
+ return this._execution;
2182
+ },
2183
+ set: function set(value) {
2184
+ if (value === null) {
2185
+ value = undefined;
2186
+ }
2187
+ this.clear();
2188
+ this._execution = value;
2189
+ var type = this._definition.type;
2190
+ if (Task.EmptyType === type || Task.ProcessType === type || Task.ShellType === type || Task.ExtensionCallbackType === type) {
2191
+ this.computeDefinitionBasedOnExecution();
2192
+ }
2193
+ }
2194
+ }, {
2195
+ key: "problemMatchers",
2196
+ get: function get() {
2197
+ return this._problemMatchers;
2198
+ },
2199
+ set: function set(value) {
2200
+ if (!Array.isArray(value)) {
2201
+ this.clear();
2202
+ this._problemMatchers = [];
2203
+ this._hasDefinedMatchers = false;
2204
+ return;
2205
+ } else {
2206
+ this.clear();
2207
+ this._problemMatchers = value;
2208
+ this._hasDefinedMatchers = true;
2209
+ }
2210
+ }
2211
+ }, {
2212
+ key: "hasDefinedMatchers",
2213
+ get: function get() {
2214
+ return this._hasDefinedMatchers;
2215
+ }
2216
+ }, {
2217
+ key: "isBackground",
2218
+ get: function get() {
2219
+ return this._isBackground;
2220
+ },
2221
+ set: function set(value) {
2222
+ if (value !== true && value !== false) {
2223
+ value = false;
2224
+ }
2225
+ this.clear();
2226
+ this._isBackground = value;
2227
+ }
2228
+ }, {
2229
+ key: "source",
2230
+ get: function get() {
2231
+ return this._source;
2232
+ },
2233
+ set: function set(value) {
2234
+ if (typeof value !== 'string' || value.length === 0) {
2235
+ throw illegalArgument('source must be a string of length > 0');
2236
+ }
2237
+ this.clear();
2238
+ this._source = value;
2239
+ }
2240
+ }, {
2241
+ key: "group",
2242
+ get: function get() {
2243
+ return this._group;
2244
+ },
2245
+ set: function set(value) {
2246
+ if (value === null) {
2247
+ value = undefined;
2248
+ }
2249
+ this.clear();
2250
+ this._group = value;
2251
+ }
2252
+ }, {
2253
+ key: "detail",
2254
+ get: function get() {
2255
+ return this._detail;
2256
+ },
2257
+ set: function set(value) {
2258
+ if (value === null) {
2259
+ value = undefined;
2260
+ }
2261
+ this._detail = value;
2262
+ }
2263
+ }, {
2264
+ key: "presentationOptions",
2265
+ get: function get() {
2266
+ return this._presentationOptions;
2267
+ },
2268
+ set: function set(value) {
2269
+ if (value === null || value === undefined) {
2270
+ value = Object.create(null);
2271
+ }
2272
+ this.clear();
2273
+ this._presentationOptions = value;
2274
+ }
2275
+ }, {
2276
+ key: "runOptions",
2277
+ get: function get() {
2278
+ return this._runOptions;
2279
+ },
2280
+ set: function set(value) {
2281
+ if (value === null || value === undefined) {
2282
+ value = Object.create(null);
2283
+ }
2284
+ this.clear();
2285
+ this._runOptions = value;
2286
+ }
2287
+ }]);
2288
+ return Task;
2289
+ }();
2290
+ Task.ExtensionCallbackType = 'customExecution';
2291
+ Task.ProcessType = 'process';
2292
+ Task.ShellType = 'shell';
2293
+ Task.EmptyType = '$empty';
2294
+ export var ProgressLocation = /*#__PURE__*/function (ProgressLocation) {
2295
+ ProgressLocation[ProgressLocation["SourceControl"] = 1] = "SourceControl";
2296
+ ProgressLocation[ProgressLocation["Window"] = 10] = "Window";
2297
+ ProgressLocation[ProgressLocation["Notification"] = 15] = "Notification";
2298
+ return ProgressLocation;
2299
+ }({});
2300
+ export var ViewBadge;
2301
+ (function (_ViewBadge) {
2302
+ function isViewBadge(thing) {
2303
+ var viewBadgeThing = thing;
2304
+ if (!isNumber(viewBadgeThing.value)) {
2305
+ console.log('INVALID view badge, invalid value', viewBadgeThing.value);
2306
+ return false;
2307
+ }
2308
+ if (viewBadgeThing.tooltip && !isString(viewBadgeThing.tooltip)) {
2309
+ console.log('INVALID view badge, invalid tooltip', viewBadgeThing.tooltip);
2310
+ return false;
2311
+ }
2312
+ return true;
2313
+ }
2314
+ _ViewBadge.isViewBadge = isViewBadge;
2315
+ })(ViewBadge || (ViewBadge = {}));
2316
+ export var TreeItem = /*#__PURE__*/function () {
2317
+ function TreeItem(arg1) {
2318
+ var collapsibleState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : TreeItemCollapsibleState.None;
2319
+ _classCallCheck(this, TreeItem);
2320
+ this.collapsibleState = collapsibleState;
2321
+ if (URI.isUri(arg1)) {
2322
+ this.resourceUri = arg1;
2323
+ } else {
2324
+ this.label = arg1;
2325
+ }
2326
+ }
2327
+ _createClass(TreeItem, null, [{
2328
+ key: "isTreeItem",
2329
+ value: function isTreeItem(thing) {
2330
+ var _treeItemThing$label, _treeItemThing$access;
2331
+ var treeItemThing = thing;
2332
+ if (treeItemThing.checkboxState !== undefined) {
2333
+ var checkbox = isNumber(treeItemThing.checkboxState) ? treeItemThing.checkboxState : isObject(treeItemThing.checkboxState) && isNumber(treeItemThing.checkboxState.state) ? treeItemThing.checkboxState.state : undefined;
2334
+ var _tooltip = !isNumber(treeItemThing.checkboxState) && isObject(treeItemThing.checkboxState) ? treeItemThing.checkboxState.tooltip : undefined;
2335
+ if (checkbox === undefined || checkbox !== TreeItemCheckboxState.Checked && checkbox !== TreeItemCheckboxState.Unchecked || _tooltip !== undefined && !isString(_tooltip)) {
2336
+ console.log('INVALID tree item, invalid checkboxState', treeItemThing.checkboxState);
2337
+ return false;
2338
+ }
2339
+ }
2340
+ if (thing instanceof TreeItem) {
2341
+ return true;
2342
+ }
2343
+ if (treeItemThing.label !== undefined && !isString(treeItemThing.label) && !((_treeItemThing$label = treeItemThing.label) !== null && _treeItemThing$label !== void 0 && _treeItemThing$label.label)) {
2344
+ console.log('INVALID tree item, invalid label', treeItemThing.label);
2345
+ return false;
2346
+ }
2347
+ if (treeItemThing.id !== undefined && !isString(treeItemThing.id)) {
2348
+ console.log('INVALID tree item, invalid id', treeItemThing.id);
2349
+ return false;
2350
+ }
2351
+ if (treeItemThing.iconPath !== undefined && !isString(treeItemThing.iconPath) && !URI.isUri(treeItemThing.iconPath) && (!treeItemThing.iconPath || !isString(treeItemThing.iconPath.id))) {
2352
+ var asLightAndDarkThing = treeItemThing.iconPath;
2353
+ if (!asLightAndDarkThing || !isString(asLightAndDarkThing.light) && !URI.isUri(asLightAndDarkThing.light) && !isString(asLightAndDarkThing.dark) && !URI.isUri(asLightAndDarkThing.dark)) {
2354
+ console.log('INVALID tree item, invalid iconPath', treeItemThing.iconPath);
2355
+ return false;
2356
+ }
2357
+ }
2358
+ if (treeItemThing.description !== undefined && !isString(treeItemThing.description) && typeof treeItemThing.description !== 'boolean') {
2359
+ console.log('INVALID tree item, invalid description', treeItemThing.description);
2360
+ return false;
2361
+ }
2362
+ if (treeItemThing.resourceUri !== undefined && !URI.isUri(treeItemThing.resourceUri)) {
2363
+ console.log('INVALID tree item, invalid resourceUri', treeItemThing.resourceUri);
2364
+ return false;
2365
+ }
2366
+ if (treeItemThing.tooltip !== undefined && !isString(treeItemThing.tooltip) && !(treeItemThing.tooltip instanceof MarkdownString)) {
2367
+ console.log('INVALID tree item, invalid tooltip', treeItemThing.tooltip);
2368
+ return false;
2369
+ }
2370
+ if (treeItemThing.command !== undefined && !treeItemThing.command.command) {
2371
+ console.log('INVALID tree item, invalid command', treeItemThing.command);
2372
+ return false;
2373
+ }
2374
+ if (treeItemThing.collapsibleState !== undefined && treeItemThing.collapsibleState < TreeItemCollapsibleState.None && treeItemThing.collapsibleState > TreeItemCollapsibleState.Expanded) {
2375
+ console.log('INVALID tree item, invalid collapsibleState', treeItemThing.collapsibleState);
2376
+ return false;
2377
+ }
2378
+ if (treeItemThing.contextValue !== undefined && !isString(treeItemThing.contextValue)) {
2379
+ console.log('INVALID tree item, invalid contextValue', treeItemThing.contextValue);
2380
+ return false;
2381
+ }
2382
+ if (treeItemThing.accessibilityInformation !== undefined && !((_treeItemThing$access = treeItemThing.accessibilityInformation) !== null && _treeItemThing$access !== void 0 && _treeItemThing$access.label)) {
2383
+ console.log('INVALID tree item, invalid accessibilityInformation', treeItemThing.accessibilityInformation);
2384
+ return false;
2385
+ }
2386
+ return true;
2387
+ }
2388
+ }]);
2389
+ return TreeItem;
2390
+ }();
2391
+ export var TreeItemCollapsibleState = /*#__PURE__*/function (TreeItemCollapsibleState) {
2392
+ TreeItemCollapsibleState[TreeItemCollapsibleState["None"] = 0] = "None";
2393
+ TreeItemCollapsibleState[TreeItemCollapsibleState["Collapsed"] = 1] = "Collapsed";
2394
+ TreeItemCollapsibleState[TreeItemCollapsibleState["Expanded"] = 2] = "Expanded";
2395
+ return TreeItemCollapsibleState;
2396
+ }({});
2397
+ export var TreeItemCheckboxState = /*#__PURE__*/function (TreeItemCheckboxState) {
2398
+ TreeItemCheckboxState[TreeItemCheckboxState["Unchecked"] = 0] = "Unchecked";
2399
+ TreeItemCheckboxState[TreeItemCheckboxState["Checked"] = 1] = "Checked";
2400
+ return TreeItemCheckboxState;
2401
+ }({});
2402
+ export var DataTransferItem = /*#__PURE__*/function () {
2403
+ function DataTransferItem(value) {
2404
+ _classCallCheck(this, DataTransferItem);
2405
+ this.value = value;
2406
+ }
2407
+ _createClass(DataTransferItem, [{
2408
+ key: "asString",
2409
+ value: function () {
2410
+ var _asString = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
2411
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
2412
+ while (1) switch (_context.prev = _context.next) {
2413
+ case 0:
2414
+ return _context.abrupt("return", typeof this.value === 'string' ? this.value : JSON.stringify(this.value));
2415
+ case 1:
2416
+ case "end":
2417
+ return _context.stop();
2418
+ }
2419
+ }, _callee, this);
2420
+ }));
2421
+ function asString() {
2422
+ return _asString.apply(this, arguments);
2423
+ }
2424
+ return asString;
2425
+ }()
2426
+ }, {
2427
+ key: "asFile",
2428
+ value: function asFile() {
2429
+ return undefined;
2430
+ }
2431
+ }]);
2432
+ return DataTransferItem;
2433
+ }();
2434
+
2435
+ /**
2436
+ * A data transfer item that has been created by VS Code instead of by a extension.
2437
+ *
2438
+ * Intentionally not exported to extensions.
2439
+ */
2440
+ export var InternalDataTransferItem = /*#__PURE__*/function (_DataTransferItem) {
2441
+ _inherits(InternalDataTransferItem, _DataTransferItem);
2442
+ var _super2 = _createSuper(InternalDataTransferItem);
2443
+ function InternalDataTransferItem() {
2444
+ _classCallCheck(this, InternalDataTransferItem);
2445
+ return _super2.apply(this, arguments);
2446
+ }
2447
+ return _createClass(InternalDataTransferItem);
2448
+ }(DataTransferItem);
2449
+
2450
+ /**
2451
+ * A data transfer item for a file.
2452
+ *
2453
+ * Intentionally not exported to extensions as only we can create these.
2454
+ */
2455
+ var _file = /*#__PURE__*/_classPrivateFieldLooseKey("file");
2456
+ export var InternalFileDataTransferItem = /*#__PURE__*/function (_InternalDataTransfer) {
2457
+ _inherits(InternalFileDataTransferItem, _InternalDataTransfer);
2458
+ var _super3 = _createSuper(InternalFileDataTransferItem);
2459
+ function InternalFileDataTransferItem(file) {
2460
+ var _this2;
2461
+ _classCallCheck(this, InternalFileDataTransferItem);
2462
+ _this2 = _super3.call(this, '');
2463
+ Object.defineProperty(_assertThisInitialized(_this2), _file, {
2464
+ writable: true,
2465
+ value: void 0
2466
+ });
2467
+ _classPrivateFieldLooseBase(_assertThisInitialized(_this2), _file)[_file] = file;
2468
+ return _this2;
2469
+ }
2470
+ _createClass(InternalFileDataTransferItem, [{
2471
+ key: "asFile",
2472
+ value: function asFile() {
2473
+ return _classPrivateFieldLooseBase(this, _file)[_file];
2474
+ }
2475
+ }]);
2476
+ return InternalFileDataTransferItem;
2477
+ }(InternalDataTransferItem);
2478
+
2479
+ /**
2480
+ * Intentionally not exported to extensions
2481
+ */
2482
+ export var DataTransferFile = /*#__PURE__*/function () {
2483
+ function DataTransferFile(name, uri, itemId, getData) {
2484
+ _classCallCheck(this, DataTransferFile);
2485
+ this.name = name;
2486
+ this.uri = uri;
2487
+ this._itemId = itemId;
2488
+ this._getData = getData;
2489
+ }
2490
+ _createClass(DataTransferFile, [{
2491
+ key: "data",
2492
+ value: function data() {
2493
+ return this._getData();
2494
+ }
2495
+ }]);
2496
+ return DataTransferFile;
2497
+ }();
2498
+ var _items = /*#__PURE__*/_classPrivateFieldLooseKey("items");
2499
+ var _normalizeMime = /*#__PURE__*/_classPrivateFieldLooseKey("normalizeMime");
2500
+ _Symbol$iterator = Symbol.iterator;
2501
+ export var DataTransfer = /*#__PURE__*/function () {
2502
+ function DataTransfer(init) {
2503
+ _classCallCheck(this, DataTransfer);
2504
+ Object.defineProperty(this, _normalizeMime, {
2505
+ value: _normalizeMime2
2506
+ });
2507
+ Object.defineProperty(this, _items, {
2508
+ writable: true,
2509
+ value: new Map()
2510
+ });
2511
+ var _iterator6 = _createForOfIteratorHelper(init !== null && init !== void 0 ? init : []),
2512
+ _step6;
2513
+ try {
2514
+ for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
2515
+ var _step6$value = _slicedToArray(_step6.value, 2),
2516
+ _mime = _step6$value[0],
2517
+ _item2 = _step6$value[1];
2518
+ var existing = _classPrivateFieldLooseBase(this, _items)[_items].get(_classPrivateFieldLooseBase(this, _normalizeMime)[_normalizeMime](_mime));
2519
+ if (existing) {
2520
+ existing.push(_item2);
2521
+ } else {
2522
+ _classPrivateFieldLooseBase(this, _items)[_items].set(_classPrivateFieldLooseBase(this, _normalizeMime)[_normalizeMime](_mime), [_item2]);
2523
+ }
2524
+ }
2525
+ } catch (err) {
2526
+ _iterator6.e(err);
2527
+ } finally {
2528
+ _iterator6.f();
2529
+ }
2530
+ }
2531
+ _createClass(DataTransfer, [{
2532
+ key: "get",
2533
+ value: function get(mimeType) {
2534
+ var _classPrivateFieldLoo;
2535
+ return (_classPrivateFieldLoo = _classPrivateFieldLooseBase(this, _items)[_items].get(_classPrivateFieldLooseBase(this, _normalizeMime)[_normalizeMime](mimeType))) === null || _classPrivateFieldLoo === void 0 ? void 0 : _classPrivateFieldLoo[0];
2536
+ }
2537
+ }, {
2538
+ key: "set",
2539
+ value: function set(mimeType, value) {
2540
+ // This intentionally overwrites all entries for a given mimetype.
2541
+ // This is similar to how the DOM DataTransfer type works
2542
+ _classPrivateFieldLooseBase(this, _items)[_items].set(_classPrivateFieldLooseBase(this, _normalizeMime)[_normalizeMime](mimeType), [value]);
2543
+ }
2544
+ }, {
2545
+ key: "forEach",
2546
+ value: function forEach(callbackfn, thisArg) {
2547
+ var _iterator7 = _createForOfIteratorHelper(_classPrivateFieldLooseBase(this, _items)[_items]),
2548
+ _step7;
2549
+ try {
2550
+ for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
2551
+ var _step7$value = _slicedToArray(_step7.value, 2),
2552
+ _mime2 = _step7$value[0],
2553
+ items = _step7$value[1];
2554
+ var _iterator8 = _createForOfIteratorHelper(items),
2555
+ _step8;
2556
+ try {
2557
+ for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
2558
+ var _item3 = _step8.value;
2559
+ callbackfn.call(thisArg, _item3, _mime2, this);
2560
+ }
2561
+ } catch (err) {
2562
+ _iterator8.e(err);
2563
+ } finally {
2564
+ _iterator8.f();
2565
+ }
2566
+ }
2567
+ } catch (err) {
2568
+ _iterator7.e(err);
2569
+ } finally {
2570
+ _iterator7.f();
2571
+ }
2572
+ }
2573
+ }, {
2574
+ key: _Symbol$iterator,
2575
+ value: /*#__PURE__*/_regeneratorRuntime().mark(function value() {
2576
+ var _iterator9, _step9, _step9$value, _mime3, items, _iterator10, _step10, _item4;
2577
+ return _regeneratorRuntime().wrap(function value$(_context2) {
2578
+ while (1) switch (_context2.prev = _context2.next) {
2579
+ case 0:
2580
+ _iterator9 = _createForOfIteratorHelper(_classPrivateFieldLooseBase(this, _items)[_items]);
2581
+ _context2.prev = 1;
2582
+ _iterator9.s();
2583
+ case 3:
2584
+ if ((_step9 = _iterator9.n()).done) {
2585
+ _context2.next = 24;
2586
+ break;
2587
+ }
2588
+ _step9$value = _slicedToArray(_step9.value, 2), _mime3 = _step9$value[0], items = _step9$value[1];
2589
+ _iterator10 = _createForOfIteratorHelper(items);
2590
+ _context2.prev = 6;
2591
+ _iterator10.s();
2592
+ case 8:
2593
+ if ((_step10 = _iterator10.n()).done) {
2594
+ _context2.next = 14;
2595
+ break;
2596
+ }
2597
+ _item4 = _step10.value;
2598
+ _context2.next = 12;
2599
+ return [_mime3, _item4];
2600
+ case 12:
2601
+ _context2.next = 8;
2602
+ break;
2603
+ case 14:
2604
+ _context2.next = 19;
2605
+ break;
2606
+ case 16:
2607
+ _context2.prev = 16;
2608
+ _context2.t0 = _context2["catch"](6);
2609
+ _iterator10.e(_context2.t0);
2610
+ case 19:
2611
+ _context2.prev = 19;
2612
+ _iterator10.f();
2613
+ return _context2.finish(19);
2614
+ case 22:
2615
+ _context2.next = 3;
2616
+ break;
2617
+ case 24:
2618
+ _context2.next = 29;
2619
+ break;
2620
+ case 26:
2621
+ _context2.prev = 26;
2622
+ _context2.t1 = _context2["catch"](1);
2623
+ _iterator9.e(_context2.t1);
2624
+ case 29:
2625
+ _context2.prev = 29;
2626
+ _iterator9.f();
2627
+ return _context2.finish(29);
2628
+ case 32:
2629
+ case "end":
2630
+ return _context2.stop();
2631
+ }
2632
+ }, value, this, [[1, 26, 29, 32], [6, 16, 19, 22]]);
2633
+ })
2634
+ }]);
2635
+ return DataTransfer;
2636
+ }();
2637
+ function _normalizeMime2(mimeType) {
2638
+ return mimeType.toLowerCase();
2639
+ }
2640
+ export var DocumentDropEdit = /*#__PURE__*/_createClass(function DocumentDropEdit(insertText) {
2641
+ _classCallCheck(this, DocumentDropEdit);
2642
+ this.insertText = insertText;
2643
+ });
2644
+ export var DocumentPasteEdit = /*#__PURE__*/_createClass(function DocumentPasteEdit(insertText, label) {
2645
+ _classCallCheck(this, DocumentPasteEdit);
2646
+ this.label = label;
2647
+ this.insertText = insertText;
2648
+ });
2649
+ export var ThemeIcon = /*#__PURE__*/function () {
2650
+ function ThemeIcon(id, color) {
2651
+ _classCallCheck(this, ThemeIcon);
2652
+ this.id = id;
2653
+ this.color = color;
2654
+ }
2655
+ _createClass(ThemeIcon, null, [{
2656
+ key: "isThemeIcon",
2657
+ value: function isThemeIcon(thing) {
2658
+ if (typeof thing.id !== 'string') {
2659
+ console.log('INVALID ThemeIcon, invalid id', thing.id);
2660
+ return false;
2661
+ }
2662
+ return true;
2663
+ }
2664
+ }]);
2665
+ return ThemeIcon;
2666
+ }();
2667
+ ThemeIcon.File = new ThemeIcon('file');
2668
+ ThemeIcon.Folder = new ThemeIcon('folder');
2669
+ export var ThemeColor = /*#__PURE__*/_createClass(function ThemeColor(id) {
2670
+ _classCallCheck(this, ThemeColor);
2671
+ this.id = id;
2672
+ });
2673
+ export var ConfigurationTarget = /*#__PURE__*/function (ConfigurationTarget) {
2674
+ ConfigurationTarget[ConfigurationTarget["Global"] = 1] = "Global";
2675
+ ConfigurationTarget[ConfigurationTarget["Workspace"] = 2] = "Workspace";
2676
+ ConfigurationTarget[ConfigurationTarget["WorkspaceFolder"] = 3] = "WorkspaceFolder";
2677
+ return ConfigurationTarget;
2678
+ }({});
2679
+ export var RelativePattern = /*#__PURE__*/function () {
2680
+ function RelativePattern(base, pattern) {
2681
+ _classCallCheck(this, RelativePattern);
2682
+ if (typeof base !== 'string') {
2683
+ if (!base || !URI.isUri(base) && !URI.isUri(base.uri)) {
2684
+ throw illegalArgument('base');
2685
+ }
2686
+ }
2687
+ if (typeof pattern !== 'string') {
2688
+ throw illegalArgument('pattern');
2689
+ }
2690
+ if (typeof base === 'string') {
2691
+ this.baseUri = URI.file(base);
2692
+ } else if (URI.isUri(base)) {
2693
+ this.baseUri = base;
2694
+ } else {
2695
+ this.baseUri = base.uri;
2696
+ }
2697
+ this.pattern = pattern;
2698
+ }
2699
+ _createClass(RelativePattern, [{
2700
+ key: "base",
2701
+ get: function get() {
2702
+ return this._base;
2703
+ },
2704
+ set: function set(base) {
2705
+ this._base = base;
2706
+ this._baseUri = URI.file(base);
2707
+ }
2708
+ }, {
2709
+ key: "baseUri",
2710
+ get: function get() {
2711
+ return this._baseUri;
2712
+ },
2713
+ set: function set(baseUri) {
2714
+ this._baseUri = baseUri;
2715
+ this._base = baseUri.fsPath;
2716
+ }
2717
+ }, {
2718
+ key: "toJSON",
2719
+ value: function toJSON() {
2720
+ return {
2721
+ pattern: this.pattern,
2722
+ base: this.base,
2723
+ baseUri: this.baseUri.toJSON()
2724
+ };
2725
+ }
2726
+ }]);
2727
+ return RelativePattern;
2728
+ }();
2729
+ var breakpointIds = new WeakMap();
2730
+
2731
+ /**
2732
+ * We want to be able to construct Breakpoints internally that have a particular id, but we don't want extensions to be
2733
+ * able to do this with the exposed Breakpoint classes in extension API.
2734
+ * We also want "instanceof" to work with debug.breakpoints and the exposed breakpoint classes.
2735
+ * And private members will be renamed in the built js, so casting to any and setting a private member is not safe.
2736
+ * So, we store internal breakpoint IDs in a WeakMap. This function must be called after constructing a Breakpoint
2737
+ * with a known id.
2738
+ */
2739
+ export function setBreakpointId(bp, id) {
2740
+ breakpointIds.set(bp, id);
2741
+ }
2742
+ export var Breakpoint = /*#__PURE__*/function () {
2743
+ function Breakpoint(enabled, condition, hitCondition, logMessage) {
2744
+ _classCallCheck(this, Breakpoint);
2745
+ this.enabled = typeof enabled === 'boolean' ? enabled : true;
2746
+ if (typeof condition === 'string') {
2747
+ this.condition = condition;
2748
+ }
2749
+ if (typeof hitCondition === 'string') {
2750
+ this.hitCondition = hitCondition;
2751
+ }
2752
+ if (typeof logMessage === 'string') {
2753
+ this.logMessage = logMessage;
2754
+ }
2755
+ }
2756
+ _createClass(Breakpoint, [{
2757
+ key: "id",
2758
+ get: function get() {
2759
+ if (!this._id) {
2760
+ var _breakpointIds$get;
2761
+ this._id = (_breakpointIds$get = breakpointIds.get(this)) !== null && _breakpointIds$get !== void 0 ? _breakpointIds$get : generateUuid();
2762
+ }
2763
+ return this._id;
2764
+ }
2765
+ }]);
2766
+ return Breakpoint;
2767
+ }();
2768
+ export var SourceBreakpoint = /*#__PURE__*/function (_Breakpoint) {
2769
+ _inherits(SourceBreakpoint, _Breakpoint);
2770
+ var _super4 = _createSuper(SourceBreakpoint);
2771
+ function SourceBreakpoint(location, enabled, condition, hitCondition, logMessage) {
2772
+ var _this3;
2773
+ _classCallCheck(this, SourceBreakpoint);
2774
+ _this3 = _super4.call(this, enabled, condition, hitCondition, logMessage);
2775
+ if (location === null) {
2776
+ throw illegalArgument('location');
2777
+ }
2778
+ _this3.location = location;
2779
+ return _this3;
2780
+ }
2781
+ return _createClass(SourceBreakpoint);
2782
+ }(Breakpoint);
2783
+ export var FunctionBreakpoint = /*#__PURE__*/function (_Breakpoint2) {
2784
+ _inherits(FunctionBreakpoint, _Breakpoint2);
2785
+ var _super5 = _createSuper(FunctionBreakpoint);
2786
+ function FunctionBreakpoint(functionName, enabled, condition, hitCondition, logMessage) {
2787
+ var _this4;
2788
+ _classCallCheck(this, FunctionBreakpoint);
2789
+ _this4 = _super5.call(this, enabled, condition, hitCondition, logMessage);
2790
+ _this4.functionName = functionName;
2791
+ return _this4;
2792
+ }
2793
+ return _createClass(FunctionBreakpoint);
2794
+ }(Breakpoint);
2795
+ export var DataBreakpoint = /*#__PURE__*/function (_Breakpoint3) {
2796
+ _inherits(DataBreakpoint, _Breakpoint3);
2797
+ var _super6 = _createSuper(DataBreakpoint);
2798
+ function DataBreakpoint(label, dataId, canPersist, enabled, condition, hitCondition, logMessage) {
2799
+ var _this5;
2800
+ _classCallCheck(this, DataBreakpoint);
2801
+ _this5 = _super6.call(this, enabled, condition, hitCondition, logMessage);
2802
+ if (!dataId) {
2803
+ throw illegalArgument('dataId');
2804
+ }
2805
+ _this5.label = label;
2806
+ _this5.dataId = dataId;
2807
+ _this5.canPersist = canPersist;
2808
+ return _this5;
2809
+ }
2810
+ return _createClass(DataBreakpoint);
2811
+ }(Breakpoint);
2812
+ export var DebugAdapterExecutable = /*#__PURE__*/_createClass(function DebugAdapterExecutable(command, args, options) {
2813
+ _classCallCheck(this, DebugAdapterExecutable);
2814
+ this.command = command;
2815
+ this.args = args || [];
2816
+ this.options = options;
2817
+ });
2818
+ export var DebugAdapterServer = /*#__PURE__*/_createClass(function DebugAdapterServer(port, host) {
2819
+ _classCallCheck(this, DebugAdapterServer);
2820
+ this.port = port;
2821
+ this.host = host;
2822
+ });
2823
+ export var DebugAdapterNamedPipeServer = /*#__PURE__*/_createClass(function DebugAdapterNamedPipeServer(path) {
2824
+ _classCallCheck(this, DebugAdapterNamedPipeServer);
2825
+ this.path = path;
2826
+ });
2827
+ export var DebugAdapterInlineImplementation = /*#__PURE__*/_createClass(function DebugAdapterInlineImplementation(impl) {
2828
+ _classCallCheck(this, DebugAdapterInlineImplementation);
2829
+ this.implementation = impl;
2830
+ });
2831
+ export var StackFrameFocus = /*#__PURE__*/_createClass(function StackFrameFocus(session, threadId, frameId) {
2832
+ _classCallCheck(this, StackFrameFocus);
2833
+ this.session = session;
2834
+ this.threadId = threadId;
2835
+ this.frameId = frameId;
2836
+ });
2837
+ export var ThreadFocus = /*#__PURE__*/_createClass(function ThreadFocus(session, threadId) {
2838
+ _classCallCheck(this, ThreadFocus);
2839
+ this.session = session;
2840
+ this.threadId = threadId;
2841
+ });
2842
+ export var EvaluatableExpression = /*#__PURE__*/_createClass(function EvaluatableExpression(range, expression) {
2843
+ _classCallCheck(this, EvaluatableExpression);
2844
+ this.range = range;
2845
+ this.expression = expression;
2846
+ });
2847
+ export var InlineCompletionTriggerKind = /*#__PURE__*/function (InlineCompletionTriggerKind) {
2848
+ InlineCompletionTriggerKind[InlineCompletionTriggerKind["Invoke"] = 0] = "Invoke";
2849
+ InlineCompletionTriggerKind[InlineCompletionTriggerKind["Automatic"] = 1] = "Automatic";
2850
+ return InlineCompletionTriggerKind;
2851
+ }({});
2852
+ export var InlineValueText = /*#__PURE__*/_createClass(function InlineValueText(range, text) {
2853
+ _classCallCheck(this, InlineValueText);
2854
+ this.range = range;
2855
+ this.text = text;
2856
+ });
2857
+ export var InlineValueVariableLookup = /*#__PURE__*/_createClass(function InlineValueVariableLookup(range, variableName) {
2858
+ var caseSensitiveLookup = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
2859
+ _classCallCheck(this, InlineValueVariableLookup);
2860
+ this.range = range;
2861
+ this.variableName = variableName;
2862
+ this.caseSensitiveLookup = caseSensitiveLookup;
2863
+ });
2864
+ export var InlineValueEvaluatableExpression = /*#__PURE__*/_createClass(function InlineValueEvaluatableExpression(range, expression) {
2865
+ _classCallCheck(this, InlineValueEvaluatableExpression);
2866
+ this.range = range;
2867
+ this.expression = expression;
2868
+ });
2869
+ export var InlineValueContext = /*#__PURE__*/_createClass(function InlineValueContext(frameId, range) {
2870
+ _classCallCheck(this, InlineValueContext);
2871
+ this.frameId = frameId;
2872
+ this.stoppedLocation = range;
2873
+ });
2874
+
2875
+ //#region file api
2876
+
2877
+ export var FileChangeType = /*#__PURE__*/function (FileChangeType) {
2878
+ FileChangeType[FileChangeType["Changed"] = 1] = "Changed";
2879
+ FileChangeType[FileChangeType["Created"] = 2] = "Created";
2880
+ FileChangeType[FileChangeType["Deleted"] = 3] = "Deleted";
2881
+ return FileChangeType;
2882
+ }({});
2883
+ export var FileSystemError = /*#__PURE__*/function (_Error) {
2884
+ _inherits(FileSystemError, _Error);
2885
+ var _super7 = _createSuper(FileSystemError);
2886
+ function FileSystemError(uriOrMessage) {
2887
+ var _terminator$name;
2888
+ var _this6;
2889
+ var code = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : FileSystemProviderErrorCode.Unknown;
2890
+ var terminator = arguments.length > 2 ? arguments[2] : undefined;
2891
+ _classCallCheck(this, FileSystemError);
2892
+ _this6 = _super7.call(this, URI.isUri(uriOrMessage) ? uriOrMessage.toString(true) : uriOrMessage);
2893
+ _this6.code = (_terminator$name = terminator === null || terminator === void 0 ? void 0 : terminator.name) !== null && _terminator$name !== void 0 ? _terminator$name : 'Unknown';
2894
+
2895
+ // mark the error as file system provider error so that
2896
+ // we can extract the error code on the receiving side
2897
+ markAsFileSystemProviderError(_assertThisInitialized(_this6), code);
2898
+
2899
+ // workaround when extending builtin objects and when compiling to ES5, see:
2900
+ // https://github.com/microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work
2901
+ Object.setPrototypeOf(_assertThisInitialized(_this6), FileSystemError.prototype);
2902
+ if (typeof Error.captureStackTrace === 'function' && typeof terminator === 'function') {
2903
+ // nice stack traces
2904
+ Error.captureStackTrace(_assertThisInitialized(_this6), terminator);
2905
+ }
2906
+ return _this6;
2907
+ }
2908
+ _createClass(FileSystemError, null, [{
2909
+ key: "FileExists",
2910
+ value: function FileExists(messageOrUri) {
2911
+ return new FileSystemError(messageOrUri, FileSystemProviderErrorCode.FileExists, FileSystemError.FileExists);
2912
+ }
2913
+ }, {
2914
+ key: "FileNotFound",
2915
+ value: function FileNotFound(messageOrUri) {
2916
+ return new FileSystemError(messageOrUri, FileSystemProviderErrorCode.FileNotFound, FileSystemError.FileNotFound);
2917
+ }
2918
+ }, {
2919
+ key: "FileNotADirectory",
2920
+ value: function FileNotADirectory(messageOrUri) {
2921
+ return new FileSystemError(messageOrUri, FileSystemProviderErrorCode.FileNotADirectory, FileSystemError.FileNotADirectory);
2922
+ }
2923
+ }, {
2924
+ key: "FileIsADirectory",
2925
+ value: function FileIsADirectory(messageOrUri) {
2926
+ return new FileSystemError(messageOrUri, FileSystemProviderErrorCode.FileIsADirectory, FileSystemError.FileIsADirectory);
2927
+ }
2928
+ }, {
2929
+ key: "NoPermissions",
2930
+ value: function NoPermissions(messageOrUri) {
2931
+ return new FileSystemError(messageOrUri, FileSystemProviderErrorCode.NoPermissions, FileSystemError.NoPermissions);
2932
+ }
2933
+ }, {
2934
+ key: "Unavailable",
2935
+ value: function Unavailable(messageOrUri) {
2936
+ return new FileSystemError(messageOrUri, FileSystemProviderErrorCode.Unavailable, FileSystemError.Unavailable);
2937
+ }
2938
+ }]);
2939
+ return FileSystemError;
2940
+ }( /*#__PURE__*/_wrapNativeSuper(Error));
2941
+
2942
+ //#endregion
2943
+
2944
+ //#region folding api
2945
+
2946
+ export var FoldingRange = /*#__PURE__*/_createClass(function FoldingRange(start, end, kind) {
2947
+ _classCallCheck(this, FoldingRange);
2948
+ this.start = start;
2949
+ this.end = end;
2950
+ this.kind = kind;
2951
+ });
2952
+ export var FoldingRangeKind = /*#__PURE__*/function (FoldingRangeKind) {
2953
+ FoldingRangeKind[FoldingRangeKind["Comment"] = 1] = "Comment";
2954
+ FoldingRangeKind[FoldingRangeKind["Imports"] = 2] = "Imports";
2955
+ FoldingRangeKind[FoldingRangeKind["Region"] = 3] = "Region";
2956
+ return FoldingRangeKind;
2957
+ }({});
2958
+
2959
+ //#endregion
2960
+
2961
+ //#region Comment
2962
+ export var CommentThreadCollapsibleState = /*#__PURE__*/function (CommentThreadCollapsibleState) {
2963
+ CommentThreadCollapsibleState[CommentThreadCollapsibleState["Collapsed"] = 0] = "Collapsed";
2964
+ CommentThreadCollapsibleState[CommentThreadCollapsibleState["Expanded"] = 1] = "Expanded";
2965
+ return CommentThreadCollapsibleState;
2966
+ }({});
2967
+ export var CommentMode = /*#__PURE__*/function (CommentMode) {
2968
+ CommentMode[CommentMode["Editing"] = 0] = "Editing";
2969
+ CommentMode[CommentMode["Preview"] = 1] = "Preview";
2970
+ return CommentMode;
2971
+ }({});
2972
+ export var CommentState = /*#__PURE__*/function (CommentState) {
2973
+ CommentState[CommentState["Published"] = 0] = "Published";
2974
+ CommentState[CommentState["Draft"] = 1] = "Draft";
2975
+ return CommentState;
2976
+ }({});
2977
+ export var CommentThreadState = /*#__PURE__*/function (CommentThreadState) {
2978
+ CommentThreadState[CommentThreadState["Unresolved"] = 0] = "Unresolved";
2979
+ CommentThreadState[CommentThreadState["Resolved"] = 1] = "Resolved";
2980
+ return CommentThreadState;
2981
+ }({});
2982
+
2983
+ //#endregion
2984
+
2985
+ //#region Semantic Coloring
2986
+
2987
+ export var SemanticTokensLegend = /*#__PURE__*/_createClass(function SemanticTokensLegend(tokenTypes) {
2988
+ var tokenModifiers = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
2989
+ _classCallCheck(this, SemanticTokensLegend);
2990
+ this.tokenTypes = tokenTypes;
2991
+ this.tokenModifiers = tokenModifiers;
2992
+ });
2993
+ function isStrArrayOrUndefined(arg) {
2994
+ return typeof arg === 'undefined' || isStringArray(arg);
2995
+ }
2996
+ export var SemanticTokensBuilder = /*#__PURE__*/function () {
2997
+ function SemanticTokensBuilder(legend) {
2998
+ _classCallCheck(this, SemanticTokensBuilder);
2999
+ this._prevLine = 0;
3000
+ this._prevChar = 0;
3001
+ this._dataIsSortedAndDeltaEncoded = true;
3002
+ this._data = [];
3003
+ this._dataLen = 0;
3004
+ this._tokenTypeStrToInt = new Map();
3005
+ this._tokenModifierStrToInt = new Map();
3006
+ this._hasLegend = false;
3007
+ if (legend) {
3008
+ this._hasLegend = true;
3009
+ for (var i = 0, len = legend.tokenTypes.length; i < len; i++) {
3010
+ this._tokenTypeStrToInt.set(legend.tokenTypes[i], i);
3011
+ }
3012
+ for (var _i2 = 0, _len2 = legend.tokenModifiers.length; _i2 < _len2; _i2++) {
3013
+ this._tokenModifierStrToInt.set(legend.tokenModifiers[_i2], _i2);
3014
+ }
3015
+ }
3016
+ }
3017
+ _createClass(SemanticTokensBuilder, [{
3018
+ key: "push",
3019
+ value: function push(arg0, arg1, arg2, arg3, arg4) {
3020
+ if (typeof arg0 === 'number' && typeof arg1 === 'number' && typeof arg2 === 'number' && typeof arg3 === 'number' && (typeof arg4 === 'number' || typeof arg4 === 'undefined')) {
3021
+ if (typeof arg4 === 'undefined') {
3022
+ arg4 = 0;
3023
+ }
3024
+ // 1st overload
3025
+ return this._pushEncoded(arg0, arg1, arg2, arg3, arg4);
3026
+ }
3027
+ if (Range.isRange(arg0) && typeof arg1 === 'string' && isStrArrayOrUndefined(arg2)) {
3028
+ // 2nd overload
3029
+ return this._push(arg0, arg1, arg2);
3030
+ }
3031
+ throw illegalArgument();
3032
+ }
3033
+ }, {
3034
+ key: "_push",
3035
+ value: function _push(range, tokenType, tokenModifiers) {
3036
+ if (!this._hasLegend) {
3037
+ throw new Error('Legend must be provided in constructor');
3038
+ }
3039
+ if (range.start.line !== range.end.line) {
3040
+ throw new Error('`range` cannot span multiple lines');
3041
+ }
3042
+ if (!this._tokenTypeStrToInt.has(tokenType)) {
3043
+ throw new Error('`tokenType` is not in the provided legend');
3044
+ }
3045
+ var line = range.start.line;
3046
+ var char = range.start.character;
3047
+ var length = range.end.character - range.start.character;
3048
+ var nTokenType = this._tokenTypeStrToInt.get(tokenType);
3049
+ var nTokenModifiers = 0;
3050
+ if (tokenModifiers) {
3051
+ var _iterator11 = _createForOfIteratorHelper(tokenModifiers),
3052
+ _step11;
3053
+ try {
3054
+ for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
3055
+ var tokenModifier = _step11.value;
3056
+ if (!this._tokenModifierStrToInt.has(tokenModifier)) {
3057
+ throw new Error('`tokenModifier` is not in the provided legend');
3058
+ }
3059
+ var nTokenModifier = this._tokenModifierStrToInt.get(tokenModifier);
3060
+ nTokenModifiers |= 1 << nTokenModifier >>> 0;
3061
+ }
3062
+ } catch (err) {
3063
+ _iterator11.e(err);
3064
+ } finally {
3065
+ _iterator11.f();
3066
+ }
3067
+ }
3068
+ this._pushEncoded(line, char, length, nTokenType, nTokenModifiers);
3069
+ }
3070
+ }, {
3071
+ key: "_pushEncoded",
3072
+ value: function _pushEncoded(line, char, length, tokenType, tokenModifiers) {
3073
+ if (this._dataIsSortedAndDeltaEncoded && (line < this._prevLine || line === this._prevLine && char < this._prevChar)) {
3074
+ // push calls were ordered and are no longer ordered
3075
+ this._dataIsSortedAndDeltaEncoded = false;
3076
+
3077
+ // Remove delta encoding from data
3078
+ var tokenCount = this._data.length / 5 | 0;
3079
+ var prevLine = 0;
3080
+ var prevChar = 0;
3081
+ for (var i = 0; i < tokenCount; i++) {
3082
+ var _line = this._data[5 * i];
3083
+ var _char = this._data[5 * i + 1];
3084
+ if (_line === 0) {
3085
+ // on the same line as previous token
3086
+ _line = prevLine;
3087
+ _char += prevChar;
3088
+ } else {
3089
+ // on a different line than previous token
3090
+ _line += prevLine;
3091
+ }
3092
+ this._data[5 * i] = _line;
3093
+ this._data[5 * i + 1] = _char;
3094
+ prevLine = _line;
3095
+ prevChar = _char;
3096
+ }
3097
+ }
3098
+ var pushLine = line;
3099
+ var pushChar = char;
3100
+ if (this._dataIsSortedAndDeltaEncoded && this._dataLen > 0) {
3101
+ pushLine -= this._prevLine;
3102
+ if (pushLine === 0) {
3103
+ pushChar -= this._prevChar;
3104
+ }
3105
+ }
3106
+ this._data[this._dataLen++] = pushLine;
3107
+ this._data[this._dataLen++] = pushChar;
3108
+ this._data[this._dataLen++] = length;
3109
+ this._data[this._dataLen++] = tokenType;
3110
+ this._data[this._dataLen++] = tokenModifiers;
3111
+ this._prevLine = line;
3112
+ this._prevChar = char;
3113
+ }
3114
+ }, {
3115
+ key: "build",
3116
+ value: function build(resultId) {
3117
+ if (!this._dataIsSortedAndDeltaEncoded) {
3118
+ return new SemanticTokens(SemanticTokensBuilder._sortAndDeltaEncode(this._data), resultId);
3119
+ }
3120
+ return new SemanticTokens(new Uint32Array(this._data), resultId);
3121
+ }
3122
+ }], [{
3123
+ key: "_sortAndDeltaEncode",
3124
+ value: function _sortAndDeltaEncode(data) {
3125
+ var pos = [];
3126
+ var tokenCount = data.length / 5 | 0;
3127
+ for (var i = 0; i < tokenCount; i++) {
3128
+ pos[i] = i;
3129
+ }
3130
+ pos.sort(function (a, b) {
3131
+ var aLine = data[5 * a];
3132
+ var bLine = data[5 * b];
3133
+ if (aLine === bLine) {
3134
+ var aChar = data[5 * a + 1];
3135
+ var bChar = data[5 * b + 1];
3136
+ return aChar - bChar;
3137
+ }
3138
+ return aLine - bLine;
3139
+ });
3140
+ var result = new Uint32Array(data.length);
3141
+ var prevLine = 0;
3142
+ var prevChar = 0;
3143
+ for (var _i3 = 0; _i3 < tokenCount; _i3++) {
3144
+ var srcOffset = 5 * pos[_i3];
3145
+ var _line2 = data[srcOffset + 0];
3146
+ var _char2 = data[srcOffset + 1];
3147
+ var _length = data[srcOffset + 2];
3148
+ var _tokenType = data[srcOffset + 3];
3149
+ var _tokenModifiers = data[srcOffset + 4];
3150
+ var pushLine = _line2 - prevLine;
3151
+ var pushChar = pushLine === 0 ? _char2 - prevChar : _char2;
3152
+ var dstOffset = 5 * _i3;
3153
+ result[dstOffset + 0] = pushLine;
3154
+ result[dstOffset + 1] = pushChar;
3155
+ result[dstOffset + 2] = _length;
3156
+ result[dstOffset + 3] = _tokenType;
3157
+ result[dstOffset + 4] = _tokenModifiers;
3158
+ prevLine = _line2;
3159
+ prevChar = _char2;
3160
+ }
3161
+ return result;
3162
+ }
3163
+ }]);
3164
+ return SemanticTokensBuilder;
3165
+ }();
3166
+ export var SemanticTokens = /*#__PURE__*/_createClass(function SemanticTokens(data, resultId) {
3167
+ _classCallCheck(this, SemanticTokens);
3168
+ this.resultId = resultId;
3169
+ this.data = data;
3170
+ });
3171
+ export var SemanticTokensEdit = /*#__PURE__*/_createClass(function SemanticTokensEdit(start, deleteCount, data) {
3172
+ _classCallCheck(this, SemanticTokensEdit);
3173
+ this.start = start;
3174
+ this.deleteCount = deleteCount;
3175
+ this.data = data;
3176
+ });
3177
+ export var SemanticTokensEdits = /*#__PURE__*/_createClass(function SemanticTokensEdits(edits, resultId) {
3178
+ _classCallCheck(this, SemanticTokensEdits);
3179
+ this.resultId = resultId;
3180
+ this.edits = edits;
3181
+ });
3182
+
3183
+ //#endregion
3184
+
3185
+ //#region debug
3186
+ export var DebugConsoleMode = /*#__PURE__*/function (DebugConsoleMode) {
3187
+ DebugConsoleMode[DebugConsoleMode["Separate"] = 0] = "Separate";
3188
+ DebugConsoleMode[DebugConsoleMode["MergeWithParent"] = 1] = "MergeWithParent";
3189
+ return DebugConsoleMode;
3190
+ }({});
3191
+
3192
+ //#endregion
3193
+
3194
+ export var QuickInputButtons = /*#__PURE__*/_createClass(function QuickInputButtons() {
3195
+ _classCallCheck(this, QuickInputButtons);
3196
+ });
3197
+ QuickInputButtons.Back = {
3198
+ iconPath: new ThemeIcon('arrow-left')
3199
+ };
3200
+ export var QuickPickItemKind = /*#__PURE__*/function (QuickPickItemKind) {
3201
+ QuickPickItemKind[QuickPickItemKind["Separator"] = -1] = "Separator";
3202
+ QuickPickItemKind[QuickPickItemKind["Default"] = 0] = "Default";
3203
+ return QuickPickItemKind;
3204
+ }({});
3205
+ export var InputBoxValidationSeverity = /*#__PURE__*/function (InputBoxValidationSeverity) {
3206
+ InputBoxValidationSeverity[InputBoxValidationSeverity["Info"] = 1] = "Info";
3207
+ InputBoxValidationSeverity[InputBoxValidationSeverity["Warning"] = 2] = "Warning";
3208
+ InputBoxValidationSeverity[InputBoxValidationSeverity["Error"] = 3] = "Error";
3209
+ return InputBoxValidationSeverity;
3210
+ }({});
3211
+ export var ExtensionKind = /*#__PURE__*/function (ExtensionKind) {
3212
+ ExtensionKind[ExtensionKind["UI"] = 1] = "UI";
3213
+ ExtensionKind[ExtensionKind["Workspace"] = 2] = "Workspace";
3214
+ return ExtensionKind;
3215
+ }({});
3216
+
3217
+ // export class FileDecoration {
3218
+ // static validate(d: FileDecoration): boolean {
3219
+ // if (typeof d.badge === 'string') {
3220
+ // let len = nextCharLength(d.badge, 0);
3221
+ // if (len < d.badge.length) {
3222
+ // len += nextCharLength(d.badge, len);
3223
+ // }
3224
+ // if (d.badge.length > len) {
3225
+ // throw new Error(`The 'badge'-property must be undefined or a short character`);
3226
+ // }
3227
+ // } else if (d.badge) {
3228
+ // if (!ThemeIcon.isThemeIcon(d.badge)) {
3229
+ // throw new Error(`The 'badge'-property is not a valid ThemeIcon`);
3230
+ // }
3231
+ // }
3232
+ // if (!d.color && !d.badge && !d.tooltip) {
3233
+ // throw new Error(`The decoration is empty`);
3234
+ // }
3235
+ // return true;
3236
+ // }
3237
+
3238
+ // badge?: string | vscode.ThemeIcon;
3239
+ // tooltip?: string;
3240
+ // color?: vscode.ThemeColor;
3241
+ // propagate?: boolean;
3242
+
3243
+ // constructor(badge?: string | ThemeIcon, tooltip?: string, color?: ThemeColor) {
3244
+ // this.badge = badge;
3245
+ // this.tooltip = tooltip;
3246
+ // this.color = color;
3247
+ // }
3248
+ // }
3249
+
3250
+ //#region Theming
3251
+
3252
+ export var ColorTheme = /*#__PURE__*/_createClass(function ColorTheme(kind) {
3253
+ _classCallCheck(this, ColorTheme);
3254
+ this.kind = kind;
3255
+ });
3256
+ export var ColorThemeKind = /*#__PURE__*/function (ColorThemeKind) {
3257
+ ColorThemeKind[ColorThemeKind["Light"] = 1] = "Light";
3258
+ ColorThemeKind[ColorThemeKind["Dark"] = 2] = "Dark";
3259
+ ColorThemeKind[ColorThemeKind["HighContrast"] = 3] = "HighContrast";
3260
+ ColorThemeKind[ColorThemeKind["HighContrastLight"] = 4] = "HighContrastLight";
3261
+ return ColorThemeKind;
3262
+ }({});
3263
+
3264
+ //#endregion Theming
3265
+
3266
+ //#region Notebook
3267
+
3268
+ export var NotebookRange = /*#__PURE__*/function () {
3269
+ function NotebookRange(start, end) {
3270
+ _classCallCheck(this, NotebookRange);
3271
+ if (start < 0) {
3272
+ throw illegalArgument('start must be positive');
3273
+ }
3274
+ if (end < 0) {
3275
+ throw illegalArgument('end must be positive');
3276
+ }
3277
+ if (start <= end) {
3278
+ this._start = start;
3279
+ this._end = end;
3280
+ } else {
3281
+ this._start = end;
3282
+ this._end = start;
3283
+ }
3284
+ }
3285
+ _createClass(NotebookRange, [{
3286
+ key: "start",
3287
+ get: function get() {
3288
+ return this._start;
3289
+ }
3290
+ }, {
3291
+ key: "end",
3292
+ get: function get() {
3293
+ return this._end;
3294
+ }
3295
+ }, {
3296
+ key: "isEmpty",
3297
+ get: function get() {
3298
+ return this._start === this._end;
3299
+ }
3300
+ }, {
3301
+ key: "with",
3302
+ value: function _with(change) {
3303
+ var start = this._start;
3304
+ var end = this._end;
3305
+ if (change.start !== undefined) {
3306
+ start = change.start;
3307
+ }
3308
+ if (change.end !== undefined) {
3309
+ end = change.end;
3310
+ }
3311
+ if (start === this._start && end === this._end) {
3312
+ return this;
3313
+ }
3314
+ return new NotebookRange(start, end);
3315
+ }
3316
+ }], [{
3317
+ key: "isNotebookRange",
3318
+ value: function isNotebookRange(thing) {
3319
+ if (thing instanceof NotebookRange) {
3320
+ return true;
3321
+ }
3322
+ if (!thing) {
3323
+ return false;
3324
+ }
3325
+ return typeof thing.start === 'number' && typeof thing.end === 'number';
3326
+ }
3327
+ }]);
3328
+ return NotebookRange;
3329
+ }();
3330
+ export var NotebookCellData = /*#__PURE__*/function () {
3331
+ function NotebookCellData(kind, value, languageId, mime, outputs, metadata, executionSummary) {
3332
+ _classCallCheck(this, NotebookCellData);
3333
+ this.kind = kind;
3334
+ this.value = value;
3335
+ this.languageId = languageId;
3336
+ this.mime = mime;
3337
+ this.outputs = outputs !== null && outputs !== void 0 ? outputs : [];
3338
+ this.metadata = metadata;
3339
+ this.executionSummary = executionSummary;
3340
+ NotebookCellData.validate(this);
3341
+ }
3342
+ _createClass(NotebookCellData, null, [{
3343
+ key: "validate",
3344
+ value: function validate(data) {
3345
+ if (typeof data.kind !== 'number') {
3346
+ throw new Error("NotebookCellData MUST have 'kind' property");
3347
+ }
3348
+ if (typeof data.value !== 'string') {
3349
+ throw new Error("NotebookCellData MUST have 'value' property");
3350
+ }
3351
+ if (typeof data.languageId !== 'string') {
3352
+ throw new Error("NotebookCellData MUST have 'languageId' property");
3353
+ }
3354
+ }
3355
+ }, {
3356
+ key: "isNotebookCellDataArray",
3357
+ value: function isNotebookCellDataArray(value) {
3358
+ return Array.isArray(value) && value.every(function (elem) {
3359
+ return NotebookCellData.isNotebookCellData(elem);
3360
+ });
3361
+ }
3362
+ }, {
3363
+ key: "isNotebookCellData",
3364
+ value: function isNotebookCellData(value) {
3365
+ // return value instanceof NotebookCellData;
3366
+ return true;
3367
+ }
3368
+ }]);
3369
+ return NotebookCellData;
3370
+ }();
3371
+ export var NotebookData = /*#__PURE__*/_createClass(function NotebookData(cells) {
3372
+ _classCallCheck(this, NotebookData);
3373
+ this.cells = cells;
3374
+ });
3375
+ var _encoder = /*#__PURE__*/_classPrivateFieldLooseKey("encoder");
3376
+ export var NotebookCellOutputItem = /*#__PURE__*/function () {
3377
+ function NotebookCellOutputItem(data, mime) {
3378
+ _classCallCheck(this, NotebookCellOutputItem);
3379
+ this.data = data;
3380
+ this.mime = mime;
3381
+ var mimeNormalized = normalizeMimeType(mime, true);
3382
+ if (!mimeNormalized) {
3383
+ throw new Error("INVALID mime type: ".concat(mime, ". Must be in the format \"type/subtype[;optionalparameter]\""));
3384
+ }
3385
+ this.mime = mimeNormalized;
3386
+ }
3387
+ _createClass(NotebookCellOutputItem, null, [{
3388
+ key: "isNotebookCellOutputItem",
3389
+ value: function isNotebookCellOutputItem(obj) {
3390
+ if (obj instanceof NotebookCellOutputItem) {
3391
+ return true;
3392
+ }
3393
+ if (!obj) {
3394
+ return false;
3395
+ }
3396
+ return typeof obj.mime === 'string' && obj.data instanceof Uint8Array;
3397
+ }
3398
+ }, {
3399
+ key: "error",
3400
+ value: function error(err) {
3401
+ var obj = {
3402
+ name: err.name,
3403
+ message: err.message,
3404
+ stack: err.stack
3405
+ };
3406
+ return NotebookCellOutputItem.json(obj, 'application/vnd.code.notebook.error');
3407
+ }
3408
+ }, {
3409
+ key: "stdout",
3410
+ value: function stdout(value) {
3411
+ return NotebookCellOutputItem.text(value, 'application/vnd.code.notebook.stdout');
3412
+ }
3413
+ }, {
3414
+ key: "stderr",
3415
+ value: function stderr(value) {
3416
+ return NotebookCellOutputItem.text(value, 'application/vnd.code.notebook.stderr');
3417
+ }
3418
+ }, {
3419
+ key: "bytes",
3420
+ value: function bytes(value) {
3421
+ var mime = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'application/octet-stream';
3422
+ return new NotebookCellOutputItem(value, mime);
3423
+ }
3424
+ }, {
3425
+ key: "text",
3426
+ value: function text(value) {
3427
+ var mime = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Mimes.text;
3428
+ var bytes = _classPrivateFieldLooseBase(NotebookCellOutputItem, _encoder)[_encoder].encode(String(value));
3429
+ return new NotebookCellOutputItem(bytes, mime);
3430
+ }
3431
+ }, {
3432
+ key: "json",
3433
+ value: function json(value) {
3434
+ var mime = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'text/x-json';
3435
+ var rawStr = JSON.stringify(value, undefined, '\t');
3436
+ return NotebookCellOutputItem.text(rawStr, mime);
3437
+ }
3438
+ }]);
3439
+ return NotebookCellOutputItem;
3440
+ }();
3441
+ Object.defineProperty(NotebookCellOutputItem, _encoder, {
3442
+ writable: true,
3443
+ value: new TextEncoder()
3444
+ });
3445
+ export var NotebookCellOutput = /*#__PURE__*/function () {
3446
+ function NotebookCellOutput(items, idOrMetadata, metadata) {
3447
+ _classCallCheck(this, NotebookCellOutput);
3448
+ this.items = NotebookCellOutput.ensureUniqueMimeTypes(items, true);
3449
+ if (typeof idOrMetadata === 'string') {
3450
+ this.id = idOrMetadata;
3451
+ this.metadata = metadata;
3452
+ } else {
3453
+ this.id = generateUuid();
3454
+ this.metadata = idOrMetadata !== null && idOrMetadata !== void 0 ? idOrMetadata : metadata;
3455
+ }
3456
+ }
3457
+ _createClass(NotebookCellOutput, null, [{
3458
+ key: "isNotebookCellOutput",
3459
+ value: function isNotebookCellOutput(candidate) {
3460
+ if (candidate instanceof NotebookCellOutput) {
3461
+ return true;
3462
+ }
3463
+ if (!candidate || _typeof(candidate) !== 'object') {
3464
+ return false;
3465
+ }
3466
+ return typeof candidate.id === 'string' && Array.isArray(candidate.items);
3467
+ }
3468
+ }, {
3469
+ key: "ensureUniqueMimeTypes",
3470
+ value: function ensureUniqueMimeTypes(items) {
3471
+ var warn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
3472
+ var seen = new Set();
3473
+ var removeIdx = new Set();
3474
+ for (var i = 0; i < items.length; i++) {
3475
+ var _item5 = items[i];
3476
+ var normalMime = normalizeMimeType(_item5.mime);
3477
+ // We can have multiple text stream mime types in the same output.
3478
+ if (!seen.has(normalMime) || isTextStreamMime(normalMime)) {
3479
+ seen.add(normalMime);
3480
+ continue;
3481
+ }
3482
+ // duplicated mime types... first has won
3483
+ removeIdx.add(i);
3484
+ if (warn) {
3485
+ console.warn("DUPLICATED mime type '".concat(_item5.mime, "' will be dropped"));
3486
+ }
3487
+ }
3488
+ if (removeIdx.size === 0) {
3489
+ return items;
3490
+ }
3491
+ return items.filter(function (_item, index) {
3492
+ return !removeIdx.has(index);
3493
+ });
3494
+ }
3495
+ }]);
3496
+ return NotebookCellOutput;
3497
+ }();
3498
+ export var NotebookCellKind = /*#__PURE__*/function (NotebookCellKind) {
3499
+ NotebookCellKind[NotebookCellKind["Markup"] = 1] = "Markup";
3500
+ NotebookCellKind[NotebookCellKind["Code"] = 2] = "Code";
3501
+ return NotebookCellKind;
3502
+ }({});
3503
+ export var NotebookCellExecutionState = /*#__PURE__*/function (NotebookCellExecutionState) {
3504
+ NotebookCellExecutionState[NotebookCellExecutionState["Idle"] = 1] = "Idle";
3505
+ NotebookCellExecutionState[NotebookCellExecutionState["Pending"] = 2] = "Pending";
3506
+ NotebookCellExecutionState[NotebookCellExecutionState["Executing"] = 3] = "Executing";
3507
+ return NotebookCellExecutionState;
3508
+ }({});
3509
+ export var NotebookCellStatusBarAlignment = /*#__PURE__*/function (NotebookCellStatusBarAlignment) {
3510
+ NotebookCellStatusBarAlignment[NotebookCellStatusBarAlignment["Left"] = 1] = "Left";
3511
+ NotebookCellStatusBarAlignment[NotebookCellStatusBarAlignment["Right"] = 2] = "Right";
3512
+ return NotebookCellStatusBarAlignment;
3513
+ }({});
3514
+ export var NotebookEditorRevealType = /*#__PURE__*/function (NotebookEditorRevealType) {
3515
+ NotebookEditorRevealType[NotebookEditorRevealType["Default"] = 0] = "Default";
3516
+ NotebookEditorRevealType[NotebookEditorRevealType["InCenter"] = 1] = "InCenter";
3517
+ NotebookEditorRevealType[NotebookEditorRevealType["InCenterIfOutsideViewport"] = 2] = "InCenterIfOutsideViewport";
3518
+ NotebookEditorRevealType[NotebookEditorRevealType["AtTop"] = 3] = "AtTop";
3519
+ return NotebookEditorRevealType;
3520
+ }({});
3521
+ export var NotebookCellStatusBarItem = /*#__PURE__*/_createClass(function NotebookCellStatusBarItem(text, alignment) {
3522
+ _classCallCheck(this, NotebookCellStatusBarItem);
3523
+ this.text = text;
3524
+ this.alignment = alignment;
3525
+ });
3526
+ export var NotebookControllerAffinity = /*#__PURE__*/function (NotebookControllerAffinity) {
3527
+ NotebookControllerAffinity[NotebookControllerAffinity["Default"] = 1] = "Default";
3528
+ NotebookControllerAffinity[NotebookControllerAffinity["Preferred"] = 2] = "Preferred";
3529
+ return NotebookControllerAffinity;
3530
+ }({});
3531
+ export var NotebookControllerAffinity2 = /*#__PURE__*/function (NotebookControllerAffinity2) {
3532
+ NotebookControllerAffinity2[NotebookControllerAffinity2["Default"] = 1] = "Default";
3533
+ NotebookControllerAffinity2[NotebookControllerAffinity2["Preferred"] = 2] = "Preferred";
3534
+ NotebookControllerAffinity2[NotebookControllerAffinity2["Hidden"] = -1] = "Hidden";
3535
+ return NotebookControllerAffinity2;
3536
+ }({});
3537
+ export var NotebookRendererScript = /*#__PURE__*/_createClass(function NotebookRendererScript(uri) {
3538
+ var provides = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
3539
+ _classCallCheck(this, NotebookRendererScript);
3540
+ this.uri = uri;
3541
+ this.provides = asArray(provides);
3542
+ });
3543
+ export var NotebookKernelSourceAction = /*#__PURE__*/_createClass(function NotebookKernelSourceAction(label) {
3544
+ _classCallCheck(this, NotebookKernelSourceAction);
3545
+ this.label = label;
3546
+ });
3547
+ export var NotebookVariablesRequestKind = /*#__PURE__*/function (NotebookVariablesRequestKind) {
3548
+ NotebookVariablesRequestKind[NotebookVariablesRequestKind["Named"] = 1] = "Named";
3549
+ NotebookVariablesRequestKind[NotebookVariablesRequestKind["Indexed"] = 2] = "Indexed";
3550
+ return NotebookVariablesRequestKind;
3551
+ }({});
3552
+
3553
+ //#endregion
3554
+
3555
+ //#region Timeline
3556
+
3557
+ // export class TimelineItem implements vscode.TimelineItem {
3558
+ // constructor(
3559
+ // public label: string,
3560
+ // public timestamp: number,
3561
+ // ) {}
3562
+ // }
3563
+
3564
+ //#endregion Timeline
3565
+
3566
+ //#region ExtensionContext
3567
+
3568
+ export var ExtensionMode = /*#__PURE__*/function (ExtensionMode) {
3569
+ ExtensionMode[ExtensionMode["Production"] = 1] = "Production";
3570
+ ExtensionMode[ExtensionMode["Development"] = 2] = "Development";
3571
+ ExtensionMode[ExtensionMode["Test"] = 3] = "Test";
3572
+ return ExtensionMode;
3573
+ }({});
3574
+ export var ExtensionRuntime = /*#__PURE__*/function (ExtensionRuntime) {
3575
+ ExtensionRuntime[ExtensionRuntime["Node"] = 1] = "Node";
3576
+ ExtensionRuntime[ExtensionRuntime["Webworker"] = 2] = "Webworker";
3577
+ return ExtensionRuntime;
3578
+ }({});
3579
+
3580
+ //#endregion ExtensionContext
3581
+
3582
+ export var StandardTokenType = /*#__PURE__*/function (StandardTokenType) {
3583
+ StandardTokenType[StandardTokenType["Other"] = 0] = "Other";
3584
+ StandardTokenType[StandardTokenType["Comment"] = 1] = "Comment";
3585
+ StandardTokenType[StandardTokenType["String"] = 2] = "String";
3586
+ StandardTokenType[StandardTokenType["RegEx"] = 3] = "RegEx";
3587
+ return StandardTokenType;
3588
+ }({});
3589
+ export var LinkedEditingRanges = /*#__PURE__*/_createClass(function LinkedEditingRanges(ranges, wordPattern) {
3590
+ _classCallCheck(this, LinkedEditingRanges);
3591
+ this.ranges = ranges;
3592
+ this.wordPattern = wordPattern;
3593
+ }
3594
+
3595
+ /**
3596
+ * A list of ranges that can be edited together. The ranges must have
3597
+ * identical length and text content. The ranges cannot overlap.
3598
+ */
3599
+
3600
+ /**
3601
+ * An optional word pattern that describes valid contents for the given ranges.
3602
+ * If no pattern is provided, the language configuration's word pattern will be used.
3603
+ */);
3604
+
3605
+ //#region ports
3606
+ export var PortAttributes = /*#__PURE__*/function () {
3607
+ function PortAttributes(autoForwardAction) {
3608
+ _classCallCheck(this, PortAttributes);
3609
+ this._autoForwardAction = autoForwardAction;
3610
+ }
3611
+ _createClass(PortAttributes, [{
3612
+ key: "autoForwardAction",
3613
+ get: function get() {
3614
+ return this._autoForwardAction;
3615
+ }
3616
+ }]);
3617
+ return PortAttributes;
3618
+ }();
3619
+ //#endregion ports
3620
+
3621
+ //#region Testing
3622
+ export var TestResultState = /*#__PURE__*/function (TestResultState) {
3623
+ TestResultState[TestResultState["Queued"] = 1] = "Queued";
3624
+ TestResultState[TestResultState["Running"] = 2] = "Running";
3625
+ TestResultState[TestResultState["Passed"] = 3] = "Passed";
3626
+ TestResultState[TestResultState["Failed"] = 4] = "Failed";
3627
+ TestResultState[TestResultState["Skipped"] = 5] = "Skipped";
3628
+ TestResultState[TestResultState["Errored"] = 6] = "Errored";
3629
+ return TestResultState;
3630
+ }({});
3631
+ export var TestRunProfileKind = /*#__PURE__*/function (TestRunProfileKind) {
3632
+ TestRunProfileKind[TestRunProfileKind["Run"] = 1] = "Run";
3633
+ TestRunProfileKind[TestRunProfileKind["Debug"] = 2] = "Debug";
3634
+ TestRunProfileKind[TestRunProfileKind["Coverage"] = 3] = "Coverage";
3635
+ return TestRunProfileKind;
3636
+ }({});
3637
+ export var TestRunRequest = /*#__PURE__*/_createClass(function TestRunRequest() {
3638
+ var include = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
3639
+ var exclude = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
3640
+ var profile = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
3641
+ var continuous = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
3642
+ _classCallCheck(this, TestRunRequest);
3643
+ this.include = include;
3644
+ this.exclude = exclude;
3645
+ this.profile = profile;
3646
+ this.continuous = continuous;
3647
+ });
3648
+ export var TestMessage = /*#__PURE__*/function () {
3649
+ function TestMessage(message) {
3650
+ _classCallCheck(this, TestMessage);
3651
+ this.message = message;
3652
+ }
3653
+ _createClass(TestMessage, null, [{
3654
+ key: "diff",
3655
+ value: /** proposed: */
3656
+
3657
+ function diff(message, expected, actual) {
3658
+ var msg = new TestMessage(message);
3659
+ msg.expectedOutput = expected;
3660
+ msg.actualOutput = actual;
3661
+ return msg;
3662
+ }
3663
+ }]);
3664
+ return TestMessage;
3665
+ }();
3666
+ export var TestTag = /*#__PURE__*/_createClass(function TestTag(id) {
3667
+ _classCallCheck(this, TestTag);
3668
+ this.id = id;
3669
+ });
3670
+
3671
+ //#endregion
3672
+
3673
+ export var ExternalUriOpenerPriority = /*#__PURE__*/function (ExternalUriOpenerPriority) {
3674
+ ExternalUriOpenerPriority[ExternalUriOpenerPriority["None"] = 0] = "None";
3675
+ ExternalUriOpenerPriority[ExternalUriOpenerPriority["Option"] = 1] = "Option";
3676
+ ExternalUriOpenerPriority[ExternalUriOpenerPriority["Default"] = 2] = "Default";
3677
+ ExternalUriOpenerPriority[ExternalUriOpenerPriority["Preferred"] = 3] = "Preferred";
3678
+ return ExternalUriOpenerPriority;
3679
+ }({});
3680
+ export var WorkspaceTrustState = /*#__PURE__*/function (WorkspaceTrustState) {
3681
+ WorkspaceTrustState[WorkspaceTrustState["Untrusted"] = 0] = "Untrusted";
3682
+ WorkspaceTrustState[WorkspaceTrustState["Trusted"] = 1] = "Trusted";
3683
+ WorkspaceTrustState[WorkspaceTrustState["Unspecified"] = 2] = "Unspecified";
3684
+ return WorkspaceTrustState;
3685
+ }({});
3686
+ export var PortAutoForwardAction = /*#__PURE__*/function (PortAutoForwardAction) {
3687
+ PortAutoForwardAction[PortAutoForwardAction["Notify"] = 1] = "Notify";
3688
+ PortAutoForwardAction[PortAutoForwardAction["OpenBrowser"] = 2] = "OpenBrowser";
3689
+ PortAutoForwardAction[PortAutoForwardAction["OpenPreview"] = 3] = "OpenPreview";
3690
+ PortAutoForwardAction[PortAutoForwardAction["Silent"] = 4] = "Silent";
3691
+ PortAutoForwardAction[PortAutoForwardAction["Ignore"] = 5] = "Ignore";
3692
+ PortAutoForwardAction[PortAutoForwardAction["OpenBrowserOnce"] = 6] = "OpenBrowserOnce";
3693
+ return PortAutoForwardAction;
3694
+ }({});
3695
+ export var TypeHierarchyItem = /*#__PURE__*/_createClass(function TypeHierarchyItem(kind, name, detail, uri, range, selectionRange) {
3696
+ _classCallCheck(this, TypeHierarchyItem);
3697
+ this.kind = kind;
3698
+ this.name = name;
3699
+ this.detail = detail;
3700
+ this.uri = uri;
3701
+ this.range = range;
3702
+ this.selectionRange = selectionRange;
3703
+ });
3704
+
3705
+ //#region Tab Inputs
3706
+
3707
+ export var TextTabInput = /*#__PURE__*/_createClass(function TextTabInput(uri) {
3708
+ _classCallCheck(this, TextTabInput);
3709
+ this.uri = uri;
3710
+ });
3711
+ export var TextDiffTabInput = /*#__PURE__*/_createClass(function TextDiffTabInput(original, modified) {
3712
+ _classCallCheck(this, TextDiffTabInput);
3713
+ this.original = original;
3714
+ this.modified = modified;
3715
+ });
3716
+ export var TextMergeTabInput = /*#__PURE__*/_createClass(function TextMergeTabInput(base, input1, input2, result) {
3717
+ _classCallCheck(this, TextMergeTabInput);
3718
+ this.base = base;
3719
+ this.input1 = input1;
3720
+ this.input2 = input2;
3721
+ this.result = result;
3722
+ });
3723
+ export var CustomEditorTabInput = /*#__PURE__*/_createClass(function CustomEditorTabInput(uri, viewType) {
3724
+ _classCallCheck(this, CustomEditorTabInput);
3725
+ this.uri = uri;
3726
+ this.viewType = viewType;
3727
+ });
3728
+ export var WebviewEditorTabInput = /*#__PURE__*/_createClass(function WebviewEditorTabInput(viewType) {
3729
+ _classCallCheck(this, WebviewEditorTabInput);
3730
+ this.viewType = viewType;
3731
+ });
3732
+ export var NotebookEditorTabInput = /*#__PURE__*/_createClass(function NotebookEditorTabInput(uri, notebookType) {
3733
+ _classCallCheck(this, NotebookEditorTabInput);
3734
+ this.uri = uri;
3735
+ this.notebookType = notebookType;
3736
+ });
3737
+ export var NotebookDiffEditorTabInput = /*#__PURE__*/_createClass(function NotebookDiffEditorTabInput(original, modified, notebookType) {
3738
+ _classCallCheck(this, NotebookDiffEditorTabInput);
3739
+ this.original = original;
3740
+ this.modified = modified;
3741
+ this.notebookType = notebookType;
3742
+ });
3743
+ export var TerminalEditorTabInput = /*#__PURE__*/_createClass(function TerminalEditorTabInput() {
3744
+ _classCallCheck(this, TerminalEditorTabInput);
3745
+ });
3746
+ export var InteractiveWindowInput = /*#__PURE__*/_createClass(function InteractiveWindowInput(uri, inputBoxUri) {
3747
+ _classCallCheck(this, InteractiveWindowInput);
3748
+ this.uri = uri;
3749
+ this.inputBoxUri = inputBoxUri;
3750
+ });
3751
+ export var ChatEditorTabInput = /*#__PURE__*/_createClass(function ChatEditorTabInput(providerId) {
3752
+ _classCallCheck(this, ChatEditorTabInput);
3753
+ this.providerId = providerId;
3754
+ });
3755
+ //#endregion
3756
+
3757
+ //#region Chat
3758
+
3759
+ export var InteractiveSessionVoteDirection = /*#__PURE__*/function (InteractiveSessionVoteDirection) {
3760
+ InteractiveSessionVoteDirection[InteractiveSessionVoteDirection["Down"] = 0] = "Down";
3761
+ InteractiveSessionVoteDirection[InteractiveSessionVoteDirection["Up"] = 1] = "Up";
3762
+ return InteractiveSessionVoteDirection;
3763
+ }({});
3764
+ export var ChatAgentCopyKind = /*#__PURE__*/function (ChatAgentCopyKind) {
3765
+ ChatAgentCopyKind[ChatAgentCopyKind["Action"] = 1] = "Action";
3766
+ ChatAgentCopyKind[ChatAgentCopyKind["Toolbar"] = 2] = "Toolbar";
3767
+ return ChatAgentCopyKind;
3768
+ }({});
3769
+ export var ChatVariableLevel = /*#__PURE__*/function (ChatVariableLevel) {
3770
+ ChatVariableLevel[ChatVariableLevel["Short"] = 1] = "Short";
3771
+ ChatVariableLevel[ChatVariableLevel["Medium"] = 2] = "Medium";
3772
+ ChatVariableLevel[ChatVariableLevel["Full"] = 3] = "Full";
3773
+ return ChatVariableLevel;
3774
+ }({});
3775
+
3776
+ //#endregion
3777
+
3778
+ //#region Interactive Editor
3779
+
3780
+ export var InteractiveEditorResponseFeedbackKind = /*#__PURE__*/function (InteractiveEditorResponseFeedbackKind) {
3781
+ InteractiveEditorResponseFeedbackKind[InteractiveEditorResponseFeedbackKind["Unhelpful"] = 0] = "Unhelpful";
3782
+ InteractiveEditorResponseFeedbackKind[InteractiveEditorResponseFeedbackKind["Helpful"] = 1] = "Helpful";
3783
+ InteractiveEditorResponseFeedbackKind[InteractiveEditorResponseFeedbackKind["Undone"] = 2] = "Undone";
3784
+ InteractiveEditorResponseFeedbackKind[InteractiveEditorResponseFeedbackKind["Accepted"] = 3] = "Accepted";
3785
+ InteractiveEditorResponseFeedbackKind[InteractiveEditorResponseFeedbackKind["Bug"] = 4] = "Bug";
3786
+ return InteractiveEditorResponseFeedbackKind;
3787
+ }({});
3788
+ export var ChatMessageRole = /*#__PURE__*/function (ChatMessageRole) {
3789
+ ChatMessageRole[ChatMessageRole["System"] = 0] = "System";
3790
+ ChatMessageRole[ChatMessageRole["User"] = 1] = "User";
3791
+ ChatMessageRole[ChatMessageRole["Assistant"] = 2] = "Assistant";
3792
+ ChatMessageRole[ChatMessageRole["Function"] = 3] = "Function";
3793
+ return ChatMessageRole;
3794
+ }({});
3795
+ export var ChatAgentResultFeedbackKind = /*#__PURE__*/function (ChatAgentResultFeedbackKind) {
3796
+ ChatAgentResultFeedbackKind[ChatAgentResultFeedbackKind["Unhelpful"] = 0] = "Unhelpful";
3797
+ ChatAgentResultFeedbackKind[ChatAgentResultFeedbackKind["Helpful"] = 1] = "Helpful";
3798
+ return ChatAgentResultFeedbackKind;
3799
+ }({});
3800
+
3801
+ //#endregion
3802
+
3803
+ //#region ai
3804
+
3805
+ export var RelatedInformationType = /*#__PURE__*/function (RelatedInformationType) {
3806
+ RelatedInformationType[RelatedInformationType["SymbolInformation"] = 1] = "SymbolInformation";
3807
+ RelatedInformationType[RelatedInformationType["CommandInformation"] = 2] = "CommandInformation";
3808
+ RelatedInformationType[RelatedInformationType["SearchInformation"] = 3] = "SearchInformation";
3809
+ RelatedInformationType[RelatedInformationType["SettingInformation"] = 4] = "SettingInformation";
3810
+ return RelatedInformationType;
3811
+ }({});
3812
+
3813
+ //#endregion
3814
+
3815
+ //#region Speech
3816
+
3817
+ export var SpeechToTextStatus = /*#__PURE__*/function (SpeechToTextStatus) {
3818
+ SpeechToTextStatus[SpeechToTextStatus["Started"] = 1] = "Started";
3819
+ SpeechToTextStatus[SpeechToTextStatus["Recognizing"] = 2] = "Recognizing";
3820
+ SpeechToTextStatus[SpeechToTextStatus["Recognized"] = 3] = "Recognized";
3821
+ SpeechToTextStatus[SpeechToTextStatus["Stopped"] = 4] = "Stopped";
3822
+ return SpeechToTextStatus;
3823
+ }({});
3824
+
3825
+ //#endregion