@difizen/libro-lsp 0.1.2
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/adapters/adapter.d.ts +255 -0
- package/es/adapters/adapter.d.ts.map +1 -0
- package/es/adapters/adapter.js +647 -0
- package/es/adapters/notebook-adapter.d.ts +150 -0
- package/es/adapters/notebook-adapter.d.ts.map +1 -0
- package/es/adapters/notebook-adapter.js +588 -0
- package/es/adapters/status-message.d.ts +48 -0
- package/es/adapters/status-message.d.ts.map +1 -0
- package/es/adapters/status-message.js +110 -0
- package/es/connection-manager.d.ts +199 -0
- package/es/connection-manager.d.ts.map +1 -0
- package/es/connection-manager.js +685 -0
- package/es/connection.d.ts +149 -0
- package/es/connection.d.ts.map +1 -0
- package/es/connection.js +591 -0
- package/es/extractors/index.d.ts +4 -0
- package/es/extractors/index.d.ts.map +1 -0
- package/es/extractors/index.js +6 -0
- package/es/extractors/manager.d.ts +31 -0
- package/es/extractors/manager.d.ts.map +1 -0
- package/es/extractors/manager.js +90 -0
- package/es/extractors/text-extractor.d.ts +56 -0
- package/es/extractors/text-extractor.d.ts.map +1 -0
- package/es/extractors/text-extractor.js +72 -0
- package/es/extractors/types.d.ts +68 -0
- package/es/extractors/types.d.ts.map +1 -0
- package/es/extractors/types.js +1 -0
- package/es/feature.d.ts +29 -0
- package/es/feature.d.ts.map +1 -0
- package/es/feature.js +85 -0
- package/es/index.d.ts +19 -0
- package/es/index.d.ts.map +1 -0
- package/es/index.js +21 -0
- package/es/lsp-app-contribution.d.ts +19 -0
- package/es/lsp-app-contribution.d.ts.map +1 -0
- package/es/lsp-app-contribution.js +155 -0
- package/es/lsp-protocol.d.ts +10 -0
- package/es/lsp-protocol.d.ts.map +1 -0
- package/es/lsp-protocol.js +1 -0
- package/es/lsp.d.ts +136 -0
- package/es/lsp.d.ts.map +1 -0
- package/es/lsp.js +141 -0
- package/es/manager.d.ts +142 -0
- package/es/manager.d.ts.map +1 -0
- package/es/manager.js +423 -0
- package/es/module.d.ts +3 -0
- package/es/module.d.ts.map +1 -0
- package/es/module.js +21 -0
- package/es/plugin.d.ts +56 -0
- package/es/plugin.d.ts.map +1 -0
- package/es/plugin.js +0 -0
- package/es/positioning.d.ts +66 -0
- package/es/positioning.d.ts.map +1 -0
- package/es/positioning.js +96 -0
- package/es/schema.d.ts +240 -0
- package/es/schema.d.ts.map +1 -0
- package/es/schema.js +0 -0
- package/es/tokens.d.ts +677 -0
- package/es/tokens.d.ts.map +1 -0
- package/es/tokens.js +183 -0
- package/es/utils.d.ts +33 -0
- package/es/utils.d.ts.map +1 -0
- package/es/utils.js +168 -0
- package/es/virtual/document.d.ts +546 -0
- package/es/virtual/document.d.ts.map +1 -0
- package/es/virtual/document.js +1263 -0
- package/es/ws-connection/server-capability-registration.d.ts +19 -0
- package/es/ws-connection/server-capability-registration.d.ts.map +1 -0
- package/es/ws-connection/server-capability-registration.js +51 -0
- package/es/ws-connection/types.d.ts +76 -0
- package/es/ws-connection/types.d.ts.map +1 -0
- package/es/ws-connection/types.js +1 -0
- package/es/ws-connection/ws-connection.d.ts +105 -0
- package/es/ws-connection/ws-connection.d.ts.map +1 -0
- package/es/ws-connection/ws-connection.js +301 -0
- package/package.json +67 -0
- package/src/adapters/adapter.ts +611 -0
- package/src/adapters/notebook-adapter.ts +463 -0
- package/src/adapters/status-message.ts +93 -0
- package/src/connection-manager.ts +626 -0
- package/src/connection.ts +570 -0
- package/src/extractors/index.ts +6 -0
- package/src/extractors/manager.ts +82 -0
- package/src/extractors/text-extractor.ts +94 -0
- package/src/extractors/types.ts +78 -0
- package/src/feature.ts +60 -0
- package/src/index.spec.ts +10 -0
- package/src/index.ts +21 -0
- package/src/lsp-app-contribution.ts +83 -0
- package/src/lsp-protocol.ts +10 -0
- package/src/lsp.ts +160 -0
- package/src/manager.ts +358 -0
- package/src/module.ts +32 -0
- package/src/plugin.ts +62 -0
- package/src/positioning.ts +121 -0
- package/src/schema.ts +249 -0
- package/src/tokens.ts +843 -0
- package/src/utils.ts +109 -0
- package/src/virtual/document.ts +1250 -0
- package/src/ws-connection/server-capability-registration.ts +77 -0
- package/src/ws-connection/types.ts +102 -0
- package/src/ws-connection/ws-connection.ts +320 -0
|
@@ -0,0 +1,155 @@
|
|
|
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, _dec4, _dec5, _dec6, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5;
|
|
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(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
11
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
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 { LibroService } from '@difizen/libro-core';
|
|
15
|
+
import { ServerManager } from '@difizen/libro-kernel';
|
|
16
|
+
import { ApplicationContribution } from '@difizen/mana-app';
|
|
17
|
+
import { inject, singleton } from '@difizen/mana-app';
|
|
18
|
+
import { NotebookAdapter } from "./adapters/notebook-adapter.js";
|
|
19
|
+
import { ILSPCodeExtractorsManager, ILSPDocumentConnectionManager, ILSPFeatureManager } from "./tokens.js";
|
|
20
|
+
export var LSPAppContribution = (_dec = singleton({
|
|
21
|
+
contrib: [ApplicationContribution]
|
|
22
|
+
}), _dec2 = inject(LibroService), _dec3 = inject(ServerManager), _dec4 = inject(ILSPDocumentConnectionManager), _dec5 = inject(ILSPFeatureManager), _dec6 = inject(ILSPCodeExtractorsManager), _dec(_class = (_class2 = /*#__PURE__*/function () {
|
|
23
|
+
function LSPAppContribution() {
|
|
24
|
+
_classCallCheck(this, LSPAppContribution);
|
|
25
|
+
_initializerDefineProperty(this, "libroService", _descriptor, this);
|
|
26
|
+
_initializerDefineProperty(this, "serverManager", _descriptor2, this);
|
|
27
|
+
_initializerDefineProperty(this, "connectionManager", _descriptor3, this);
|
|
28
|
+
_initializerDefineProperty(this, "featureManager", _descriptor4, this);
|
|
29
|
+
_initializerDefineProperty(this, "codeExtractorManager", _descriptor5, this);
|
|
30
|
+
}
|
|
31
|
+
_createClass(LSPAppContribution, [{
|
|
32
|
+
key: "onStart",
|
|
33
|
+
value: function onStart() {
|
|
34
|
+
/**
|
|
35
|
+
* FIXME:capability声明应该和具体的实现写在一起
|
|
36
|
+
*/
|
|
37
|
+
this.featureManager.register({
|
|
38
|
+
id: 'libro-lsp',
|
|
39
|
+
capabilities: {
|
|
40
|
+
textDocument: {
|
|
41
|
+
completion: {
|
|
42
|
+
completionItem: {
|
|
43
|
+
documentationFormat: ['markdown']
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
diagnostic: {
|
|
47
|
+
dynamicRegistration: true
|
|
48
|
+
},
|
|
49
|
+
/**
|
|
50
|
+
* jedi-lsp的hover功能没有用hover的格式配置,而是使用completion的格式配置。。。
|
|
51
|
+
*/
|
|
52
|
+
hover: {
|
|
53
|
+
dynamicRegistration: true,
|
|
54
|
+
contentFormat: ['markdown', 'plaintext']
|
|
55
|
+
},
|
|
56
|
+
signatureHelp: {
|
|
57
|
+
dynamicRegistration: true,
|
|
58
|
+
contextSupport: true,
|
|
59
|
+
signatureInformation: {
|
|
60
|
+
activeParameterSupport: true,
|
|
61
|
+
documentationFormat: ['markdown'],
|
|
62
|
+
parameterInformation: {
|
|
63
|
+
labelOffsetSupport: true
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
this.setupNotebookLanguageServer();
|
|
71
|
+
}
|
|
72
|
+
}, {
|
|
73
|
+
key: "setupNotebookLanguageServer",
|
|
74
|
+
value: function setupNotebookLanguageServer() {
|
|
75
|
+
var _this = this;
|
|
76
|
+
this.libroService.onNotebookViewCreated( /*#__PURE__*/function () {
|
|
77
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(notebook) {
|
|
78
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
79
|
+
while (1) switch (_context.prev = _context.next) {
|
|
80
|
+
case 0:
|
|
81
|
+
_this.activateNotebookLanguageServer(notebook);
|
|
82
|
+
case 1:
|
|
83
|
+
case "end":
|
|
84
|
+
return _context.stop();
|
|
85
|
+
}
|
|
86
|
+
}, _callee);
|
|
87
|
+
}));
|
|
88
|
+
return function (_x) {
|
|
89
|
+
return _ref.apply(this, arguments);
|
|
90
|
+
};
|
|
91
|
+
}());
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Activate the language server for notebook.
|
|
96
|
+
*/
|
|
97
|
+
}, {
|
|
98
|
+
key: "activateNotebookLanguageServer",
|
|
99
|
+
value: function () {
|
|
100
|
+
var _activateNotebookLanguageServer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(notebook) {
|
|
101
|
+
var adapter;
|
|
102
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
103
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
104
|
+
case 0:
|
|
105
|
+
_context2.next = 2;
|
|
106
|
+
return notebook.initialized;
|
|
107
|
+
case 2:
|
|
108
|
+
_context2.next = 4;
|
|
109
|
+
return this.serverManager.ready;
|
|
110
|
+
case 4:
|
|
111
|
+
adapter = new NotebookAdapter(notebook, {
|
|
112
|
+
connectionManager: this.connectionManager,
|
|
113
|
+
featureManager: this.featureManager,
|
|
114
|
+
foreignCodeExtractorsManager: this.codeExtractorManager
|
|
115
|
+
});
|
|
116
|
+
this.connectionManager.registerAdapter(notebook.model.id, adapter);
|
|
117
|
+
case 6:
|
|
118
|
+
case "end":
|
|
119
|
+
return _context2.stop();
|
|
120
|
+
}
|
|
121
|
+
}, _callee2, this);
|
|
122
|
+
}));
|
|
123
|
+
function activateNotebookLanguageServer(_x2) {
|
|
124
|
+
return _activateNotebookLanguageServer.apply(this, arguments);
|
|
125
|
+
}
|
|
126
|
+
return activateNotebookLanguageServer;
|
|
127
|
+
}()
|
|
128
|
+
}]);
|
|
129
|
+
return LSPAppContribution;
|
|
130
|
+
}(), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "libroService", [_dec2], {
|
|
131
|
+
configurable: true,
|
|
132
|
+
enumerable: true,
|
|
133
|
+
writable: true,
|
|
134
|
+
initializer: null
|
|
135
|
+
}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "serverManager", [_dec3], {
|
|
136
|
+
configurable: true,
|
|
137
|
+
enumerable: true,
|
|
138
|
+
writable: true,
|
|
139
|
+
initializer: null
|
|
140
|
+
}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "connectionManager", [_dec4], {
|
|
141
|
+
configurable: true,
|
|
142
|
+
enumerable: true,
|
|
143
|
+
writable: true,
|
|
144
|
+
initializer: null
|
|
145
|
+
}), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "featureManager", [_dec5], {
|
|
146
|
+
configurable: true,
|
|
147
|
+
enumerable: true,
|
|
148
|
+
writable: true,
|
|
149
|
+
initializer: null
|
|
150
|
+
}), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "codeExtractorManager", [_dec6], {
|
|
151
|
+
configurable: true,
|
|
152
|
+
enumerable: true,
|
|
153
|
+
writable: true,
|
|
154
|
+
initializer: null
|
|
155
|
+
})), _class2)) || _class);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { LSPConnection } from './connection.js';
|
|
2
|
+
import type { Document } from './tokens.js';
|
|
3
|
+
import type { VirtualDocument } from './virtual/document.js';
|
|
4
|
+
export type LSPProviderResult = {
|
|
5
|
+
virtualDocument: VirtualDocument;
|
|
6
|
+
lspConnection: LSPConnection;
|
|
7
|
+
editor: Document.IEditor;
|
|
8
|
+
};
|
|
9
|
+
export type LSPProvider = () => Promise<LSPProviderResult>;
|
|
10
|
+
//# sourceMappingURL=lsp-protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lsp-protocol.d.ts","sourceRoot":"","sources":["../src/lsp-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,MAAM,MAAM,iBAAiB,GAAG;IAC9B,eAAe,EAAE,eAAe,CAAC;IACjC,aAAa,EAAE,aAAa,CAAC;IAC7B,MAAM,EAAE,QAAQ,CAAC,OAAO,CAAC;CAC1B,CAAC;AACF,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,CAAC,iBAAiB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/es/lsp.d.ts
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import type * as lsp from 'vscode-languageserver-protocol';
|
|
2
|
+
export type ClientCapabilities = lsp.ClientCapabilities;
|
|
3
|
+
export declare enum DiagnosticSeverity {
|
|
4
|
+
Error = 1,
|
|
5
|
+
Warning = 2,
|
|
6
|
+
Information = 3,
|
|
7
|
+
Hint = 4
|
|
8
|
+
}
|
|
9
|
+
export declare enum DiagnosticTag {
|
|
10
|
+
Unnecessary = 1,
|
|
11
|
+
Deprecated = 2
|
|
12
|
+
}
|
|
13
|
+
export declare enum CompletionItemTag {
|
|
14
|
+
Deprecated = 1
|
|
15
|
+
}
|
|
16
|
+
export declare enum CompletionItemKind {
|
|
17
|
+
Text = 1,
|
|
18
|
+
Method = 2,
|
|
19
|
+
Function = 3,
|
|
20
|
+
Constructor = 4,
|
|
21
|
+
Field = 5,
|
|
22
|
+
Variable = 6,
|
|
23
|
+
Class = 7,
|
|
24
|
+
Interface = 8,
|
|
25
|
+
Module = 9,
|
|
26
|
+
Property = 10,
|
|
27
|
+
Unit = 11,
|
|
28
|
+
Value = 12,
|
|
29
|
+
Enum = 13,
|
|
30
|
+
Keyword = 14,
|
|
31
|
+
Snippet = 15,
|
|
32
|
+
Color = 16,
|
|
33
|
+
File = 17,
|
|
34
|
+
Reference = 18,
|
|
35
|
+
Folder = 19,
|
|
36
|
+
EnumMember = 20,
|
|
37
|
+
Constant = 21,
|
|
38
|
+
Struct = 22,
|
|
39
|
+
Event = 23,
|
|
40
|
+
Operator = 24,
|
|
41
|
+
TypeParameter = 25
|
|
42
|
+
}
|
|
43
|
+
export declare enum DocumentHighlightKind {
|
|
44
|
+
Text = 1,
|
|
45
|
+
Read = 2,
|
|
46
|
+
Write = 3
|
|
47
|
+
}
|
|
48
|
+
export declare enum CompletionTriggerKind {
|
|
49
|
+
Invoked = 1,
|
|
50
|
+
TriggerCharacter = 2,
|
|
51
|
+
TriggerForIncompleteCompletions = 3
|
|
52
|
+
}
|
|
53
|
+
export declare enum AdditionalCompletionTriggerKinds {
|
|
54
|
+
AutoInvoked = 9999
|
|
55
|
+
}
|
|
56
|
+
export type ExtendedCompletionTriggerKind = CompletionTriggerKind | AdditionalCompletionTriggerKinds;
|
|
57
|
+
export type CompletionItemKindStrings = keyof typeof CompletionItemKind;
|
|
58
|
+
export type RecommendedLanguageIdentifier = keyof typeof Languages;
|
|
59
|
+
/**
|
|
60
|
+
* Language identifier for the LSP server, allowing any string but preferring
|
|
61
|
+
* the identifiers as recommended by the LSP documentation.
|
|
62
|
+
*/
|
|
63
|
+
export type LanguageIdentifier = RecommendedLanguageIdentifier | string;
|
|
64
|
+
/**
|
|
65
|
+
* Type represents a location inside a resource, such as a line
|
|
66
|
+
* inside a text file.
|
|
67
|
+
*/
|
|
68
|
+
export type AnyLocation = lsp.Location | lsp.Location[] | lsp.LocationLink[] | undefined | null;
|
|
69
|
+
/**
|
|
70
|
+
* Type represents the completion result.
|
|
71
|
+
*/
|
|
72
|
+
export type AnyCompletion = lsp.CompletionList | lsp.CompletionItem[];
|
|
73
|
+
/**
|
|
74
|
+
* The language identifier for LSP, with the preferred identifier as defined in the documentation
|
|
75
|
+
* see the table in https://microsoft.github.io/language-server-protocol/specification#textDocumentItem
|
|
76
|
+
*/
|
|
77
|
+
export declare const Languages: {
|
|
78
|
+
'git-commit': string;
|
|
79
|
+
'git-rebase': string;
|
|
80
|
+
'objective-c': string;
|
|
81
|
+
'objective-cpp': string;
|
|
82
|
+
abap: string;
|
|
83
|
+
bat: string;
|
|
84
|
+
bibtex: string;
|
|
85
|
+
clojure: string;
|
|
86
|
+
coffeescript: string;
|
|
87
|
+
c: string;
|
|
88
|
+
cpp: string;
|
|
89
|
+
csharp: string;
|
|
90
|
+
css: string;
|
|
91
|
+
diff: string;
|
|
92
|
+
dart: string;
|
|
93
|
+
dockerfile: string;
|
|
94
|
+
elixir: string;
|
|
95
|
+
erlang: string;
|
|
96
|
+
fsharp: string;
|
|
97
|
+
go: string;
|
|
98
|
+
groovy: string;
|
|
99
|
+
handlebars: string;
|
|
100
|
+
html: string;
|
|
101
|
+
ini: string;
|
|
102
|
+
java: string;
|
|
103
|
+
javascript: string;
|
|
104
|
+
javascriptreact: string;
|
|
105
|
+
json: string;
|
|
106
|
+
latex: string;
|
|
107
|
+
less: string;
|
|
108
|
+
lua: string;
|
|
109
|
+
makefile: string;
|
|
110
|
+
markdown: string;
|
|
111
|
+
perl: string;
|
|
112
|
+
perl6: string;
|
|
113
|
+
php: string;
|
|
114
|
+
powershell: string;
|
|
115
|
+
jade: string;
|
|
116
|
+
python: string;
|
|
117
|
+
r: string;
|
|
118
|
+
razor: string;
|
|
119
|
+
ruby: string;
|
|
120
|
+
rust: string;
|
|
121
|
+
scss: string;
|
|
122
|
+
sass: string;
|
|
123
|
+
scala: string;
|
|
124
|
+
shaderlab: string;
|
|
125
|
+
shellscript: string;
|
|
126
|
+
sql: string;
|
|
127
|
+
swift: string;
|
|
128
|
+
typescript: string;
|
|
129
|
+
typescriptreact: string;
|
|
130
|
+
tex: string;
|
|
131
|
+
vb: string;
|
|
132
|
+
xml: string;
|
|
133
|
+
xsl: string;
|
|
134
|
+
yaml: string;
|
|
135
|
+
};
|
|
136
|
+
//# sourceMappingURL=lsp.d.ts.map
|
package/es/lsp.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lsp.d.ts","sourceRoot":"","sources":["../src/lsp.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,GAAG,MAAM,gCAAgC,CAAC;AAE3D,MAAM,MAAM,kBAAkB,GAAG,GAAG,CAAC,kBAAkB,CAAC;AAExD,oBAAY,kBAAkB;IAC5B,KAAK,IAAI;IACT,OAAO,IAAI;IACX,WAAW,IAAI;IACf,IAAI,IAAI;CACT;AAED,oBAAY,aAAa;IACvB,WAAW,IAAI;IACf,UAAU,IAAI;CACf;AAED,oBAAY,iBAAiB;IAC3B,UAAU,IAAI;CACf;AAED,oBAAY,kBAAkB;IAC5B,IAAI,IAAI;IACR,MAAM,IAAI;IACV,QAAQ,IAAI;IACZ,WAAW,IAAI;IACf,KAAK,IAAI;IACT,QAAQ,IAAI;IACZ,KAAK,IAAI;IACT,SAAS,IAAI;IACb,MAAM,IAAI;IACV,QAAQ,KAAK;IACb,IAAI,KAAK;IACT,KAAK,KAAK;IACV,IAAI,KAAK;IACT,OAAO,KAAK;IACZ,OAAO,KAAK;IACZ,KAAK,KAAK;IACV,IAAI,KAAK;IACT,SAAS,KAAK;IACd,MAAM,KAAK;IACX,UAAU,KAAK;IACf,QAAQ,KAAK;IACb,MAAM,KAAK;IACX,KAAK,KAAK;IACV,QAAQ,KAAK;IACb,aAAa,KAAK;CACnB;AAED,oBAAY,qBAAqB;IAC/B,IAAI,IAAI;IACR,IAAI,IAAI;IACR,KAAK,IAAI;CACV;AAED,oBAAY,qBAAqB;IAC/B,OAAO,IAAI;IACX,gBAAgB,IAAI;IACpB,+BAA+B,IAAI;CACpC;AAED,oBAAY,gCAAgC;IAC1C,WAAW,OAAO;CACnB;AAED,MAAM,MAAM,6BAA6B,GACrC,qBAAqB,GACrB,gCAAgC,CAAC;AAErC,MAAM,MAAM,yBAAyB,GAAG,MAAM,OAAO,kBAAkB,CAAC;AAExE,MAAM,MAAM,6BAA6B,GAAG,MAAM,OAAO,SAAS,CAAC;AAEnE;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,6BAA6B,GAAG,MAAM,CAAC;AAExE;;;GAGG;AACH,MAAM,MAAM,WAAW,GACnB,GAAG,CAAC,QAAQ,GACZ,GAAG,CAAC,QAAQ,EAAE,GACd,GAAG,CAAC,YAAY,EAAE,GAClB,SAAS,GACT,IAAI,CAAC;AAET;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,GAAG,CAAC,cAAc,GAAG,GAAG,CAAC,cAAc,EAAE,CAAC;AAEtE;;;GAGG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0DrB,CAAC"}
|
package/es/lsp.js
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
// Copyright (c) Jupyter Development Team.
|
|
2
|
+
// Distributed under the terms of the Modified BSD License.
|
|
3
|
+
|
|
4
|
+
export var DiagnosticSeverity = /*#__PURE__*/function (DiagnosticSeverity) {
|
|
5
|
+
DiagnosticSeverity[DiagnosticSeverity["Error"] = 1] = "Error";
|
|
6
|
+
DiagnosticSeverity[DiagnosticSeverity["Warning"] = 2] = "Warning";
|
|
7
|
+
DiagnosticSeverity[DiagnosticSeverity["Information"] = 3] = "Information";
|
|
8
|
+
DiagnosticSeverity[DiagnosticSeverity["Hint"] = 4] = "Hint";
|
|
9
|
+
return DiagnosticSeverity;
|
|
10
|
+
}({});
|
|
11
|
+
export var DiagnosticTag = /*#__PURE__*/function (DiagnosticTag) {
|
|
12
|
+
DiagnosticTag[DiagnosticTag["Unnecessary"] = 1] = "Unnecessary";
|
|
13
|
+
DiagnosticTag[DiagnosticTag["Deprecated"] = 2] = "Deprecated";
|
|
14
|
+
return DiagnosticTag;
|
|
15
|
+
}({});
|
|
16
|
+
export var CompletionItemTag = /*#__PURE__*/function (CompletionItemTag) {
|
|
17
|
+
CompletionItemTag[CompletionItemTag["Deprecated"] = 1] = "Deprecated";
|
|
18
|
+
return CompletionItemTag;
|
|
19
|
+
}({});
|
|
20
|
+
export var CompletionItemKind = /*#__PURE__*/function (CompletionItemKind) {
|
|
21
|
+
CompletionItemKind[CompletionItemKind["Text"] = 1] = "Text";
|
|
22
|
+
CompletionItemKind[CompletionItemKind["Method"] = 2] = "Method";
|
|
23
|
+
CompletionItemKind[CompletionItemKind["Function"] = 3] = "Function";
|
|
24
|
+
CompletionItemKind[CompletionItemKind["Constructor"] = 4] = "Constructor";
|
|
25
|
+
CompletionItemKind[CompletionItemKind["Field"] = 5] = "Field";
|
|
26
|
+
CompletionItemKind[CompletionItemKind["Variable"] = 6] = "Variable";
|
|
27
|
+
CompletionItemKind[CompletionItemKind["Class"] = 7] = "Class";
|
|
28
|
+
CompletionItemKind[CompletionItemKind["Interface"] = 8] = "Interface";
|
|
29
|
+
CompletionItemKind[CompletionItemKind["Module"] = 9] = "Module";
|
|
30
|
+
CompletionItemKind[CompletionItemKind["Property"] = 10] = "Property";
|
|
31
|
+
CompletionItemKind[CompletionItemKind["Unit"] = 11] = "Unit";
|
|
32
|
+
CompletionItemKind[CompletionItemKind["Value"] = 12] = "Value";
|
|
33
|
+
CompletionItemKind[CompletionItemKind["Enum"] = 13] = "Enum";
|
|
34
|
+
CompletionItemKind[CompletionItemKind["Keyword"] = 14] = "Keyword";
|
|
35
|
+
CompletionItemKind[CompletionItemKind["Snippet"] = 15] = "Snippet";
|
|
36
|
+
CompletionItemKind[CompletionItemKind["Color"] = 16] = "Color";
|
|
37
|
+
CompletionItemKind[CompletionItemKind["File"] = 17] = "File";
|
|
38
|
+
CompletionItemKind[CompletionItemKind["Reference"] = 18] = "Reference";
|
|
39
|
+
CompletionItemKind[CompletionItemKind["Folder"] = 19] = "Folder";
|
|
40
|
+
CompletionItemKind[CompletionItemKind["EnumMember"] = 20] = "EnumMember";
|
|
41
|
+
CompletionItemKind[CompletionItemKind["Constant"] = 21] = "Constant";
|
|
42
|
+
CompletionItemKind[CompletionItemKind["Struct"] = 22] = "Struct";
|
|
43
|
+
CompletionItemKind[CompletionItemKind["Event"] = 23] = "Event";
|
|
44
|
+
CompletionItemKind[CompletionItemKind["Operator"] = 24] = "Operator";
|
|
45
|
+
CompletionItemKind[CompletionItemKind["TypeParameter"] = 25] = "TypeParameter";
|
|
46
|
+
return CompletionItemKind;
|
|
47
|
+
}({});
|
|
48
|
+
export var DocumentHighlightKind = /*#__PURE__*/function (DocumentHighlightKind) {
|
|
49
|
+
DocumentHighlightKind[DocumentHighlightKind["Text"] = 1] = "Text";
|
|
50
|
+
DocumentHighlightKind[DocumentHighlightKind["Read"] = 2] = "Read";
|
|
51
|
+
DocumentHighlightKind[DocumentHighlightKind["Write"] = 3] = "Write";
|
|
52
|
+
return DocumentHighlightKind;
|
|
53
|
+
}({});
|
|
54
|
+
export var CompletionTriggerKind = /*#__PURE__*/function (CompletionTriggerKind) {
|
|
55
|
+
CompletionTriggerKind[CompletionTriggerKind["Invoked"] = 1] = "Invoked";
|
|
56
|
+
CompletionTriggerKind[CompletionTriggerKind["TriggerCharacter"] = 2] = "TriggerCharacter";
|
|
57
|
+
CompletionTriggerKind[CompletionTriggerKind["TriggerForIncompleteCompletions"] = 3] = "TriggerForIncompleteCompletions";
|
|
58
|
+
return CompletionTriggerKind;
|
|
59
|
+
}({});
|
|
60
|
+
export var AdditionalCompletionTriggerKinds = /*#__PURE__*/function (AdditionalCompletionTriggerKinds) {
|
|
61
|
+
AdditionalCompletionTriggerKinds[AdditionalCompletionTriggerKinds["AutoInvoked"] = 9999] = "AutoInvoked";
|
|
62
|
+
return AdditionalCompletionTriggerKinds;
|
|
63
|
+
}({});
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Language identifier for the LSP server, allowing any string but preferring
|
|
67
|
+
* the identifiers as recommended by the LSP documentation.
|
|
68
|
+
*/
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Type represents a location inside a resource, such as a line
|
|
72
|
+
* inside a text file.
|
|
73
|
+
*/
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Type represents the completion result.
|
|
77
|
+
*/
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* The language identifier for LSP, with the preferred identifier as defined in the documentation
|
|
81
|
+
* see the table in https://microsoft.github.io/language-server-protocol/specification#textDocumentItem
|
|
82
|
+
*/
|
|
83
|
+
export var Languages = {
|
|
84
|
+
'git-commit': 'Git (commit)',
|
|
85
|
+
'git-rebase': 'Git (rebase)',
|
|
86
|
+
'objective-c': 'Objective-C',
|
|
87
|
+
'objective-cpp': 'Objective-C++',
|
|
88
|
+
abap: 'ABAP',
|
|
89
|
+
bat: 'Windows Bat',
|
|
90
|
+
bibtex: 'BibTeX',
|
|
91
|
+
clojure: 'Clojure',
|
|
92
|
+
coffeescript: 'Coffeescript',
|
|
93
|
+
c: 'C',
|
|
94
|
+
cpp: 'C++',
|
|
95
|
+
csharp: 'C#',
|
|
96
|
+
css: 'CSS',
|
|
97
|
+
diff: 'Diff',
|
|
98
|
+
dart: 'Dart',
|
|
99
|
+
dockerfile: 'Dockerfile',
|
|
100
|
+
elixir: 'Elixir',
|
|
101
|
+
erlang: 'Erlang',
|
|
102
|
+
fsharp: 'F#',
|
|
103
|
+
go: 'Go',
|
|
104
|
+
groovy: 'Groovy',
|
|
105
|
+
handlebars: 'Handlebars',
|
|
106
|
+
html: 'HTML',
|
|
107
|
+
ini: 'Ini',
|
|
108
|
+
java: 'Java',
|
|
109
|
+
javascript: 'JavaScript',
|
|
110
|
+
javascriptreact: 'JavaScript React',
|
|
111
|
+
json: 'JSON',
|
|
112
|
+
latex: 'LaTeX',
|
|
113
|
+
less: 'Less',
|
|
114
|
+
lua: 'Lua',
|
|
115
|
+
makefile: 'Makefile',
|
|
116
|
+
markdown: 'Markdown',
|
|
117
|
+
perl: 'Perl',
|
|
118
|
+
perl6: 'Perl 6',
|
|
119
|
+
php: 'PHP',
|
|
120
|
+
powershell: 'Powershell',
|
|
121
|
+
jade: 'Pug',
|
|
122
|
+
python: 'Python',
|
|
123
|
+
r: 'R',
|
|
124
|
+
razor: 'Razor (cshtml)',
|
|
125
|
+
ruby: 'Ruby',
|
|
126
|
+
rust: 'Rust',
|
|
127
|
+
scss: 'SCSS (syntax using curly brackets)',
|
|
128
|
+
sass: 'SCSS (indented syntax)',
|
|
129
|
+
scala: 'Scala',
|
|
130
|
+
shaderlab: 'ShaderLab',
|
|
131
|
+
shellscript: 'Shell Script (Bash)',
|
|
132
|
+
sql: 'SQL',
|
|
133
|
+
swift: 'Swift',
|
|
134
|
+
typescript: 'TypeScript',
|
|
135
|
+
typescriptreact: 'TypeScript React',
|
|
136
|
+
tex: 'TeX',
|
|
137
|
+
vb: 'Visual Basic',
|
|
138
|
+
xml: 'XML',
|
|
139
|
+
xsl: 'XSL',
|
|
140
|
+
yaml: 'YAML'
|
|
141
|
+
};
|
package/es/manager.d.ts
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import type { ISettings } from '@difizen/libro-kernel';
|
|
2
|
+
import { ServerConnection, ServerManager } from '@difizen/libro-kernel';
|
|
3
|
+
import type { Event } from '@difizen/mana-app';
|
|
4
|
+
import { Deferred, Emitter } from '@difizen/mana-app';
|
|
5
|
+
import type { ServerSpecProperties } from './schema.js';
|
|
6
|
+
import { ILanguageServerManagerOptions } from './tokens.js';
|
|
7
|
+
import type { IGetServerIdOptions, ILanguageServerManager, TLanguageServerConfigurations, TLanguageServerId, TSessionMap, TSpecsMap } from './tokens.js';
|
|
8
|
+
export declare class LanguageServerManager implements ILanguageServerManager {
|
|
9
|
+
serverConnection: ServerConnection;
|
|
10
|
+
serverManager: ServerManager;
|
|
11
|
+
constructor(options: ILanguageServerManagerOptions);
|
|
12
|
+
init(): void;
|
|
13
|
+
/**
|
|
14
|
+
* Check if the manager is enabled or disabled
|
|
15
|
+
*/
|
|
16
|
+
get isEnabled(): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Check if the manager is disposed.
|
|
19
|
+
*/
|
|
20
|
+
get isDisposed(): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Get the language server specs.
|
|
23
|
+
*/
|
|
24
|
+
get specs(): TSpecsMap;
|
|
25
|
+
/**
|
|
26
|
+
* Get the status end point.
|
|
27
|
+
*/
|
|
28
|
+
get statusUrl(): string;
|
|
29
|
+
/**
|
|
30
|
+
* Signal emitted when a language server session is changed
|
|
31
|
+
*/
|
|
32
|
+
get sessionsChanged(): Event<void>;
|
|
33
|
+
/**
|
|
34
|
+
* Get the map of language server sessions.
|
|
35
|
+
*/
|
|
36
|
+
get sessions(): TSessionMap;
|
|
37
|
+
/**
|
|
38
|
+
* A promise resolved when this server manager is ready.
|
|
39
|
+
*/
|
|
40
|
+
get ready(): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* Get the status code of server's responses.
|
|
43
|
+
*/
|
|
44
|
+
get statusCode(): number;
|
|
45
|
+
/**
|
|
46
|
+
* Enable the language server services
|
|
47
|
+
*/
|
|
48
|
+
enable(): Promise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* Disable the language server services
|
|
51
|
+
*/
|
|
52
|
+
disable(): void;
|
|
53
|
+
/**
|
|
54
|
+
* Dispose the manager.
|
|
55
|
+
*/
|
|
56
|
+
dispose(): void;
|
|
57
|
+
/**
|
|
58
|
+
* Update the language server configuration.
|
|
59
|
+
*/
|
|
60
|
+
setConfiguration(configuration: TLanguageServerConfigurations): void;
|
|
61
|
+
/**
|
|
62
|
+
* Get matching language server for input language option.
|
|
63
|
+
*
|
|
64
|
+
* modify lsp server rank on ~/.jupyter/lab/user-settings/@jupyterlab/lsp-extension
|
|
65
|
+
*/
|
|
66
|
+
getMatchingServers(options: IGetServerIdOptions): TLanguageServerId[];
|
|
67
|
+
/**
|
|
68
|
+
* Get matching language server spec for input language option.
|
|
69
|
+
*/
|
|
70
|
+
getMatchingSpecs(options: IGetServerIdOptions): TSpecsMap;
|
|
71
|
+
/**
|
|
72
|
+
* Fetch the server session list from the status endpoint. The server
|
|
73
|
+
* manager is ready once this method finishes.
|
|
74
|
+
*/
|
|
75
|
+
fetchSessions(): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* Version number of sever session.
|
|
78
|
+
*/
|
|
79
|
+
protected version: number;
|
|
80
|
+
/**
|
|
81
|
+
* Check if input language option maths the language server spec.
|
|
82
|
+
*/
|
|
83
|
+
protected isMatchingSpec(options: IGetServerIdOptions, spec: ServerSpecProperties): boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Helper function to warn a message only once.
|
|
86
|
+
*/
|
|
87
|
+
protected warnOnce(arg: string): void;
|
|
88
|
+
/**
|
|
89
|
+
* Compare the rank of two servers with the same language.
|
|
90
|
+
*/
|
|
91
|
+
protected compareRanks(a: TLanguageServerId, b: TLanguageServerId): number;
|
|
92
|
+
/**
|
|
93
|
+
* map of language server sessions.
|
|
94
|
+
*/
|
|
95
|
+
protected _sessions: TSessionMap;
|
|
96
|
+
/**
|
|
97
|
+
* Map of language server specs.
|
|
98
|
+
*/
|
|
99
|
+
protected _specs: TSpecsMap;
|
|
100
|
+
/**
|
|
101
|
+
* Server connection setting.
|
|
102
|
+
*/
|
|
103
|
+
protected _settings: ISettings;
|
|
104
|
+
/**
|
|
105
|
+
* Base URL to connect to the language server handler.
|
|
106
|
+
*/
|
|
107
|
+
protected _baseUrl: string;
|
|
108
|
+
/**
|
|
109
|
+
* Status code of server response
|
|
110
|
+
*/
|
|
111
|
+
protected _statusCode: number;
|
|
112
|
+
/**
|
|
113
|
+
* Number of connection retry, default to 2.
|
|
114
|
+
*/
|
|
115
|
+
protected _retries: number;
|
|
116
|
+
/**
|
|
117
|
+
* Interval between each retry, default to 10s.
|
|
118
|
+
*/
|
|
119
|
+
protected _retriesInterval: number;
|
|
120
|
+
/**
|
|
121
|
+
* Language server configuration.
|
|
122
|
+
*/
|
|
123
|
+
protected _configuration: TLanguageServerConfigurations;
|
|
124
|
+
/**
|
|
125
|
+
* Set of emitted warning message, message in this set will not be warned again.
|
|
126
|
+
*/
|
|
127
|
+
protected _warningsEmitted: Set<string>;
|
|
128
|
+
/**
|
|
129
|
+
* A promise resolved when this server manager is ready.
|
|
130
|
+
*/
|
|
131
|
+
protected _ready: Deferred<void>;
|
|
132
|
+
/**
|
|
133
|
+
* Signal emitted when a language server session is changed
|
|
134
|
+
*/
|
|
135
|
+
protected _sessionsChanged: Emitter<void>;
|
|
136
|
+
protected _isDisposed: boolean;
|
|
137
|
+
/**
|
|
138
|
+
* Check if the manager is enabled or disabled
|
|
139
|
+
*/
|
|
140
|
+
protected _enabled: boolean;
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../src/manager.ts"],"names":[],"mappings":"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"}
|