@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.
- package/LICENSE +21 -0
- package/README.md +0 -0
- package/es/common/api.d.ts +38 -0
- package/es/common/api.d.ts.map +1 -0
- package/es/common/api.js +9 -0
- package/es/common/callHierarchy.d.ts +39 -0
- package/es/common/callHierarchy.d.ts.map +1 -0
- package/es/common/callHierarchy.js +139 -0
- package/es/common/client.d.ts +482 -0
- package/es/common/client.d.ts.map +1 -0
- package/es/common/client.js +2731 -0
- package/es/common/codeAction.d.ts +22 -0
- package/es/common/codeAction.d.ts.map +1 -0
- package/es/common/codeAction.js +149 -0
- package/es/common/codeConverter.d.ts +81 -0
- package/es/common/codeConverter.d.ts.map +1 -0
- package/es/common/codeConverter.js +1040 -0
- package/es/common/codeLens.d.ts +26 -0
- package/es/common/codeLens.d.ts.map +1 -0
- package/es/common/codeLens.js +125 -0
- package/es/common/colorProvider.d.ts +27 -0
- package/es/common/colorProvider.d.ts.map +1 -0
- package/es/common/colorProvider.js +104 -0
- package/es/common/completion.d.ts +22 -0
- package/es/common/completion.d.ts.map +1 -0
- package/es/common/completion.js +130 -0
- package/es/common/configuration.d.ts +71 -0
- package/es/common/configuration.d.ts.map +1 -0
- package/es/common/configuration.js +292 -0
- package/es/common/declaration.d.ts +18 -0
- package/es/common/declaration.d.ts.map +1 -0
- package/es/common/declaration.js +88 -0
- package/es/common/definition.d.ts +18 -0
- package/es/common/definition.d.ts.map +1 -0
- package/es/common/definition.js +80 -0
- package/es/common/diagnostic.d.ts +125 -0
- package/es/common/diagnostic.d.ts.map +1 -0
- package/es/common/diagnostic.js +1442 -0
- package/es/common/documentHighlight.d.ts +17 -0
- package/es/common/documentHighlight.d.ts.map +1 -0
- package/es/common/documentHighlight.js +73 -0
- package/es/common/documentLink.d.ts +21 -0
- package/es/common/documentLink.d.ts.map +1 -0
- package/es/common/documentLink.js +90 -0
- package/es/common/documentSymbol.d.ts +20 -0
- package/es/common/documentSymbol.d.ts.map +1 -0
- package/es/common/documentSymbol.js +134 -0
- package/es/common/executeCommand.d.ts +22 -0
- package/es/common/executeCommand.d.ts.map +1 -0
- package/es/common/executeCommand.js +117 -0
- package/es/common/features.d.ts +421 -0
- package/es/common/features.d.ts.map +1 -0
- package/es/common/features.js +576 -0
- package/es/common/fileOperations.d.ts +118 -0
- package/es/common/fileOperations.d.ts.map +1 -0
- package/es/common/fileOperations.js +705 -0
- package/es/common/fileSystemWatcher.d.ts +19 -0
- package/es/common/fileSystemWatcher.d.ts.map +1 -0
- package/es/common/fileSystemWatcher.js +173 -0
- package/es/common/foldingRange.d.ts +22 -0
- package/es/common/foldingRange.d.ts.map +1 -0
- package/es/common/foldingRange.js +127 -0
- package/es/common/formatting.d.ts +41 -0
- package/es/common/formatting.d.ts.map +1 -0
- package/es/common/formatting.js +233 -0
- package/es/common/hover.d.ts +18 -0
- package/es/common/hover.d.ts.map +1 -0
- package/es/common/hover.js +80 -0
- package/es/common/implementation.d.ts +18 -0
- package/es/common/implementation.d.ts.map +1 -0
- package/es/common/implementation.js +88 -0
- package/es/common/inlayHint.d.ts +23 -0
- package/es/common/inlayHint.d.ts.map +1 -0
- package/es/common/inlayHint.js +187 -0
- package/es/common/inlineCompletion.d.ts +20 -0
- package/es/common/inlineCompletion.d.ts.map +1 -0
- package/es/common/inlineCompletion.js +74 -0
- package/es/common/inlineValue.d.ts +21 -0
- package/es/common/inlineValue.d.ts.map +1 -0
- package/es/common/inlineValue.js +124 -0
- package/es/common/linkedEditingRange.d.ts +23 -0
- package/es/common/linkedEditingRange.d.ts.map +1 -0
- package/es/common/linkedEditingRange.js +94 -0
- package/es/common/notebook.d.ts +97 -0
- package/es/common/notebook.d.ts.map +1 -0
- package/es/common/notebook.js +1444 -0
- package/es/common/progress.d.ts +12 -0
- package/es/common/progress.d.ts.map +1 -0
- package/es/common/progress.js +75 -0
- package/es/common/progressPart.d.ts +25 -0
- package/es/common/progressPart.d.ts.map +1 -0
- package/es/common/progressPart.js +147 -0
- package/es/common/protocolCallHierarchyItem.d.ts +9 -0
- package/es/common/protocolCallHierarchyItem.d.ts.map +1 -0
- package/es/common/protocolCallHierarchyItem.js +34 -0
- package/es/common/protocolCodeAction.d.ts +7 -0
- package/es/common/protocolCodeAction.d.ts.map +1 -0
- package/es/common/protocolCodeAction.js +32 -0
- package/es/common/protocolCodeLens.d.ts +7 -0
- package/es/common/protocolCodeLens.d.ts.map +1 -0
- package/es/common/protocolCodeLens.js +29 -0
- package/es/common/protocolCompletionItem.d.ts +13 -0
- package/es/common/protocolCompletionItem.d.ts.map +1 -0
- package/es/common/protocolCompletionItem.js +29 -0
- package/es/common/protocolConverter.d.ts +174 -0
- package/es/common/protocolConverter.d.ts.map +1 -0
- package/es/common/protocolConverter.js +1982 -0
- package/es/common/protocolDiagnostic.d.ts +20 -0
- package/es/common/protocolDiagnostic.d.ts.map +1 -0
- package/es/common/protocolDiagnostic.js +46 -0
- package/es/common/protocolDocumentLink.d.ts +8 -0
- package/es/common/protocolDocumentLink.d.ts.map +1 -0
- package/es/common/protocolDocumentLink.js +29 -0
- package/es/common/protocolInlayHint.d.ts +8 -0
- package/es/common/protocolInlayHint.d.ts.map +1 -0
- package/es/common/protocolInlayHint.js +29 -0
- package/es/common/protocolTypeHierarchyItem.d.ts +9 -0
- package/es/common/protocolTypeHierarchyItem.d.ts.map +1 -0
- package/es/common/protocolTypeHierarchyItem.js +34 -0
- package/es/common/protocolWorkspaceSymbol.d.ts +9 -0
- package/es/common/protocolWorkspaceSymbol.d.ts.map +1 -0
- package/es/common/protocolWorkspaceSymbol.js +36 -0
- package/es/common/reference.d.ts +22 -0
- package/es/common/reference.d.ts.map +1 -0
- package/es/common/reference.js +78 -0
- package/es/common/rename.d.ts +29 -0
- package/es/common/rename.d.ts.map +1 -0
- package/es/common/rename.js +132 -0
- package/es/common/selectionRange.d.ts +18 -0
- package/es/common/selectionRange.d.ts.map +1 -0
- package/es/common/selectionRange.js +108 -0
- package/es/common/semanticTokens.d.ts +36 -0
- package/es/common/semanticTokens.d.ts.map +1 -0
- package/es/common/semanticTokens.js +226 -0
- package/es/common/signatureHelp.d.ts +18 -0
- package/es/common/signatureHelp.d.ts.map +1 -0
- package/es/common/signatureHelp.js +103 -0
- package/es/common/textSynchronization.d.ts +104 -0
- package/es/common/textSynchronization.d.ts.map +1 -0
- package/es/common/textSynchronization.js +771 -0
- package/es/common/typeDefinition.d.ts +18 -0
- package/es/common/typeDefinition.d.ts.map +1 -0
- package/es/common/typeDefinition.js +89 -0
- package/es/common/typeHierarchy.d.ts +33 -0
- package/es/common/typeHierarchy.d.ts.map +1 -0
- package/es/common/typeHierarchy.js +138 -0
- package/es/common/utils/async.d.ts +42 -0
- package/es/common/utils/async.d.ts.map +1 -0
- package/es/common/utils/async.js +441 -0
- package/es/common/utils/is.d.ts +13 -0
- package/es/common/utils/is.d.ts.map +1 -0
- package/es/common/utils/is.js +52 -0
- package/es/common/utils/uuid.d.ts +23 -0
- package/es/common/utils/uuid.d.ts.map +1 -0
- package/es/common/utils/uuid.js +85 -0
- package/es/common/vscodeAdaptor/convertor.d.ts +7 -0
- package/es/common/vscodeAdaptor/convertor.d.ts.map +1 -0
- package/es/common/vscodeAdaptor/convertor.js +66 -0
- package/es/common/vscodeAdaptor/diagnosticCollection.d.ts +33 -0
- package/es/common/vscodeAdaptor/diagnosticCollection.d.ts.map +1 -0
- package/es/common/vscodeAdaptor/diagnosticCollection.js +310 -0
- package/es/common/vscodeAdaptor/extHostTypes.d.ts +1496 -0
- package/es/common/vscodeAdaptor/extHostTypes.d.ts.map +1 -0
- package/es/common/vscodeAdaptor/extHostTypes.js +3825 -0
- package/es/common/vscodeAdaptor/fileWatcher.d.ts +19 -0
- package/es/common/vscodeAdaptor/fileWatcher.d.ts.map +1 -0
- package/es/common/vscodeAdaptor/fileWatcher.js +45 -0
- package/es/common/vscodeAdaptor/hostTypeUtil.d.ts +192 -0
- package/es/common/vscodeAdaptor/hostTypeUtil.d.ts.map +1 -0
- package/es/common/vscodeAdaptor/hostTypeUtil.js +566 -0
- package/es/common/vscodeAdaptor/libro-fs.d.ts +21 -0
- package/es/common/vscodeAdaptor/libro-fs.d.ts.map +1 -0
- package/es/common/vscodeAdaptor/libro-fs.js +64 -0
- package/es/common/vscodeAdaptor/libroWindow.d.ts +21 -0
- package/es/common/vscodeAdaptor/libroWindow.d.ts.map +1 -0
- package/es/common/vscodeAdaptor/libroWindow.js +75 -0
- package/es/common/vscodeAdaptor/libroWorkspace.d.ts +33 -0
- package/es/common/vscodeAdaptor/libroWorkspace.d.ts.map +1 -0
- package/es/common/vscodeAdaptor/libroWorkspace.js +250 -0
- package/es/common/vscodeAdaptor/lspEnv.d.ts +8 -0
- package/es/common/vscodeAdaptor/lspEnv.d.ts.map +1 -0
- package/es/common/vscodeAdaptor/lspEnv.js +31 -0
- package/es/common/vscodeAdaptor/monaco-converter.d.ts +229 -0
- package/es/common/vscodeAdaptor/monaco-converter.d.ts.map +1 -0
- package/es/common/vscodeAdaptor/monaco-converter.js +1613 -0
- package/es/common/vscodeAdaptor/monacoLanguages.d.ts +48 -0
- package/es/common/vscodeAdaptor/monacoLanguages.d.ts.map +1 -0
- package/es/common/vscodeAdaptor/monacoLanguages.js +484 -0
- package/es/common/vscodeAdaptor/services.d.ts +85 -0
- package/es/common/vscodeAdaptor/services.d.ts.map +1 -0
- package/es/common/vscodeAdaptor/services.js +3 -0
- package/es/common/vscodeAdaptor/typings.d.ts +10 -0
- package/es/common/vscodeAdaptor/util.d.ts +3 -0
- package/es/common/vscodeAdaptor/util.d.ts.map +1 -0
- package/es/common/vscodeAdaptor/util.js +6 -0
- package/es/common/vscodeAdaptor/vscodeAdaptor.d.ts +77 -0
- package/es/common/vscodeAdaptor/vscodeAdaptor.d.ts.map +1 -0
- package/es/common/vscodeAdaptor/vscodeAdaptor.js +124 -0
- package/es/common/workspaceFolder.d.ts +32 -0
- package/es/common/workspaceFolder.d.ts.map +1 -0
- package/es/common/workspaceFolder.js +204 -0
- package/es/common/workspaceSymbol.d.ts +21 -0
- package/es/common/workspaceSymbol.d.ts.map +1 -0
- package/es/common/workspaceSymbol.js +101 -0
- package/es/constants.d.ts +2 -0
- package/es/constants.d.ts.map +1 -0
- package/es/constants.js +1 -0
- package/es/index.d.ts +6 -0
- package/es/index.d.ts.map +1 -0
- package/es/index.js +5 -0
- package/es/libro-language-client-contribution.d.ts +10 -0
- package/es/libro-language-client-contribution.d.ts.map +1 -0
- package/es/libro-language-client-contribution.js +143 -0
- package/es/libro-language-client-manager.d.ts +34 -0
- package/es/libro-language-client-manager.d.ts.map +1 -0
- package/es/libro-language-client-manager.js +277 -0
- package/es/libro-language-client.d.ts +27 -0
- package/es/libro-language-client.d.ts.map +1 -0
- package/es/libro-language-client.js +141 -0
- package/es/module.d.ts +3 -0
- package/es/module.d.ts.map +1 -0
- package/es/module.js +13 -0
- package/package.json +69 -0
- package/src/common/api.ts +155 -0
- package/src/common/callHierarchy.ts +269 -0
- package/src/common/client.ts +3192 -0
- package/src/common/codeAction.ts +237 -0
- package/src/common/codeConverter.ts +1409 -0
- package/src/common/codeLens.ts +188 -0
- package/src/common/colorProvider.ts +192 -0
- package/src/common/completion.ts +281 -0
- package/src/common/configuration.ts +338 -0
- package/src/common/declaration.ts +140 -0
- package/src/common/definition.ts +138 -0
- package/src/common/diagnostic.ts +1408 -0
- package/src/common/documentHighlight.ts +140 -0
- package/src/common/documentLink.ts +180 -0
- package/src/common/documentSymbol.ts +186 -0
- package/src/common/executeCommand.ts +129 -0
- package/src/common/features.ts +1157 -0
- package/src/common/fileOperations.ts +635 -0
- package/src/common/fileSystemWatcher.ts +184 -0
- package/src/common/foldingRange.ts +160 -0
- package/src/common/formatting.ts +465 -0
- package/src/common/hover.ts +133 -0
- package/src/common/implementation.ts +142 -0
- package/src/common/inlayHint.ts +201 -0
- package/src/common/inlineCompletion.ts +160 -0
- package/src/common/inlineValue.ts +158 -0
- package/src/common/linkedEditingRange.ts +141 -0
- package/src/common/notebook.ts +1443 -0
- package/src/common/progress.ts +61 -0
- package/src/common/progressPart.ts +151 -0
- package/src/common/protocolCallHierarchyItem.ts +29 -0
- package/src/common/protocolCodeAction.ts +17 -0
- package/src/common/protocolCodeLens.ts +15 -0
- package/src/common/protocolCompletionItem.ts +22 -0
- package/src/common/protocolConverter.ts +2627 -0
- package/src/common/protocolDiagnostic.ts +47 -0
- package/src/common/protocolDocumentLink.ts +17 -0
- package/src/common/protocolInlayHint.ts +21 -0
- package/src/common/protocolTypeHierarchyItem.ts +29 -0
- package/src/common/protocolWorkspaceSymbol.ts +39 -0
- package/src/common/reference.ts +144 -0
- package/src/common/rename.ts +230 -0
- package/src/common/selectionRange.ts +136 -0
- package/src/common/semanticTokens.ts +383 -0
- package/src/common/signatureHelp.ts +170 -0
- package/src/common/textSynchronization.ts +819 -0
- package/src/common/typeDefinition.ts +146 -0
- package/src/common/typeHierarchy.ts +248 -0
- package/src/common/utils/async.ts +354 -0
- package/src/common/utils/is.ts +63 -0
- package/src/common/utils/uuid.ts +136 -0
- package/src/common/vscodeAdaptor/convertor.ts +73 -0
- package/src/common/vscodeAdaptor/diagnosticCollection.ts +238 -0
- package/src/common/vscodeAdaptor/extHostTypes.ts +4498 -0
- package/src/common/vscodeAdaptor/fileWatcher.ts +36 -0
- package/src/common/vscodeAdaptor/hostTypeUtil.ts +539 -0
- package/src/common/vscodeAdaptor/libro-fs.ts +51 -0
- package/src/common/vscodeAdaptor/libroWindow.ts +85 -0
- package/src/common/vscodeAdaptor/libroWorkspace.ts +261 -0
- package/src/common/vscodeAdaptor/lspEnv.ts +16 -0
- package/src/common/vscodeAdaptor/monaco-converter.ts +1800 -0
- package/src/common/vscodeAdaptor/monacoLanguages.ts +511 -0
- package/src/common/vscodeAdaptor/services.ts +278 -0
- package/src/common/vscodeAdaptor/typings.d.ts +10 -0
- package/src/common/vscodeAdaptor/util.ts +7 -0
- package/src/common/vscodeAdaptor/vscodeAdaptor.ts +122 -0
- package/src/common/workspaceFolder.ts +236 -0
- package/src/common/workspaceSymbol.ts +166 -0
- package/src/constants.ts +1 -0
- package/src/index.spec.ts +7 -0
- package/src/index.ts +5 -0
- package/src/libro-language-client-contribution.ts +49 -0
- package/src/libro-language-client-manager.ts +131 -0
- package/src/libro-language-client.ts +100 -0
- package/src/module.ts +19 -0
|
@@ -0,0 +1,441 @@
|
|
|
1
|
+
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; }
|
|
2
|
+
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); }
|
|
3
|
+
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); } }
|
|
4
|
+
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); }); }; }
|
|
5
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
6
|
+
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); } }
|
|
7
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
8
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
9
|
+
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); }
|
|
10
|
+
/* eslint-disable promise/always-return */
|
|
11
|
+
/* eslint-disable promise/catch-or-return */
|
|
12
|
+
/* --------------------------------------------------------------------------------------------
|
|
13
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
14
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
15
|
+
* ------------------------------------------------------------------------------------------ */
|
|
16
|
+
|
|
17
|
+
import { RAL } from '@difizen/vscode-languageserver-protocol';
|
|
18
|
+
export var Delayer = /*#__PURE__*/function () {
|
|
19
|
+
function Delayer(defaultDelay) {
|
|
20
|
+
_classCallCheck(this, Delayer);
|
|
21
|
+
this.defaultDelay = defaultDelay;
|
|
22
|
+
this.timeout = undefined;
|
|
23
|
+
this.completionPromise = undefined;
|
|
24
|
+
this.onSuccess = undefined;
|
|
25
|
+
this.task = undefined;
|
|
26
|
+
}
|
|
27
|
+
_createClass(Delayer, [{
|
|
28
|
+
key: "trigger",
|
|
29
|
+
value: function trigger(task) {
|
|
30
|
+
var _this = this;
|
|
31
|
+
var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.defaultDelay;
|
|
32
|
+
this.task = task;
|
|
33
|
+
if (delay >= 0) {
|
|
34
|
+
this.cancelTimeout();
|
|
35
|
+
}
|
|
36
|
+
if (!this.completionPromise) {
|
|
37
|
+
this.completionPromise = new Promise(function (resolve) {
|
|
38
|
+
_this.onSuccess = resolve;
|
|
39
|
+
}).then(function () {
|
|
40
|
+
_this.completionPromise = undefined;
|
|
41
|
+
_this.onSuccess = undefined;
|
|
42
|
+
var result = _this.task();
|
|
43
|
+
_this.task = undefined;
|
|
44
|
+
return result;
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
if (delay >= 0 || this.timeout === void 0) {
|
|
48
|
+
this.timeout = RAL().timer.setTimeout(function () {
|
|
49
|
+
_this.timeout = undefined;
|
|
50
|
+
_this.onSuccess(undefined);
|
|
51
|
+
}, delay >= 0 ? delay : this.defaultDelay);
|
|
52
|
+
}
|
|
53
|
+
return this.completionPromise;
|
|
54
|
+
}
|
|
55
|
+
}, {
|
|
56
|
+
key: "forceDelivery",
|
|
57
|
+
value: function forceDelivery() {
|
|
58
|
+
if (!this.completionPromise) {
|
|
59
|
+
return undefined;
|
|
60
|
+
}
|
|
61
|
+
this.cancelTimeout();
|
|
62
|
+
var result = this.task();
|
|
63
|
+
this.completionPromise = undefined;
|
|
64
|
+
this.onSuccess = undefined;
|
|
65
|
+
this.task = undefined;
|
|
66
|
+
return result;
|
|
67
|
+
}
|
|
68
|
+
}, {
|
|
69
|
+
key: "isTriggered",
|
|
70
|
+
value: function isTriggered() {
|
|
71
|
+
return this.timeout !== undefined;
|
|
72
|
+
}
|
|
73
|
+
}, {
|
|
74
|
+
key: "cancel",
|
|
75
|
+
value: function cancel() {
|
|
76
|
+
this.cancelTimeout();
|
|
77
|
+
this.completionPromise = undefined;
|
|
78
|
+
}
|
|
79
|
+
}, {
|
|
80
|
+
key: "cancelTimeout",
|
|
81
|
+
value: function cancelTimeout() {
|
|
82
|
+
if (this.timeout !== undefined) {
|
|
83
|
+
this.timeout.dispose();
|
|
84
|
+
this.timeout = undefined;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}]);
|
|
88
|
+
return Delayer;
|
|
89
|
+
}();
|
|
90
|
+
export var Semaphore = /*#__PURE__*/function () {
|
|
91
|
+
function Semaphore() {
|
|
92
|
+
var capacity = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
93
|
+
_classCallCheck(this, Semaphore);
|
|
94
|
+
if (capacity <= 0) {
|
|
95
|
+
throw new Error('Capacity must be greater than 0');
|
|
96
|
+
}
|
|
97
|
+
this._capacity = capacity;
|
|
98
|
+
this._active = 0;
|
|
99
|
+
this._waiting = [];
|
|
100
|
+
}
|
|
101
|
+
_createClass(Semaphore, [{
|
|
102
|
+
key: "lock",
|
|
103
|
+
value: function lock(thunk) {
|
|
104
|
+
var _this2 = this;
|
|
105
|
+
return new Promise(function (resolve, reject) {
|
|
106
|
+
_this2._waiting.push({
|
|
107
|
+
thunk: thunk,
|
|
108
|
+
resolve: resolve,
|
|
109
|
+
reject: reject
|
|
110
|
+
});
|
|
111
|
+
_this2.runNext();
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
}, {
|
|
115
|
+
key: "active",
|
|
116
|
+
get: function get() {
|
|
117
|
+
return this._active;
|
|
118
|
+
}
|
|
119
|
+
}, {
|
|
120
|
+
key: "runNext",
|
|
121
|
+
value: function runNext() {
|
|
122
|
+
var _this3 = this;
|
|
123
|
+
if (this._waiting.length === 0 || this._active === this._capacity) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
RAL().timer.setImmediate(function () {
|
|
127
|
+
return _this3.doRunNext();
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
}, {
|
|
131
|
+
key: "doRunNext",
|
|
132
|
+
value: function doRunNext() {
|
|
133
|
+
var _this4 = this;
|
|
134
|
+
if (this._waiting.length === 0 || this._active === this._capacity) {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
var next = this._waiting.shift();
|
|
138
|
+
this._active++;
|
|
139
|
+
if (this._active > this._capacity) {
|
|
140
|
+
throw new Error("To many thunks active");
|
|
141
|
+
}
|
|
142
|
+
try {
|
|
143
|
+
var result = next.thunk();
|
|
144
|
+
if (result instanceof Promise) {
|
|
145
|
+
result.then(function (value) {
|
|
146
|
+
_this4._active--;
|
|
147
|
+
next.resolve(value);
|
|
148
|
+
_this4.runNext();
|
|
149
|
+
}, function (err) {
|
|
150
|
+
_this4._active--;
|
|
151
|
+
next.reject(err);
|
|
152
|
+
_this4.runNext();
|
|
153
|
+
});
|
|
154
|
+
} else {
|
|
155
|
+
this._active--;
|
|
156
|
+
next.resolve(result);
|
|
157
|
+
this.runNext();
|
|
158
|
+
}
|
|
159
|
+
} catch (err) {
|
|
160
|
+
this._active--;
|
|
161
|
+
next.reject(err);
|
|
162
|
+
this.runNext();
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}]);
|
|
166
|
+
return Semaphore;
|
|
167
|
+
}();
|
|
168
|
+
var $test = false;
|
|
169
|
+
export function setTestMode() {
|
|
170
|
+
$test = true;
|
|
171
|
+
}
|
|
172
|
+
export function clearTestMode() {
|
|
173
|
+
$test = false;
|
|
174
|
+
}
|
|
175
|
+
var defaultYieldTimeout = 15; /*ms*/
|
|
176
|
+
var Timer = /*#__PURE__*/function () {
|
|
177
|
+
function Timer() {
|
|
178
|
+
var yieldAfter = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultYieldTimeout;
|
|
179
|
+
_classCallCheck(this, Timer);
|
|
180
|
+
this.yieldAfter = $test === true ? Math.max(yieldAfter, 2) : Math.max(yieldAfter, defaultYieldTimeout);
|
|
181
|
+
this.startTime = Date.now();
|
|
182
|
+
this.counter = 0;
|
|
183
|
+
this.total = 0;
|
|
184
|
+
// start with a counter interval of 1.
|
|
185
|
+
this.counterInterval = 1;
|
|
186
|
+
}
|
|
187
|
+
_createClass(Timer, [{
|
|
188
|
+
key: "start",
|
|
189
|
+
value: function start() {
|
|
190
|
+
this.counter = 0;
|
|
191
|
+
this.total = 0;
|
|
192
|
+
this.counterInterval = 1;
|
|
193
|
+
this.startTime = Date.now();
|
|
194
|
+
}
|
|
195
|
+
}, {
|
|
196
|
+
key: "shouldYield",
|
|
197
|
+
value: function shouldYield() {
|
|
198
|
+
if (++this.counter >= this.counterInterval) {
|
|
199
|
+
var timeTaken = Date.now() - this.startTime;
|
|
200
|
+
var timeLeft = Math.max(0, this.yieldAfter - timeTaken);
|
|
201
|
+
this.total += this.counter;
|
|
202
|
+
this.counter = 0;
|
|
203
|
+
if (timeTaken >= this.yieldAfter || timeLeft <= 1) {
|
|
204
|
+
// Yield also if time left <= 1 since we compute the counter
|
|
205
|
+
// for max < 2 ms.
|
|
206
|
+
|
|
207
|
+
// Start with interval 1 again. We could do some calculation
|
|
208
|
+
// with using 80% of the last counter however other things (GC)
|
|
209
|
+
// affect the timing heavily since we have small timings (1 - 15ms).
|
|
210
|
+
this.counterInterval = 1;
|
|
211
|
+
this.total = 0;
|
|
212
|
+
return true;
|
|
213
|
+
} else {
|
|
214
|
+
// Only increase the counter until we have spent <= 2 ms. Increasing
|
|
215
|
+
// the counter further is very fragile since timing is influenced
|
|
216
|
+
// by other things and can increase the counter too much. This will result
|
|
217
|
+
// that we yield in average after [14 - 16]ms.
|
|
218
|
+
switch (timeTaken) {
|
|
219
|
+
case 0:
|
|
220
|
+
case 1:
|
|
221
|
+
this.counterInterval = this.total * 2;
|
|
222
|
+
break;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
return false;
|
|
227
|
+
}
|
|
228
|
+
}]);
|
|
229
|
+
return Timer;
|
|
230
|
+
}();
|
|
231
|
+
export function map(_x, _x2, _x3, _x4) {
|
|
232
|
+
return _map.apply(this, arguments);
|
|
233
|
+
}
|
|
234
|
+
function _map() {
|
|
235
|
+
_map = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(items, func, token, options) {
|
|
236
|
+
var result, timer, convertBatch, index;
|
|
237
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
238
|
+
while (1) switch (_context.prev = _context.next) {
|
|
239
|
+
case 0:
|
|
240
|
+
convertBatch = function _convertBatch(start) {
|
|
241
|
+
timer.start();
|
|
242
|
+
for (var i = start; i < items.length; i++) {
|
|
243
|
+
result[i] = func(items[i]);
|
|
244
|
+
if (timer.shouldYield()) {
|
|
245
|
+
(options === null || options === void 0 ? void 0 : options.yieldCallback) && options.yieldCallback();
|
|
246
|
+
return i + 1;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
return -1;
|
|
250
|
+
};
|
|
251
|
+
if (!(items.length === 0)) {
|
|
252
|
+
_context.next = 3;
|
|
253
|
+
break;
|
|
254
|
+
}
|
|
255
|
+
return _context.abrupt("return", []);
|
|
256
|
+
case 3:
|
|
257
|
+
result = new Array(items.length);
|
|
258
|
+
timer = new Timer(options === null || options === void 0 ? void 0 : options.yieldAfter);
|
|
259
|
+
// Convert the first batch sync on the same frame.
|
|
260
|
+
index = convertBatch(0);
|
|
261
|
+
case 6:
|
|
262
|
+
if (!(index !== -1)) {
|
|
263
|
+
_context.next = 14;
|
|
264
|
+
break;
|
|
265
|
+
}
|
|
266
|
+
if (!(token !== undefined && token.isCancellationRequested)) {
|
|
267
|
+
_context.next = 9;
|
|
268
|
+
break;
|
|
269
|
+
}
|
|
270
|
+
return _context.abrupt("break", 14);
|
|
271
|
+
case 9:
|
|
272
|
+
_context.next = 11;
|
|
273
|
+
return new Promise(function (resolve) {
|
|
274
|
+
RAL().timer.setImmediate(function () {
|
|
275
|
+
resolve(convertBatch(index));
|
|
276
|
+
});
|
|
277
|
+
});
|
|
278
|
+
case 11:
|
|
279
|
+
index = _context.sent;
|
|
280
|
+
_context.next = 6;
|
|
281
|
+
break;
|
|
282
|
+
case 14:
|
|
283
|
+
return _context.abrupt("return", result);
|
|
284
|
+
case 15:
|
|
285
|
+
case "end":
|
|
286
|
+
return _context.stop();
|
|
287
|
+
}
|
|
288
|
+
}, _callee);
|
|
289
|
+
}));
|
|
290
|
+
return _map.apply(this, arguments);
|
|
291
|
+
}
|
|
292
|
+
export function mapAsync(_x5, _x6, _x7, _x8) {
|
|
293
|
+
return _mapAsync.apply(this, arguments);
|
|
294
|
+
}
|
|
295
|
+
function _mapAsync() {
|
|
296
|
+
_mapAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(items, func, token, options) {
|
|
297
|
+
var result, timer, convertBatch, _convertBatch2, index;
|
|
298
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
299
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
300
|
+
case 0:
|
|
301
|
+
_convertBatch2 = function _convertBatch4() {
|
|
302
|
+
_convertBatch2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(start) {
|
|
303
|
+
var i;
|
|
304
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
305
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
306
|
+
case 0:
|
|
307
|
+
timer.start();
|
|
308
|
+
i = start;
|
|
309
|
+
case 2:
|
|
310
|
+
if (!(i < items.length)) {
|
|
311
|
+
_context2.next = 12;
|
|
312
|
+
break;
|
|
313
|
+
}
|
|
314
|
+
_context2.next = 5;
|
|
315
|
+
return func(items[i], token);
|
|
316
|
+
case 5:
|
|
317
|
+
result[i] = _context2.sent;
|
|
318
|
+
if (!timer.shouldYield()) {
|
|
319
|
+
_context2.next = 9;
|
|
320
|
+
break;
|
|
321
|
+
}
|
|
322
|
+
(options === null || options === void 0 ? void 0 : options.yieldCallback) && options.yieldCallback();
|
|
323
|
+
return _context2.abrupt("return", i + 1);
|
|
324
|
+
case 9:
|
|
325
|
+
i++;
|
|
326
|
+
_context2.next = 2;
|
|
327
|
+
break;
|
|
328
|
+
case 12:
|
|
329
|
+
return _context2.abrupt("return", -1);
|
|
330
|
+
case 13:
|
|
331
|
+
case "end":
|
|
332
|
+
return _context2.stop();
|
|
333
|
+
}
|
|
334
|
+
}, _callee2);
|
|
335
|
+
}));
|
|
336
|
+
return _convertBatch2.apply(this, arguments);
|
|
337
|
+
};
|
|
338
|
+
convertBatch = function _convertBatch3(_x13) {
|
|
339
|
+
return _convertBatch2.apply(this, arguments);
|
|
340
|
+
};
|
|
341
|
+
if (!(items.length === 0)) {
|
|
342
|
+
_context3.next = 4;
|
|
343
|
+
break;
|
|
344
|
+
}
|
|
345
|
+
return _context3.abrupt("return", []);
|
|
346
|
+
case 4:
|
|
347
|
+
result = new Array(items.length);
|
|
348
|
+
timer = new Timer(options === null || options === void 0 ? void 0 : options.yieldAfter);
|
|
349
|
+
_context3.next = 8;
|
|
350
|
+
return convertBatch(0);
|
|
351
|
+
case 8:
|
|
352
|
+
index = _context3.sent;
|
|
353
|
+
case 9:
|
|
354
|
+
if (!(index !== -1)) {
|
|
355
|
+
_context3.next = 17;
|
|
356
|
+
break;
|
|
357
|
+
}
|
|
358
|
+
if (!(token !== undefined && token.isCancellationRequested)) {
|
|
359
|
+
_context3.next = 12;
|
|
360
|
+
break;
|
|
361
|
+
}
|
|
362
|
+
return _context3.abrupt("break", 17);
|
|
363
|
+
case 12:
|
|
364
|
+
_context3.next = 14;
|
|
365
|
+
return new Promise(function (resolve) {
|
|
366
|
+
RAL().timer.setImmediate(function () {
|
|
367
|
+
resolve(convertBatch(index));
|
|
368
|
+
});
|
|
369
|
+
});
|
|
370
|
+
case 14:
|
|
371
|
+
index = _context3.sent;
|
|
372
|
+
_context3.next = 9;
|
|
373
|
+
break;
|
|
374
|
+
case 17:
|
|
375
|
+
return _context3.abrupt("return", result);
|
|
376
|
+
case 18:
|
|
377
|
+
case "end":
|
|
378
|
+
return _context3.stop();
|
|
379
|
+
}
|
|
380
|
+
}, _callee3);
|
|
381
|
+
}));
|
|
382
|
+
return _mapAsync.apply(this, arguments);
|
|
383
|
+
}
|
|
384
|
+
export function forEach(_x9, _x10, _x11, _x12) {
|
|
385
|
+
return _forEach.apply(this, arguments);
|
|
386
|
+
}
|
|
387
|
+
function _forEach() {
|
|
388
|
+
_forEach = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(items, func, token, options) {
|
|
389
|
+
var timer, runBatch, index;
|
|
390
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
391
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
392
|
+
case 0:
|
|
393
|
+
runBatch = function _runBatch(start) {
|
|
394
|
+
timer.start();
|
|
395
|
+
for (var i = start; i < items.length; i++) {
|
|
396
|
+
func(items[i]);
|
|
397
|
+
if (timer.shouldYield()) {
|
|
398
|
+
(options === null || options === void 0 ? void 0 : options.yieldCallback) && options.yieldCallback();
|
|
399
|
+
return i + 1;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
return -1;
|
|
403
|
+
};
|
|
404
|
+
if (!(items.length === 0)) {
|
|
405
|
+
_context4.next = 3;
|
|
406
|
+
break;
|
|
407
|
+
}
|
|
408
|
+
return _context4.abrupt("return");
|
|
409
|
+
case 3:
|
|
410
|
+
timer = new Timer(options === null || options === void 0 ? void 0 : options.yieldAfter);
|
|
411
|
+
// Convert the first batch sync on the same frame.
|
|
412
|
+
index = runBatch(0);
|
|
413
|
+
case 5:
|
|
414
|
+
if (!(index !== -1)) {
|
|
415
|
+
_context4.next = 13;
|
|
416
|
+
break;
|
|
417
|
+
}
|
|
418
|
+
if (!(token !== undefined && token.isCancellationRequested)) {
|
|
419
|
+
_context4.next = 8;
|
|
420
|
+
break;
|
|
421
|
+
}
|
|
422
|
+
return _context4.abrupt("break", 13);
|
|
423
|
+
case 8:
|
|
424
|
+
_context4.next = 10;
|
|
425
|
+
return new Promise(function (resolve) {
|
|
426
|
+
RAL().timer.setImmediate(function () {
|
|
427
|
+
resolve(runBatch(index));
|
|
428
|
+
});
|
|
429
|
+
});
|
|
430
|
+
case 10:
|
|
431
|
+
index = _context4.sent;
|
|
432
|
+
_context4.next = 5;
|
|
433
|
+
break;
|
|
434
|
+
case 13:
|
|
435
|
+
case "end":
|
|
436
|
+
return _context4.stop();
|
|
437
|
+
}
|
|
438
|
+
}, _callee4);
|
|
439
|
+
}));
|
|
440
|
+
return _forEach.apply(this, arguments);
|
|
441
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare function boolean(value: any): value is boolean;
|
|
2
|
+
export declare function string(value: any): value is string;
|
|
3
|
+
export declare function number(value: any): value is number;
|
|
4
|
+
export declare function error(value: any): value is Error;
|
|
5
|
+
export declare function func(value: any): value is Function;
|
|
6
|
+
export declare function array<T>(value: any): value is T[];
|
|
7
|
+
export declare function stringArray(value: any): value is string[];
|
|
8
|
+
export declare function typedArray<T>(value: any, check: (value: any) => boolean): value is T[];
|
|
9
|
+
export declare function thenable<T>(value: any): value is Thenable<T>;
|
|
10
|
+
export declare function asPromise<T>(value: Promise<T>): Promise<T>;
|
|
11
|
+
export declare function asPromise<T>(value: Thenable<T>): Promise<T>;
|
|
12
|
+
export declare function asPromise<T>(value: T): Promise<T>;
|
|
13
|
+
//# sourceMappingURL=is.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is.d.ts","sourceRoot":"","sources":["../../../src/common/utils/is.ts"],"names":[],"mappings":"AAKA,wBAAgB,OAAO,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,OAAO,CAEpD;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,MAAM,CAElD;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,MAAM,CAElD;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,KAAK,CAEhD;AAGD,wBAAgB,IAAI,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,QAAQ,CAElD;AAED,wBAAgB,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,CAAC,EAAE,CAEjD;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,MAAM,EAAE,CAEzD;AAED,wBAAgB,UAAU,CAAC,CAAC,EAC1B,KAAK,EAAE,GAAG,EACV,KAAK,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,OAAO,GAC7B,KAAK,IAAI,CAAC,EAAE,CAEd;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,QAAQ,CAAC,CAAC,CAAC,CAE5D;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AAC5D,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AAC7D,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/* --------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
+
* ------------------------------------------------------------------------------------------ */
|
|
5
|
+
|
|
6
|
+
export function boolean(value) {
|
|
7
|
+
return value === true || value === false;
|
|
8
|
+
}
|
|
9
|
+
export function string(value) {
|
|
10
|
+
return typeof value === 'string' || value instanceof String;
|
|
11
|
+
}
|
|
12
|
+
export function number(value) {
|
|
13
|
+
return typeof value === 'number' || value instanceof Number;
|
|
14
|
+
}
|
|
15
|
+
export function error(value) {
|
|
16
|
+
return value instanceof Error;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
20
|
+
export function func(value) {
|
|
21
|
+
return typeof value === 'function';
|
|
22
|
+
}
|
|
23
|
+
export function array(value) {
|
|
24
|
+
return Array.isArray(value);
|
|
25
|
+
}
|
|
26
|
+
export function stringArray(value) {
|
|
27
|
+
return array(value) && value.every(function (elem) {
|
|
28
|
+
return string(elem);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
export function typedArray(value, check) {
|
|
32
|
+
return Array.isArray(value) && value.every(check);
|
|
33
|
+
}
|
|
34
|
+
export function thenable(value) {
|
|
35
|
+
return value && func(value.then);
|
|
36
|
+
}
|
|
37
|
+
export function asPromise(value) {
|
|
38
|
+
if (value instanceof Promise) {
|
|
39
|
+
return value;
|
|
40
|
+
} else if (thenable(value)) {
|
|
41
|
+
return new Promise(function (resolve, reject) {
|
|
42
|
+
// eslint-disable-next-line promise/catch-or-return
|
|
43
|
+
value.then(function (resolved) {
|
|
44
|
+
return resolve(resolved);
|
|
45
|
+
}, function (error) {
|
|
46
|
+
return reject(error);
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
} else {
|
|
50
|
+
return Promise.resolve(value);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a UUID as defined by rfc4122.
|
|
3
|
+
*/
|
|
4
|
+
export interface UUID {
|
|
5
|
+
/**
|
|
6
|
+
* @returns the canonical representation in sets of hexadecimal numbers separated by dashes.
|
|
7
|
+
*/
|
|
8
|
+
asHex(): string;
|
|
9
|
+
equals(other: UUID): boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* An empty UUID that contains only zeros.
|
|
13
|
+
*/
|
|
14
|
+
export declare const empty: UUID;
|
|
15
|
+
export declare function v4(): UUID;
|
|
16
|
+
export declare function isUUID(value: string): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Parses a UUID that is of the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
|
|
19
|
+
* @param value A uuid string.
|
|
20
|
+
*/
|
|
21
|
+
export declare function parse(value: string): UUID;
|
|
22
|
+
export declare function generateUuid(): string;
|
|
23
|
+
//# sourceMappingURL=uuid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uuid.d.ts","sourceRoot":"","sources":["../../../src/common/utils/uuid.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,MAAM,WAAW,IAAI;IACnB;;OAEG;IACH,KAAK,IAAI,MAAM,CAAC;IAEhB,MAAM,CAAC,KAAK,EAAE,IAAI,GAAG,OAAO,CAAC;CAC9B;AA2FD;;GAEG;AACH,eAAO,MAAM,KAAK,EAAE,IAA4D,CAAC;AAEjF,wBAAgB,EAAE,IAAI,IAAI,CAEzB;AAID,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAE7C;AAED;;;GAGG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAMzC;AAED,wBAAgB,YAAY,IAAI,MAAM,CAErC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
3
|
+
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); }; }
|
|
4
|
+
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); }
|
|
5
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
6
|
+
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; } }
|
|
7
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
8
|
+
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); }
|
|
9
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
10
|
+
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); } }
|
|
11
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
12
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
13
|
+
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); }
|
|
14
|
+
/*---------------------------------------------------------------------------------------------
|
|
15
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
16
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
17
|
+
*--------------------------------------------------------------------------------------------*/
|
|
18
|
+
/**
|
|
19
|
+
* Represents a UUID as defined by rfc4122.
|
|
20
|
+
*/
|
|
21
|
+
var ValueUUID = /*#__PURE__*/function () {
|
|
22
|
+
function ValueUUID(_value) {
|
|
23
|
+
_classCallCheck(this, ValueUUID);
|
|
24
|
+
this._value = _value;
|
|
25
|
+
} // empty
|
|
26
|
+
_createClass(ValueUUID, [{
|
|
27
|
+
key: "asHex",
|
|
28
|
+
value: function asHex() {
|
|
29
|
+
return this._value;
|
|
30
|
+
}
|
|
31
|
+
}, {
|
|
32
|
+
key: "equals",
|
|
33
|
+
value: function equals(other) {
|
|
34
|
+
return this.asHex() === other.asHex();
|
|
35
|
+
}
|
|
36
|
+
}]);
|
|
37
|
+
return ValueUUID;
|
|
38
|
+
}();
|
|
39
|
+
var V4UUID = /*#__PURE__*/function (_ValueUUID) {
|
|
40
|
+
_inherits(V4UUID, _ValueUUID);
|
|
41
|
+
var _super = _createSuper(V4UUID);
|
|
42
|
+
function V4UUID() {
|
|
43
|
+
_classCallCheck(this, V4UUID);
|
|
44
|
+
return _super.call(this, [V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), '-', V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), '-', '4', V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), '-', V4UUID._oneOf(V4UUID._timeHighBits), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), '-', V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex(), V4UUID._randomHex()].join(''));
|
|
45
|
+
}
|
|
46
|
+
_createClass(V4UUID, null, [{
|
|
47
|
+
key: "_oneOf",
|
|
48
|
+
value: function _oneOf(array) {
|
|
49
|
+
return array[Math.floor(array.length * Math.random())];
|
|
50
|
+
}
|
|
51
|
+
}, {
|
|
52
|
+
key: "_randomHex",
|
|
53
|
+
value: function _randomHex() {
|
|
54
|
+
return V4UUID._oneOf(V4UUID._chars);
|
|
55
|
+
}
|
|
56
|
+
}]);
|
|
57
|
+
return V4UUID;
|
|
58
|
+
}(ValueUUID);
|
|
59
|
+
/**
|
|
60
|
+
* An empty UUID that contains only zeros.
|
|
61
|
+
*/
|
|
62
|
+
V4UUID._chars = ['0', '1', '2', '3', '4', '5', '6', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'];
|
|
63
|
+
V4UUID._timeHighBits = ['8', '9', 'a', 'b'];
|
|
64
|
+
export var empty = new ValueUUID('00000000-0000-0000-0000-000000000000');
|
|
65
|
+
export function v4() {
|
|
66
|
+
return new V4UUID();
|
|
67
|
+
}
|
|
68
|
+
var _UUIDPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
69
|
+
export function isUUID(value) {
|
|
70
|
+
return _UUIDPattern.test(value);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Parses a UUID that is of the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
|
|
75
|
+
* @param value A uuid string.
|
|
76
|
+
*/
|
|
77
|
+
export function parse(value) {
|
|
78
|
+
if (!isUUID(value)) {
|
|
79
|
+
throw new Error('invalid uuid');
|
|
80
|
+
}
|
|
81
|
+
return new ValueUUID(value);
|
|
82
|
+
}
|
|
83
|
+
export function generateUuid() {
|
|
84
|
+
return v4().asHex();
|
|
85
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CellView, LibroView } from '@difizen/libro-core';
|
|
2
|
+
import type { NotebookCell, NotebookDocument } from 'vscode';
|
|
3
|
+
export declare const l2c: {
|
|
4
|
+
asNotebookDocument(libroView: LibroView): NotebookDocument;
|
|
5
|
+
asNotebookCell(cell: CellView): NotebookCell;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=convertor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertor.d.ts","sourceRoot":"","sources":["../../../src/common/vscodeAdaptor/convertor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAiB,MAAM,QAAQ,CAAC;AAO5E,eAAO,MAAM,GAAG;kCACgB,SAAS,GAAG,gBAAgB;yBAuBrC,QAAQ,GAAG,YAAY;CAwC7C,CAAC"}
|