@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,10 @@
|
|
|
1
|
+
import { ApplicationContribution } from '@difizen/mana-app';
|
|
2
|
+
import { LSPEnv } from './common/vscodeAdaptor/lspEnv.js';
|
|
3
|
+
import { LibroLanguageClientManager } from './libro-language-client-manager.js';
|
|
4
|
+
export declare class LibroLanguageClientContribution implements ApplicationContribution {
|
|
5
|
+
protected readonly libroLanguageClientManager: LibroLanguageClientManager;
|
|
6
|
+
protected readonly lspEnv: LSPEnv;
|
|
7
|
+
onViewStart(): Promise<void>;
|
|
8
|
+
startLanguageClients(): Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=libro-language-client-contribution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"libro-language-client-contribution.d.ts","sourceRoot":"","sources":["../src/libro-language-client-contribution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAqB,MAAM,mBAAmB,CAAC;AAG/E,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAE1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAEhF,qBACa,+BAAgC,YAAW,uBAAuB;IAE7E,SAAS,CAAC,QAAQ,CAAC,0BAA0B,EAAE,0BAA0B,CAAC;IAG1E,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAE5B,WAAW;IAKX,oBAAoB;CA4B3B"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
var _dec, _dec2, _dec3, _class, _class2, _descriptor, _descriptor2;
|
|
3
|
+
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; } } }; }
|
|
4
|
+
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); }
|
|
5
|
+
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; }
|
|
6
|
+
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; }
|
|
7
|
+
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); } }
|
|
8
|
+
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); }); }; }
|
|
9
|
+
function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
|
|
10
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
11
|
+
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); } }
|
|
12
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
14
|
+
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); }
|
|
15
|
+
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
|
|
16
|
+
function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }
|
|
17
|
+
import { ApplicationContribution, inject, singleton } from '@difizen/mana-app';
|
|
18
|
+
import { CloseAction, ErrorAction } from "./common/api.js";
|
|
19
|
+
import { LSPEnv } from "./common/vscodeAdaptor/lspEnv.js";
|
|
20
|
+
import { workspace } from "./common/vscodeAdaptor/vscodeAdaptor.js";
|
|
21
|
+
import { LibroLanguageClientManager } from "./libro-language-client-manager.js";
|
|
22
|
+
export var LibroLanguageClientContribution = (_dec = singleton({
|
|
23
|
+
contrib: [ApplicationContribution]
|
|
24
|
+
}), _dec2 = inject(LibroLanguageClientManager), _dec3 = inject(LSPEnv), _dec(_class = (_class2 = /*#__PURE__*/function () {
|
|
25
|
+
function LibroLanguageClientContribution() {
|
|
26
|
+
_classCallCheck(this, LibroLanguageClientContribution);
|
|
27
|
+
_initializerDefineProperty(this, "libroLanguageClientManager", _descriptor, this);
|
|
28
|
+
_initializerDefineProperty(this, "lspEnv", _descriptor2, this);
|
|
29
|
+
}
|
|
30
|
+
_createClass(LibroLanguageClientContribution, [{
|
|
31
|
+
key: "onViewStart",
|
|
32
|
+
value: function () {
|
|
33
|
+
var _onViewStart = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
34
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
35
|
+
while (1) switch (_context.prev = _context.next) {
|
|
36
|
+
case 0:
|
|
37
|
+
// not block
|
|
38
|
+
this.startLanguageClients();
|
|
39
|
+
case 1:
|
|
40
|
+
case "end":
|
|
41
|
+
return _context.stop();
|
|
42
|
+
}
|
|
43
|
+
}, _callee, this);
|
|
44
|
+
}));
|
|
45
|
+
function onViewStart() {
|
|
46
|
+
return _onViewStart.apply(this, arguments);
|
|
47
|
+
}
|
|
48
|
+
return onViewStart;
|
|
49
|
+
}()
|
|
50
|
+
}, {
|
|
51
|
+
key: "startLanguageClients",
|
|
52
|
+
value: function () {
|
|
53
|
+
var _startLanguageClients = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
54
|
+
var serverIds, _iterator, _step, serverId;
|
|
55
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
56
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
57
|
+
case 0:
|
|
58
|
+
_context2.next = 2;
|
|
59
|
+
return this.lspEnv.ready;
|
|
60
|
+
case 2:
|
|
61
|
+
_context2.next = 4;
|
|
62
|
+
return this.libroLanguageClientManager.getServers();
|
|
63
|
+
case 4:
|
|
64
|
+
serverIds = _context2.sent;
|
|
65
|
+
_iterator = _createForOfIteratorHelper(serverIds);
|
|
66
|
+
_context2.prev = 6;
|
|
67
|
+
_iterator.s();
|
|
68
|
+
case 8:
|
|
69
|
+
if ((_step = _iterator.n()).done) {
|
|
70
|
+
_context2.next = 14;
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
serverId = _step.value;
|
|
74
|
+
_context2.next = 12;
|
|
75
|
+
return this.libroLanguageClientManager.getOrCreateLanguageClient(serverId, {
|
|
76
|
+
name: "".concat(serverId, " Language Client"),
|
|
77
|
+
clientOptions: {
|
|
78
|
+
// use a language id as a document selector
|
|
79
|
+
documentSelector: [{
|
|
80
|
+
language: 'python'
|
|
81
|
+
}],
|
|
82
|
+
// disable the default error handler
|
|
83
|
+
errorHandler: {
|
|
84
|
+
error: function error() {
|
|
85
|
+
return {
|
|
86
|
+
action: ErrorAction.Continue
|
|
87
|
+
};
|
|
88
|
+
},
|
|
89
|
+
closed: function closed() {
|
|
90
|
+
return {
|
|
91
|
+
action: CloseAction.DoNotRestart
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
// pyright requires a workspace folder to be present, otherwise it will not work
|
|
96
|
+
// workspaceFolder: {
|
|
97
|
+
// index: 0,
|
|
98
|
+
// name: 'workspace',
|
|
99
|
+
// uri: URI.parse('/examples'), // abs path
|
|
100
|
+
// },
|
|
101
|
+
synchronize: {
|
|
102
|
+
fileEvents: [workspace.createFileSystemWatcher('**', false)]
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
case 12:
|
|
107
|
+
_context2.next = 8;
|
|
108
|
+
break;
|
|
109
|
+
case 14:
|
|
110
|
+
_context2.next = 19;
|
|
111
|
+
break;
|
|
112
|
+
case 16:
|
|
113
|
+
_context2.prev = 16;
|
|
114
|
+
_context2.t0 = _context2["catch"](6);
|
|
115
|
+
_iterator.e(_context2.t0);
|
|
116
|
+
case 19:
|
|
117
|
+
_context2.prev = 19;
|
|
118
|
+
_iterator.f();
|
|
119
|
+
return _context2.finish(19);
|
|
120
|
+
case 22:
|
|
121
|
+
case "end":
|
|
122
|
+
return _context2.stop();
|
|
123
|
+
}
|
|
124
|
+
}, _callee2, this, [[6, 16, 19, 22]]);
|
|
125
|
+
}));
|
|
126
|
+
function startLanguageClients() {
|
|
127
|
+
return _startLanguageClients.apply(this, arguments);
|
|
128
|
+
}
|
|
129
|
+
return startLanguageClients;
|
|
130
|
+
}()
|
|
131
|
+
}]);
|
|
132
|
+
return LibroLanguageClientContribution;
|
|
133
|
+
}(), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "libroLanguageClientManager", [_dec2], {
|
|
134
|
+
configurable: true,
|
|
135
|
+
enumerable: true,
|
|
136
|
+
writable: true,
|
|
137
|
+
initializer: null
|
|
138
|
+
}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "lspEnv", [_dec3], {
|
|
139
|
+
configurable: true,
|
|
140
|
+
enumerable: true,
|
|
141
|
+
writable: true,
|
|
142
|
+
initializer: null
|
|
143
|
+
})), _class2)) || _class);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ILanguageServerManager, TSessionMap } from '@difizen/libro-lsp';
|
|
2
|
+
import { ILanguageServerManagerFactory } from '@difizen/libro-lsp';
|
|
3
|
+
import type { LibroLanguageClientOptions } from './libro-language-client.js';
|
|
4
|
+
import { LibroLanguageClient } from './libro-language-client.js';
|
|
5
|
+
interface IConnectionData {
|
|
6
|
+
connection: WebSocket;
|
|
7
|
+
languageClient: LibroLanguageClient;
|
|
8
|
+
}
|
|
9
|
+
export type LSPFeatureType = 'textDocument/formatting';
|
|
10
|
+
export declare class LibroLanguageClientManager {
|
|
11
|
+
protected readonly languageServerManagerFactory: ILanguageServerManagerFactory;
|
|
12
|
+
protected languageServerManager: ILanguageServerManager;
|
|
13
|
+
protected clientMap: Map<string, IConnectionData>;
|
|
14
|
+
init(): void;
|
|
15
|
+
protected serverUri(languageServerId: string): string;
|
|
16
|
+
getServers(language?: string): Promise<import("@difizen/libro-lsp").TLanguageServerId[]>;
|
|
17
|
+
getServerSpecs(language?: string): Promise<import("@difizen/libro-lsp").TSpecsMap>;
|
|
18
|
+
refreshRunning(): Promise<void>;
|
|
19
|
+
get sessionsChanged(): import("@difizen/mana-app").Event<void>;
|
|
20
|
+
get sessions(): TSessionMap;
|
|
21
|
+
getOrCreateLanguageClient(languageServerId: string, options: LibroLanguageClientOptions): Promise<{
|
|
22
|
+
connection: WebSocket;
|
|
23
|
+
languageClient: LibroLanguageClient;
|
|
24
|
+
} | undefined>;
|
|
25
|
+
protected createLanguageClient: (url: string, options: LibroLanguageClientOptions) => Promise<{
|
|
26
|
+
connection: WebSocket;
|
|
27
|
+
languageClient: LibroLanguageClient;
|
|
28
|
+
}>;
|
|
29
|
+
closeLanguageClient(languageServerId: string): Promise<void>;
|
|
30
|
+
closeAllLanguageClient(): Promise<void>;
|
|
31
|
+
getFeatureStatus(feature: LSPFeatureType, language?: string): Promise<boolean>;
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=libro-language-client-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"libro-language-client-manager.d.ts","sourceRoot":"","sources":["../src/libro-language-client-manager.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AAGnE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEjE,UAAU,eAAe;IACvB,UAAU,EAAE,SAAS,CAAC;IACtB,cAAc,EAAE,mBAAmB,CAAC;CACrC;AAGD,MAAM,MAAM,cAAc,GAAG,yBAAyB,CAAC;AAEvD,qBACa,0BAA0B;IAErC,SAAS,CAAC,QAAQ,CAAC,4BAA4B,EAAE,6BAA6B,CAAC;IAE/E,SAAS,CAAC,qBAAqB,EAAE,sBAAsB,CAAC;IAExD,SAAS,CAAC,SAAS,+BAAsC;IAGzD,IAAI;IAIJ,SAAS,CAAC,SAAS,CAAC,gBAAgB,EAAE,MAAM;IAKtC,UAAU,CAAC,QAAQ,SAAW;IAQ9B,cAAc,CAAC,QAAQ,SAAW;IAQlC,cAAc;IAIpB,IAAI,eAAe,4CAElB;IAED,IAAI,QAAQ,gBAQX;IAEK,yBAAyB,CAC7B,gBAAgB,EAAE,MAAM,EACxB,OAAO,EAAE,0BAA0B;;;;IAYrC,SAAS,CAAC,oBAAoB,QACvB,MAAM,WACF,0BAA0B;;;OAGnC;IAEI,mBAAmB,CAAC,gBAAgB,EAAE,MAAM;IAO5C,sBAAsB;IAMtB,gBAAgB,CACpB,OAAO,EAAE,cAAc,EACvB,QAAQ,SAAW,GAClB,OAAO,CAAC,OAAO,CAAC;CAuBpB"}
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
var _dec, _dec2, _dec3, _class, _class2, _descriptor;
|
|
3
|
+
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; }
|
|
4
|
+
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); } }
|
|
5
|
+
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); }); }; }
|
|
6
|
+
function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
|
|
7
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8
|
+
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); } }
|
|
9
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
10
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
11
|
+
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); }
|
|
12
|
+
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
|
|
13
|
+
function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }
|
|
14
|
+
import { URL } from '@difizen/libro-common';
|
|
15
|
+
import { PageConfig } from '@difizen/libro-kernel';
|
|
16
|
+
import { ILanguageServerManagerFactory } from '@difizen/libro-lsp';
|
|
17
|
+
import { singleton, inject, postConstruct, getOrigin } from '@difizen/mana-app';
|
|
18
|
+
import { LibroLanguageClient } from "./libro-language-client.js";
|
|
19
|
+
|
|
20
|
+
// TODO: type is not complete
|
|
21
|
+
|
|
22
|
+
export var LibroLanguageClientManager = (_dec = singleton(), _dec2 = inject(ILanguageServerManagerFactory), _dec3 = postConstruct(), _dec(_class = (_class2 = /*#__PURE__*/function () {
|
|
23
|
+
function LibroLanguageClientManager() {
|
|
24
|
+
_classCallCheck(this, LibroLanguageClientManager);
|
|
25
|
+
_initializerDefineProperty(this, "languageServerManagerFactory", _descriptor, this);
|
|
26
|
+
this.clientMap = new Map();
|
|
27
|
+
this.createLanguageClient = function (url, options) {
|
|
28
|
+
return LibroLanguageClient.createWebSocketLanguageClient(url, options);
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
_createClass(LibroLanguageClientManager, [{
|
|
32
|
+
key: "init",
|
|
33
|
+
value: function init() {
|
|
34
|
+
this.languageServerManager = this.languageServerManagerFactory({});
|
|
35
|
+
}
|
|
36
|
+
}, {
|
|
37
|
+
key: "serverUri",
|
|
38
|
+
value: function serverUri(languageServerId) {
|
|
39
|
+
var wsBase = PageConfig.getBaseUrl().replace(/^http/, 'ws');
|
|
40
|
+
return URL.join(wsBase, 'lsp', 'ws', languageServerId);
|
|
41
|
+
}
|
|
42
|
+
}, {
|
|
43
|
+
key: "getServers",
|
|
44
|
+
value: function () {
|
|
45
|
+
var _getServers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
46
|
+
var language,
|
|
47
|
+
serverIds,
|
|
48
|
+
_args = arguments;
|
|
49
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
50
|
+
while (1) switch (_context.prev = _context.next) {
|
|
51
|
+
case 0:
|
|
52
|
+
language = _args.length > 0 && _args[0] !== undefined ? _args[0] : 'python';
|
|
53
|
+
_context.next = 3;
|
|
54
|
+
return this.languageServerManager.ready;
|
|
55
|
+
case 3:
|
|
56
|
+
serverIds = this.languageServerManager.getMatchingServers({
|
|
57
|
+
language: language
|
|
58
|
+
});
|
|
59
|
+
return _context.abrupt("return", serverIds);
|
|
60
|
+
case 5:
|
|
61
|
+
case "end":
|
|
62
|
+
return _context.stop();
|
|
63
|
+
}
|
|
64
|
+
}, _callee, this);
|
|
65
|
+
}));
|
|
66
|
+
function getServers() {
|
|
67
|
+
return _getServers.apply(this, arguments);
|
|
68
|
+
}
|
|
69
|
+
return getServers;
|
|
70
|
+
}()
|
|
71
|
+
}, {
|
|
72
|
+
key: "getServerSpecs",
|
|
73
|
+
value: function () {
|
|
74
|
+
var _getServerSpecs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
75
|
+
var language,
|
|
76
|
+
specs,
|
|
77
|
+
_args2 = arguments;
|
|
78
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
79
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
80
|
+
case 0:
|
|
81
|
+
language = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : 'python';
|
|
82
|
+
_context2.next = 3;
|
|
83
|
+
return this.languageServerManager.ready;
|
|
84
|
+
case 3:
|
|
85
|
+
specs = this.languageServerManager.getMatchingSpecs({
|
|
86
|
+
language: language
|
|
87
|
+
});
|
|
88
|
+
return _context2.abrupt("return", specs);
|
|
89
|
+
case 5:
|
|
90
|
+
case "end":
|
|
91
|
+
return _context2.stop();
|
|
92
|
+
}
|
|
93
|
+
}, _callee2, this);
|
|
94
|
+
}));
|
|
95
|
+
function getServerSpecs() {
|
|
96
|
+
return _getServerSpecs.apply(this, arguments);
|
|
97
|
+
}
|
|
98
|
+
return getServerSpecs;
|
|
99
|
+
}()
|
|
100
|
+
}, {
|
|
101
|
+
key: "refreshRunning",
|
|
102
|
+
value: function () {
|
|
103
|
+
var _refreshRunning = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
104
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
105
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
106
|
+
case 0:
|
|
107
|
+
_context3.next = 2;
|
|
108
|
+
return this.languageServerManager.refreshRunning();
|
|
109
|
+
case 2:
|
|
110
|
+
case "end":
|
|
111
|
+
return _context3.stop();
|
|
112
|
+
}
|
|
113
|
+
}, _callee3, this);
|
|
114
|
+
}));
|
|
115
|
+
function refreshRunning() {
|
|
116
|
+
return _refreshRunning.apply(this, arguments);
|
|
117
|
+
}
|
|
118
|
+
return refreshRunning;
|
|
119
|
+
}()
|
|
120
|
+
}, {
|
|
121
|
+
key: "sessionsChanged",
|
|
122
|
+
get: function get() {
|
|
123
|
+
return this.languageServerManager.sessionsChanged;
|
|
124
|
+
}
|
|
125
|
+
}, {
|
|
126
|
+
key: "sessions",
|
|
127
|
+
get: function get() {
|
|
128
|
+
var res = new Map();
|
|
129
|
+
this.languageServerManager.sessions.forEach(function (item, key) {
|
|
130
|
+
if (item.status === 'started') {
|
|
131
|
+
res.set(key, item);
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
return res;
|
|
135
|
+
}
|
|
136
|
+
}, {
|
|
137
|
+
key: "getOrCreateLanguageClient",
|
|
138
|
+
value: function () {
|
|
139
|
+
var _getOrCreateLanguageClient = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(languageServerId, options) {
|
|
140
|
+
var url, client;
|
|
141
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
142
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
143
|
+
case 0:
|
|
144
|
+
if (!this.clientMap.has(languageServerId)) {
|
|
145
|
+
_context4.next = 2;
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
return _context4.abrupt("return", this.clientMap.get(languageServerId));
|
|
149
|
+
case 2:
|
|
150
|
+
url = this.serverUri(languageServerId);
|
|
151
|
+
_context4.next = 5;
|
|
152
|
+
return this.createLanguageClient(url, options);
|
|
153
|
+
case 5:
|
|
154
|
+
client = _context4.sent;
|
|
155
|
+
this.clientMap.set(languageServerId, client);
|
|
156
|
+
this.refreshRunning();
|
|
157
|
+
return _context4.abrupt("return", client);
|
|
158
|
+
case 9:
|
|
159
|
+
case "end":
|
|
160
|
+
return _context4.stop();
|
|
161
|
+
}
|
|
162
|
+
}, _callee4, this);
|
|
163
|
+
}));
|
|
164
|
+
function getOrCreateLanguageClient(_x, _x2) {
|
|
165
|
+
return _getOrCreateLanguageClient.apply(this, arguments);
|
|
166
|
+
}
|
|
167
|
+
return getOrCreateLanguageClient;
|
|
168
|
+
}()
|
|
169
|
+
}, {
|
|
170
|
+
key: "closeLanguageClient",
|
|
171
|
+
value: function () {
|
|
172
|
+
var _closeLanguageClient = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(languageServerId) {
|
|
173
|
+
var _getOrigin, _this$clientMap$get, _getOrigin2, _this$clientMap$get2;
|
|
174
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
175
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
176
|
+
case 0:
|
|
177
|
+
_context5.next = 2;
|
|
178
|
+
return (_getOrigin = getOrigin((_this$clientMap$get = this.clientMap.get(languageServerId)) === null || _this$clientMap$get === void 0 ? void 0 : _this$clientMap$get.languageClient)) === null || _getOrigin === void 0 ? void 0 : _getOrigin.dispose();
|
|
179
|
+
case 2:
|
|
180
|
+
(_getOrigin2 = getOrigin((_this$clientMap$get2 = this.clientMap.get(languageServerId)) === null || _this$clientMap$get2 === void 0 ? void 0 : _this$clientMap$get2.connection)) === null || _getOrigin2 === void 0 || _getOrigin2.close();
|
|
181
|
+
this.clientMap.delete(languageServerId);
|
|
182
|
+
this.refreshRunning();
|
|
183
|
+
case 5:
|
|
184
|
+
case "end":
|
|
185
|
+
return _context5.stop();
|
|
186
|
+
}
|
|
187
|
+
}, _callee5, this);
|
|
188
|
+
}));
|
|
189
|
+
function closeLanguageClient(_x3) {
|
|
190
|
+
return _closeLanguageClient.apply(this, arguments);
|
|
191
|
+
}
|
|
192
|
+
return closeLanguageClient;
|
|
193
|
+
}()
|
|
194
|
+
}, {
|
|
195
|
+
key: "closeAllLanguageClient",
|
|
196
|
+
value: function () {
|
|
197
|
+
var _closeAllLanguageClient = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
198
|
+
var _this = this;
|
|
199
|
+
var servers;
|
|
200
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
201
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
202
|
+
case 0:
|
|
203
|
+
_context6.next = 2;
|
|
204
|
+
return this.getServers();
|
|
205
|
+
case 2:
|
|
206
|
+
servers = _context6.sent;
|
|
207
|
+
_context6.next = 5;
|
|
208
|
+
return Promise.all(servers.map(function (server) {
|
|
209
|
+
return _this.closeLanguageClient(server);
|
|
210
|
+
}));
|
|
211
|
+
case 5:
|
|
212
|
+
this.refreshRunning();
|
|
213
|
+
case 6:
|
|
214
|
+
case "end":
|
|
215
|
+
return _context6.stop();
|
|
216
|
+
}
|
|
217
|
+
}, _callee6, this);
|
|
218
|
+
}));
|
|
219
|
+
function closeAllLanguageClient() {
|
|
220
|
+
return _closeAllLanguageClient.apply(this, arguments);
|
|
221
|
+
}
|
|
222
|
+
return closeAllLanguageClient;
|
|
223
|
+
}()
|
|
224
|
+
}, {
|
|
225
|
+
key: "getFeatureStatus",
|
|
226
|
+
value: function () {
|
|
227
|
+
var _getFeatureStatus = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(feature) {
|
|
228
|
+
var _this2 = this;
|
|
229
|
+
var language,
|
|
230
|
+
featureEnabled,
|
|
231
|
+
serverids,
|
|
232
|
+
_args7 = arguments;
|
|
233
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
234
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
235
|
+
case 0:
|
|
236
|
+
language = _args7.length > 1 && _args7[1] !== undefined ? _args7[1] : 'python';
|
|
237
|
+
featureEnabled = false;
|
|
238
|
+
_context7.next = 4;
|
|
239
|
+
return this.getServers(language);
|
|
240
|
+
case 4:
|
|
241
|
+
serverids = _context7.sent;
|
|
242
|
+
serverids.forEach(function (id) {
|
|
243
|
+
var _this2$clientMap$get;
|
|
244
|
+
var featureState = (_this2$clientMap$get = _this2.clientMap.get(id)) === null || _this2$clientMap$get === void 0 ? void 0 : _this2$clientMap$get.languageClient.getFeature(feature).getState();
|
|
245
|
+
if ((featureState === null || featureState === void 0 ? void 0 : featureState.kind) === 'document' && featureState.registrations === true) {
|
|
246
|
+
featureEnabled = true;
|
|
247
|
+
}
|
|
248
|
+
if ((featureState === null || featureState === void 0 ? void 0 : featureState.kind) === 'workspace' && featureState.registrations === true) {
|
|
249
|
+
featureEnabled = true;
|
|
250
|
+
}
|
|
251
|
+
if ((featureState === null || featureState === void 0 ? void 0 : featureState.kind) === 'window' && featureState.registrations === true) {
|
|
252
|
+
featureEnabled = true;
|
|
253
|
+
}
|
|
254
|
+
if ((featureState === null || featureState === void 0 ? void 0 : featureState.kind) === 'static') {
|
|
255
|
+
featureEnabled = true;
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
return _context7.abrupt("return", featureEnabled);
|
|
259
|
+
case 7:
|
|
260
|
+
case "end":
|
|
261
|
+
return _context7.stop();
|
|
262
|
+
}
|
|
263
|
+
}, _callee7, this);
|
|
264
|
+
}));
|
|
265
|
+
function getFeatureStatus(_x4) {
|
|
266
|
+
return _getFeatureStatus.apply(this, arguments);
|
|
267
|
+
}
|
|
268
|
+
return getFeatureStatus;
|
|
269
|
+
}()
|
|
270
|
+
}]);
|
|
271
|
+
return LibroLanguageClientManager;
|
|
272
|
+
}(), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "languageServerManagerFactory", [_dec2], {
|
|
273
|
+
configurable: true,
|
|
274
|
+
enumerable: true,
|
|
275
|
+
writable: true,
|
|
276
|
+
initializer: null
|
|
277
|
+
}), _applyDecoratedDescriptor(_class2.prototype, "init", [_dec3], Object.getOwnPropertyDescriptor(_class2.prototype, "init"), _class2.prototype)), _class2)) || _class);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { LanguageClientOptions, MessageTransports } from './common/client.js';
|
|
2
|
+
import { BaseLanguageClient } from './common/client.js';
|
|
3
|
+
export interface IConnectionProvider {
|
|
4
|
+
get(encoding: string): Promise<MessageTransports>;
|
|
5
|
+
}
|
|
6
|
+
export interface LibroLanguageClientOptions {
|
|
7
|
+
name: string;
|
|
8
|
+
id?: string;
|
|
9
|
+
clientOptions: LanguageClientOptions;
|
|
10
|
+
}
|
|
11
|
+
export interface LibroLanguageClientFullOptions extends LibroLanguageClientOptions {
|
|
12
|
+
connectionProvider: IConnectionProvider;
|
|
13
|
+
}
|
|
14
|
+
export declare class LibroLanguageClient extends BaseLanguageClient {
|
|
15
|
+
static createWebSocketLanguageClient: (url: string, options: LibroLanguageClientOptions) => Promise<{
|
|
16
|
+
connection: WebSocket;
|
|
17
|
+
languageClient: LibroLanguageClient;
|
|
18
|
+
}>;
|
|
19
|
+
static createWebWorkerLanguageClient: (url: string, options: LibroLanguageClientOptions) => Promise<{
|
|
20
|
+
connection: Worker;
|
|
21
|
+
languageClient: LibroLanguageClient;
|
|
22
|
+
}>;
|
|
23
|
+
protected readonly connectionProvider: IConnectionProvider;
|
|
24
|
+
constructor({ id, name, clientOptions, connectionProvider, }: LibroLanguageClientFullOptions);
|
|
25
|
+
protected createMessageTransports(encoding: string): Promise<MessageTransports>;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=libro-language-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"libro-language-client.d.ts","sourceRoot":"","sources":["../src/libro-language-client.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,WAAW,mBAAmB;IAClC,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;CACnD;AAED,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,aAAa,EAAE,qBAAqB,CAAC;CACtC;AAED,MAAM,WAAW,8BAA+B,SAAQ,0BAA0B;IAChF,kBAAkB,EAAE,mBAAmB,CAAC;CACzC;AAED,qBAAa,mBAAoB,SAAQ,kBAAkB;IACzD,MAAM,CAAC,6BAA6B,QAC7B,MAAM,WACF,0BAA0B;oBAGrB,SAAS;wBACL,mBAAmB;OAwBrC;IAEF,MAAM,CAAC,6BAA6B,QAC7B,MAAM,WACF,0BAA0B;oBACZ,MAAM;wBAAkB,mBAAmB;OAgBlE;IAEF,SAAS,CAAC,QAAQ,CAAC,kBAAkB,EAAE,mBAAmB,CAAC;gBAE/C,EACV,EAAE,EACF,IAAI,EACJ,aAAa,EACb,kBAAkB,GACnB,EAAE,8BAA8B;cAKd,uBAAuB,CACxC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,iBAAiB,CAAC;CAG9B"}
|