.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-eslint / lib / server.js
1 var __create = Object.create;
2 var __defProp = Object.defineProperty;
3 var __getProtoOf = Object.getPrototypeOf;
4 var __hasOwnProp = Object.prototype.hasOwnProperty;
5 var __getOwnPropNames = Object.getOwnPropertyNames;
6 var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7 var __markAsModule = (target) => __defProp(target, "__esModule", {value: true});
8 var __commonJS = (callback, module2) => () => {
9   if (!module2) {
10     module2 = {exports: {}};
11     callback(module2.exports, module2);
12   }
13   return module2.exports;
14 };
15 var __export = (target, all) => {
16   __markAsModule(target);
17   for (var name in all)
18     __defProp(target, name, {get: all[name], enumerable: true});
19 };
20 var __exportStar = (target, module2, desc) => {
21   __markAsModule(target);
22   if (module2 && typeof module2 === "object" || typeof module2 === "function") {
23     for (let key of __getOwnPropNames(module2))
24       if (!__hasOwnProp.call(target, key) && key !== "default")
25         __defProp(target, key, {get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable});
26   }
27   return target;
28 };
29 var __toModule = (module2) => {
30   if (module2 && module2.__esModule)
31     return module2;
32   return __exportStar(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", {value: module2, enumerable: true}), module2);
33 };
34
35 // node_modules/vscode-languageserver/lib/common/utils/is.js
36 var require_is = __commonJS((exports2) => {
37   "use strict";
38   Object.defineProperty(exports2, "__esModule", {value: true});
39   exports2.thenable = exports2.typedArray = exports2.stringArray = exports2.array = exports2.func = exports2.error = exports2.number = exports2.string = exports2.boolean = void 0;
40   function boolean(value) {
41     return value === true || value === false;
42   }
43   exports2.boolean = boolean;
44   function string(value) {
45     return typeof value === "string" || value instanceof String;
46   }
47   exports2.string = string;
48   function number(value) {
49     return typeof value === "number" || value instanceof Number;
50   }
51   exports2.number = number;
52   function error(value) {
53     return value instanceof Error;
54   }
55   exports2.error = error;
56   function func(value) {
57     return typeof value === "function";
58   }
59   exports2.func = func;
60   function array(value) {
61     return Array.isArray(value);
62   }
63   exports2.array = array;
64   function stringArray(value) {
65     return array(value) && value.every((elem) => string(elem));
66   }
67   exports2.stringArray = stringArray;
68   function typedArray(value, check) {
69     return Array.isArray(value) && value.every(check);
70   }
71   exports2.typedArray = typedArray;
72   function thenable(value) {
73     return value && func(value.then);
74   }
75   exports2.thenable = thenable;
76 });
77
78 // node_modules/vscode-languageserver/node_modules/vscode-jsonrpc/lib/common/ral.js
79 var require_ral = __commonJS((exports2) => {
80   "use strict";
81   Object.defineProperty(exports2, "__esModule", {value: true});
82   var _ral;
83   function RAL() {
84     if (_ral === void 0) {
85       throw new Error(`No runtime abstraction layer installed`);
86     }
87     return _ral;
88   }
89   (function(RAL2) {
90     function install(ral) {
91       if (ral === void 0) {
92         throw new Error(`No runtime abstraction layer provided`);
93       }
94       _ral = ral;
95     }
96     RAL2.install = install;
97   })(RAL || (RAL = {}));
98   exports2.default = RAL;
99 });
100
101 // node_modules/vscode-languageserver/node_modules/vscode-jsonrpc/lib/common/disposable.js
102 var require_disposable = __commonJS((exports2) => {
103   "use strict";
104   Object.defineProperty(exports2, "__esModule", {value: true});
105   exports2.Disposable = void 0;
106   var Disposable;
107   (function(Disposable2) {
108     function create(func) {
109       return {
110         dispose: func
111       };
112     }
113     Disposable2.create = create;
114   })(Disposable = exports2.Disposable || (exports2.Disposable = {}));
115 });
116
117 // node_modules/vscode-languageserver/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js
118 var require_messageBuffer = __commonJS((exports2) => {
119   "use strict";
120   Object.defineProperty(exports2, "__esModule", {value: true});
121   exports2.AbstractMessageBuffer = void 0;
122   var CR = 13;
123   var LF = 10;
124   var CRLF = "\r\n";
125   var AbstractMessageBuffer = class {
126     constructor(encoding = "utf-8") {
127       this._encoding = encoding;
128       this._chunks = [];
129       this._totalLength = 0;
130     }
131     get encoding() {
132       return this._encoding;
133     }
134     append(chunk) {
135       const toAppend = typeof chunk === "string" ? this.fromString(chunk, this._encoding) : chunk;
136       this._chunks.push(toAppend);
137       this._totalLength += toAppend.byteLength;
138     }
139     tryReadHeaders() {
140       if (this._chunks.length === 0) {
141         return void 0;
142       }
143       let state = 0;
144       let chunkIndex = 0;
145       let offset = 0;
146       let chunkBytesRead = 0;
147       row:
148         while (chunkIndex < this._chunks.length) {
149           const chunk = this._chunks[chunkIndex];
150           offset = 0;
151           column:
152             while (offset < chunk.length) {
153               const value = chunk[offset];
154               switch (value) {
155                 case CR:
156                   switch (state) {
157                     case 0:
158                       state = 1;
159                       break;
160                     case 2:
161                       state = 3;
162                       break;
163                     default:
164                       state = 0;
165                   }
166                   break;
167                 case LF:
168                   switch (state) {
169                     case 1:
170                       state = 2;
171                       break;
172                     case 3:
173                       state = 4;
174                       offset++;
175                       break row;
176                     default:
177                       state = 0;
178                   }
179                   break;
180                 default:
181                   state = 0;
182               }
183               offset++;
184             }
185           chunkBytesRead += chunk.byteLength;
186           chunkIndex++;
187         }
188       if (state !== 4) {
189         return void 0;
190       }
191       const buffer = this._read(chunkBytesRead + offset);
192       const result = new Map();
193       const headers = this.toString(buffer, "ascii").split(CRLF);
194       if (headers.length < 2) {
195         return result;
196       }
197       for (let i = 0; i < headers.length - 2; i++) {
198         const header = headers[i];
199         const index = header.indexOf(":");
200         if (index === -1) {
201           throw new Error("Message header must separate key and value using :");
202         }
203         const key = header.substr(0, index);
204         const value = header.substr(index + 1).trim();
205         result.set(key, value);
206       }
207       return result;
208     }
209     tryReadBody(length) {
210       if (this._totalLength < length) {
211         return void 0;
212       }
213       return this._read(length);
214     }
215     get numberOfBytes() {
216       return this._totalLength;
217     }
218     _read(byteCount) {
219       if (byteCount === 0) {
220         return this.emptyBuffer();
221       }
222       if (byteCount > this._totalLength) {
223         throw new Error(`Cannot read so many bytes!`);
224       }
225       if (this._chunks[0].byteLength === byteCount) {
226         const chunk = this._chunks[0];
227         this._chunks.shift();
228         this._totalLength -= byteCount;
229         return this.asNative(chunk);
230       }
231       if (this._chunks[0].byteLength > byteCount) {
232         const chunk = this._chunks[0];
233         const result2 = this.asNative(chunk, byteCount);
234         this._chunks[0] = chunk.slice(byteCount);
235         this._totalLength -= byteCount;
236         return result2;
237       }
238       const result = this.allocNative(byteCount);
239       let resultOffset = 0;
240       let chunkIndex = 0;
241       while (byteCount > 0) {
242         const chunk = this._chunks[chunkIndex];
243         if (chunk.byteLength > byteCount) {
244           const chunkPart = chunk.slice(0, byteCount);
245           result.set(chunkPart, resultOffset);
246           resultOffset += byteCount;
247           this._chunks[chunkIndex] = chunk.slice(byteCount);
248           this._totalLength -= byteCount;
249           byteCount -= byteCount;
250         } else {
251           result.set(chunk, resultOffset);
252           resultOffset += chunk.byteLength;
253           this._chunks.shift();
254           this._totalLength -= chunk.byteLength;
255           byteCount -= chunk.byteLength;
256         }
257       }
258       return result;
259     }
260   };
261   exports2.AbstractMessageBuffer = AbstractMessageBuffer;
262 });
263
264 // node_modules/vscode-languageserver/node_modules/vscode-jsonrpc/lib/node/ril.js
265 var require_ril = __commonJS((exports2) => {
266   "use strict";
267   Object.defineProperty(exports2, "__esModule", {value: true});
268   var ral_1 = require_ral();
269   var util_1 = require("util");
270   var disposable_1 = require_disposable();
271   var messageBuffer_1 = require_messageBuffer();
272   var MessageBuffer = class extends messageBuffer_1.AbstractMessageBuffer {
273     constructor(encoding = "utf-8") {
274       super(encoding);
275     }
276     emptyBuffer() {
277       return MessageBuffer.emptyBuffer;
278     }
279     fromString(value, encoding) {
280       return Buffer.from(value, encoding);
281     }
282     toString(value, encoding) {
283       if (value instanceof Buffer) {
284         return value.toString(encoding);
285       } else {
286         return new util_1.TextDecoder(encoding).decode(value);
287       }
288     }
289     asNative(buffer, length) {
290       if (length === void 0) {
291         return buffer instanceof Buffer ? buffer : Buffer.from(buffer);
292       } else {
293         return buffer instanceof Buffer ? buffer.slice(0, length) : Buffer.from(buffer, 0, length);
294       }
295     }
296     allocNative(length) {
297       return Buffer.allocUnsafe(length);
298     }
299   };
300   MessageBuffer.emptyBuffer = Buffer.allocUnsafe(0);
301   var ReadableStreamWrapper = class {
302     constructor(stream) {
303       this.stream = stream;
304     }
305     onClose(listener) {
306       this.stream.on("close", listener);
307       return disposable_1.Disposable.create(() => this.stream.off("close", listener));
308     }
309     onError(listener) {
310       this.stream.on("error", listener);
311       return disposable_1.Disposable.create(() => this.stream.off("error", listener));
312     }
313     onEnd(listener) {
314       this.stream.on("end", listener);
315       return disposable_1.Disposable.create(() => this.stream.off("end", listener));
316     }
317     onData(listener) {
318       this.stream.on("data", listener);
319       return disposable_1.Disposable.create(() => this.stream.off("data", listener));
320     }
321   };
322   var WritableStreamWrapper = class {
323     constructor(stream) {
324       this.stream = stream;
325     }
326     onClose(listener) {
327       this.stream.on("close", listener);
328       return disposable_1.Disposable.create(() => this.stream.off("close", listener));
329     }
330     onError(listener) {
331       this.stream.on("error", listener);
332       return disposable_1.Disposable.create(() => this.stream.off("error", listener));
333     }
334     onEnd(listener) {
335       this.stream.on("end", listener);
336       return disposable_1.Disposable.create(() => this.stream.off("end", listener));
337     }
338     write(data, encoding) {
339       return new Promise((resolve, reject) => {
340         const callback = (error) => {
341           if (error === void 0 || error === null) {
342             resolve();
343           } else {
344             reject(error);
345           }
346         };
347         if (typeof data === "string") {
348           this.stream.write(data, encoding, callback);
349         } else {
350           this.stream.write(data, callback);
351         }
352       });
353     }
354     end() {
355       this.stream.end();
356     }
357   };
358   var _ril = Object.freeze({
359     messageBuffer: Object.freeze({
360       create: (encoding) => new MessageBuffer(encoding)
361     }),
362     applicationJson: Object.freeze({
363       encoder: Object.freeze({
364         name: "application/json",
365         encode: (msg, options) => {
366           try {
367             return Promise.resolve(Buffer.from(JSON.stringify(msg, void 0, 0), options.charset));
368           } catch (err) {
369             return Promise.reject(err);
370           }
371         }
372       }),
373       decoder: Object.freeze({
374         name: "application/json",
375         decode: (buffer, options) => {
376           try {
377             if (buffer instanceof Buffer) {
378               return Promise.resolve(JSON.parse(buffer.toString(options.charset)));
379             } else {
380               return Promise.resolve(JSON.parse(new util_1.TextDecoder(options.charset).decode(buffer)));
381             }
382           } catch (err) {
383             return Promise.reject(err);
384           }
385         }
386       })
387     }),
388     stream: Object.freeze({
389       asReadableStream: (stream) => new ReadableStreamWrapper(stream),
390       asWritableStream: (stream) => new WritableStreamWrapper(stream)
391     }),
392     console,
393     timer: Object.freeze({
394       setTimeout(callback, ms, ...args) {
395         return setTimeout(callback, ms, ...args);
396       },
397       clearTimeout(handle) {
398         clearTimeout(handle);
399       },
400       setImmediate(callback, ...args) {
401         return setImmediate(callback, ...args);
402       },
403       clearImmediate(handle) {
404         clearImmediate(handle);
405       }
406     })
407   });
408   function RIL() {
409     return _ril;
410   }
411   (function(RIL2) {
412     function install() {
413       ral_1.default.install(_ril);
414     }
415     RIL2.install = install;
416   })(RIL || (RIL = {}));
417   exports2.default = RIL;
418 });
419
420 // node_modules/vscode-languageserver/node_modules/vscode-jsonrpc/lib/common/is.js
421 var require_is2 = __commonJS((exports2) => {
422   "use strict";
423   Object.defineProperty(exports2, "__esModule", {value: true});
424   exports2.stringArray = exports2.array = exports2.func = exports2.error = exports2.number = exports2.string = exports2.boolean = void 0;
425   function boolean(value) {
426     return value === true || value === false;
427   }
428   exports2.boolean = boolean;
429   function string(value) {
430     return typeof value === "string" || value instanceof String;
431   }
432   exports2.string = string;
433   function number(value) {
434     return typeof value === "number" || value instanceof Number;
435   }
436   exports2.number = number;
437   function error(value) {
438     return value instanceof Error;
439   }
440   exports2.error = error;
441   function func(value) {
442     return typeof value === "function";
443   }
444   exports2.func = func;
445   function array(value) {
446     return Array.isArray(value);
447   }
448   exports2.array = array;
449   function stringArray(value) {
450     return array(value) && value.every((elem) => string(elem));
451   }
452   exports2.stringArray = stringArray;
453 });
454
455 // node_modules/vscode-languageserver/node_modules/vscode-jsonrpc/lib/common/messages.js
456 var require_messages = __commonJS((exports2) => {
457   "use strict";
458   Object.defineProperty(exports2, "__esModule", {value: true});
459   exports2.isResponseMessage = exports2.isNotificationMessage = exports2.isRequestMessage = exports2.NotificationType9 = exports2.NotificationType8 = exports2.NotificationType7 = exports2.NotificationType6 = exports2.NotificationType5 = exports2.NotificationType4 = exports2.NotificationType3 = exports2.NotificationType2 = exports2.NotificationType1 = exports2.NotificationType0 = exports2.NotificationType = exports2.RequestType9 = exports2.RequestType8 = exports2.RequestType7 = exports2.RequestType6 = exports2.RequestType5 = exports2.RequestType4 = exports2.RequestType3 = exports2.RequestType2 = exports2.RequestType1 = exports2.RequestType = exports2.RequestType0 = exports2.AbstractMessageSignature = exports2.ParameterStructures = exports2.ResponseError = exports2.ErrorCodes = void 0;
460   var is = require_is2();
461   var ErrorCodes;
462   (function(ErrorCodes2) {
463     ErrorCodes2.ParseError = -32700;
464     ErrorCodes2.InvalidRequest = -32600;
465     ErrorCodes2.MethodNotFound = -32601;
466     ErrorCodes2.InvalidParams = -32602;
467     ErrorCodes2.InternalError = -32603;
468     ErrorCodes2.jsonrpcReservedErrorRangeStart = -32099;
469     ErrorCodes2.serverErrorStart = ErrorCodes2.jsonrpcReservedErrorRangeStart;
470     ErrorCodes2.MessageWriteError = -32099;
471     ErrorCodes2.MessageReadError = -32098;
472     ErrorCodes2.ServerNotInitialized = -32002;
473     ErrorCodes2.UnknownErrorCode = -32001;
474     ErrorCodes2.jsonrpcReservedErrorRangeEnd = -32e3;
475     ErrorCodes2.serverErrorEnd = ErrorCodes2.jsonrpcReservedErrorRangeEnd;
476   })(ErrorCodes = exports2.ErrorCodes || (exports2.ErrorCodes = {}));
477   var ResponseError = class extends Error {
478     constructor(code, message, data) {
479       super(message);
480       this.code = is.number(code) ? code : ErrorCodes.UnknownErrorCode;
481       this.data = data;
482       Object.setPrototypeOf(this, ResponseError.prototype);
483     }
484     toJson() {
485       return {
486         code: this.code,
487         message: this.message,
488         data: this.data
489       };
490     }
491   };
492   exports2.ResponseError = ResponseError;
493   var ParameterStructures = class {
494     constructor(kind) {
495       this.kind = kind;
496     }
497     static is(value) {
498       return value === ParameterStructures.auto || value === ParameterStructures.byName || value === ParameterStructures.byPosition;
499     }
500     toString() {
501       return this.kind;
502     }
503   };
504   exports2.ParameterStructures = ParameterStructures;
505   ParameterStructures.auto = new ParameterStructures("auto");
506   ParameterStructures.byPosition = new ParameterStructures("byPosition");
507   ParameterStructures.byName = new ParameterStructures("byName");
508   var AbstractMessageSignature = class {
509     constructor(method, numberOfParams) {
510       this.method = method;
511       this.numberOfParams = numberOfParams;
512     }
513     get parameterStructures() {
514       return ParameterStructures.auto;
515     }
516   };
517   exports2.AbstractMessageSignature = AbstractMessageSignature;
518   var RequestType0 = class extends AbstractMessageSignature {
519     constructor(method) {
520       super(method, 0);
521     }
522   };
523   exports2.RequestType0 = RequestType0;
524   var RequestType = class extends AbstractMessageSignature {
525     constructor(method, _parameterStructures = ParameterStructures.auto) {
526       super(method, 1);
527       this._parameterStructures = _parameterStructures;
528     }
529     get parameterStructures() {
530       return this._parameterStructures;
531     }
532   };
533   exports2.RequestType = RequestType;
534   var RequestType1 = class extends AbstractMessageSignature {
535     constructor(method, _parameterStructures = ParameterStructures.auto) {
536       super(method, 1);
537       this._parameterStructures = _parameterStructures;
538     }
539     get parameterStructures() {
540       return this._parameterStructures;
541     }
542   };
543   exports2.RequestType1 = RequestType1;
544   var RequestType2 = class extends AbstractMessageSignature {
545     constructor(method) {
546       super(method, 2);
547     }
548   };
549   exports2.RequestType2 = RequestType2;
550   var RequestType3 = class extends AbstractMessageSignature {
551     constructor(method) {
552       super(method, 3);
553     }
554   };
555   exports2.RequestType3 = RequestType3;
556   var RequestType4 = class extends AbstractMessageSignature {
557     constructor(method) {
558       super(method, 4);
559     }
560   };
561   exports2.RequestType4 = RequestType4;
562   var RequestType5 = class extends AbstractMessageSignature {
563     constructor(method) {
564       super(method, 5);
565     }
566   };
567   exports2.RequestType5 = RequestType5;
568   var RequestType6 = class extends AbstractMessageSignature {
569     constructor(method) {
570       super(method, 6);
571     }
572   };
573   exports2.RequestType6 = RequestType6;
574   var RequestType7 = class extends AbstractMessageSignature {
575     constructor(method) {
576       super(method, 7);
577     }
578   };
579   exports2.RequestType7 = RequestType7;
580   var RequestType8 = class extends AbstractMessageSignature {
581     constructor(method) {
582       super(method, 8);
583     }
584   };
585   exports2.RequestType8 = RequestType8;
586   var RequestType9 = class extends AbstractMessageSignature {
587     constructor(method) {
588       super(method, 9);
589     }
590   };
591   exports2.RequestType9 = RequestType9;
592   var NotificationType = class extends AbstractMessageSignature {
593     constructor(method, _parameterStructures = ParameterStructures.auto) {
594       super(method, 1);
595       this._parameterStructures = _parameterStructures;
596     }
597     get parameterStructures() {
598       return this._parameterStructures;
599     }
600   };
601   exports2.NotificationType = NotificationType;
602   var NotificationType0 = class extends AbstractMessageSignature {
603     constructor(method) {
604       super(method, 0);
605     }
606   };
607   exports2.NotificationType0 = NotificationType0;
608   var NotificationType1 = class extends AbstractMessageSignature {
609     constructor(method, _parameterStructures = ParameterStructures.auto) {
610       super(method, 1);
611       this._parameterStructures = _parameterStructures;
612     }
613     get parameterStructures() {
614       return this._parameterStructures;
615     }
616   };
617   exports2.NotificationType1 = NotificationType1;
618   var NotificationType2 = class extends AbstractMessageSignature {
619     constructor(method) {
620       super(method, 2);
621     }
622   };
623   exports2.NotificationType2 = NotificationType2;
624   var NotificationType3 = class extends AbstractMessageSignature {
625     constructor(method) {
626       super(method, 3);
627     }
628   };
629   exports2.NotificationType3 = NotificationType3;
630   var NotificationType4 = class extends AbstractMessageSignature {
631     constructor(method) {
632       super(method, 4);
633     }
634   };
635   exports2.NotificationType4 = NotificationType4;
636   var NotificationType5 = class extends AbstractMessageSignature {
637     constructor(method) {
638       super(method, 5);
639     }
640   };
641   exports2.NotificationType5 = NotificationType5;
642   var NotificationType6 = class extends AbstractMessageSignature {
643     constructor(method) {
644       super(method, 6);
645     }
646   };
647   exports2.NotificationType6 = NotificationType6;
648   var NotificationType7 = class extends AbstractMessageSignature {
649     constructor(method) {
650       super(method, 7);
651     }
652   };
653   exports2.NotificationType7 = NotificationType7;
654   var NotificationType8 = class extends AbstractMessageSignature {
655     constructor(method) {
656       super(method, 8);
657     }
658   };
659   exports2.NotificationType8 = NotificationType8;
660   var NotificationType9 = class extends AbstractMessageSignature {
661     constructor(method) {
662       super(method, 9);
663     }
664   };
665   exports2.NotificationType9 = NotificationType9;
666   function isRequestMessage(message) {
667     const candidate = message;
668     return candidate && is.string(candidate.method) && (is.string(candidate.id) || is.number(candidate.id));
669   }
670   exports2.isRequestMessage = isRequestMessage;
671   function isNotificationMessage(message) {
672     const candidate = message;
673     return candidate && is.string(candidate.method) && message.id === void 0;
674   }
675   exports2.isNotificationMessage = isNotificationMessage;
676   function isResponseMessage(message) {
677     const candidate = message;
678     return candidate && (candidate.result !== void 0 || !!candidate.error) && (is.string(candidate.id) || is.number(candidate.id) || candidate.id === null);
679   }
680   exports2.isResponseMessage = isResponseMessage;
681 });
682
683 // node_modules/vscode-languageserver/node_modules/vscode-jsonrpc/lib/common/events.js
684 var require_events = __commonJS((exports2) => {
685   "use strict";
686   Object.defineProperty(exports2, "__esModule", {value: true});
687   exports2.Emitter = exports2.Event = void 0;
688   var ral_1 = require_ral();
689   var Event;
690   (function(Event2) {
691     const _disposable = {dispose() {
692     }};
693     Event2.None = function() {
694       return _disposable;
695     };
696   })(Event = exports2.Event || (exports2.Event = {}));
697   var CallbackList = class {
698     add(callback, context = null, bucket) {
699       if (!this._callbacks) {
700         this._callbacks = [];
701         this._contexts = [];
702       }
703       this._callbacks.push(callback);
704       this._contexts.push(context);
705       if (Array.isArray(bucket)) {
706         bucket.push({dispose: () => this.remove(callback, context)});
707       }
708     }
709     remove(callback, context = null) {
710       if (!this._callbacks) {
711         return;
712       }
713       let foundCallbackWithDifferentContext = false;
714       for (let i = 0, len = this._callbacks.length; i < len; i++) {
715         if (this._callbacks[i] === callback) {
716           if (this._contexts[i] === context) {
717             this._callbacks.splice(i, 1);
718             this._contexts.splice(i, 1);
719             return;
720           } else {
721             foundCallbackWithDifferentContext = true;
722           }
723         }
724       }
725       if (foundCallbackWithDifferentContext) {
726         throw new Error("When adding a listener with a context, you should remove it with the same context");
727       }
728     }
729     invoke(...args) {
730       if (!this._callbacks) {
731         return [];
732       }
733       const ret = [], callbacks = this._callbacks.slice(0), contexts = this._contexts.slice(0);
734       for (let i = 0, len = callbacks.length; i < len; i++) {
735         try {
736           ret.push(callbacks[i].apply(contexts[i], args));
737         } catch (e) {
738           ral_1.default().console.error(e);
739         }
740       }
741       return ret;
742     }
743     isEmpty() {
744       return !this._callbacks || this._callbacks.length === 0;
745     }
746     dispose() {
747       this._callbacks = void 0;
748       this._contexts = void 0;
749     }
750   };
751   var Emitter = class {
752     constructor(_options) {
753       this._options = _options;
754     }
755     get event() {
756       if (!this._event) {
757         this._event = (listener, thisArgs, disposables) => {
758           if (!this._callbacks) {
759             this._callbacks = new CallbackList();
760           }
761           if (this._options && this._options.onFirstListenerAdd && this._callbacks.isEmpty()) {
762             this._options.onFirstListenerAdd(this);
763           }
764           this._callbacks.add(listener, thisArgs);
765           const result = {
766             dispose: () => {
767               if (!this._callbacks) {
768                 return;
769               }
770               this._callbacks.remove(listener, thisArgs);
771               result.dispose = Emitter._noop;
772               if (this._options && this._options.onLastListenerRemove && this._callbacks.isEmpty()) {
773                 this._options.onLastListenerRemove(this);
774               }
775             }
776           };
777           if (Array.isArray(disposables)) {
778             disposables.push(result);
779           }
780           return result;
781         };
782       }
783       return this._event;
784     }
785     fire(event) {
786       if (this._callbacks) {
787         this._callbacks.invoke.call(this._callbacks, event);
788       }
789     }
790     dispose() {
791       if (this._callbacks) {
792         this._callbacks.dispose();
793         this._callbacks = void 0;
794       }
795     }
796   };
797   exports2.Emitter = Emitter;
798   Emitter._noop = function() {
799   };
800 });
801
802 // node_modules/vscode-languageserver/node_modules/vscode-jsonrpc/lib/common/cancellation.js
803 var require_cancellation = __commonJS((exports2) => {
804   "use strict";
805   Object.defineProperty(exports2, "__esModule", {value: true});
806   exports2.CancellationTokenSource = exports2.CancellationToken = void 0;
807   var ral_1 = require_ral();
808   var Is = require_is2();
809   var events_1 = require_events();
810   var CancellationToken;
811   (function(CancellationToken2) {
812     CancellationToken2.None = Object.freeze({
813       isCancellationRequested: false,
814       onCancellationRequested: events_1.Event.None
815     });
816     CancellationToken2.Cancelled = Object.freeze({
817       isCancellationRequested: true,
818       onCancellationRequested: events_1.Event.None
819     });
820     function is(value) {
821       const candidate = value;
822       return candidate && (candidate === CancellationToken2.None || candidate === CancellationToken2.Cancelled || Is.boolean(candidate.isCancellationRequested) && !!candidate.onCancellationRequested);
823     }
824     CancellationToken2.is = is;
825   })(CancellationToken = exports2.CancellationToken || (exports2.CancellationToken = {}));
826   var shortcutEvent = Object.freeze(function(callback, context) {
827     const handle = ral_1.default().timer.setTimeout(callback.bind(context), 0);
828     return {dispose() {
829       ral_1.default().timer.clearTimeout(handle);
830     }};
831   });
832   var MutableToken = class {
833     constructor() {
834       this._isCancelled = false;
835     }
836     cancel() {
837       if (!this._isCancelled) {
838         this._isCancelled = true;
839         if (this._emitter) {
840           this._emitter.fire(void 0);
841           this.dispose();
842         }
843       }
844     }
845     get isCancellationRequested() {
846       return this._isCancelled;
847     }
848     get onCancellationRequested() {
849       if (this._isCancelled) {
850         return shortcutEvent;
851       }
852       if (!this._emitter) {
853         this._emitter = new events_1.Emitter();
854       }
855       return this._emitter.event;
856     }
857     dispose() {
858       if (this._emitter) {
859         this._emitter.dispose();
860         this._emitter = void 0;
861       }
862     }
863   };
864   var CancellationTokenSource = class {
865     get token() {
866       if (!this._token) {
867         this._token = new MutableToken();
868       }
869       return this._token;
870     }
871     cancel() {
872       if (!this._token) {
873         this._token = CancellationToken.Cancelled;
874       } else {
875         this._token.cancel();
876       }
877     }
878     dispose() {
879       if (!this._token) {
880         this._token = CancellationToken.None;
881       } else if (this._token instanceof MutableToken) {
882         this._token.dispose();
883       }
884     }
885   };
886   exports2.CancellationTokenSource = CancellationTokenSource;
887 });
888
889 // node_modules/vscode-languageserver/node_modules/vscode-jsonrpc/lib/common/messageReader.js
890 var require_messageReader = __commonJS((exports2) => {
891   "use strict";
892   Object.defineProperty(exports2, "__esModule", {value: true});
893   exports2.ReadableStreamMessageReader = exports2.AbstractMessageReader = exports2.MessageReader = void 0;
894   var ral_1 = require_ral();
895   var Is = require_is2();
896   var events_1 = require_events();
897   var MessageReader;
898   (function(MessageReader2) {
899     function is(value) {
900       let candidate = value;
901       return candidate && Is.func(candidate.listen) && Is.func(candidate.dispose) && Is.func(candidate.onError) && Is.func(candidate.onClose) && Is.func(candidate.onPartialMessage);
902     }
903     MessageReader2.is = is;
904   })(MessageReader = exports2.MessageReader || (exports2.MessageReader = {}));
905   var AbstractMessageReader = class {
906     constructor() {
907       this.errorEmitter = new events_1.Emitter();
908       this.closeEmitter = new events_1.Emitter();
909       this.partialMessageEmitter = new events_1.Emitter();
910     }
911     dispose() {
912       this.errorEmitter.dispose();
913       this.closeEmitter.dispose();
914     }
915     get onError() {
916       return this.errorEmitter.event;
917     }
918     fireError(error) {
919       this.errorEmitter.fire(this.asError(error));
920     }
921     get onClose() {
922       return this.closeEmitter.event;
923     }
924     fireClose() {
925       this.closeEmitter.fire(void 0);
926     }
927     get onPartialMessage() {
928       return this.partialMessageEmitter.event;
929     }
930     firePartialMessage(info) {
931       this.partialMessageEmitter.fire(info);
932     }
933     asError(error) {
934       if (error instanceof Error) {
935         return error;
936       } else {
937         return new Error(`Reader received error. Reason: ${Is.string(error.message) ? error.message : "unknown"}`);
938       }
939     }
940   };
941   exports2.AbstractMessageReader = AbstractMessageReader;
942   var ResolvedMessageReaderOptions;
943   (function(ResolvedMessageReaderOptions2) {
944     function fromOptions(options) {
945       var _a2;
946       let charset;
947       let result;
948       let contentDecoder;
949       const contentDecoders = new Map();
950       let contentTypeDecoder;
951       const contentTypeDecoders = new Map();
952       if (options === void 0 || typeof options === "string") {
953         charset = options !== null && options !== void 0 ? options : "utf-8";
954       } else {
955         charset = (_a2 = options.charset) !== null && _a2 !== void 0 ? _a2 : "utf-8";
956         if (options.contentDecoder !== void 0) {
957           contentDecoder = options.contentDecoder;
958           contentDecoders.set(contentDecoder.name, contentDecoder);
959         }
960         if (options.contentDecoders !== void 0) {
961           for (const decoder of options.contentDecoders) {
962             contentDecoders.set(decoder.name, decoder);
963           }
964         }
965         if (options.contentTypeDecoder !== void 0) {
966           contentTypeDecoder = options.contentTypeDecoder;
967           contentTypeDecoders.set(contentTypeDecoder.name, contentTypeDecoder);
968         }
969         if (options.contentTypeDecoders !== void 0) {
970           for (const decoder of options.contentTypeDecoders) {
971             contentTypeDecoders.set(decoder.name, decoder);
972           }
973         }
974       }
975       if (contentTypeDecoder === void 0) {
976         contentTypeDecoder = ral_1.default().applicationJson.decoder;
977         contentTypeDecoders.set(contentTypeDecoder.name, contentTypeDecoder);
978       }
979       return {charset, contentDecoder, contentDecoders, contentTypeDecoder, contentTypeDecoders};
980     }
981     ResolvedMessageReaderOptions2.fromOptions = fromOptions;
982   })(ResolvedMessageReaderOptions || (ResolvedMessageReaderOptions = {}));
983   var ReadableStreamMessageReader = class extends AbstractMessageReader {
984     constructor(readable, options) {
985       super();
986       this.readable = readable;
987       this.options = ResolvedMessageReaderOptions.fromOptions(options);
988       this.buffer = ral_1.default().messageBuffer.create(this.options.charset);
989       this._partialMessageTimeout = 1e4;
990       this.nextMessageLength = -1;
991       this.messageToken = 0;
992     }
993     set partialMessageTimeout(timeout) {
994       this._partialMessageTimeout = timeout;
995     }
996     get partialMessageTimeout() {
997       return this._partialMessageTimeout;
998     }
999     listen(callback) {
1000       this.nextMessageLength = -1;
1001       this.messageToken = 0;
1002       this.partialMessageTimer = void 0;
1003       this.callback = callback;
1004       const result = this.readable.onData((data) => {
1005         this.onData(data);
1006       });
1007       this.readable.onError((error) => this.fireError(error));
1008       this.readable.onClose(() => this.fireClose());
1009       return result;
1010     }
1011     onData(data) {
1012       this.buffer.append(data);
1013       while (true) {
1014         if (this.nextMessageLength === -1) {
1015           const headers = this.buffer.tryReadHeaders();
1016           if (!headers) {
1017             return;
1018           }
1019           const contentLength = headers.get("Content-Length");
1020           if (!contentLength) {
1021             throw new Error("Header must provide a Content-Length property.");
1022           }
1023           const length = parseInt(contentLength);
1024           if (isNaN(length)) {
1025             throw new Error("Content-Length value must be a number.");
1026           }
1027           this.nextMessageLength = length;
1028         }
1029         const body = this.buffer.tryReadBody(this.nextMessageLength);
1030         if (body === void 0) {
1031           this.setPartialMessageTimer();
1032           return;
1033         }
1034         this.clearPartialMessageTimer();
1035         this.nextMessageLength = -1;
1036         let p;
1037         if (this.options.contentDecoder !== void 0) {
1038           p = this.options.contentDecoder.decode(body);
1039         } else {
1040           p = Promise.resolve(body);
1041         }
1042         p.then((value) => {
1043           this.options.contentTypeDecoder.decode(value, this.options).then((msg) => {
1044             this.callback(msg);
1045           }, (error) => {
1046             this.fireError(error);
1047           });
1048         }, (error) => {
1049           this.fireError(error);
1050         });
1051       }
1052     }
1053     clearPartialMessageTimer() {
1054       if (this.partialMessageTimer) {
1055         ral_1.default().timer.clearTimeout(this.partialMessageTimer);
1056         this.partialMessageTimer = void 0;
1057       }
1058     }
1059     setPartialMessageTimer() {
1060       this.clearPartialMessageTimer();
1061       if (this._partialMessageTimeout <= 0) {
1062         return;
1063       }
1064       this.partialMessageTimer = ral_1.default().timer.setTimeout((token, timeout) => {
1065         this.partialMessageTimer = void 0;
1066         if (token === this.messageToken) {
1067           this.firePartialMessage({messageToken: token, waitingTime: timeout});
1068           this.setPartialMessageTimer();
1069         }
1070       }, this._partialMessageTimeout, this.messageToken, this._partialMessageTimeout);
1071     }
1072   };
1073   exports2.ReadableStreamMessageReader = ReadableStreamMessageReader;
1074 });
1075
1076 // node_modules/vscode-languageserver/node_modules/vscode-jsonrpc/lib/common/semaphore.js
1077 var require_semaphore = __commonJS((exports2) => {
1078   "use strict";
1079   Object.defineProperty(exports2, "__esModule", {value: true});
1080   exports2.Semaphore = void 0;
1081   var ral_1 = require_ral();
1082   var Semaphore = class {
1083     constructor(capacity = 1) {
1084       if (capacity <= 0) {
1085         throw new Error("Capacity must be greater than 0");
1086       }
1087       this._capacity = capacity;
1088       this._active = 0;
1089       this._waiting = [];
1090     }
1091     lock(thunk) {
1092       return new Promise((resolve, reject) => {
1093         this._waiting.push({thunk, resolve, reject});
1094         this.runNext();
1095       });
1096     }
1097     get active() {
1098       return this._active;
1099     }
1100     runNext() {
1101       if (this._waiting.length === 0 || this._active === this._capacity) {
1102         return;
1103       }
1104       ral_1.default().timer.setImmediate(() => this.doRunNext());
1105     }
1106     doRunNext() {
1107       if (this._waiting.length === 0 || this._active === this._capacity) {
1108         return;
1109       }
1110       const next = this._waiting.shift();
1111       this._active++;
1112       if (this._active > this._capacity) {
1113         throw new Error(`To many thunks active`);
1114       }
1115       try {
1116         const result = next.thunk();
1117         if (result instanceof Promise) {
1118           result.then((value) => {
1119             this._active--;
1120             next.resolve(value);
1121             this.runNext();
1122           }, (err) => {
1123             this._active--;
1124             next.reject(err);
1125             this.runNext();
1126           });
1127         } else {
1128           this._active--;
1129           next.resolve(result);
1130           this.runNext();
1131         }
1132       } catch (err) {
1133         this._active--;
1134         next.reject(err);
1135         this.runNext();
1136       }
1137     }
1138   };
1139   exports2.Semaphore = Semaphore;
1140 });
1141
1142 // node_modules/vscode-languageserver/node_modules/vscode-jsonrpc/lib/common/messageWriter.js
1143 var require_messageWriter = __commonJS((exports2) => {
1144   "use strict";
1145   Object.defineProperty(exports2, "__esModule", {value: true});
1146   exports2.WriteableStreamMessageWriter = exports2.AbstractMessageWriter = exports2.MessageWriter = void 0;
1147   var ral_1 = require_ral();
1148   var Is = require_is2();
1149   var semaphore_1 = require_semaphore();
1150   var events_1 = require_events();
1151   var ContentLength = "Content-Length: ";
1152   var CRLF = "\r\n";
1153   var MessageWriter;
1154   (function(MessageWriter2) {
1155     function is(value) {
1156       let candidate = value;
1157       return candidate && Is.func(candidate.dispose) && Is.func(candidate.onClose) && Is.func(candidate.onError) && Is.func(candidate.write);
1158     }
1159     MessageWriter2.is = is;
1160   })(MessageWriter = exports2.MessageWriter || (exports2.MessageWriter = {}));
1161   var AbstractMessageWriter = class {
1162     constructor() {
1163       this.errorEmitter = new events_1.Emitter();
1164       this.closeEmitter = new events_1.Emitter();
1165     }
1166     dispose() {
1167       this.errorEmitter.dispose();
1168       this.closeEmitter.dispose();
1169     }
1170     get onError() {
1171       return this.errorEmitter.event;
1172     }
1173     fireError(error, message, count) {
1174       this.errorEmitter.fire([this.asError(error), message, count]);
1175     }
1176     get onClose() {
1177       return this.closeEmitter.event;
1178     }
1179     fireClose() {
1180       this.closeEmitter.fire(void 0);
1181     }
1182     asError(error) {
1183       if (error instanceof Error) {
1184         return error;
1185       } else {
1186         return new Error(`Writer received error. Reason: ${Is.string(error.message) ? error.message : "unknown"}`);
1187       }
1188     }
1189   };
1190   exports2.AbstractMessageWriter = AbstractMessageWriter;
1191   var ResolvedMessageWriterOptions;
1192   (function(ResolvedMessageWriterOptions2) {
1193     function fromOptions(options) {
1194       var _a2, _b;
1195       if (options === void 0 || typeof options === "string") {
1196         return {charset: options !== null && options !== void 0 ? options : "utf-8", contentTypeEncoder: ral_1.default().applicationJson.encoder};
1197       } else {
1198         return {charset: (_a2 = options.charset) !== null && _a2 !== void 0 ? _a2 : "utf-8", contentEncoder: options.contentEncoder, contentTypeEncoder: (_b = options.contentTypeEncoder) !== null && _b !== void 0 ? _b : ral_1.default().applicationJson.encoder};
1199       }
1200     }
1201     ResolvedMessageWriterOptions2.fromOptions = fromOptions;
1202   })(ResolvedMessageWriterOptions || (ResolvedMessageWriterOptions = {}));
1203   var WriteableStreamMessageWriter = class extends AbstractMessageWriter {
1204     constructor(writable, options) {
1205       super();
1206       this.writable = writable;
1207       this.options = ResolvedMessageWriterOptions.fromOptions(options);
1208       this.errorCount = 0;
1209       this.writeSemaphore = new semaphore_1.Semaphore(1);
1210       this.writable.onError((error) => this.fireError(error));
1211       this.writable.onClose(() => this.fireClose());
1212     }
1213     async write(msg) {
1214       return this.writeSemaphore.lock(async () => {
1215         const payload = this.options.contentTypeEncoder.encode(msg, this.options).then((buffer) => {
1216           if (this.options.contentEncoder !== void 0) {
1217             return this.options.contentEncoder.encode(buffer);
1218           } else {
1219             return buffer;
1220           }
1221         });
1222         return payload.then((buffer) => {
1223           const headers = [];
1224           headers.push(ContentLength, buffer.byteLength.toString(), CRLF);
1225           headers.push(CRLF);
1226           return this.doWrite(msg, headers, buffer);
1227         }, (error) => {
1228           this.fireError(error);
1229           throw error;
1230         });
1231       });
1232     }
1233     async doWrite(msg, headers, data) {
1234       try {
1235         await this.writable.write(headers.join(""), "ascii");
1236         return this.writable.write(data);
1237       } catch (error) {
1238         this.handleError(error, msg);
1239         return Promise.reject(error);
1240       }
1241     }
1242     handleError(error, msg) {
1243       this.errorCount++;
1244       this.fireError(error, msg, this.errorCount);
1245     }
1246     end() {
1247       this.writable.end();
1248     }
1249   };
1250   exports2.WriteableStreamMessageWriter = WriteableStreamMessageWriter;
1251 });
1252
1253 // node_modules/vscode-languageserver/node_modules/vscode-jsonrpc/lib/common/linkedMap.js
1254 var require_linkedMap = __commonJS((exports2) => {
1255   "use strict";
1256   Object.defineProperty(exports2, "__esModule", {value: true});
1257   exports2.LRUCache = exports2.LinkedMap = exports2.Touch = void 0;
1258   var Touch;
1259   (function(Touch2) {
1260     Touch2.None = 0;
1261     Touch2.First = 1;
1262     Touch2.AsOld = Touch2.First;
1263     Touch2.Last = 2;
1264     Touch2.AsNew = Touch2.Last;
1265   })(Touch = exports2.Touch || (exports2.Touch = {}));
1266   var LinkedMap = class {
1267     constructor() {
1268       this[Symbol.toStringTag] = "LinkedMap";
1269       this._map = new Map();
1270       this._head = void 0;
1271       this._tail = void 0;
1272       this._size = 0;
1273       this._state = 0;
1274     }
1275     clear() {
1276       this._map.clear();
1277       this._head = void 0;
1278       this._tail = void 0;
1279       this._size = 0;
1280       this._state++;
1281     }
1282     isEmpty() {
1283       return !this._head && !this._tail;
1284     }
1285     get size() {
1286       return this._size;
1287     }
1288     get first() {
1289       var _a2;
1290       return (_a2 = this._head) === null || _a2 === void 0 ? void 0 : _a2.value;
1291     }
1292     get last() {
1293       var _a2;
1294       return (_a2 = this._tail) === null || _a2 === void 0 ? void 0 : _a2.value;
1295     }
1296     has(key) {
1297       return this._map.has(key);
1298     }
1299     get(key, touch = Touch.None) {
1300       const item = this._map.get(key);
1301       if (!item) {
1302         return void 0;
1303       }
1304       if (touch !== Touch.None) {
1305         this.touch(item, touch);
1306       }
1307       return item.value;
1308     }
1309     set(key, value, touch = Touch.None) {
1310       let item = this._map.get(key);
1311       if (item) {
1312         item.value = value;
1313         if (touch !== Touch.None) {
1314           this.touch(item, touch);
1315         }
1316       } else {
1317         item = {key, value, next: void 0, previous: void 0};
1318         switch (touch) {
1319           case Touch.None:
1320             this.addItemLast(item);
1321             break;
1322           case Touch.First:
1323             this.addItemFirst(item);
1324             break;
1325           case Touch.Last:
1326             this.addItemLast(item);
1327             break;
1328           default:
1329             this.addItemLast(item);
1330             break;
1331         }
1332         this._map.set(key, item);
1333         this._size++;
1334       }
1335       return this;
1336     }
1337     delete(key) {
1338       return !!this.remove(key);
1339     }
1340     remove(key) {
1341       const item = this._map.get(key);
1342       if (!item) {
1343         return void 0;
1344       }
1345       this._map.delete(key);
1346       this.removeItem(item);
1347       this._size--;
1348       return item.value;
1349     }
1350     shift() {
1351       if (!this._head && !this._tail) {
1352         return void 0;
1353       }
1354       if (!this._head || !this._tail) {
1355         throw new Error("Invalid list");
1356       }
1357       const item = this._head;
1358       this._map.delete(item.key);
1359       this.removeItem(item);
1360       this._size--;
1361       return item.value;
1362     }
1363     forEach(callbackfn, thisArg) {
1364       const state = this._state;
1365       let current = this._head;
1366       while (current) {
1367         if (thisArg) {
1368           callbackfn.bind(thisArg)(current.value, current.key, this);
1369         } else {
1370           callbackfn(current.value, current.key, this);
1371         }
1372         if (this._state !== state) {
1373           throw new Error(`LinkedMap got modified during iteration.`);
1374         }
1375         current = current.next;
1376       }
1377     }
1378     keys() {
1379       const map = this;
1380       const state = this._state;
1381       let current = this._head;
1382       const iterator = {
1383         [Symbol.iterator]() {
1384           return iterator;
1385         },
1386         next() {
1387           if (map._state !== state) {
1388             throw new Error(`LinkedMap got modified during iteration.`);
1389           }
1390           if (current) {
1391             const result = {value: current.key, done: false};
1392             current = current.next;
1393             return result;
1394           } else {
1395             return {value: void 0, done: true};
1396           }
1397         }
1398       };
1399       return iterator;
1400     }
1401     values() {
1402       const map = this;
1403       const state = this._state;
1404       let current = this._head;
1405       const iterator = {
1406         [Symbol.iterator]() {
1407           return iterator;
1408         },
1409         next() {
1410           if (map._state !== state) {
1411             throw new Error(`LinkedMap got modified during iteration.`);
1412           }
1413           if (current) {
1414             const result = {value: current.value, done: false};
1415             current = current.next;
1416             return result;
1417           } else {
1418             return {value: void 0, done: true};
1419           }
1420         }
1421       };
1422       return iterator;
1423     }
1424     entries() {
1425       const map = this;
1426       const state = this._state;
1427       let current = this._head;
1428       const iterator = {
1429         [Symbol.iterator]() {
1430           return iterator;
1431         },
1432         next() {
1433           if (map._state !== state) {
1434             throw new Error(`LinkedMap got modified during iteration.`);
1435           }
1436           if (current) {
1437             const result = {value: [current.key, current.value], done: false};
1438             current = current.next;
1439             return result;
1440           } else {
1441             return {value: void 0, done: true};
1442           }
1443         }
1444       };
1445       return iterator;
1446     }
1447     [Symbol.iterator]() {
1448       return this.entries();
1449     }
1450     trimOld(newSize) {
1451       if (newSize >= this.size) {
1452         return;
1453       }
1454       if (newSize === 0) {
1455         this.clear();
1456         return;
1457       }
1458       let current = this._head;
1459       let currentSize = this.size;
1460       while (current && currentSize > newSize) {
1461         this._map.delete(current.key);
1462         current = current.next;
1463         currentSize--;
1464       }
1465       this._head = current;
1466       this._size = currentSize;
1467       if (current) {
1468         current.previous = void 0;
1469       }
1470       this._state++;
1471     }
1472     addItemFirst(item) {
1473       if (!this._head && !this._tail) {
1474         this._tail = item;
1475       } else if (!this._head) {
1476         throw new Error("Invalid list");
1477       } else {
1478         item.next = this._head;
1479         this._head.previous = item;
1480       }
1481       this._head = item;
1482       this._state++;
1483     }
1484     addItemLast(item) {
1485       if (!this._head && !this._tail) {
1486         this._head = item;
1487       } else if (!this._tail) {
1488         throw new Error("Invalid list");
1489       } else {
1490         item.previous = this._tail;
1491         this._tail.next = item;
1492       }
1493       this._tail = item;
1494       this._state++;
1495     }
1496     removeItem(item) {
1497       if (item === this._head && item === this._tail) {
1498         this._head = void 0;
1499         this._tail = void 0;
1500       } else if (item === this._head) {
1501         if (!item.next) {
1502           throw new Error("Invalid list");
1503         }
1504         item.next.previous = void 0;
1505         this._head = item.next;
1506       } else if (item === this._tail) {
1507         if (!item.previous) {
1508           throw new Error("Invalid list");
1509         }
1510         item.previous.next = void 0;
1511         this._tail = item.previous;
1512       } else {
1513         const next = item.next;
1514         const previous = item.previous;
1515         if (!next || !previous) {
1516           throw new Error("Invalid list");
1517         }
1518         next.previous = previous;
1519         previous.next = next;
1520       }
1521       item.next = void 0;
1522       item.previous = void 0;
1523       this._state++;
1524     }
1525     touch(item, touch) {
1526       if (!this._head || !this._tail) {
1527         throw new Error("Invalid list");
1528       }
1529       if (touch !== Touch.First && touch !== Touch.Last) {
1530         return;
1531       }
1532       if (touch === Touch.First) {
1533         if (item === this._head) {
1534           return;
1535         }
1536         const next = item.next;
1537         const previous = item.previous;
1538         if (item === this._tail) {
1539           previous.next = void 0;
1540           this._tail = previous;
1541         } else {
1542           next.previous = previous;
1543           previous.next = next;
1544         }
1545         item.previous = void 0;
1546         item.next = this._head;
1547         this._head.previous = item;
1548         this._head = item;
1549         this._state++;
1550       } else if (touch === Touch.Last) {
1551         if (item === this._tail) {
1552           return;
1553         }
1554         const next = item.next;
1555         const previous = item.previous;
1556         if (item === this._head) {
1557           next.previous = void 0;
1558           this._head = next;
1559         } else {
1560           next.previous = previous;
1561           previous.next = next;
1562         }
1563         item.next = void 0;
1564         item.previous = this._tail;
1565         this._tail.next = item;
1566         this._tail = item;
1567         this._state++;
1568       }
1569     }
1570     toJSON() {
1571       const data = [];
1572       this.forEach((value, key) => {
1573         data.push([key, value]);
1574       });
1575       return data;
1576     }
1577     fromJSON(data) {
1578       this.clear();
1579       for (const [key, value] of data) {
1580         this.set(key, value);
1581       }
1582     }
1583   };
1584   exports2.LinkedMap = LinkedMap;
1585   var LRUCache = class extends LinkedMap {
1586     constructor(limit, ratio = 1) {
1587       super();
1588       this._limit = limit;
1589       this._ratio = Math.min(Math.max(0, ratio), 1);
1590     }
1591     get limit() {
1592       return this._limit;
1593     }
1594     set limit(limit) {
1595       this._limit = limit;
1596       this.checkTrim();
1597     }
1598     get ratio() {
1599       return this._ratio;
1600     }
1601     set ratio(ratio) {
1602       this._ratio = Math.min(Math.max(0, ratio), 1);
1603       this.checkTrim();
1604     }
1605     get(key, touch = Touch.AsNew) {
1606       return super.get(key, touch);
1607     }
1608     peek(key) {
1609       return super.get(key, Touch.None);
1610     }
1611     set(key, value) {
1612       super.set(key, value, Touch.Last);
1613       this.checkTrim();
1614       return this;
1615     }
1616     checkTrim() {
1617       if (this.size > this._limit) {
1618         this.trimOld(Math.round(this._limit * this._ratio));
1619       }
1620     }
1621   };
1622   exports2.LRUCache = LRUCache;
1623 });
1624
1625 // node_modules/vscode-languageserver/node_modules/vscode-jsonrpc/lib/common/connection.js
1626 var require_connection = __commonJS((exports2) => {
1627   "use strict";
1628   Object.defineProperty(exports2, "__esModule", {value: true});
1629   exports2.createMessageConnection = exports2.ConnectionOptions = exports2.CancellationStrategy = exports2.CancellationSenderStrategy = exports2.CancellationReceiverStrategy = exports2.ConnectionStrategy = exports2.ConnectionError = exports2.ConnectionErrors = exports2.LogTraceNotification = exports2.SetTraceNotification = exports2.TraceFormat = exports2.Trace = exports2.NullLogger = exports2.ProgressType = void 0;
1630   var ral_1 = require_ral();
1631   var Is = require_is2();
1632   var messages_1 = require_messages();
1633   var linkedMap_1 = require_linkedMap();
1634   var events_1 = require_events();
1635   var cancellation_1 = require_cancellation();
1636   var CancelNotification;
1637   (function(CancelNotification2) {
1638     CancelNotification2.type = new messages_1.NotificationType("$/cancelRequest");
1639   })(CancelNotification || (CancelNotification = {}));
1640   var ProgressNotification;
1641   (function(ProgressNotification2) {
1642     ProgressNotification2.type = new messages_1.NotificationType("$/progress");
1643   })(ProgressNotification || (ProgressNotification = {}));
1644   var ProgressType = class {
1645     constructor() {
1646     }
1647   };
1648   exports2.ProgressType = ProgressType;
1649   var StarRequestHandler;
1650   (function(StarRequestHandler2) {
1651     function is(value) {
1652       return Is.func(value);
1653     }
1654     StarRequestHandler2.is = is;
1655   })(StarRequestHandler || (StarRequestHandler = {}));
1656   exports2.NullLogger = Object.freeze({
1657     error: () => {
1658     },
1659     warn: () => {
1660     },
1661     info: () => {
1662     },
1663     log: () => {
1664     }
1665   });
1666   var Trace;
1667   (function(Trace2) {
1668     Trace2[Trace2["Off"] = 0] = "Off";
1669     Trace2[Trace2["Messages"] = 1] = "Messages";
1670     Trace2[Trace2["Verbose"] = 2] = "Verbose";
1671   })(Trace = exports2.Trace || (exports2.Trace = {}));
1672   (function(Trace2) {
1673     function fromString(value) {
1674       if (!Is.string(value)) {
1675         return Trace2.Off;
1676       }
1677       value = value.toLowerCase();
1678       switch (value) {
1679         case "off":
1680           return Trace2.Off;
1681         case "messages":
1682           return Trace2.Messages;
1683         case "verbose":
1684           return Trace2.Verbose;
1685         default:
1686           return Trace2.Off;
1687       }
1688     }
1689     Trace2.fromString = fromString;
1690     function toString(value) {
1691       switch (value) {
1692         case Trace2.Off:
1693           return "off";
1694         case Trace2.Messages:
1695           return "messages";
1696         case Trace2.Verbose:
1697           return "verbose";
1698         default:
1699           return "off";
1700       }
1701     }
1702     Trace2.toString = toString;
1703   })(Trace = exports2.Trace || (exports2.Trace = {}));
1704   var TraceFormat;
1705   (function(TraceFormat2) {
1706     TraceFormat2["Text"] = "text";
1707     TraceFormat2["JSON"] = "json";
1708   })(TraceFormat = exports2.TraceFormat || (exports2.TraceFormat = {}));
1709   (function(TraceFormat2) {
1710     function fromString(value) {
1711       value = value.toLowerCase();
1712       if (value === "json") {
1713         return TraceFormat2.JSON;
1714       } else {
1715         return TraceFormat2.Text;
1716       }
1717     }
1718     TraceFormat2.fromString = fromString;
1719   })(TraceFormat = exports2.TraceFormat || (exports2.TraceFormat = {}));
1720   var SetTraceNotification;
1721   (function(SetTraceNotification2) {
1722     SetTraceNotification2.type = new messages_1.NotificationType("$/setTrace");
1723   })(SetTraceNotification = exports2.SetTraceNotification || (exports2.SetTraceNotification = {}));
1724   var LogTraceNotification;
1725   (function(LogTraceNotification2) {
1726     LogTraceNotification2.type = new messages_1.NotificationType("$/logTrace");
1727   })(LogTraceNotification = exports2.LogTraceNotification || (exports2.LogTraceNotification = {}));
1728   var ConnectionErrors;
1729   (function(ConnectionErrors2) {
1730     ConnectionErrors2[ConnectionErrors2["Closed"] = 1] = "Closed";
1731     ConnectionErrors2[ConnectionErrors2["Disposed"] = 2] = "Disposed";
1732     ConnectionErrors2[ConnectionErrors2["AlreadyListening"] = 3] = "AlreadyListening";
1733   })(ConnectionErrors = exports2.ConnectionErrors || (exports2.ConnectionErrors = {}));
1734   var ConnectionError = class extends Error {
1735     constructor(code, message) {
1736       super(message);
1737       this.code = code;
1738       Object.setPrototypeOf(this, ConnectionError.prototype);
1739     }
1740   };
1741   exports2.ConnectionError = ConnectionError;
1742   var ConnectionStrategy;
1743   (function(ConnectionStrategy2) {
1744     function is(value) {
1745       const candidate = value;
1746       return candidate && Is.func(candidate.cancelUndispatched);
1747     }
1748     ConnectionStrategy2.is = is;
1749   })(ConnectionStrategy = exports2.ConnectionStrategy || (exports2.ConnectionStrategy = {}));
1750   var CancellationReceiverStrategy;
1751   (function(CancellationReceiverStrategy2) {
1752     CancellationReceiverStrategy2.Message = Object.freeze({
1753       createCancellationTokenSource(_) {
1754         return new cancellation_1.CancellationTokenSource();
1755       }
1756     });
1757     function is(value) {
1758       const candidate = value;
1759       return candidate && Is.func(candidate.createCancellationTokenSource);
1760     }
1761     CancellationReceiverStrategy2.is = is;
1762   })(CancellationReceiverStrategy = exports2.CancellationReceiverStrategy || (exports2.CancellationReceiverStrategy = {}));
1763   var CancellationSenderStrategy;
1764   (function(CancellationSenderStrategy2) {
1765     CancellationSenderStrategy2.Message = Object.freeze({
1766       sendCancellation(conn, id) {
1767         conn.sendNotification(CancelNotification.type, {id});
1768       },
1769       cleanup(_) {
1770       }
1771     });
1772     function is(value) {
1773       const candidate = value;
1774       return candidate && Is.func(candidate.sendCancellation) && Is.func(candidate.cleanup);
1775     }
1776     CancellationSenderStrategy2.is = is;
1777   })(CancellationSenderStrategy = exports2.CancellationSenderStrategy || (exports2.CancellationSenderStrategy = {}));
1778   var CancellationStrategy;
1779   (function(CancellationStrategy2) {
1780     CancellationStrategy2.Message = Object.freeze({
1781       receiver: CancellationReceiverStrategy.Message,
1782       sender: CancellationSenderStrategy.Message
1783     });
1784     function is(value) {
1785       const candidate = value;
1786       return candidate && CancellationReceiverStrategy.is(candidate.receiver) && CancellationSenderStrategy.is(candidate.sender);
1787     }
1788     CancellationStrategy2.is = is;
1789   })(CancellationStrategy = exports2.CancellationStrategy || (exports2.CancellationStrategy = {}));
1790   var ConnectionOptions;
1791   (function(ConnectionOptions2) {
1792     function is(value) {
1793       const candidate = value;
1794       return candidate && (CancellationStrategy.is(candidate.cancellationStrategy) || ConnectionStrategy.is(candidate.connectionStrategy));
1795     }
1796     ConnectionOptions2.is = is;
1797   })(ConnectionOptions = exports2.ConnectionOptions || (exports2.ConnectionOptions = {}));
1798   var ConnectionState;
1799   (function(ConnectionState2) {
1800     ConnectionState2[ConnectionState2["New"] = 1] = "New";
1801     ConnectionState2[ConnectionState2["Listening"] = 2] = "Listening";
1802     ConnectionState2[ConnectionState2["Closed"] = 3] = "Closed";
1803     ConnectionState2[ConnectionState2["Disposed"] = 4] = "Disposed";
1804   })(ConnectionState || (ConnectionState = {}));
1805   function createMessageConnection(messageReader, messageWriter, _logger, options) {
1806     const logger = _logger !== void 0 ? _logger : exports2.NullLogger;
1807     let sequenceNumber = 0;
1808     let notificationSquenceNumber = 0;
1809     let unknownResponseSquenceNumber = 0;
1810     const version = "2.0";
1811     let starRequestHandler = void 0;
1812     const requestHandlers = Object.create(null);
1813     let starNotificationHandler = void 0;
1814     const notificationHandlers = Object.create(null);
1815     const progressHandlers = new Map();
1816     let timer;
1817     let messageQueue = new linkedMap_1.LinkedMap();
1818     let responsePromises = Object.create(null);
1819     let requestTokens = Object.create(null);
1820     let trace = Trace.Off;
1821     let traceFormat = TraceFormat.Text;
1822     let tracer;
1823     let state = ConnectionState.New;
1824     const errorEmitter = new events_1.Emitter();
1825     const closeEmitter = new events_1.Emitter();
1826     const unhandledNotificationEmitter = new events_1.Emitter();
1827     const unhandledProgressEmitter = new events_1.Emitter();
1828     const disposeEmitter = new events_1.Emitter();
1829     const cancellationStrategy = options && options.cancellationStrategy ? options.cancellationStrategy : CancellationStrategy.Message;
1830     function createRequestQueueKey(id) {
1831       if (id === null) {
1832         throw new Error(`Can't send requests with id null since the response can't be correlated.`);
1833       }
1834       return "req-" + id.toString();
1835     }
1836     function createResponseQueueKey(id) {
1837       if (id === null) {
1838         return "res-unknown-" + (++unknownResponseSquenceNumber).toString();
1839       } else {
1840         return "res-" + id.toString();
1841       }
1842     }
1843     function createNotificationQueueKey() {
1844       return "not-" + (++notificationSquenceNumber).toString();
1845     }
1846     function addMessageToQueue(queue, message) {
1847       if (messages_1.isRequestMessage(message)) {
1848         queue.set(createRequestQueueKey(message.id), message);
1849       } else if (messages_1.isResponseMessage(message)) {
1850         queue.set(createResponseQueueKey(message.id), message);
1851       } else {
1852         queue.set(createNotificationQueueKey(), message);
1853       }
1854     }
1855     function cancelUndispatched(_message) {
1856       return void 0;
1857     }
1858     function isListening() {
1859       return state === ConnectionState.Listening;
1860     }
1861     function isClosed() {
1862       return state === ConnectionState.Closed;
1863     }
1864     function isDisposed() {
1865       return state === ConnectionState.Disposed;
1866     }
1867     function closeHandler() {
1868       if (state === ConnectionState.New || state === ConnectionState.Listening) {
1869         state = ConnectionState.Closed;
1870         closeEmitter.fire(void 0);
1871       }
1872     }
1873     function readErrorHandler(error) {
1874       errorEmitter.fire([error, void 0, void 0]);
1875     }
1876     function writeErrorHandler(data) {
1877       errorEmitter.fire(data);
1878     }
1879     messageReader.onClose(closeHandler);
1880     messageReader.onError(readErrorHandler);
1881     messageWriter.onClose(closeHandler);
1882     messageWriter.onError(writeErrorHandler);
1883     function triggerMessageQueue() {
1884       if (timer || messageQueue.size === 0) {
1885         return;
1886       }
1887       timer = ral_1.default().timer.setImmediate(() => {
1888         timer = void 0;
1889         processMessageQueue();
1890       });
1891     }
1892     function processMessageQueue() {
1893       if (messageQueue.size === 0) {
1894         return;
1895       }
1896       const message = messageQueue.shift();
1897       try {
1898         if (messages_1.isRequestMessage(message)) {
1899           handleRequest(message);
1900         } else if (messages_1.isNotificationMessage(message)) {
1901           handleNotification(message);
1902         } else if (messages_1.isResponseMessage(message)) {
1903           handleResponse(message);
1904         } else {
1905           handleInvalidMessage(message);
1906         }
1907       } finally {
1908         triggerMessageQueue();
1909       }
1910     }
1911     const callback = (message) => {
1912       try {
1913         if (messages_1.isNotificationMessage(message) && message.method === CancelNotification.type.method) {
1914           const key = createRequestQueueKey(message.params.id);
1915           const toCancel = messageQueue.get(key);
1916           if (messages_1.isRequestMessage(toCancel)) {
1917             const strategy = options === null || options === void 0 ? void 0 : options.connectionStrategy;
1918             const response = strategy && strategy.cancelUndispatched ? strategy.cancelUndispatched(toCancel, cancelUndispatched) : cancelUndispatched(toCancel);
1919             if (response && (response.error !== void 0 || response.result !== void 0)) {
1920               messageQueue.delete(key);
1921               response.id = toCancel.id;
1922               traceSendingResponse(response, message.method, Date.now());
1923               messageWriter.write(response);
1924               return;
1925             }
1926           }
1927         }
1928         addMessageToQueue(messageQueue, message);
1929       } finally {
1930         triggerMessageQueue();
1931       }
1932     };
1933     function handleRequest(requestMessage) {
1934       if (isDisposed()) {
1935         return;
1936       }
1937       function reply(resultOrError, method, startTime2) {
1938         const message = {
1939           jsonrpc: version,
1940           id: requestMessage.id
1941         };
1942         if (resultOrError instanceof messages_1.ResponseError) {
1943           message.error = resultOrError.toJson();
1944         } else {
1945           message.result = resultOrError === void 0 ? null : resultOrError;
1946         }
1947         traceSendingResponse(message, method, startTime2);
1948         messageWriter.write(message);
1949       }
1950       function replyError(error, method, startTime2) {
1951         const message = {
1952           jsonrpc: version,
1953           id: requestMessage.id,
1954           error: error.toJson()
1955         };
1956         traceSendingResponse(message, method, startTime2);
1957         messageWriter.write(message);
1958       }
1959       function replySuccess(result, method, startTime2) {
1960         if (result === void 0) {
1961           result = null;
1962         }
1963         const message = {
1964           jsonrpc: version,
1965           id: requestMessage.id,
1966           result
1967         };
1968         traceSendingResponse(message, method, startTime2);
1969         messageWriter.write(message);
1970       }
1971       traceReceivedRequest(requestMessage);
1972       const element = requestHandlers[requestMessage.method];
1973       let type;
1974       let requestHandler;
1975       if (element) {
1976         type = element.type;
1977         requestHandler = element.handler;
1978       }
1979       const startTime = Date.now();
1980       if (requestHandler || starRequestHandler) {
1981         const tokenKey = String(requestMessage.id);
1982         const cancellationSource = cancellationStrategy.receiver.createCancellationTokenSource(tokenKey);
1983         requestTokens[tokenKey] = cancellationSource;
1984         try {
1985           let handlerResult;
1986           if (requestHandler) {
1987             if (requestMessage.params === void 0) {
1988               if (type !== void 0 && type.numberOfParams !== 0) {
1989                 replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InvalidParams, `Request ${requestMessage.method} defines ${type.numberOfParams} params but recevied none.`), requestMessage.method, startTime);
1990                 return;
1991               }
1992               handlerResult = requestHandler(cancellationSource.token);
1993             } else if (Array.isArray(requestMessage.params)) {
1994               if (type !== void 0 && type.parameterStructures === messages_1.ParameterStructures.byName) {
1995                 replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InvalidParams, `Request ${requestMessage.method} defines parameters by name but received parameters by position`), requestMessage.method, startTime);
1996                 return;
1997               }
1998               handlerResult = requestHandler(...requestMessage.params, cancellationSource.token);
1999             } else {
2000               if (type !== void 0 && type.parameterStructures === messages_1.ParameterStructures.byPosition) {
2001                 replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InvalidParams, `Request ${requestMessage.method} defines parameters by position but received parameters by name`), requestMessage.method, startTime);
2002                 return;
2003               }
2004               handlerResult = requestHandler(requestMessage.params, cancellationSource.token);
2005             }
2006           } else if (starRequestHandler) {
2007             handlerResult = starRequestHandler(requestMessage.method, requestMessage.params, cancellationSource.token);
2008           }
2009           const promise = handlerResult;
2010           if (!handlerResult) {
2011             delete requestTokens[tokenKey];
2012             replySuccess(handlerResult, requestMessage.method, startTime);
2013           } else if (promise.then) {
2014             promise.then((resultOrError) => {
2015               delete requestTokens[tokenKey];
2016               reply(resultOrError, requestMessage.method, startTime);
2017             }, (error) => {
2018               delete requestTokens[tokenKey];
2019               if (error instanceof messages_1.ResponseError) {
2020                 replyError(error, requestMessage.method, startTime);
2021               } else if (error && Is.string(error.message)) {
2022                 replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed with message: ${error.message}`), requestMessage.method, startTime);
2023               } else {
2024                 replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed unexpectedly without providing any details.`), requestMessage.method, startTime);
2025               }
2026             });
2027           } else {
2028             delete requestTokens[tokenKey];
2029             reply(handlerResult, requestMessage.method, startTime);
2030           }
2031         } catch (error) {
2032           delete requestTokens[tokenKey];
2033           if (error instanceof messages_1.ResponseError) {
2034             reply(error, requestMessage.method, startTime);
2035           } else if (error && Is.string(error.message)) {
2036             replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed with message: ${error.message}`), requestMessage.method, startTime);
2037           } else {
2038             replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed unexpectedly without providing any details.`), requestMessage.method, startTime);
2039           }
2040         }
2041       } else {
2042         replyError(new messages_1.ResponseError(messages_1.ErrorCodes.MethodNotFound, `Unhandled method ${requestMessage.method}`), requestMessage.method, startTime);
2043       }
2044     }
2045     function handleResponse(responseMessage) {
2046       if (isDisposed()) {
2047         return;
2048       }
2049       if (responseMessage.id === null) {
2050         if (responseMessage.error) {
2051           logger.error(`Received response message without id: Error is: 
2052 ${JSON.stringify(responseMessage.error, void 0, 4)}`);
2053         } else {
2054           logger.error(`Received response message without id. No further error information provided.`);
2055         }
2056       } else {
2057         const key = String(responseMessage.id);
2058         const responsePromise = responsePromises[key];
2059         traceReceivedResponse(responseMessage, responsePromise);
2060         if (responsePromise) {
2061           delete responsePromises[key];
2062           try {
2063             if (responseMessage.error) {
2064               const error = responseMessage.error;
2065               responsePromise.reject(new messages_1.ResponseError(error.code, error.message, error.data));
2066             } else if (responseMessage.result !== void 0) {
2067               responsePromise.resolve(responseMessage.result);
2068             } else {
2069               throw new Error("Should never happen.");
2070             }
2071           } catch (error) {
2072             if (error.message) {
2073               logger.error(`Response handler '${responsePromise.method}' failed with message: ${error.message}`);
2074             } else {
2075               logger.error(`Response handler '${responsePromise.method}' failed unexpectedly.`);
2076             }
2077           }
2078         }
2079       }
2080     }
2081     function handleNotification(message) {
2082       if (isDisposed()) {
2083         return;
2084       }
2085       let type = void 0;
2086       let notificationHandler;
2087       if (message.method === CancelNotification.type.method) {
2088         notificationHandler = (params) => {
2089           const id = params.id;
2090           const source = requestTokens[String(id)];
2091           if (source) {
2092             source.cancel();
2093           }
2094         };
2095       } else {
2096         const element = notificationHandlers[message.method];
2097         if (element) {
2098           notificationHandler = element.handler;
2099           type = element.type;
2100         }
2101       }
2102       if (notificationHandler || starNotificationHandler) {
2103         try {
2104           traceReceivedNotification(message);
2105           if (notificationHandler) {
2106             if (message.params === void 0) {
2107               if (type !== void 0) {
2108                 if (type.numberOfParams !== 0 && type.parameterStructures !== messages_1.ParameterStructures.byName) {
2109                   logger.error(`Notification ${message.method} defines ${type.numberOfParams} params but recevied none.`);
2110                 }
2111               }
2112               notificationHandler();
2113             } else if (Array.isArray(message.params)) {
2114               if (type !== void 0) {
2115                 if (type.parameterStructures === messages_1.ParameterStructures.byName) {
2116                   logger.error(`Notification ${message.method} defines parameters by name but received parameters by position`);
2117                 }
2118                 if (type.numberOfParams !== message.params.length) {
2119                   logger.error(`Notification ${message.method} defines ${type.numberOfParams} params but received ${message.params.length} argumennts`);
2120                 }
2121               }
2122               notificationHandler(...message.params);
2123             } else {
2124               if (type !== void 0 && type.parameterStructures === messages_1.ParameterStructures.byPosition) {
2125                 logger.error(`Notification ${message.method} defines parameters by position but received parameters by name`);
2126               }
2127               notificationHandler(message.params);
2128             }
2129           } else if (starNotificationHandler) {
2130             starNotificationHandler(message.method, message.params);
2131           }
2132         } catch (error) {
2133           if (error.message) {
2134             logger.error(`Notification handler '${message.method}' failed with message: ${error.message}`);
2135           } else {
2136             logger.error(`Notification handler '${message.method}' failed unexpectedly.`);
2137           }
2138         }
2139       } else {
2140         unhandledNotificationEmitter.fire(message);
2141       }
2142     }
2143     function handleInvalidMessage(message) {
2144       if (!message) {
2145         logger.error("Received empty message.");
2146         return;
2147       }
2148       logger.error(`Received message which is neither a response nor a notification message:
2149 ${JSON.stringify(message, null, 4)}`);
2150       const responseMessage = message;
2151       if (Is.string(responseMessage.id) || Is.number(responseMessage.id)) {
2152         const key = String(responseMessage.id);
2153         const responseHandler = responsePromises[key];
2154         if (responseHandler) {
2155           responseHandler.reject(new Error("The received response has neither a result nor an error property."));
2156         }
2157       }
2158     }
2159     function traceSendingRequest(message) {
2160       if (trace === Trace.Off || !tracer) {
2161         return;
2162       }
2163       if (traceFormat === TraceFormat.Text) {
2164         let data = void 0;
2165         if (trace === Trace.Verbose && message.params) {
2166           data = `Params: ${JSON.stringify(message.params, null, 4)}
2167
2168 `;
2169         }
2170         tracer.log(`Sending request '${message.method} - (${message.id})'.`, data);
2171       } else {
2172         logLSPMessage("send-request", message);
2173       }
2174     }
2175     function traceSendingNotification(message) {
2176       if (trace === Trace.Off || !tracer) {
2177         return;
2178       }
2179       if (traceFormat === TraceFormat.Text) {
2180         let data = void 0;
2181         if (trace === Trace.Verbose) {
2182           if (message.params) {
2183             data = `Params: ${JSON.stringify(message.params, null, 4)}
2184
2185 `;
2186           } else {
2187             data = "No parameters provided.\n\n";
2188           }
2189         }
2190         tracer.log(`Sending notification '${message.method}'.`, data);
2191       } else {
2192         logLSPMessage("send-notification", message);
2193       }
2194     }
2195     function traceSendingResponse(message, method, startTime) {
2196       if (trace === Trace.Off || !tracer) {
2197         return;
2198       }
2199       if (traceFormat === TraceFormat.Text) {
2200         let data = void 0;
2201         if (trace === Trace.Verbose) {
2202           if (message.error && message.error.data) {
2203             data = `Error data: ${JSON.stringify(message.error.data, null, 4)}
2204
2205 `;
2206           } else {
2207             if (message.result) {
2208               data = `Result: ${JSON.stringify(message.result, null, 4)}
2209
2210 `;
2211             } else if (message.error === void 0) {
2212               data = "No result returned.\n\n";
2213             }
2214           }
2215         }
2216         tracer.log(`Sending response '${method} - (${message.id})'. Processing request took ${Date.now() - startTime}ms`, data);
2217       } else {
2218         logLSPMessage("send-response", message);
2219       }
2220     }
2221     function traceReceivedRequest(message) {
2222       if (trace === Trace.Off || !tracer) {
2223         return;
2224       }
2225       if (traceFormat === TraceFormat.Text) {
2226         let data = void 0;
2227         if (trace === Trace.Verbose && message.params) {
2228           data = `Params: ${JSON.stringify(message.params, null, 4)}
2229
2230 `;
2231         }
2232         tracer.log(`Received request '${message.method} - (${message.id})'.`, data);
2233       } else {
2234         logLSPMessage("receive-request", message);
2235       }
2236     }
2237     function traceReceivedNotification(message) {
2238       if (trace === Trace.Off || !tracer || message.method === LogTraceNotification.type.method) {
2239         return;
2240       }
2241       if (traceFormat === TraceFormat.Text) {
2242         let data = void 0;
2243         if (trace === Trace.Verbose) {
2244           if (message.params) {
2245             data = `Params: ${JSON.stringify(message.params, null, 4)}
2246
2247 `;
2248           } else {
2249             data = "No parameters provided.\n\n";
2250           }
2251         }
2252         tracer.log(`Received notification '${message.method}'.`, data);
2253       } else {
2254         logLSPMessage("receive-notification", message);
2255       }
2256     }
2257     function traceReceivedResponse(message, responsePromise) {
2258       if (trace === Trace.Off || !tracer) {
2259         return;
2260       }
2261       if (traceFormat === TraceFormat.Text) {
2262         let data = void 0;
2263         if (trace === Trace.Verbose) {
2264           if (message.error && message.error.data) {
2265             data = `Error data: ${JSON.stringify(message.error.data, null, 4)}
2266
2267 `;
2268           } else {
2269             if (message.result) {
2270               data = `Result: ${JSON.stringify(message.result, null, 4)}
2271
2272 `;
2273             } else if (message.error === void 0) {
2274               data = "No result returned.\n\n";
2275             }
2276           }
2277         }
2278         if (responsePromise) {
2279           const error = message.error ? ` Request failed: ${message.error.message} (${message.error.code}).` : "";
2280           tracer.log(`Received response '${responsePromise.method} - (${message.id})' in ${Date.now() - responsePromise.timerStart}ms.${error}`, data);
2281         } else {
2282           tracer.log(`Received response ${message.id} without active response promise.`, data);
2283         }
2284       } else {
2285         logLSPMessage("receive-response", message);
2286       }
2287     }
2288     function logLSPMessage(type, message) {
2289       if (!tracer || trace === Trace.Off) {
2290         return;
2291       }
2292       const lspMessage = {
2293         isLSPMessage: true,
2294         type,
2295         message,
2296         timestamp: Date.now()
2297       };
2298       tracer.log(lspMessage);
2299     }
2300     function throwIfClosedOrDisposed() {
2301       if (isClosed()) {
2302         throw new ConnectionError(ConnectionErrors.Closed, "Connection is closed.");
2303       }
2304       if (isDisposed()) {
2305         throw new ConnectionError(ConnectionErrors.Disposed, "Connection is disposed.");
2306       }
2307     }
2308     function throwIfListening() {
2309       if (isListening()) {
2310         throw new ConnectionError(ConnectionErrors.AlreadyListening, "Connection is already listening");
2311       }
2312     }
2313     function throwIfNotListening() {
2314       if (!isListening()) {
2315         throw new Error("Call listen() first.");
2316       }
2317     }
2318     function undefinedToNull(param) {
2319       if (param === void 0) {
2320         return null;
2321       } else {
2322         return param;
2323       }
2324     }
2325     function nullToUndefined(param) {
2326       if (param === null) {
2327         return void 0;
2328       } else {
2329         return param;
2330       }
2331     }
2332     function isNamedParam(param) {
2333       return param !== void 0 && param !== null && !Array.isArray(param) && typeof param === "object";
2334     }
2335     function computeSingleParam(parameterStructures, param) {
2336       switch (parameterStructures) {
2337         case messages_1.ParameterStructures.auto:
2338           if (isNamedParam(param)) {
2339             return nullToUndefined(param);
2340           } else {
2341             return [undefinedToNull(param)];
2342           }
2343           break;
2344         case messages_1.ParameterStructures.byName:
2345           if (!isNamedParam(param)) {
2346             throw new Error(`Recevied parameters by name but param is not an object literal.`);
2347           }
2348           return nullToUndefined(param);
2349         case messages_1.ParameterStructures.byPosition:
2350           return [undefinedToNull(param)];
2351         default:
2352           throw new Error(`Unknown parameter structure ${parameterStructures.toString()}`);
2353       }
2354     }
2355     function computeMessageParams(type, params) {
2356       let result;
2357       const numberOfParams = type.numberOfParams;
2358       switch (numberOfParams) {
2359         case 0:
2360           result = void 0;
2361           break;
2362         case 1:
2363           result = computeSingleParam(type.parameterStructures, params[0]);
2364           break;
2365         default:
2366           result = [];
2367           for (let i = 0; i < params.length && i < numberOfParams; i++) {
2368             result.push(undefinedToNull(params[i]));
2369           }
2370           if (params.length < numberOfParams) {
2371             for (let i = params.length; i < numberOfParams; i++) {
2372               result.push(null);
2373             }
2374           }
2375           break;
2376       }
2377       return result;
2378     }
2379     const connection = {
2380       sendNotification: (type, ...args) => {
2381         throwIfClosedOrDisposed();
2382         let method;
2383         let messageParams;
2384         if (Is.string(type)) {
2385           method = type;
2386           const first = args[0];
2387           let paramStart = 0;
2388           let parameterStructures = messages_1.ParameterStructures.auto;
2389           if (messages_1.ParameterStructures.is(first)) {
2390             paramStart = 1;
2391             parameterStructures = first;
2392           }
2393           let paramEnd = args.length;
2394           const numberOfParams = paramEnd - paramStart;
2395           switch (numberOfParams) {
2396             case 0:
2397               messageParams = void 0;
2398               break;
2399             case 1:
2400               messageParams = computeSingleParam(parameterStructures, args[paramStart]);
2401               break;
2402             default:
2403               if (parameterStructures === messages_1.ParameterStructures.byName) {
2404                 throw new Error(`Recevied ${numberOfParams} parameters for 'by Name' notification parameter structure.`);
2405               }
2406               messageParams = args.slice(paramStart, paramEnd).map((value) => undefinedToNull(value));
2407               break;
2408           }
2409         } else {
2410           const params = args;
2411           method = type.method;
2412           messageParams = computeMessageParams(type, params);
2413         }
2414         const notificationMessage = {
2415           jsonrpc: version,
2416           method,
2417           params: messageParams
2418         };
2419         traceSendingNotification(notificationMessage);
2420         messageWriter.write(notificationMessage);
2421       },
2422       onNotification: (type, handler) => {
2423         throwIfClosedOrDisposed();
2424         let method;
2425         if (Is.func(type)) {
2426           starNotificationHandler = type;
2427         } else if (handler) {
2428           if (Is.string(type)) {
2429             method = type;
2430             notificationHandlers[type] = {type: void 0, handler};
2431           } else {
2432             method = type.method;
2433             notificationHandlers[type.method] = {type, handler};
2434           }
2435         }
2436         return {
2437           dispose: () => {
2438             if (method !== void 0) {
2439               delete notificationHandlers[method];
2440             } else {
2441               starNotificationHandler = void 0;
2442             }
2443           }
2444         };
2445       },
2446       onProgress: (_type, token, handler) => {
2447         if (progressHandlers.has(token)) {
2448           throw new Error(`Progress handler for token ${token} already registered`);
2449         }
2450         progressHandlers.set(token, handler);
2451         return {
2452           dispose: () => {
2453             progressHandlers.delete(token);
2454           }
2455         };
2456       },
2457       sendProgress: (_type, token, value) => {
2458         connection.sendNotification(ProgressNotification.type, {token, value});
2459       },
2460       onUnhandledProgress: unhandledProgressEmitter.event,
2461       sendRequest: (type, ...args) => {
2462         throwIfClosedOrDisposed();
2463         throwIfNotListening();
2464         let method;
2465         let messageParams;
2466         let token = void 0;
2467         if (Is.string(type)) {
2468           method = type;
2469           const first = args[0];
2470           const last = args[args.length - 1];
2471           let paramStart = 0;
2472           let parameterStructures = messages_1.ParameterStructures.auto;
2473           if (messages_1.ParameterStructures.is(first)) {
2474             paramStart = 1;
2475             parameterStructures = first;
2476           }
2477           let paramEnd = args.length;
2478           if (cancellation_1.CancellationToken.is(last)) {
2479             paramEnd = paramEnd - 1;
2480             token = last;
2481           }
2482           const numberOfParams = paramEnd - paramStart;
2483           switch (numberOfParams) {
2484             case 0:
2485               messageParams = void 0;
2486               break;
2487             case 1:
2488               messageParams = computeSingleParam(parameterStructures, args[paramStart]);
2489               break;
2490             default:
2491               if (parameterStructures === messages_1.ParameterStructures.byName) {
2492                 throw new Error(`Recevied ${numberOfParams} parameters for 'by Name' request parameter structure.`);
2493               }
2494               messageParams = args.slice(paramStart, paramEnd).map((value) => undefinedToNull(value));
2495               break;
2496           }
2497         } else {
2498           const params = args;
2499           method = type.method;
2500           messageParams = computeMessageParams(type, params);
2501           const numberOfParams = type.numberOfParams;
2502           token = cancellation_1.CancellationToken.is(params[numberOfParams]) ? params[numberOfParams] : void 0;
2503         }
2504         const id = sequenceNumber++;
2505         let disposable;
2506         if (token) {
2507           disposable = token.onCancellationRequested(() => {
2508             cancellationStrategy.sender.sendCancellation(connection, id);
2509           });
2510         }
2511         const result = new Promise((resolve, reject) => {
2512           const requestMessage = {
2513             jsonrpc: version,
2514             id,
2515             method,
2516             params: messageParams
2517           };
2518           const resolveWithCleanup = (r) => {
2519             resolve(r);
2520             cancellationStrategy.sender.cleanup(id);
2521             disposable === null || disposable === void 0 ? void 0 : disposable.dispose();
2522           };
2523           const rejectWithCleanup = (r) => {
2524             reject(r);
2525             cancellationStrategy.sender.cleanup(id);
2526             disposable === null || disposable === void 0 ? void 0 : disposable.dispose();
2527           };
2528           let responsePromise = {method, timerStart: Date.now(), resolve: resolveWithCleanup, reject: rejectWithCleanup};
2529           traceSendingRequest(requestMessage);
2530           try {
2531             messageWriter.write(requestMessage);
2532           } catch (e) {
2533             responsePromise.reject(new messages_1.ResponseError(messages_1.ErrorCodes.MessageWriteError, e.message ? e.message : "Unknown reason"));
2534             responsePromise = null;
2535           }
2536           if (responsePromise) {
2537             responsePromises[String(id)] = responsePromise;
2538           }
2539         });
2540         return result;
2541       },
2542       onRequest: (type, handler) => {
2543         throwIfClosedOrDisposed();
2544         let method = null;
2545         if (StarRequestHandler.is(type)) {
2546           method = void 0;
2547           starRequestHandler = type;
2548         } else if (Is.string(type)) {
2549           method = null;
2550           if (handler !== void 0) {
2551             method = type;
2552             requestHandlers[type] = {handler, type: void 0};
2553           }
2554         } else {
2555           if (handler !== void 0) {
2556             method = type.method;
2557             requestHandlers[type.method] = {type, handler};
2558           }
2559         }
2560         return {
2561           dispose: () => {
2562             if (method === null) {
2563               return;
2564             }
2565             if (method !== void 0) {
2566               delete requestHandlers[method];
2567             } else {
2568               starRequestHandler = void 0;
2569             }
2570           }
2571         };
2572       },
2573       trace: (_value, _tracer, sendNotificationOrTraceOptions) => {
2574         let _sendNotification = false;
2575         let _traceFormat = TraceFormat.Text;
2576         if (sendNotificationOrTraceOptions !== void 0) {
2577           if (Is.boolean(sendNotificationOrTraceOptions)) {
2578             _sendNotification = sendNotificationOrTraceOptions;
2579           } else {
2580             _sendNotification = sendNotificationOrTraceOptions.sendNotification || false;
2581             _traceFormat = sendNotificationOrTraceOptions.traceFormat || TraceFormat.Text;
2582           }
2583         }
2584         trace = _value;
2585         traceFormat = _traceFormat;
2586         if (trace === Trace.Off) {
2587           tracer = void 0;
2588         } else {
2589           tracer = _tracer;
2590         }
2591         if (_sendNotification && !isClosed() && !isDisposed()) {
2592           connection.sendNotification(SetTraceNotification.type, {value: Trace.toString(_value)});
2593         }
2594       },
2595       onError: errorEmitter.event,
2596       onClose: closeEmitter.event,
2597       onUnhandledNotification: unhandledNotificationEmitter.event,
2598       onDispose: disposeEmitter.event,
2599       end: () => {
2600         messageWriter.end();
2601       },
2602       dispose: () => {
2603         if (isDisposed()) {
2604           return;
2605         }
2606         state = ConnectionState.Disposed;
2607         disposeEmitter.fire(void 0);
2608         const error = new Error("Connection got disposed.");
2609         Object.keys(responsePromises).forEach((key) => {
2610           responsePromises[key].reject(error);
2611         });
2612         responsePromises = Object.create(null);
2613         requestTokens = Object.create(null);
2614         messageQueue = new linkedMap_1.LinkedMap();
2615         if (Is.func(messageWriter.dispose)) {
2616           messageWriter.dispose();
2617         }
2618         if (Is.func(messageReader.dispose)) {
2619           messageReader.dispose();
2620         }
2621       },
2622       listen: () => {
2623         throwIfClosedOrDisposed();
2624         throwIfListening();
2625         state = ConnectionState.Listening;
2626         messageReader.listen(callback);
2627       },
2628       inspect: () => {
2629         ral_1.default().console.log("inspect");
2630       }
2631     };
2632     connection.onNotification(LogTraceNotification.type, (params) => {
2633       if (trace === Trace.Off || !tracer) {
2634         return;
2635       }
2636       tracer.log(params.message, trace === Trace.Verbose ? params.verbose : void 0);
2637     });
2638     connection.onNotification(ProgressNotification.type, (params) => {
2639       const handler = progressHandlers.get(params.token);
2640       if (handler) {
2641         handler(params.value);
2642       } else {
2643         unhandledProgressEmitter.fire(params);
2644       }
2645     });
2646     return connection;
2647   }
2648   exports2.createMessageConnection = createMessageConnection;
2649 });
2650
2651 // node_modules/vscode-languageserver/node_modules/vscode-jsonrpc/lib/common/api.js
2652 var require_api = __commonJS((exports2) => {
2653   "use strict";
2654   Object.defineProperty(exports2, "__esModule", {value: true});
2655   exports2.CancellationSenderStrategy = exports2.CancellationReceiverStrategy = exports2.ConnectionError = exports2.ConnectionErrors = exports2.LogTraceNotification = exports2.SetTraceNotification = exports2.TraceFormat = exports2.Trace = exports2.ProgressType = exports2.createMessageConnection = exports2.NullLogger = exports2.ConnectionOptions = exports2.ConnectionStrategy = exports2.WriteableStreamMessageWriter = exports2.AbstractMessageWriter = exports2.MessageWriter = exports2.ReadableStreamMessageReader = exports2.AbstractMessageReader = exports2.MessageReader = exports2.CancellationToken = exports2.CancellationTokenSource = exports2.Emitter = exports2.Event = exports2.Disposable = exports2.ParameterStructures = exports2.NotificationType9 = exports2.NotificationType8 = exports2.NotificationType7 = exports2.NotificationType6 = exports2.NotificationType5 = exports2.NotificationType4 = exports2.NotificationType3 = exports2.NotificationType2 = exports2.NotificationType1 = exports2.NotificationType0 = exports2.NotificationType = exports2.ErrorCodes = exports2.ResponseError = exports2.RequestType9 = exports2.RequestType8 = exports2.RequestType7 = exports2.RequestType6 = exports2.RequestType5 = exports2.RequestType4 = exports2.RequestType3 = exports2.RequestType2 = exports2.RequestType1 = exports2.RequestType0 = exports2.RequestType = exports2.RAL = void 0;
2656   exports2.CancellationStrategy = void 0;
2657   var messages_1 = require_messages();
2658   Object.defineProperty(exports2, "RequestType", {enumerable: true, get: function() {
2659     return messages_1.RequestType;
2660   }});
2661   Object.defineProperty(exports2, "RequestType0", {enumerable: true, get: function() {
2662     return messages_1.RequestType0;
2663   }});
2664   Object.defineProperty(exports2, "RequestType1", {enumerable: true, get: function() {
2665     return messages_1.RequestType1;
2666   }});
2667   Object.defineProperty(exports2, "RequestType2", {enumerable: true, get: function() {
2668     return messages_1.RequestType2;
2669   }});
2670   Object.defineProperty(exports2, "RequestType3", {enumerable: true, get: function() {
2671     return messages_1.RequestType3;
2672   }});
2673   Object.defineProperty(exports2, "RequestType4", {enumerable: true, get: function() {
2674     return messages_1.RequestType4;
2675   }});
2676   Object.defineProperty(exports2, "RequestType5", {enumerable: true, get: function() {
2677     return messages_1.RequestType5;
2678   }});
2679   Object.defineProperty(exports2, "RequestType6", {enumerable: true, get: function() {
2680     return messages_1.RequestType6;
2681   }});
2682   Object.defineProperty(exports2, "RequestType7", {enumerable: true, get: function() {
2683     return messages_1.RequestType7;
2684   }});
2685   Object.defineProperty(exports2, "RequestType8", {enumerable: true, get: function() {
2686     return messages_1.RequestType8;
2687   }});
2688   Object.defineProperty(exports2, "RequestType9", {enumerable: true, get: function() {
2689     return messages_1.RequestType9;
2690   }});
2691   Object.defineProperty(exports2, "ResponseError", {enumerable: true, get: function() {
2692     return messages_1.ResponseError;
2693   }});
2694   Object.defineProperty(exports2, "ErrorCodes", {enumerable: true, get: function() {
2695     return messages_1.ErrorCodes;
2696   }});
2697   Object.defineProperty(exports2, "NotificationType", {enumerable: true, get: function() {
2698     return messages_1.NotificationType;
2699   }});
2700   Object.defineProperty(exports2, "NotificationType0", {enumerable: true, get: function() {
2701     return messages_1.NotificationType0;
2702   }});
2703   Object.defineProperty(exports2, "NotificationType1", {enumerable: true, get: function() {
2704     return messages_1.NotificationType1;
2705   }});
2706   Object.defineProperty(exports2, "NotificationType2", {enumerable: true, get: function() {
2707     return messages_1.NotificationType2;
2708   }});
2709   Object.defineProperty(exports2, "NotificationType3", {enumerable: true, get: function() {
2710     return messages_1.NotificationType3;
2711   }});
2712   Object.defineProperty(exports2, "NotificationType4", {enumerable: true, get: function() {
2713     return messages_1.NotificationType4;
2714   }});
2715   Object.defineProperty(exports2, "NotificationType5", {enumerable: true, get: function() {
2716     return messages_1.NotificationType5;
2717   }});
2718   Object.defineProperty(exports2, "NotificationType6", {enumerable: true, get: function() {
2719     return messages_1.NotificationType6;
2720   }});
2721   Object.defineProperty(exports2, "NotificationType7", {enumerable: true, get: function() {
2722     return messages_1.NotificationType7;
2723   }});
2724   Object.defineProperty(exports2, "NotificationType8", {enumerable: true, get: function() {
2725     return messages_1.NotificationType8;
2726   }});
2727   Object.defineProperty(exports2, "NotificationType9", {enumerable: true, get: function() {
2728     return messages_1.NotificationType9;
2729   }});
2730   Object.defineProperty(exports2, "ParameterStructures", {enumerable: true, get: function() {
2731     return messages_1.ParameterStructures;
2732   }});
2733   var disposable_1 = require_disposable();
2734   Object.defineProperty(exports2, "Disposable", {enumerable: true, get: function() {
2735     return disposable_1.Disposable;
2736   }});
2737   var events_1 = require_events();
2738   Object.defineProperty(exports2, "Event", {enumerable: true, get: function() {
2739     return events_1.Event;
2740   }});
2741   Object.defineProperty(exports2, "Emitter", {enumerable: true, get: function() {
2742     return events_1.Emitter;
2743   }});
2744   var cancellation_1 = require_cancellation();
2745   Object.defineProperty(exports2, "CancellationTokenSource", {enumerable: true, get: function() {
2746     return cancellation_1.CancellationTokenSource;
2747   }});
2748   Object.defineProperty(exports2, "CancellationToken", {enumerable: true, get: function() {
2749     return cancellation_1.CancellationToken;
2750   }});
2751   var messageReader_1 = require_messageReader();
2752   Object.defineProperty(exports2, "MessageReader", {enumerable: true, get: function() {
2753     return messageReader_1.MessageReader;
2754   }});
2755   Object.defineProperty(exports2, "AbstractMessageReader", {enumerable: true, get: function() {
2756     return messageReader_1.AbstractMessageReader;
2757   }});
2758   Object.defineProperty(exports2, "ReadableStreamMessageReader", {enumerable: true, get: function() {
2759     return messageReader_1.ReadableStreamMessageReader;
2760   }});
2761   var messageWriter_1 = require_messageWriter();
2762   Object.defineProperty(exports2, "MessageWriter", {enumerable: true, get: function() {
2763     return messageWriter_1.MessageWriter;
2764   }});
2765   Object.defineProperty(exports2, "AbstractMessageWriter", {enumerable: true, get: function() {
2766     return messageWriter_1.AbstractMessageWriter;
2767   }});
2768   Object.defineProperty(exports2, "WriteableStreamMessageWriter", {enumerable: true, get: function() {
2769     return messageWriter_1.WriteableStreamMessageWriter;
2770   }});
2771   var connection_1 = require_connection();
2772   Object.defineProperty(exports2, "ConnectionStrategy", {enumerable: true, get: function() {
2773     return connection_1.ConnectionStrategy;
2774   }});
2775   Object.defineProperty(exports2, "ConnectionOptions", {enumerable: true, get: function() {
2776     return connection_1.ConnectionOptions;
2777   }});
2778   Object.defineProperty(exports2, "NullLogger", {enumerable: true, get: function() {
2779     return connection_1.NullLogger;
2780   }});
2781   Object.defineProperty(exports2, "createMessageConnection", {enumerable: true, get: function() {
2782     return connection_1.createMessageConnection;
2783   }});
2784   Object.defineProperty(exports2, "ProgressType", {enumerable: true, get: function() {
2785     return connection_1.ProgressType;
2786   }});
2787   Object.defineProperty(exports2, "Trace", {enumerable: true, get: function() {
2788     return connection_1.Trace;
2789   }});
2790   Object.defineProperty(exports2, "TraceFormat", {enumerable: true, get: function() {
2791     return connection_1.TraceFormat;
2792   }});
2793   Object.defineProperty(exports2, "SetTraceNotification", {enumerable: true, get: function() {
2794     return connection_1.SetTraceNotification;
2795   }});
2796   Object.defineProperty(exports2, "LogTraceNotification", {enumerable: true, get: function() {
2797     return connection_1.LogTraceNotification;
2798   }});
2799   Object.defineProperty(exports2, "ConnectionErrors", {enumerable: true, get: function() {
2800     return connection_1.ConnectionErrors;
2801   }});
2802   Object.defineProperty(exports2, "ConnectionError", {enumerable: true, get: function() {
2803     return connection_1.ConnectionError;
2804   }});
2805   Object.defineProperty(exports2, "CancellationReceiverStrategy", {enumerable: true, get: function() {
2806     return connection_1.CancellationReceiverStrategy;
2807   }});
2808   Object.defineProperty(exports2, "CancellationSenderStrategy", {enumerable: true, get: function() {
2809     return connection_1.CancellationSenderStrategy;
2810   }});
2811   Object.defineProperty(exports2, "CancellationStrategy", {enumerable: true, get: function() {
2812     return connection_1.CancellationStrategy;
2813   }});
2814   var ral_1 = require_ral();
2815   exports2.RAL = ral_1.default;
2816 });
2817
2818 // node_modules/vscode-languageserver/node_modules/vscode-jsonrpc/lib/node/main.js
2819 var require_main = __commonJS((exports2) => {
2820   "use strict";
2821   var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
2822     if (k2 === void 0)
2823       k2 = k;
2824     Object.defineProperty(o, k2, {enumerable: true, get: function() {
2825       return m[k];
2826     }});
2827   } : function(o, m, k, k2) {
2828     if (k2 === void 0)
2829       k2 = k;
2830     o[k2] = m[k];
2831   });
2832   var __exportStar2 = exports2 && exports2.__exportStar || function(m, exports3) {
2833     for (var p in m)
2834       if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p))
2835         __createBinding(exports3, m, p);
2836   };
2837   Object.defineProperty(exports2, "__esModule", {value: true});
2838   exports2.createMessageConnection = exports2.createServerSocketTransport = exports2.createClientSocketTransport = exports2.createServerPipeTransport = exports2.createClientPipeTransport = exports2.generateRandomPipeName = exports2.StreamMessageWriter = exports2.StreamMessageReader = exports2.SocketMessageWriter = exports2.SocketMessageReader = exports2.IPCMessageWriter = exports2.IPCMessageReader = void 0;
2839   var ril_1 = require_ril();
2840   ril_1.default.install();
2841   var api_1 = require_api();
2842   var path = require("path");
2843   var os = require("os");
2844   var crypto_1 = require("crypto");
2845   var net_1 = require("net");
2846   __exportStar2(require_api(), exports2);
2847   var IPCMessageReader = class extends api_1.AbstractMessageReader {
2848     constructor(process2) {
2849       super();
2850       this.process = process2;
2851       let eventEmitter = this.process;
2852       eventEmitter.on("error", (error) => this.fireError(error));
2853       eventEmitter.on("close", () => this.fireClose());
2854     }
2855     listen(callback) {
2856       this.process.on("message", callback);
2857       return api_1.Disposable.create(() => this.process.off("message", callback));
2858     }
2859   };
2860   exports2.IPCMessageReader = IPCMessageReader;
2861   var IPCMessageWriter = class extends api_1.AbstractMessageWriter {
2862     constructor(process2) {
2863       super();
2864       this.process = process2;
2865       this.errorCount = 0;
2866       let eventEmitter = this.process;
2867       eventEmitter.on("error", (error) => this.fireError(error));
2868       eventEmitter.on("close", () => this.fireClose);
2869     }
2870     write(msg) {
2871       try {
2872         if (typeof this.process.send === "function") {
2873           this.process.send(msg, void 0, void 0, (error) => {
2874             if (error) {
2875               this.errorCount++;
2876               this.handleError(error, msg);
2877             } else {
2878               this.errorCount = 0;
2879             }
2880           });
2881         }
2882         return Promise.resolve();
2883       } catch (error) {
2884         this.handleError(error, msg);
2885         return Promise.reject(error);
2886       }
2887     }
2888     handleError(error, msg) {
2889       this.errorCount++;
2890       this.fireError(error, msg, this.errorCount);
2891     }
2892     end() {
2893     }
2894   };
2895   exports2.IPCMessageWriter = IPCMessageWriter;
2896   var SocketMessageReader = class extends api_1.ReadableStreamMessageReader {
2897     constructor(socket, encoding = "utf-8") {
2898       super(ril_1.default().stream.asReadableStream(socket), encoding);
2899     }
2900   };
2901   exports2.SocketMessageReader = SocketMessageReader;
2902   var SocketMessageWriter = class extends api_1.WriteableStreamMessageWriter {
2903     constructor(socket, options) {
2904       super(ril_1.default().stream.asWritableStream(socket), options);
2905       this.socket = socket;
2906     }
2907     dispose() {
2908       super.dispose();
2909       this.socket.destroy();
2910     }
2911   };
2912   exports2.SocketMessageWriter = SocketMessageWriter;
2913   var StreamMessageReader = class extends api_1.ReadableStreamMessageReader {
2914     constructor(readble, encoding) {
2915       super(ril_1.default().stream.asReadableStream(readble), encoding);
2916     }
2917   };
2918   exports2.StreamMessageReader = StreamMessageReader;
2919   var StreamMessageWriter = class extends api_1.WriteableStreamMessageWriter {
2920     constructor(writable, options) {
2921       super(ril_1.default().stream.asWritableStream(writable), options);
2922     }
2923   };
2924   exports2.StreamMessageWriter = StreamMessageWriter;
2925   var XDG_RUNTIME_DIR = process.env["XDG_RUNTIME_DIR"];
2926   var safeIpcPathLengths = new Map([
2927     ["linux", 107],
2928     ["darwin", 103]
2929   ]);
2930   function generateRandomPipeName() {
2931     const randomSuffix = crypto_1.randomBytes(21).toString("hex");
2932     if (process.platform === "win32") {
2933       return `\\\\.\\pipe\\vscode-jsonrpc-${randomSuffix}-sock`;
2934     }
2935     let result;
2936     if (XDG_RUNTIME_DIR) {
2937       result = path.join(XDG_RUNTIME_DIR, `vscode-ipc-${randomSuffix}.sock`);
2938     } else {
2939       result = path.join(os.tmpdir(), `vscode-${randomSuffix}.sock`);
2940     }
2941     const limit = safeIpcPathLengths.get(process.platform);
2942     if (limit !== void 0 && result.length >= limit) {
2943       ril_1.default().console.warn(`WARNING: IPC handle "${result}" is longer than ${limit} characters.`);
2944     }
2945     return result;
2946   }
2947   exports2.generateRandomPipeName = generateRandomPipeName;
2948   function createClientPipeTransport(pipeName, encoding = "utf-8") {
2949     let connectResolve;
2950     const connected = new Promise((resolve, _reject) => {
2951       connectResolve = resolve;
2952     });
2953     return new Promise((resolve, reject) => {
2954       let server = net_1.createServer((socket) => {
2955         server.close();
2956         connectResolve([
2957           new SocketMessageReader(socket, encoding),
2958           new SocketMessageWriter(socket, encoding)
2959         ]);
2960       });
2961       server.on("error", reject);
2962       server.listen(pipeName, () => {
2963         server.removeListener("error", reject);
2964         resolve({
2965           onConnected: () => {
2966             return connected;
2967           }
2968         });
2969       });
2970     });
2971   }
2972   exports2.createClientPipeTransport = createClientPipeTransport;
2973   function createServerPipeTransport(pipeName, encoding = "utf-8") {
2974     const socket = net_1.createConnection(pipeName);
2975     return [
2976       new SocketMessageReader(socket, encoding),
2977       new SocketMessageWriter(socket, encoding)
2978     ];
2979   }
2980   exports2.createServerPipeTransport = createServerPipeTransport;
2981   function createClientSocketTransport(port, encoding = "utf-8") {
2982     let connectResolve;
2983     const connected = new Promise((resolve, _reject) => {
2984       connectResolve = resolve;
2985     });
2986     return new Promise((resolve, reject) => {
2987       const server = net_1.createServer((socket) => {
2988         server.close();
2989         connectResolve([
2990           new SocketMessageReader(socket, encoding),
2991           new SocketMessageWriter(socket, encoding)
2992         ]);
2993       });
2994       server.on("error", reject);
2995       server.listen(port, "127.0.0.1", () => {
2996         server.removeListener("error", reject);
2997         resolve({
2998           onConnected: () => {
2999             return connected;
3000           }
3001         });
3002       });
3003     });
3004   }
3005   exports2.createClientSocketTransport = createClientSocketTransport;
3006   function createServerSocketTransport(port, encoding = "utf-8") {
3007     const socket = net_1.createConnection(port, "127.0.0.1");
3008     return [
3009       new SocketMessageReader(socket, encoding),
3010       new SocketMessageWriter(socket, encoding)
3011     ];
3012   }
3013   exports2.createServerSocketTransport = createServerSocketTransport;
3014   function isReadableStream(value) {
3015     const candidate = value;
3016     return candidate.read !== void 0 && candidate.addListener !== void 0;
3017   }
3018   function isWritableStream(value) {
3019     const candidate = value;
3020     return candidate.write !== void 0 && candidate.addListener !== void 0;
3021   }
3022   function createMessageConnection(input, output, logger, options) {
3023     if (!logger) {
3024       logger = api_1.NullLogger;
3025     }
3026     const reader = isReadableStream(input) ? new StreamMessageReader(input) : input;
3027     const writer = isWritableStream(output) ? new StreamMessageWriter(output) : output;
3028     if (api_1.ConnectionStrategy.is(options)) {
3029       options = {connectionStrategy: options};
3030     }
3031     return api_1.createMessageConnection(reader, writer, logger, options);
3032   }
3033   exports2.createMessageConnection = createMessageConnection;
3034 });
3035
3036 // node_modules/vscode-languageserver/node_modules/vscode-jsonrpc/node.js
3037 var require_node = __commonJS((exports2, module2) => {
3038   "use strict";
3039   module2.exports = require_main();
3040 });
3041
3042 // node_modules/vscode-languageserver/node_modules/vscode-languageserver-types/lib/esm/main.js
3043 var require_main2 = __commonJS((exports2) => {
3044   __export(exports2, {
3045     AnnotatedTextEdit: () => AnnotatedTextEdit,
3046     ChangeAnnotation: () => ChangeAnnotation,
3047     ChangeAnnotationIdentifier: () => ChangeAnnotationIdentifier,
3048     CodeAction: () => CodeAction,
3049     CodeActionContext: () => CodeActionContext,
3050     CodeActionKind: () => CodeActionKind,
3051     CodeDescription: () => CodeDescription,
3052     CodeLens: () => CodeLens,
3053     Color: () => Color,
3054     ColorInformation: () => ColorInformation,
3055     ColorPresentation: () => ColorPresentation,
3056     Command: () => Command,
3057     CompletionItem: () => CompletionItem,
3058     CompletionItemKind: () => CompletionItemKind,
3059     CompletionItemTag: () => CompletionItemTag,
3060     CompletionList: () => CompletionList,
3061     CreateFile: () => CreateFile,
3062     DeleteFile: () => DeleteFile,
3063     Diagnostic: () => Diagnostic,
3064     DiagnosticRelatedInformation: () => DiagnosticRelatedInformation,
3065     DiagnosticSeverity: () => DiagnosticSeverity,
3066     DiagnosticTag: () => DiagnosticTag,
3067     DocumentHighlight: () => DocumentHighlight,
3068     DocumentHighlightKind: () => DocumentHighlightKind,
3069     DocumentLink: () => DocumentLink,
3070     DocumentSymbol: () => DocumentSymbol,
3071     EOL: () => EOL,
3072     FoldingRange: () => FoldingRange,
3073     FoldingRangeKind: () => FoldingRangeKind,
3074     FormattingOptions: () => FormattingOptions,
3075     Hover: () => Hover,
3076     InsertReplaceEdit: () => InsertReplaceEdit,
3077     InsertTextFormat: () => InsertTextFormat,
3078     InsertTextMode: () => InsertTextMode,
3079     Location: () => Location,
3080     LocationLink: () => LocationLink,
3081     MarkedString: () => MarkedString,
3082     MarkupContent: () => MarkupContent,
3083     MarkupKind: () => MarkupKind,
3084     OptionalVersionedTextDocumentIdentifier: () => OptionalVersionedTextDocumentIdentifier,
3085     ParameterInformation: () => ParameterInformation,
3086     Position: () => Position,
3087     Range: () => Range,
3088     RenameFile: () => RenameFile,
3089     SelectionRange: () => SelectionRange,
3090     SignatureInformation: () => SignatureInformation,
3091     SymbolInformation: () => SymbolInformation,
3092     SymbolKind: () => SymbolKind,
3093     SymbolTag: () => SymbolTag,
3094     TextDocument: () => TextDocument2,
3095     TextDocumentEdit: () => TextDocumentEdit,
3096     TextDocumentIdentifier: () => TextDocumentIdentifier,
3097     TextDocumentItem: () => TextDocumentItem,
3098     TextEdit: () => TextEdit,
3099     VersionedTextDocumentIdentifier: () => VersionedTextDocumentIdentifier,
3100     WorkspaceChange: () => WorkspaceChange,
3101     WorkspaceEdit: () => WorkspaceEdit,
3102     integer: () => integer,
3103     uinteger: () => uinteger
3104   });
3105   "use strict";
3106   var integer;
3107   (function(integer2) {
3108     integer2.MIN_VALUE = -2147483648;
3109     integer2.MAX_VALUE = 2147483647;
3110   })(integer || (integer = {}));
3111   var uinteger;
3112   (function(uinteger2) {
3113     uinteger2.MIN_VALUE = 0;
3114     uinteger2.MAX_VALUE = 2147483647;
3115   })(uinteger || (uinteger = {}));
3116   var Position;
3117   (function(Position2) {
3118     function create(line, character) {
3119       if (line === Number.MAX_VALUE) {
3120         line = uinteger.MAX_VALUE;
3121       }
3122       if (character === Number.MAX_VALUE) {
3123         character = uinteger.MAX_VALUE;
3124       }
3125       return {line, character};
3126     }
3127     Position2.create = create;
3128     function is(value) {
3129       var candidate = value;
3130       return Is.objectLiteral(candidate) && Is.uinteger(candidate.line) && Is.uinteger(candidate.character);
3131     }
3132     Position2.is = is;
3133   })(Position || (Position = {}));
3134   var Range;
3135   (function(Range2) {
3136     function create(one, two, three, four) {
3137       if (Is.uinteger(one) && Is.uinteger(two) && Is.uinteger(three) && Is.uinteger(four)) {
3138         return {start: Position.create(one, two), end: Position.create(three, four)};
3139       } else if (Position.is(one) && Position.is(two)) {
3140         return {start: one, end: two};
3141       } else {
3142         throw new Error("Range#create called with invalid arguments[" + one + ", " + two + ", " + three + ", " + four + "]");
3143       }
3144     }
3145     Range2.create = create;
3146     function is(value) {
3147       var candidate = value;
3148       return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);
3149     }
3150     Range2.is = is;
3151   })(Range || (Range = {}));
3152   var Location;
3153   (function(Location2) {
3154     function create(uri, range) {
3155       return {uri, range};
3156     }
3157     Location2.create = create;
3158     function is(value) {
3159       var candidate = value;
3160       return Is.defined(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri));
3161     }
3162     Location2.is = is;
3163   })(Location || (Location = {}));
3164   var LocationLink;
3165   (function(LocationLink2) {
3166     function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) {
3167       return {targetUri, targetRange, targetSelectionRange, originSelectionRange};
3168     }
3169     LocationLink2.create = create;
3170     function is(value) {
3171       var candidate = value;
3172       return Is.defined(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri) && (Range.is(candidate.targetSelectionRange) || Is.undefined(candidate.targetSelectionRange)) && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange));
3173     }
3174     LocationLink2.is = is;
3175   })(LocationLink || (LocationLink = {}));
3176   var Color;
3177   (function(Color2) {
3178     function create(red, green, blue, alpha) {
3179       return {
3180         red,
3181         green,
3182         blue,
3183         alpha
3184       };
3185     }
3186     Color2.create = create;
3187     function is(value) {
3188       var candidate = value;
3189       return Is.numberRange(candidate.red, 0, 1) && Is.numberRange(candidate.green, 0, 1) && Is.numberRange(candidate.blue, 0, 1) && Is.numberRange(candidate.alpha, 0, 1);
3190     }
3191     Color2.is = is;
3192   })(Color || (Color = {}));
3193   var ColorInformation;
3194   (function(ColorInformation2) {
3195     function create(range, color) {
3196       return {
3197         range,
3198         color
3199       };
3200     }
3201     ColorInformation2.create = create;
3202     function is(value) {
3203       var candidate = value;
3204       return Range.is(candidate.range) && Color.is(candidate.color);
3205     }
3206     ColorInformation2.is = is;
3207   })(ColorInformation || (ColorInformation = {}));
3208   var ColorPresentation;
3209   (function(ColorPresentation2) {
3210     function create(label, textEdit, additionalTextEdits) {
3211       return {
3212         label,
3213         textEdit,
3214         additionalTextEdits
3215       };
3216     }
3217     ColorPresentation2.create = create;
3218     function is(value) {
3219       var candidate = value;
3220       return Is.string(candidate.label) && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate)) && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is));
3221     }
3222     ColorPresentation2.is = is;
3223   })(ColorPresentation || (ColorPresentation = {}));
3224   var FoldingRangeKind;
3225   (function(FoldingRangeKind2) {
3226     FoldingRangeKind2["Comment"] = "comment";
3227     FoldingRangeKind2["Imports"] = "imports";
3228     FoldingRangeKind2["Region"] = "region";
3229   })(FoldingRangeKind || (FoldingRangeKind = {}));
3230   var FoldingRange;
3231   (function(FoldingRange2) {
3232     function create(startLine, endLine, startCharacter, endCharacter, kind) {
3233       var result = {
3234         startLine,
3235         endLine
3236       };
3237       if (Is.defined(startCharacter)) {
3238         result.startCharacter = startCharacter;
3239       }
3240       if (Is.defined(endCharacter)) {
3241         result.endCharacter = endCharacter;
3242       }
3243       if (Is.defined(kind)) {
3244         result.kind = kind;
3245       }
3246       return result;
3247     }
3248     FoldingRange2.create = create;
3249     function is(value) {
3250       var candidate = value;
3251       return Is.uinteger(candidate.startLine) && Is.uinteger(candidate.startLine) && (Is.undefined(candidate.startCharacter) || Is.uinteger(candidate.startCharacter)) && (Is.undefined(candidate.endCharacter) || Is.uinteger(candidate.endCharacter)) && (Is.undefined(candidate.kind) || Is.string(candidate.kind));
3252     }
3253     FoldingRange2.is = is;
3254   })(FoldingRange || (FoldingRange = {}));
3255   var DiagnosticRelatedInformation;
3256   (function(DiagnosticRelatedInformation2) {
3257     function create(location, message) {
3258       return {
3259         location,
3260         message
3261       };
3262     }
3263     DiagnosticRelatedInformation2.create = create;
3264     function is(value) {
3265       var candidate = value;
3266       return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message);
3267     }
3268     DiagnosticRelatedInformation2.is = is;
3269   })(DiagnosticRelatedInformation || (DiagnosticRelatedInformation = {}));
3270   var DiagnosticSeverity;
3271   (function(DiagnosticSeverity2) {
3272     DiagnosticSeverity2.Error = 1;
3273     DiagnosticSeverity2.Warning = 2;
3274     DiagnosticSeverity2.Information = 3;
3275     DiagnosticSeverity2.Hint = 4;
3276   })(DiagnosticSeverity || (DiagnosticSeverity = {}));
3277   var DiagnosticTag;
3278   (function(DiagnosticTag2) {
3279     DiagnosticTag2.Unnecessary = 1;
3280     DiagnosticTag2.Deprecated = 2;
3281   })(DiagnosticTag || (DiagnosticTag = {}));
3282   var CodeDescription;
3283   (function(CodeDescription2) {
3284     function is(value) {
3285       var candidate = value;
3286       return candidate !== void 0 && candidate !== null && Is.string(candidate.href);
3287     }
3288     CodeDescription2.is = is;
3289   })(CodeDescription || (CodeDescription = {}));
3290   var Diagnostic;
3291   (function(Diagnostic2) {
3292     function create(range, message, severity, code, source, relatedInformation) {
3293       var result = {range, message};
3294       if (Is.defined(severity)) {
3295         result.severity = severity;
3296       }
3297       if (Is.defined(code)) {
3298         result.code = code;
3299       }
3300       if (Is.defined(source)) {
3301         result.source = source;
3302       }
3303       if (Is.defined(relatedInformation)) {
3304         result.relatedInformation = relatedInformation;
3305       }
3306       return result;
3307     }
3308     Diagnostic2.create = create;
3309     function is(value) {
3310       var _a2;
3311       var candidate = value;
3312       return Is.defined(candidate) && Range.is(candidate.range) && Is.string(candidate.message) && (Is.number(candidate.severity) || Is.undefined(candidate.severity)) && (Is.integer(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code)) && (Is.undefined(candidate.codeDescription) || Is.string((_a2 = candidate.codeDescription) === null || _a2 === void 0 ? void 0 : _a2.href)) && (Is.string(candidate.source) || Is.undefined(candidate.source)) && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is));
3313     }
3314     Diagnostic2.is = is;
3315   })(Diagnostic || (Diagnostic = {}));
3316   var Command;
3317   (function(Command2) {
3318     function create(title, command) {
3319       var args = [];
3320       for (var _i = 2; _i < arguments.length; _i++) {
3321         args[_i - 2] = arguments[_i];
3322       }
3323       var result = {title, command};
3324       if (Is.defined(args) && args.length > 0) {
3325         result.arguments = args;
3326       }
3327       return result;
3328     }
3329     Command2.create = create;
3330     function is(value) {
3331       var candidate = value;
3332       return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command);
3333     }
3334     Command2.is = is;
3335   })(Command || (Command = {}));
3336   var TextEdit;
3337   (function(TextEdit2) {
3338     function replace(range, newText) {
3339       return {range, newText};
3340     }
3341     TextEdit2.replace = replace;
3342     function insert(position, newText) {
3343       return {range: {start: position, end: position}, newText};
3344     }
3345     TextEdit2.insert = insert;
3346     function del(range) {
3347       return {range, newText: ""};
3348     }
3349     TextEdit2.del = del;
3350     function is(value) {
3351       var candidate = value;
3352       return Is.objectLiteral(candidate) && Is.string(candidate.newText) && Range.is(candidate.range);
3353     }
3354     TextEdit2.is = is;
3355   })(TextEdit || (TextEdit = {}));
3356   var ChangeAnnotation;
3357   (function(ChangeAnnotation2) {
3358     function create(label, needsConfirmation, description) {
3359       var result = {label};
3360       if (needsConfirmation !== void 0) {
3361         result.needsConfirmation = needsConfirmation;
3362       }
3363       if (description !== void 0) {
3364         result.description = description;
3365       }
3366       return result;
3367     }
3368     ChangeAnnotation2.create = create;
3369     function is(value) {
3370       var candidate = value;
3371       return candidate !== void 0 && Is.objectLiteral(candidate) && Is.string(candidate.label) && (Is.boolean(candidate.needsConfirmation) || candidate.needsConfirmation === void 0) && (Is.string(candidate.description) || candidate.description === void 0);
3372     }
3373     ChangeAnnotation2.is = is;
3374   })(ChangeAnnotation || (ChangeAnnotation = {}));
3375   var ChangeAnnotationIdentifier;
3376   (function(ChangeAnnotationIdentifier2) {
3377     function is(value) {
3378       var candidate = value;
3379       return typeof candidate === "string";
3380     }
3381     ChangeAnnotationIdentifier2.is = is;
3382   })(ChangeAnnotationIdentifier || (ChangeAnnotationIdentifier = {}));
3383   var AnnotatedTextEdit;
3384   (function(AnnotatedTextEdit2) {
3385     function replace(range, newText, annotation) {
3386       return {range, newText, annotationId: annotation};
3387     }
3388     AnnotatedTextEdit2.replace = replace;
3389     function insert(position, newText, annotation) {
3390       return {range: {start: position, end: position}, newText, annotationId: annotation};
3391     }
3392     AnnotatedTextEdit2.insert = insert;
3393     function del(range, annotation) {
3394       return {range, newText: "", annotationId: annotation};
3395     }
3396     AnnotatedTextEdit2.del = del;
3397     function is(value) {
3398       var candidate = value;
3399       return TextEdit.is(candidate) && (ChangeAnnotation.is(candidate.annotationId) || ChangeAnnotationIdentifier.is(candidate.annotationId));
3400     }
3401     AnnotatedTextEdit2.is = is;
3402   })(AnnotatedTextEdit || (AnnotatedTextEdit = {}));
3403   var TextDocumentEdit;
3404   (function(TextDocumentEdit2) {
3405     function create(textDocument, edits) {
3406       return {textDocument, edits};
3407     }
3408     TextDocumentEdit2.create = create;
3409     function is(value) {
3410       var candidate = value;
3411       return Is.defined(candidate) && OptionalVersionedTextDocumentIdentifier.is(candidate.textDocument) && Array.isArray(candidate.edits);
3412     }
3413     TextDocumentEdit2.is = is;
3414   })(TextDocumentEdit || (TextDocumentEdit = {}));
3415   var CreateFile;
3416   (function(CreateFile2) {
3417     function create(uri, options, annotation) {
3418       var result = {
3419         kind: "create",
3420         uri
3421       };
3422       if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) {
3423         result.options = options;
3424       }
3425       if (annotation !== void 0) {
3426         result.annotationId = annotation;
3427       }
3428       return result;
3429     }
3430     CreateFile2.create = create;
3431     function is(value) {
3432       var candidate = value;
3433       return candidate && candidate.kind === "create" && Is.string(candidate.uri) && (candidate.options === void 0 || (candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId));
3434     }
3435     CreateFile2.is = is;
3436   })(CreateFile || (CreateFile = {}));
3437   var RenameFile;
3438   (function(RenameFile2) {
3439     function create(oldUri, newUri, options, annotation) {
3440       var result = {
3441         kind: "rename",
3442         oldUri,
3443         newUri
3444       };
3445       if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) {
3446         result.options = options;
3447       }
3448       if (annotation !== void 0) {
3449         result.annotationId = annotation;
3450       }
3451       return result;
3452     }
3453     RenameFile2.create = create;
3454     function is(value) {
3455       var candidate = value;
3456       return candidate && candidate.kind === "rename" && Is.string(candidate.oldUri) && Is.string(candidate.newUri) && (candidate.options === void 0 || (candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId));
3457     }
3458     RenameFile2.is = is;
3459   })(RenameFile || (RenameFile = {}));
3460   var DeleteFile;
3461   (function(DeleteFile2) {
3462     function create(uri, options, annotation) {
3463       var result = {
3464         kind: "delete",
3465         uri
3466       };
3467       if (options !== void 0 && (options.recursive !== void 0 || options.ignoreIfNotExists !== void 0)) {
3468         result.options = options;
3469       }
3470       if (annotation !== void 0) {
3471         result.annotationId = annotation;
3472       }
3473       return result;
3474     }
3475     DeleteFile2.create = create;
3476     function is(value) {
3477       var candidate = value;
3478       return candidate && candidate.kind === "delete" && Is.string(candidate.uri) && (candidate.options === void 0 || (candidate.options.recursive === void 0 || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === void 0 || Is.boolean(candidate.options.ignoreIfNotExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId));
3479     }
3480     DeleteFile2.is = is;
3481   })(DeleteFile || (DeleteFile = {}));
3482   var WorkspaceEdit;
3483   (function(WorkspaceEdit2) {
3484     function is(value) {
3485       var candidate = value;
3486       return candidate && (candidate.changes !== void 0 || candidate.documentChanges !== void 0) && (candidate.documentChanges === void 0 || candidate.documentChanges.every(function(change) {
3487         if (Is.string(change.kind)) {
3488           return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change);
3489         } else {
3490           return TextDocumentEdit.is(change);
3491         }
3492       }));
3493     }
3494     WorkspaceEdit2.is = is;
3495   })(WorkspaceEdit || (WorkspaceEdit = {}));
3496   var TextEditChangeImpl = function() {
3497     function TextEditChangeImpl2(edits, changeAnnotations) {
3498       this.edits = edits;
3499       this.changeAnnotations = changeAnnotations;
3500     }
3501     TextEditChangeImpl2.prototype.insert = function(position, newText, annotation) {
3502       var edit;
3503       var id;
3504       if (annotation === void 0) {
3505         edit = TextEdit.insert(position, newText);
3506       } else if (ChangeAnnotationIdentifier.is(annotation)) {
3507         id = annotation;
3508         edit = AnnotatedTextEdit.insert(position, newText, annotation);
3509       } else {
3510         this.assertChangeAnnotations(this.changeAnnotations);
3511         id = this.changeAnnotations.manage(annotation);
3512         edit = AnnotatedTextEdit.insert(position, newText, id);
3513       }
3514       this.edits.push(edit);
3515       if (id !== void 0) {
3516         return id;
3517       }
3518     };
3519     TextEditChangeImpl2.prototype.replace = function(range, newText, annotation) {
3520       var edit;
3521       var id;
3522       if (annotation === void 0) {
3523         edit = TextEdit.replace(range, newText);
3524       } else if (ChangeAnnotationIdentifier.is(annotation)) {
3525         id = annotation;
3526         edit = AnnotatedTextEdit.replace(range, newText, annotation);
3527       } else {
3528         this.assertChangeAnnotations(this.changeAnnotations);
3529         id = this.changeAnnotations.manage(annotation);
3530         edit = AnnotatedTextEdit.replace(range, newText, id);
3531       }
3532       this.edits.push(edit);
3533       if (id !== void 0) {
3534         return id;
3535       }
3536     };
3537     TextEditChangeImpl2.prototype.delete = function(range, annotation) {
3538       var edit;
3539       var id;
3540       if (annotation === void 0) {
3541         edit = TextEdit.del(range);
3542       } else if (ChangeAnnotationIdentifier.is(annotation)) {
3543         id = annotation;
3544         edit = AnnotatedTextEdit.del(range, annotation);
3545       } else {
3546         this.assertChangeAnnotations(this.changeAnnotations);
3547         id = this.changeAnnotations.manage(annotation);
3548         edit = AnnotatedTextEdit.del(range, id);
3549       }
3550       this.edits.push(edit);
3551       if (id !== void 0) {
3552         return id;
3553       }
3554     };
3555     TextEditChangeImpl2.prototype.add = function(edit) {
3556       this.edits.push(edit);
3557     };
3558     TextEditChangeImpl2.prototype.all = function() {
3559       return this.edits;
3560     };
3561     TextEditChangeImpl2.prototype.clear = function() {
3562       this.edits.splice(0, this.edits.length);
3563     };
3564     TextEditChangeImpl2.prototype.assertChangeAnnotations = function(value) {
3565       if (value === void 0) {
3566         throw new Error("Text edit change is not configured to manage change annotations.");
3567       }
3568     };
3569     return TextEditChangeImpl2;
3570   }();
3571   var ChangeAnnotations = function() {
3572     function ChangeAnnotations2(annotations) {
3573       this._annotations = annotations === void 0 ? Object.create(null) : annotations;
3574       this._counter = 0;
3575       this._size = 0;
3576     }
3577     ChangeAnnotations2.prototype.all = function() {
3578       return this._annotations;
3579     };
3580     Object.defineProperty(ChangeAnnotations2.prototype, "size", {
3581       get: function() {
3582         return this._size;
3583       },
3584       enumerable: false,
3585       configurable: true
3586     });
3587     ChangeAnnotations2.prototype.manage = function(idOrAnnotation, annotation) {
3588       var id;
3589       if (ChangeAnnotationIdentifier.is(idOrAnnotation)) {
3590         id = idOrAnnotation;
3591       } else {
3592         id = this.nextId();
3593         annotation = idOrAnnotation;
3594       }
3595       if (this._annotations[id] !== void 0) {
3596         throw new Error("Id " + id + " is already in use.");
3597       }
3598       if (annotation === void 0) {
3599         throw new Error("No annotation provided for id " + id);
3600       }
3601       this._annotations[id] = annotation;
3602       this._size++;
3603       return id;
3604     };
3605     ChangeAnnotations2.prototype.nextId = function() {
3606       this._counter++;
3607       return this._counter.toString();
3608     };
3609     return ChangeAnnotations2;
3610   }();
3611   var WorkspaceChange = function() {
3612     function WorkspaceChange2(workspaceEdit) {
3613       var _this = this;
3614       this._textEditChanges = Object.create(null);
3615       if (workspaceEdit !== void 0) {
3616         this._workspaceEdit = workspaceEdit;
3617         if (workspaceEdit.documentChanges) {
3618           this._changeAnnotations = new ChangeAnnotations(workspaceEdit.changeAnnotations);
3619           workspaceEdit.changeAnnotations = this._changeAnnotations.all();
3620           workspaceEdit.documentChanges.forEach(function(change) {
3621             if (TextDocumentEdit.is(change)) {
3622               var textEditChange = new TextEditChangeImpl(change.edits, _this._changeAnnotations);
3623               _this._textEditChanges[change.textDocument.uri] = textEditChange;
3624             }
3625           });
3626         } else if (workspaceEdit.changes) {
3627           Object.keys(workspaceEdit.changes).forEach(function(key) {
3628             var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]);
3629             _this._textEditChanges[key] = textEditChange;
3630           });
3631         }
3632       } else {
3633         this._workspaceEdit = {};
3634       }
3635     }
3636     Object.defineProperty(WorkspaceChange2.prototype, "edit", {
3637       get: function() {
3638         this.initDocumentChanges();
3639         if (this._changeAnnotations !== void 0) {
3640           if (this._changeAnnotations.size === 0) {
3641             this._workspaceEdit.changeAnnotations = void 0;
3642           } else {
3643             this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();
3644           }
3645         }
3646         return this._workspaceEdit;
3647       },
3648       enumerable: false,
3649       configurable: true
3650     });
3651     WorkspaceChange2.prototype.getTextEditChange = function(key) {
3652       if (OptionalVersionedTextDocumentIdentifier.is(key)) {
3653         this.initDocumentChanges();
3654         if (this._workspaceEdit.documentChanges === void 0) {
3655           throw new Error("Workspace edit is not configured for document changes.");
3656         }
3657         var textDocument = {uri: key.uri, version: key.version};
3658         var result = this._textEditChanges[textDocument.uri];
3659         if (!result) {
3660           var edits = [];
3661           var textDocumentEdit = {
3662             textDocument,
3663             edits
3664           };
3665           this._workspaceEdit.documentChanges.push(textDocumentEdit);
3666           result = new TextEditChangeImpl(edits, this._changeAnnotations);
3667           this._textEditChanges[textDocument.uri] = result;
3668         }
3669         return result;
3670       } else {
3671         this.initChanges();
3672         if (this._workspaceEdit.changes === void 0) {
3673           throw new Error("Workspace edit is not configured for normal text edit changes.");
3674         }
3675         var result = this._textEditChanges[key];
3676         if (!result) {
3677           var edits = [];
3678           this._workspaceEdit.changes[key] = edits;
3679           result = new TextEditChangeImpl(edits);
3680           this._textEditChanges[key] = result;
3681         }
3682         return result;
3683       }
3684     };
3685     WorkspaceChange2.prototype.initDocumentChanges = function() {
3686       if (this._workspaceEdit.documentChanges === void 0 && this._workspaceEdit.changes === void 0) {
3687         this._changeAnnotations = new ChangeAnnotations();
3688         this._workspaceEdit.documentChanges = [];
3689         this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();
3690       }
3691     };
3692     WorkspaceChange2.prototype.initChanges = function() {
3693       if (this._workspaceEdit.documentChanges === void 0 && this._workspaceEdit.changes === void 0) {
3694         this._workspaceEdit.changes = Object.create(null);
3695       }
3696     };
3697     WorkspaceChange2.prototype.createFile = function(uri, optionsOrAnnotation, options) {
3698       this.initDocumentChanges();
3699       if (this._workspaceEdit.documentChanges === void 0) {
3700         throw new Error("Workspace edit is not configured for document changes.");
3701       }
3702       var annotation;
3703       if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
3704         annotation = optionsOrAnnotation;
3705       } else {
3706         options = optionsOrAnnotation;
3707       }
3708       var operation;
3709       var id;
3710       if (annotation === void 0) {
3711         operation = CreateFile.create(uri, options);
3712       } else {
3713         id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
3714         operation = CreateFile.create(uri, options, id);
3715       }
3716       this._workspaceEdit.documentChanges.push(operation);
3717       if (id !== void 0) {
3718         return id;
3719       }
3720     };
3721     WorkspaceChange2.prototype.renameFile = function(oldUri, newUri, optionsOrAnnotation, options) {
3722       this.initDocumentChanges();
3723       if (this._workspaceEdit.documentChanges === void 0) {
3724         throw new Error("Workspace edit is not configured for document changes.");
3725       }
3726       var annotation;
3727       if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
3728         annotation = optionsOrAnnotation;
3729       } else {
3730         options = optionsOrAnnotation;
3731       }
3732       var operation;
3733       var id;
3734       if (annotation === void 0) {
3735         operation = RenameFile.create(oldUri, newUri, options);
3736       } else {
3737         id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
3738         operation = RenameFile.create(oldUri, newUri, options, id);
3739       }
3740       this._workspaceEdit.documentChanges.push(operation);
3741       if (id !== void 0) {
3742         return id;
3743       }
3744     };
3745     WorkspaceChange2.prototype.deleteFile = function(uri, optionsOrAnnotation, options) {
3746       this.initDocumentChanges();
3747       if (this._workspaceEdit.documentChanges === void 0) {
3748         throw new Error("Workspace edit is not configured for document changes.");
3749       }
3750       var annotation;
3751       if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
3752         annotation = optionsOrAnnotation;
3753       } else {
3754         options = optionsOrAnnotation;
3755       }
3756       var operation;
3757       var id;
3758       if (annotation === void 0) {
3759         operation = DeleteFile.create(uri, options);
3760       } else {
3761         id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
3762         operation = DeleteFile.create(uri, options, id);
3763       }
3764       this._workspaceEdit.documentChanges.push(operation);
3765       if (id !== void 0) {
3766         return id;
3767       }
3768     };
3769     return WorkspaceChange2;
3770   }();
3771   var TextDocumentIdentifier;
3772   (function(TextDocumentIdentifier2) {
3773     function create(uri) {
3774       return {uri};
3775     }
3776     TextDocumentIdentifier2.create = create;
3777     function is(value) {
3778       var candidate = value;
3779       return Is.defined(candidate) && Is.string(candidate.uri);
3780     }
3781     TextDocumentIdentifier2.is = is;
3782   })(TextDocumentIdentifier || (TextDocumentIdentifier = {}));
3783   var VersionedTextDocumentIdentifier;
3784   (function(VersionedTextDocumentIdentifier2) {
3785     function create(uri, version) {
3786       return {uri, version};
3787     }
3788     VersionedTextDocumentIdentifier2.create = create;
3789     function is(value) {
3790       var candidate = value;
3791       return Is.defined(candidate) && Is.string(candidate.uri) && Is.integer(candidate.version);
3792     }
3793     VersionedTextDocumentIdentifier2.is = is;
3794   })(VersionedTextDocumentIdentifier || (VersionedTextDocumentIdentifier = {}));
3795   var OptionalVersionedTextDocumentIdentifier;
3796   (function(OptionalVersionedTextDocumentIdentifier2) {
3797     function create(uri, version) {
3798       return {uri, version};
3799     }
3800     OptionalVersionedTextDocumentIdentifier2.create = create;
3801     function is(value) {
3802       var candidate = value;
3803       return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.integer(candidate.version));
3804     }
3805     OptionalVersionedTextDocumentIdentifier2.is = is;
3806   })(OptionalVersionedTextDocumentIdentifier || (OptionalVersionedTextDocumentIdentifier = {}));
3807   var TextDocumentItem;
3808   (function(TextDocumentItem2) {
3809     function create(uri, languageId, version, text) {
3810       return {uri, languageId, version, text};
3811     }
3812     TextDocumentItem2.create = create;
3813     function is(value) {
3814       var candidate = value;
3815       return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.integer(candidate.version) && Is.string(candidate.text);
3816     }
3817     TextDocumentItem2.is = is;
3818   })(TextDocumentItem || (TextDocumentItem = {}));
3819   var MarkupKind;
3820   (function(MarkupKind2) {
3821     MarkupKind2.PlainText = "plaintext";
3822     MarkupKind2.Markdown = "markdown";
3823   })(MarkupKind || (MarkupKind = {}));
3824   (function(MarkupKind2) {
3825     function is(value) {
3826       var candidate = value;
3827       return candidate === MarkupKind2.PlainText || candidate === MarkupKind2.Markdown;
3828     }
3829     MarkupKind2.is = is;
3830   })(MarkupKind || (MarkupKind = {}));
3831   var MarkupContent;
3832   (function(MarkupContent2) {
3833     function is(value) {
3834       var candidate = value;
3835       return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);
3836     }
3837     MarkupContent2.is = is;
3838   })(MarkupContent || (MarkupContent = {}));
3839   var CompletionItemKind;
3840   (function(CompletionItemKind2) {
3841     CompletionItemKind2.Text = 1;
3842     CompletionItemKind2.Method = 2;
3843     CompletionItemKind2.Function = 3;
3844     CompletionItemKind2.Constructor = 4;
3845     CompletionItemKind2.Field = 5;
3846     CompletionItemKind2.Variable = 6;
3847     CompletionItemKind2.Class = 7;
3848     CompletionItemKind2.Interface = 8;
3849     CompletionItemKind2.Module = 9;
3850     CompletionItemKind2.Property = 10;
3851     CompletionItemKind2.Unit = 11;
3852     CompletionItemKind2.Value = 12;
3853     CompletionItemKind2.Enum = 13;
3854     CompletionItemKind2.Keyword = 14;
3855     CompletionItemKind2.Snippet = 15;
3856     CompletionItemKind2.Color = 16;
3857     CompletionItemKind2.File = 17;
3858     CompletionItemKind2.Reference = 18;
3859     CompletionItemKind2.Folder = 19;
3860     CompletionItemKind2.EnumMember = 20;
3861     CompletionItemKind2.Constant = 21;
3862     CompletionItemKind2.Struct = 22;
3863     CompletionItemKind2.Event = 23;
3864     CompletionItemKind2.Operator = 24;
3865     CompletionItemKind2.TypeParameter = 25;
3866   })(CompletionItemKind || (CompletionItemKind = {}));
3867   var InsertTextFormat;
3868   (function(InsertTextFormat2) {
3869     InsertTextFormat2.PlainText = 1;
3870     InsertTextFormat2.Snippet = 2;
3871   })(InsertTextFormat || (InsertTextFormat = {}));
3872   var CompletionItemTag;
3873   (function(CompletionItemTag2) {
3874     CompletionItemTag2.Deprecated = 1;
3875   })(CompletionItemTag || (CompletionItemTag = {}));
3876   var InsertReplaceEdit;
3877   (function(InsertReplaceEdit2) {
3878     function create(newText, insert, replace) {
3879       return {newText, insert, replace};
3880     }
3881     InsertReplaceEdit2.create = create;
3882     function is(value) {
3883       var candidate = value;
3884       return candidate && Is.string(candidate.newText) && Range.is(candidate.insert) && Range.is(candidate.replace);
3885     }
3886     InsertReplaceEdit2.is = is;
3887   })(InsertReplaceEdit || (InsertReplaceEdit = {}));
3888   var InsertTextMode;
3889   (function(InsertTextMode2) {
3890     InsertTextMode2.asIs = 1;
3891     InsertTextMode2.adjustIndentation = 2;
3892   })(InsertTextMode || (InsertTextMode = {}));
3893   var CompletionItem;
3894   (function(CompletionItem2) {
3895     function create(label) {
3896       return {label};
3897     }
3898     CompletionItem2.create = create;
3899   })(CompletionItem || (CompletionItem = {}));
3900   var CompletionList;
3901   (function(CompletionList2) {
3902     function create(items, isIncomplete) {
3903       return {items: items ? items : [], isIncomplete: !!isIncomplete};
3904     }
3905     CompletionList2.create = create;
3906   })(CompletionList || (CompletionList = {}));
3907   var MarkedString;
3908   (function(MarkedString2) {
3909     function fromPlainText(plainText) {
3910       return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, "\\$&");
3911     }
3912     MarkedString2.fromPlainText = fromPlainText;
3913     function is(value) {
3914       var candidate = value;
3915       return Is.string(candidate) || Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value);
3916     }
3917     MarkedString2.is = is;
3918   })(MarkedString || (MarkedString = {}));
3919   var Hover;
3920   (function(Hover2) {
3921     function is(value) {
3922       var candidate = value;
3923       return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) || MarkedString.is(candidate.contents) || Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === void 0 || Range.is(value.range));
3924     }
3925     Hover2.is = is;
3926   })(Hover || (Hover = {}));
3927   var ParameterInformation;
3928   (function(ParameterInformation2) {
3929     function create(label, documentation) {
3930       return documentation ? {label, documentation} : {label};
3931     }
3932     ParameterInformation2.create = create;
3933   })(ParameterInformation || (ParameterInformation = {}));
3934   var SignatureInformation;
3935   (function(SignatureInformation2) {
3936     function create(label, documentation) {
3937       var parameters = [];
3938       for (var _i = 2; _i < arguments.length; _i++) {
3939         parameters[_i - 2] = arguments[_i];
3940       }
3941       var result = {label};
3942       if (Is.defined(documentation)) {
3943         result.documentation = documentation;
3944       }
3945       if (Is.defined(parameters)) {
3946         result.parameters = parameters;
3947       } else {
3948         result.parameters = [];
3949       }
3950       return result;
3951     }
3952     SignatureInformation2.create = create;
3953   })(SignatureInformation || (SignatureInformation = {}));
3954   var DocumentHighlightKind;
3955   (function(DocumentHighlightKind2) {
3956     DocumentHighlightKind2.Text = 1;
3957     DocumentHighlightKind2.Read = 2;
3958     DocumentHighlightKind2.Write = 3;
3959   })(DocumentHighlightKind || (DocumentHighlightKind = {}));
3960   var DocumentHighlight;
3961   (function(DocumentHighlight2) {
3962     function create(range, kind) {
3963       var result = {range};
3964       if (Is.number(kind)) {
3965         result.kind = kind;
3966       }
3967       return result;
3968     }
3969     DocumentHighlight2.create = create;
3970   })(DocumentHighlight || (DocumentHighlight = {}));
3971   var SymbolKind;
3972   (function(SymbolKind2) {
3973     SymbolKind2.File = 1;
3974     SymbolKind2.Module = 2;
3975     SymbolKind2.Namespace = 3;
3976     SymbolKind2.Package = 4;
3977     SymbolKind2.Class = 5;
3978     SymbolKind2.Method = 6;
3979     SymbolKind2.Property = 7;
3980     SymbolKind2.Field = 8;
3981     SymbolKind2.Constructor = 9;
3982     SymbolKind2.Enum = 10;
3983     SymbolKind2.Interface = 11;
3984     SymbolKind2.Function = 12;
3985     SymbolKind2.Variable = 13;
3986     SymbolKind2.Constant = 14;
3987     SymbolKind2.String = 15;
3988     SymbolKind2.Number = 16;
3989     SymbolKind2.Boolean = 17;
3990     SymbolKind2.Array = 18;
3991     SymbolKind2.Object = 19;
3992     SymbolKind2.Key = 20;
3993     SymbolKind2.Null = 21;
3994     SymbolKind2.EnumMember = 22;
3995     SymbolKind2.Struct = 23;
3996     SymbolKind2.Event = 24;
3997     SymbolKind2.Operator = 25;
3998     SymbolKind2.TypeParameter = 26;
3999   })(SymbolKind || (SymbolKind = {}));
4000   var SymbolTag;
4001   (function(SymbolTag2) {
4002     SymbolTag2.Deprecated = 1;
4003   })(SymbolTag || (SymbolTag = {}));
4004   var SymbolInformation;
4005   (function(SymbolInformation2) {
4006     function create(name, kind, range, uri, containerName) {
4007       var result = {
4008         name,
4009         kind,
4010         location: {uri, range}
4011       };
4012       if (containerName) {
4013         result.containerName = containerName;
4014       }
4015       return result;
4016     }
4017     SymbolInformation2.create = create;
4018   })(SymbolInformation || (SymbolInformation = {}));
4019   var DocumentSymbol;
4020   (function(DocumentSymbol2) {
4021     function create(name, detail, kind, range, selectionRange, children) {
4022       var result = {
4023         name,
4024         detail,
4025         kind,
4026         range,
4027         selectionRange
4028       };
4029       if (children !== void 0) {
4030         result.children = children;
4031       }
4032       return result;
4033     }
4034     DocumentSymbol2.create = create;
4035     function is(value) {
4036       var candidate = value;
4037       return candidate && Is.string(candidate.name) && Is.number(candidate.kind) && Range.is(candidate.range) && Range.is(candidate.selectionRange) && (candidate.detail === void 0 || Is.string(candidate.detail)) && (candidate.deprecated === void 0 || Is.boolean(candidate.deprecated)) && (candidate.children === void 0 || Array.isArray(candidate.children)) && (candidate.tags === void 0 || Array.isArray(candidate.tags));
4038     }
4039     DocumentSymbol2.is = is;
4040   })(DocumentSymbol || (DocumentSymbol = {}));
4041   var CodeActionKind;
4042   (function(CodeActionKind2) {
4043     CodeActionKind2.Empty = "";
4044     CodeActionKind2.QuickFix = "quickfix";
4045     CodeActionKind2.Refactor = "refactor";
4046     CodeActionKind2.RefactorExtract = "refactor.extract";
4047     CodeActionKind2.RefactorInline = "refactor.inline";
4048     CodeActionKind2.RefactorRewrite = "refactor.rewrite";
4049     CodeActionKind2.Source = "source";
4050     CodeActionKind2.SourceOrganizeImports = "source.organizeImports";
4051     CodeActionKind2.SourceFixAll = "source.fixAll";
4052   })(CodeActionKind || (CodeActionKind = {}));
4053   var CodeActionContext;
4054   (function(CodeActionContext2) {
4055     function create(diagnostics, only) {
4056       var result = {diagnostics};
4057       if (only !== void 0 && only !== null) {
4058         result.only = only;
4059       }
4060       return result;
4061     }
4062     CodeActionContext2.create = create;
4063     function is(value) {
4064       var candidate = value;
4065       return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string));
4066     }
4067     CodeActionContext2.is = is;
4068   })(CodeActionContext || (CodeActionContext = {}));
4069   var CodeAction;
4070   (function(CodeAction2) {
4071     function create(title, kindOrCommandOrEdit, kind) {
4072       var result = {title};
4073       var checkKind = true;
4074       if (typeof kindOrCommandOrEdit === "string") {
4075         checkKind = false;
4076         result.kind = kindOrCommandOrEdit;
4077       } else if (Command.is(kindOrCommandOrEdit)) {
4078         result.command = kindOrCommandOrEdit;
4079       } else {
4080         result.edit = kindOrCommandOrEdit;
4081       }
4082       if (checkKind && kind !== void 0) {
4083         result.kind = kind;
4084       }
4085       return result;
4086     }
4087     CodeAction2.create = create;
4088     function is(value) {
4089       var candidate = value;
4090       return candidate && Is.string(candidate.title) && (candidate.diagnostics === void 0 || Is.typedArray(candidate.diagnostics, Diagnostic.is)) && (candidate.kind === void 0 || Is.string(candidate.kind)) && (candidate.edit !== void 0 || candidate.command !== void 0) && (candidate.command === void 0 || Command.is(candidate.command)) && (candidate.isPreferred === void 0 || Is.boolean(candidate.isPreferred)) && (candidate.edit === void 0 || WorkspaceEdit.is(candidate.edit));
4091     }
4092     CodeAction2.is = is;
4093   })(CodeAction || (CodeAction = {}));
4094   var CodeLens;
4095   (function(CodeLens2) {
4096     function create(range, data) {
4097       var result = {range};
4098       if (Is.defined(data)) {
4099         result.data = data;
4100       }
4101       return result;
4102     }
4103     CodeLens2.create = create;
4104     function is(value) {
4105       var candidate = value;
4106       return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command));
4107     }
4108     CodeLens2.is = is;
4109   })(CodeLens || (CodeLens = {}));
4110   var FormattingOptions;
4111   (function(FormattingOptions2) {
4112     function create(tabSize, insertSpaces) {
4113       return {tabSize, insertSpaces};
4114     }
4115     FormattingOptions2.create = create;
4116     function is(value) {
4117       var candidate = value;
4118       return Is.defined(candidate) && Is.uinteger(candidate.tabSize) && Is.boolean(candidate.insertSpaces);
4119     }
4120     FormattingOptions2.is = is;
4121   })(FormattingOptions || (FormattingOptions = {}));
4122   var DocumentLink;
4123   (function(DocumentLink2) {
4124     function create(range, target, data) {
4125       return {range, target, data};
4126     }
4127     DocumentLink2.create = create;
4128     function is(value) {
4129       var candidate = value;
4130       return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target));
4131     }
4132     DocumentLink2.is = is;
4133   })(DocumentLink || (DocumentLink = {}));
4134   var SelectionRange;
4135   (function(SelectionRange2) {
4136     function create(range, parent) {
4137       return {range, parent};
4138     }
4139     SelectionRange2.create = create;
4140     function is(value) {
4141       var candidate = value;
4142       return candidate !== void 0 && Range.is(candidate.range) && (candidate.parent === void 0 || SelectionRange2.is(candidate.parent));
4143     }
4144     SelectionRange2.is = is;
4145   })(SelectionRange || (SelectionRange = {}));
4146   var EOL = ["\n", "\r\n", "\r"];
4147   var TextDocument2;
4148   (function(TextDocument3) {
4149     function create(uri, languageId, version, content) {
4150       return new FullTextDocument2(uri, languageId, version, content);
4151     }
4152     TextDocument3.create = create;
4153     function is(value) {
4154       var candidate = value;
4155       return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.uinteger(candidate.lineCount) && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;
4156     }
4157     TextDocument3.is = is;
4158     function applyEdits(document, edits) {
4159       var text = document.getText();
4160       var sortedEdits = mergeSort2(edits, function(a, b) {
4161         var diff = a.range.start.line - b.range.start.line;
4162         if (diff === 0) {
4163           return a.range.start.character - b.range.start.character;
4164         }
4165         return diff;
4166       });
4167       var lastModifiedOffset = text.length;
4168       for (var i = sortedEdits.length - 1; i >= 0; i--) {
4169         var e = sortedEdits[i];
4170         var startOffset = document.offsetAt(e.range.start);
4171         var endOffset = document.offsetAt(e.range.end);
4172         if (endOffset <= lastModifiedOffset) {
4173           text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length);
4174         } else {
4175           throw new Error("Overlapping edit");
4176         }
4177         lastModifiedOffset = startOffset;
4178       }
4179       return text;
4180     }
4181     TextDocument3.applyEdits = applyEdits;
4182     function mergeSort2(data, compare) {
4183       if (data.length <= 1) {
4184         return data;
4185       }
4186       var p = data.length / 2 | 0;
4187       var left = data.slice(0, p);
4188       var right = data.slice(p);
4189       mergeSort2(left, compare);
4190       mergeSort2(right, compare);
4191       var leftIdx = 0;
4192       var rightIdx = 0;
4193       var i = 0;
4194       while (leftIdx < left.length && rightIdx < right.length) {
4195         var ret = compare(left[leftIdx], right[rightIdx]);
4196         if (ret <= 0) {
4197           data[i++] = left[leftIdx++];
4198         } else {
4199           data[i++] = right[rightIdx++];
4200         }
4201       }
4202       while (leftIdx < left.length) {
4203         data[i++] = left[leftIdx++];
4204       }
4205       while (rightIdx < right.length) {
4206         data[i++] = right[rightIdx++];
4207       }
4208       return data;
4209     }
4210   })(TextDocument2 || (TextDocument2 = {}));
4211   var FullTextDocument2 = function() {
4212     function FullTextDocument3(uri, languageId, version, content) {
4213       this._uri = uri;
4214       this._languageId = languageId;
4215       this._version = version;
4216       this._content = content;
4217       this._lineOffsets = void 0;
4218     }
4219     Object.defineProperty(FullTextDocument3.prototype, "uri", {
4220       get: function() {
4221         return this._uri;
4222       },
4223       enumerable: false,
4224       configurable: true
4225     });
4226     Object.defineProperty(FullTextDocument3.prototype, "languageId", {
4227       get: function() {
4228         return this._languageId;
4229       },
4230       enumerable: false,
4231       configurable: true
4232     });
4233     Object.defineProperty(FullTextDocument3.prototype, "version", {
4234       get: function() {
4235         return this._version;
4236       },
4237       enumerable: false,
4238       configurable: true
4239     });
4240     FullTextDocument3.prototype.getText = function(range) {
4241       if (range) {
4242         var start = this.offsetAt(range.start);
4243         var end = this.offsetAt(range.end);
4244         return this._content.substring(start, end);
4245       }
4246       return this._content;
4247     };
4248     FullTextDocument3.prototype.update = function(event, version) {
4249       this._content = event.text;
4250       this._version = version;
4251       this._lineOffsets = void 0;
4252     };
4253     FullTextDocument3.prototype.getLineOffsets = function() {
4254       if (this._lineOffsets === void 0) {
4255         var lineOffsets = [];
4256         var text = this._content;
4257         var isLineStart = true;
4258         for (var i = 0; i < text.length; i++) {
4259           if (isLineStart) {
4260             lineOffsets.push(i);
4261             isLineStart = false;
4262           }
4263           var ch = text.charAt(i);
4264           isLineStart = ch === "\r" || ch === "\n";
4265           if (ch === "\r" && i + 1 < text.length && text.charAt(i + 1) === "\n") {
4266             i++;
4267           }
4268         }
4269         if (isLineStart && text.length > 0) {
4270           lineOffsets.push(text.length);
4271         }
4272         this._lineOffsets = lineOffsets;
4273       }
4274       return this._lineOffsets;
4275     };
4276     FullTextDocument3.prototype.positionAt = function(offset) {
4277       offset = Math.max(Math.min(offset, this._content.length), 0);
4278       var lineOffsets = this.getLineOffsets();
4279       var low = 0, high = lineOffsets.length;
4280       if (high === 0) {
4281         return Position.create(0, offset);
4282       }
4283       while (low < high) {
4284         var mid = Math.floor((low + high) / 2);
4285         if (lineOffsets[mid] > offset) {
4286           high = mid;
4287         } else {
4288           low = mid + 1;
4289         }
4290       }
4291       var line = low - 1;
4292       return Position.create(line, offset - lineOffsets[line]);
4293     };
4294     FullTextDocument3.prototype.offsetAt = function(position) {
4295       var lineOffsets = this.getLineOffsets();
4296       if (position.line >= lineOffsets.length) {
4297         return this._content.length;
4298       } else if (position.line < 0) {
4299         return 0;
4300       }
4301       var lineOffset = lineOffsets[position.line];
4302       var nextLineOffset = position.line + 1 < lineOffsets.length ? lineOffsets[position.line + 1] : this._content.length;
4303       return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset);
4304     };
4305     Object.defineProperty(FullTextDocument3.prototype, "lineCount", {
4306       get: function() {
4307         return this.getLineOffsets().length;
4308       },
4309       enumerable: false,
4310       configurable: true
4311     });
4312     return FullTextDocument3;
4313   }();
4314   var Is;
4315   (function(Is2) {
4316     var toString = Object.prototype.toString;
4317     function defined(value) {
4318       return typeof value !== "undefined";
4319     }
4320     Is2.defined = defined;
4321     function undefined2(value) {
4322       return typeof value === "undefined";
4323     }
4324     Is2.undefined = undefined2;
4325     function boolean(value) {
4326       return value === true || value === false;
4327     }
4328     Is2.boolean = boolean;
4329     function string(value) {
4330       return toString.call(value) === "[object String]";
4331     }
4332     Is2.string = string;
4333     function number(value) {
4334       return toString.call(value) === "[object Number]";
4335     }
4336     Is2.number = number;
4337     function numberRange(value, min, max) {
4338       return toString.call(value) === "[object Number]" && min <= value && value <= max;
4339     }
4340     Is2.numberRange = numberRange;
4341     function integer2(value) {
4342       return toString.call(value) === "[object Number]" && -2147483648 <= value && value <= 2147483647;
4343     }
4344     Is2.integer = integer2;
4345     function uinteger2(value) {
4346       return toString.call(value) === "[object Number]" && 0 <= value && value <= 2147483647;
4347     }
4348     Is2.uinteger = uinteger2;
4349     function func(value) {
4350       return toString.call(value) === "[object Function]";
4351     }
4352     Is2.func = func;
4353     function objectLiteral(value) {
4354       return value !== null && typeof value === "object";
4355     }
4356     Is2.objectLiteral = objectLiteral;
4357     function typedArray(value, check) {
4358       return Array.isArray(value) && value.every(check);
4359     }
4360     Is2.typedArray = typedArray;
4361   })(Is || (Is = {}));
4362 });
4363
4364 // node_modules/vscode-languageserver/node_modules/vscode-languageserver-protocol/lib/common/messages.js
4365 var require_messages2 = __commonJS((exports2) => {
4366   "use strict";
4367   Object.defineProperty(exports2, "__esModule", {value: true});
4368   exports2.ProtocolNotificationType = exports2.ProtocolNotificationType0 = exports2.ProtocolRequestType = exports2.ProtocolRequestType0 = exports2.RegistrationType = void 0;
4369   var vscode_jsonrpc_1 = require_main();
4370   var RegistrationType = class {
4371     constructor(method) {
4372       this.method = method;
4373     }
4374   };
4375   exports2.RegistrationType = RegistrationType;
4376   var ProtocolRequestType0 = class extends vscode_jsonrpc_1.RequestType0 {
4377     constructor(method) {
4378       super(method);
4379     }
4380   };
4381   exports2.ProtocolRequestType0 = ProtocolRequestType0;
4382   var ProtocolRequestType = class extends vscode_jsonrpc_1.RequestType {
4383     constructor(method) {
4384       super(method, vscode_jsonrpc_1.ParameterStructures.byName);
4385     }
4386   };
4387   exports2.ProtocolRequestType = ProtocolRequestType;
4388   var ProtocolNotificationType0 = class extends vscode_jsonrpc_1.NotificationType0 {
4389     constructor(method) {
4390       super(method);
4391     }
4392   };
4393   exports2.ProtocolNotificationType0 = ProtocolNotificationType0;
4394   var ProtocolNotificationType = class extends vscode_jsonrpc_1.NotificationType {
4395     constructor(method) {
4396       super(method, vscode_jsonrpc_1.ParameterStructures.byName);
4397     }
4398   };
4399   exports2.ProtocolNotificationType = ProtocolNotificationType;
4400 });
4401
4402 // node_modules/vscode-languageserver/node_modules/vscode-languageserver-protocol/lib/common/utils/is.js
4403 var require_is3 = __commonJS((exports2) => {
4404   "use strict";
4405   Object.defineProperty(exports2, "__esModule", {value: true});
4406   exports2.objectLiteral = exports2.typedArray = exports2.stringArray = exports2.array = exports2.func = exports2.error = exports2.number = exports2.string = exports2.boolean = void 0;
4407   function boolean(value) {
4408     return value === true || value === false;
4409   }
4410   exports2.boolean = boolean;
4411   function string(value) {
4412     return typeof value === "string" || value instanceof String;
4413   }
4414   exports2.string = string;
4415   function number(value) {
4416     return typeof value === "number" || value instanceof Number;
4417   }
4418   exports2.number = number;
4419   function error(value) {
4420     return value instanceof Error;
4421   }
4422   exports2.error = error;
4423   function func(value) {
4424     return typeof value === "function";
4425   }
4426   exports2.func = func;
4427   function array(value) {
4428     return Array.isArray(value);
4429   }
4430   exports2.array = array;
4431   function stringArray(value) {
4432     return array(value) && value.every((elem) => string(elem));
4433   }
4434   exports2.stringArray = stringArray;
4435   function typedArray(value, check) {
4436     return Array.isArray(value) && value.every(check);
4437   }
4438   exports2.typedArray = typedArray;
4439   function objectLiteral(value) {
4440     return value !== null && typeof value === "object";
4441   }
4442   exports2.objectLiteral = objectLiteral;
4443 });
4444
4445 // node_modules/vscode-languageserver/node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.js
4446 var require_protocol_implementation = __commonJS((exports2) => {
4447   "use strict";
4448   Object.defineProperty(exports2, "__esModule", {value: true});
4449   exports2.ImplementationRequest = void 0;
4450   var messages_1 = require_messages2();
4451   var ImplementationRequest;
4452   (function(ImplementationRequest2) {
4453     ImplementationRequest2.method = "textDocument/implementation";
4454     ImplementationRequest2.type = new messages_1.ProtocolRequestType(ImplementationRequest2.method);
4455   })(ImplementationRequest = exports2.ImplementationRequest || (exports2.ImplementationRequest = {}));
4456 });
4457
4458 // node_modules/vscode-languageserver/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.js
4459 var require_protocol_typeDefinition = __commonJS((exports2) => {
4460   "use strict";
4461   Object.defineProperty(exports2, "__esModule", {value: true});
4462   exports2.TypeDefinitionRequest = void 0;
4463   var messages_1 = require_messages2();
4464   var TypeDefinitionRequest;
4465   (function(TypeDefinitionRequest2) {
4466     TypeDefinitionRequest2.method = "textDocument/typeDefinition";
4467     TypeDefinitionRequest2.type = new messages_1.ProtocolRequestType(TypeDefinitionRequest2.method);
4468   })(TypeDefinitionRequest = exports2.TypeDefinitionRequest || (exports2.TypeDefinitionRequest = {}));
4469 });
4470
4471 // node_modules/vscode-languageserver/node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolders.js
4472 var require_protocol_workspaceFolders = __commonJS((exports2) => {
4473   "use strict";
4474   Object.defineProperty(exports2, "__esModule", {value: true});
4475   exports2.DidChangeWorkspaceFoldersNotification = exports2.WorkspaceFoldersRequest = void 0;
4476   var messages_1 = require_messages2();
4477   var WorkspaceFoldersRequest;
4478   (function(WorkspaceFoldersRequest2) {
4479     WorkspaceFoldersRequest2.type = new messages_1.ProtocolRequestType0("workspace/workspaceFolders");
4480   })(WorkspaceFoldersRequest = exports2.WorkspaceFoldersRequest || (exports2.WorkspaceFoldersRequest = {}));
4481   var DidChangeWorkspaceFoldersNotification;
4482   (function(DidChangeWorkspaceFoldersNotification2) {
4483     DidChangeWorkspaceFoldersNotification2.type = new messages_1.ProtocolNotificationType("workspace/didChangeWorkspaceFolders");
4484   })(DidChangeWorkspaceFoldersNotification = exports2.DidChangeWorkspaceFoldersNotification || (exports2.DidChangeWorkspaceFoldersNotification = {}));
4485 });
4486
4487 // node_modules/vscode-languageserver/node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.js
4488 var require_protocol_configuration = __commonJS((exports2) => {
4489   "use strict";
4490   Object.defineProperty(exports2, "__esModule", {value: true});
4491   exports2.ConfigurationRequest = void 0;
4492   var messages_1 = require_messages2();
4493   var ConfigurationRequest;
4494   (function(ConfigurationRequest2) {
4495     ConfigurationRequest2.type = new messages_1.ProtocolRequestType("workspace/configuration");
4496   })(ConfigurationRequest = exports2.ConfigurationRequest || (exports2.ConfigurationRequest = {}));
4497 });
4498
4499 // node_modules/vscode-languageserver/node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.js
4500 var require_protocol_colorProvider = __commonJS((exports2) => {
4501   "use strict";
4502   Object.defineProperty(exports2, "__esModule", {value: true});
4503   exports2.ColorPresentationRequest = exports2.DocumentColorRequest = void 0;
4504   var messages_1 = require_messages2();
4505   var DocumentColorRequest;
4506   (function(DocumentColorRequest2) {
4507     DocumentColorRequest2.method = "textDocument/documentColor";
4508     DocumentColorRequest2.type = new messages_1.ProtocolRequestType(DocumentColorRequest2.method);
4509   })(DocumentColorRequest = exports2.DocumentColorRequest || (exports2.DocumentColorRequest = {}));
4510   var ColorPresentationRequest;
4511   (function(ColorPresentationRequest2) {
4512     ColorPresentationRequest2.type = new messages_1.ProtocolRequestType("textDocument/colorPresentation");
4513   })(ColorPresentationRequest = exports2.ColorPresentationRequest || (exports2.ColorPresentationRequest = {}));
4514 });
4515
4516 // node_modules/vscode-languageserver/node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.js
4517 var require_protocol_foldingRange = __commonJS((exports2) => {
4518   "use strict";
4519   Object.defineProperty(exports2, "__esModule", {value: true});
4520   exports2.FoldingRangeRequest = exports2.FoldingRangeKind = void 0;
4521   var messages_1 = require_messages2();
4522   var FoldingRangeKind;
4523   (function(FoldingRangeKind2) {
4524     FoldingRangeKind2["Comment"] = "comment";
4525     FoldingRangeKind2["Imports"] = "imports";
4526     FoldingRangeKind2["Region"] = "region";
4527   })(FoldingRangeKind = exports2.FoldingRangeKind || (exports2.FoldingRangeKind = {}));
4528   var FoldingRangeRequest;
4529   (function(FoldingRangeRequest2) {
4530     FoldingRangeRequest2.method = "textDocument/foldingRange";
4531     FoldingRangeRequest2.type = new messages_1.ProtocolRequestType(FoldingRangeRequest2.method);
4532   })(FoldingRangeRequest = exports2.FoldingRangeRequest || (exports2.FoldingRangeRequest = {}));
4533 });
4534
4535 // node_modules/vscode-languageserver/node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.js
4536 var require_protocol_declaration = __commonJS((exports2) => {
4537   "use strict";
4538   Object.defineProperty(exports2, "__esModule", {value: true});
4539   exports2.DeclarationRequest = void 0;
4540   var messages_1 = require_messages2();
4541   var DeclarationRequest;
4542   (function(DeclarationRequest2) {
4543     DeclarationRequest2.method = "textDocument/declaration";
4544     DeclarationRequest2.type = new messages_1.ProtocolRequestType(DeclarationRequest2.method);
4545   })(DeclarationRequest = exports2.DeclarationRequest || (exports2.DeclarationRequest = {}));
4546 });
4547
4548 // node_modules/vscode-languageserver/node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.js
4549 var require_protocol_selectionRange = __commonJS((exports2) => {
4550   "use strict";
4551   Object.defineProperty(exports2, "__esModule", {value: true});
4552   exports2.SelectionRangeRequest = void 0;
4553   var messages_1 = require_messages2();
4554   var SelectionRangeRequest;
4555   (function(SelectionRangeRequest2) {
4556     SelectionRangeRequest2.method = "textDocument/selectionRange";
4557     SelectionRangeRequest2.type = new messages_1.ProtocolRequestType(SelectionRangeRequest2.method);
4558   })(SelectionRangeRequest = exports2.SelectionRangeRequest || (exports2.SelectionRangeRequest = {}));
4559 });
4560
4561 // node_modules/vscode-languageserver/node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.js
4562 var require_protocol_progress = __commonJS((exports2) => {
4563   "use strict";
4564   Object.defineProperty(exports2, "__esModule", {value: true});
4565   exports2.WorkDoneProgressCancelNotification = exports2.WorkDoneProgressCreateRequest = exports2.WorkDoneProgress = void 0;
4566   var vscode_jsonrpc_1 = require_main();
4567   var messages_1 = require_messages2();
4568   var WorkDoneProgress;
4569   (function(WorkDoneProgress2) {
4570     WorkDoneProgress2.type = new vscode_jsonrpc_1.ProgressType();
4571     function is(value) {
4572       return value === WorkDoneProgress2.type;
4573     }
4574     WorkDoneProgress2.is = is;
4575   })(WorkDoneProgress = exports2.WorkDoneProgress || (exports2.WorkDoneProgress = {}));
4576   var WorkDoneProgressCreateRequest;
4577   (function(WorkDoneProgressCreateRequest2) {
4578     WorkDoneProgressCreateRequest2.type = new messages_1.ProtocolRequestType("window/workDoneProgress/create");
4579   })(WorkDoneProgressCreateRequest = exports2.WorkDoneProgressCreateRequest || (exports2.WorkDoneProgressCreateRequest = {}));
4580   var WorkDoneProgressCancelNotification;
4581   (function(WorkDoneProgressCancelNotification2) {
4582     WorkDoneProgressCancelNotification2.type = new messages_1.ProtocolNotificationType("window/workDoneProgress/cancel");
4583   })(WorkDoneProgressCancelNotification = exports2.WorkDoneProgressCancelNotification || (exports2.WorkDoneProgressCancelNotification = {}));
4584 });
4585
4586 // node_modules/vscode-languageserver/node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.js
4587 var require_protocol_callHierarchy = __commonJS((exports2) => {
4588   "use strict";
4589   Object.defineProperty(exports2, "__esModule", {value: true});
4590   exports2.CallHierarchyOutgoingCallsRequest = exports2.CallHierarchyIncomingCallsRequest = exports2.CallHierarchyPrepareRequest = void 0;
4591   var messages_1 = require_messages2();
4592   var CallHierarchyPrepareRequest;
4593   (function(CallHierarchyPrepareRequest2) {
4594     CallHierarchyPrepareRequest2.method = "textDocument/prepareCallHierarchy";
4595     CallHierarchyPrepareRequest2.type = new messages_1.ProtocolRequestType(CallHierarchyPrepareRequest2.method);
4596   })(CallHierarchyPrepareRequest = exports2.CallHierarchyPrepareRequest || (exports2.CallHierarchyPrepareRequest = {}));
4597   var CallHierarchyIncomingCallsRequest;
4598   (function(CallHierarchyIncomingCallsRequest2) {
4599     CallHierarchyIncomingCallsRequest2.method = "callHierarchy/incomingCalls";
4600     CallHierarchyIncomingCallsRequest2.type = new messages_1.ProtocolRequestType(CallHierarchyIncomingCallsRequest2.method);
4601   })(CallHierarchyIncomingCallsRequest = exports2.CallHierarchyIncomingCallsRequest || (exports2.CallHierarchyIncomingCallsRequest = {}));
4602   var CallHierarchyOutgoingCallsRequest;
4603   (function(CallHierarchyOutgoingCallsRequest2) {
4604     CallHierarchyOutgoingCallsRequest2.method = "callHierarchy/outgoingCalls";
4605     CallHierarchyOutgoingCallsRequest2.type = new messages_1.ProtocolRequestType(CallHierarchyOutgoingCallsRequest2.method);
4606   })(CallHierarchyOutgoingCallsRequest = exports2.CallHierarchyOutgoingCallsRequest || (exports2.CallHierarchyOutgoingCallsRequest = {}));
4607 });
4608
4609 // node_modules/vscode-languageserver/node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.js
4610 var require_protocol_semanticTokens = __commonJS((exports2) => {
4611   "use strict";
4612   Object.defineProperty(exports2, "__esModule", {value: true});
4613   exports2.SemanticTokensRefreshRequest = exports2.SemanticTokensRangeRequest = exports2.SemanticTokensDeltaRequest = exports2.SemanticTokensRequest = exports2.SemanticTokensRegistrationType = exports2.TokenFormat = exports2.SemanticTokens = exports2.SemanticTokenModifiers = exports2.SemanticTokenTypes = void 0;
4614   var messages_1 = require_messages2();
4615   var SemanticTokenTypes;
4616   (function(SemanticTokenTypes2) {
4617     SemanticTokenTypes2["namespace"] = "namespace";
4618     SemanticTokenTypes2["type"] = "type";
4619     SemanticTokenTypes2["class"] = "class";
4620     SemanticTokenTypes2["enum"] = "enum";
4621     SemanticTokenTypes2["interface"] = "interface";
4622     SemanticTokenTypes2["struct"] = "struct";
4623     SemanticTokenTypes2["typeParameter"] = "typeParameter";
4624     SemanticTokenTypes2["parameter"] = "parameter";
4625     SemanticTokenTypes2["variable"] = "variable";
4626     SemanticTokenTypes2["property"] = "property";
4627     SemanticTokenTypes2["enumMember"] = "enumMember";
4628     SemanticTokenTypes2["event"] = "event";
4629     SemanticTokenTypes2["function"] = "function";
4630     SemanticTokenTypes2["method"] = "method";
4631     SemanticTokenTypes2["macro"] = "macro";
4632     SemanticTokenTypes2["keyword"] = "keyword";
4633     SemanticTokenTypes2["modifier"] = "modifier";
4634     SemanticTokenTypes2["comment"] = "comment";
4635     SemanticTokenTypes2["string"] = "string";
4636     SemanticTokenTypes2["number"] = "number";
4637     SemanticTokenTypes2["regexp"] = "regexp";
4638     SemanticTokenTypes2["operator"] = "operator";
4639   })(SemanticTokenTypes = exports2.SemanticTokenTypes || (exports2.SemanticTokenTypes = {}));
4640   var SemanticTokenModifiers;
4641   (function(SemanticTokenModifiers2) {
4642     SemanticTokenModifiers2["declaration"] = "declaration";
4643     SemanticTokenModifiers2["definition"] = "definition";
4644     SemanticTokenModifiers2["readonly"] = "readonly";
4645     SemanticTokenModifiers2["static"] = "static";
4646     SemanticTokenModifiers2["deprecated"] = "deprecated";
4647     SemanticTokenModifiers2["abstract"] = "abstract";
4648     SemanticTokenModifiers2["async"] = "async";
4649     SemanticTokenModifiers2["modification"] = "modification";
4650     SemanticTokenModifiers2["documentation"] = "documentation";
4651     SemanticTokenModifiers2["defaultLibrary"] = "defaultLibrary";
4652   })(SemanticTokenModifiers = exports2.SemanticTokenModifiers || (exports2.SemanticTokenModifiers = {}));
4653   var SemanticTokens;
4654   (function(SemanticTokens2) {
4655     function is(value) {
4656       const candidate = value;
4657       return candidate !== void 0 && (candidate.resultId === void 0 || typeof candidate.resultId === "string") && Array.isArray(candidate.data) && (candidate.data.length === 0 || typeof candidate.data[0] === "number");
4658     }
4659     SemanticTokens2.is = is;
4660   })(SemanticTokens = exports2.SemanticTokens || (exports2.SemanticTokens = {}));
4661   var TokenFormat;
4662   (function(TokenFormat2) {
4663     TokenFormat2.Relative = "relative";
4664   })(TokenFormat = exports2.TokenFormat || (exports2.TokenFormat = {}));
4665   var SemanticTokensRegistrationType;
4666   (function(SemanticTokensRegistrationType2) {
4667     SemanticTokensRegistrationType2.method = "textDocument/semanticTokens";
4668     SemanticTokensRegistrationType2.type = new messages_1.RegistrationType(SemanticTokensRegistrationType2.method);
4669   })(SemanticTokensRegistrationType = exports2.SemanticTokensRegistrationType || (exports2.SemanticTokensRegistrationType = {}));
4670   var SemanticTokensRequest;
4671   (function(SemanticTokensRequest2) {
4672     SemanticTokensRequest2.method = "textDocument/semanticTokens/full";
4673     SemanticTokensRequest2.type = new messages_1.ProtocolRequestType(SemanticTokensRequest2.method);
4674   })(SemanticTokensRequest = exports2.SemanticTokensRequest || (exports2.SemanticTokensRequest = {}));
4675   var SemanticTokensDeltaRequest;
4676   (function(SemanticTokensDeltaRequest2) {
4677     SemanticTokensDeltaRequest2.method = "textDocument/semanticTokens/full/delta";
4678     SemanticTokensDeltaRequest2.type = new messages_1.ProtocolRequestType(SemanticTokensDeltaRequest2.method);
4679   })(SemanticTokensDeltaRequest = exports2.SemanticTokensDeltaRequest || (exports2.SemanticTokensDeltaRequest = {}));
4680   var SemanticTokensRangeRequest;
4681   (function(SemanticTokensRangeRequest2) {
4682     SemanticTokensRangeRequest2.method = "textDocument/semanticTokens/range";
4683     SemanticTokensRangeRequest2.type = new messages_1.ProtocolRequestType(SemanticTokensRangeRequest2.method);
4684   })(SemanticTokensRangeRequest = exports2.SemanticTokensRangeRequest || (exports2.SemanticTokensRangeRequest = {}));
4685   var SemanticTokensRefreshRequest;
4686   (function(SemanticTokensRefreshRequest2) {
4687     SemanticTokensRefreshRequest2.method = `workspace/semanticTokens/refresh`;
4688     SemanticTokensRefreshRequest2.type = new messages_1.ProtocolRequestType0(SemanticTokensRefreshRequest2.method);
4689   })(SemanticTokensRefreshRequest = exports2.SemanticTokensRefreshRequest || (exports2.SemanticTokensRefreshRequest = {}));
4690 });
4691
4692 // node_modules/vscode-languageserver/node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.js
4693 var require_protocol_showDocument = __commonJS((exports2) => {
4694   "use strict";
4695   Object.defineProperty(exports2, "__esModule", {value: true});
4696   exports2.ShowDocumentRequest = void 0;
4697   var messages_1 = require_messages2();
4698   var ShowDocumentRequest;
4699   (function(ShowDocumentRequest2) {
4700     ShowDocumentRequest2.method = "window/showDocument";
4701     ShowDocumentRequest2.type = new messages_1.ProtocolRequestType(ShowDocumentRequest2.method);
4702   })(ShowDocumentRequest = exports2.ShowDocumentRequest || (exports2.ShowDocumentRequest = {}));
4703 });
4704
4705 // node_modules/vscode-languageserver/node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.js
4706 var require_protocol_linkedEditingRange = __commonJS((exports2) => {
4707   "use strict";
4708   Object.defineProperty(exports2, "__esModule", {value: true});
4709   exports2.LinkedEditingRangeRequest = void 0;
4710   var messages_1 = require_messages2();
4711   var LinkedEditingRangeRequest;
4712   (function(LinkedEditingRangeRequest2) {
4713     LinkedEditingRangeRequest2.method = "textDocument/linkedEditingRange";
4714     LinkedEditingRangeRequest2.type = new messages_1.ProtocolRequestType(LinkedEditingRangeRequest2.method);
4715   })(LinkedEditingRangeRequest = exports2.LinkedEditingRangeRequest || (exports2.LinkedEditingRangeRequest = {}));
4716 });
4717
4718 // node_modules/vscode-languageserver/node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.js
4719 var require_protocol_fileOperations = __commonJS((exports2) => {
4720   "use strict";
4721   Object.defineProperty(exports2, "__esModule", {value: true});
4722   exports2.WillDeleteFilesRequest = exports2.DidDeleteFilesNotification = exports2.DidRenameFilesNotification = exports2.WillRenameFilesRequest = exports2.DidCreateFilesNotification = exports2.WillCreateFilesRequest = exports2.FileOperationPatternKind = void 0;
4723   var messages_1 = require_messages2();
4724   var FileOperationPatternKind;
4725   (function(FileOperationPatternKind2) {
4726     FileOperationPatternKind2.file = "file";
4727     FileOperationPatternKind2.folder = "folder";
4728   })(FileOperationPatternKind = exports2.FileOperationPatternKind || (exports2.FileOperationPatternKind = {}));
4729   var WillCreateFilesRequest;
4730   (function(WillCreateFilesRequest2) {
4731     WillCreateFilesRequest2.method = "workspace/willCreateFiles";
4732     WillCreateFilesRequest2.type = new messages_1.ProtocolRequestType(WillCreateFilesRequest2.method);
4733   })(WillCreateFilesRequest = exports2.WillCreateFilesRequest || (exports2.WillCreateFilesRequest = {}));
4734   var DidCreateFilesNotification;
4735   (function(DidCreateFilesNotification2) {
4736     DidCreateFilesNotification2.method = "workspace/didCreateFiles";
4737     DidCreateFilesNotification2.type = new messages_1.ProtocolNotificationType(DidCreateFilesNotification2.method);
4738   })(DidCreateFilesNotification = exports2.DidCreateFilesNotification || (exports2.DidCreateFilesNotification = {}));
4739   var WillRenameFilesRequest;
4740   (function(WillRenameFilesRequest2) {
4741     WillRenameFilesRequest2.method = "workspace/willRenameFiles";
4742     WillRenameFilesRequest2.type = new messages_1.ProtocolRequestType(WillRenameFilesRequest2.method);
4743   })(WillRenameFilesRequest = exports2.WillRenameFilesRequest || (exports2.WillRenameFilesRequest = {}));
4744   var DidRenameFilesNotification;
4745   (function(DidRenameFilesNotification2) {
4746     DidRenameFilesNotification2.method = "workspace/didRenameFiles";
4747     DidRenameFilesNotification2.type = new messages_1.ProtocolNotificationType(DidRenameFilesNotification2.method);
4748   })(DidRenameFilesNotification = exports2.DidRenameFilesNotification || (exports2.DidRenameFilesNotification = {}));
4749   var DidDeleteFilesNotification;
4750   (function(DidDeleteFilesNotification2) {
4751     DidDeleteFilesNotification2.method = "workspace/didDeleteFiles";
4752     DidDeleteFilesNotification2.type = new messages_1.ProtocolNotificationType(DidDeleteFilesNotification2.method);
4753   })(DidDeleteFilesNotification = exports2.DidDeleteFilesNotification || (exports2.DidDeleteFilesNotification = {}));
4754   var WillDeleteFilesRequest;
4755   (function(WillDeleteFilesRequest2) {
4756     WillDeleteFilesRequest2.method = "workspace/willDeleteFiles";
4757     WillDeleteFilesRequest2.type = new messages_1.ProtocolRequestType(WillDeleteFilesRequest2.method);
4758   })(WillDeleteFilesRequest = exports2.WillDeleteFilesRequest || (exports2.WillDeleteFilesRequest = {}));
4759 });
4760
4761 // node_modules/vscode-languageserver/node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.js
4762 var require_protocol_moniker = __commonJS((exports2) => {
4763   "use strict";
4764   Object.defineProperty(exports2, "__esModule", {value: true});
4765   exports2.MonikerRequest = exports2.MonikerKind = exports2.UniquenessLevel = void 0;
4766   var messages_1 = require_messages2();
4767   var UniquenessLevel;
4768   (function(UniquenessLevel2) {
4769     UniquenessLevel2["document"] = "document";
4770     UniquenessLevel2["project"] = "project";
4771     UniquenessLevel2["group"] = "group";
4772     UniquenessLevel2["scheme"] = "scheme";
4773     UniquenessLevel2["global"] = "global";
4774   })(UniquenessLevel = exports2.UniquenessLevel || (exports2.UniquenessLevel = {}));
4775   var MonikerKind;
4776   (function(MonikerKind2) {
4777     MonikerKind2["import"] = "import";
4778     MonikerKind2["export"] = "export";
4779     MonikerKind2["local"] = "local";
4780   })(MonikerKind = exports2.MonikerKind || (exports2.MonikerKind = {}));
4781   var MonikerRequest;
4782   (function(MonikerRequest2) {
4783     MonikerRequest2.method = "textDocument/moniker";
4784     MonikerRequest2.type = new messages_1.ProtocolRequestType(MonikerRequest2.method);
4785   })(MonikerRequest = exports2.MonikerRequest || (exports2.MonikerRequest = {}));
4786 });
4787
4788 // node_modules/vscode-languageserver/node_modules/vscode-languageserver-protocol/lib/common/protocol.js
4789 var require_protocol = __commonJS((exports2) => {
4790   "use strict";
4791   Object.defineProperty(exports2, "__esModule", {value: true});
4792   exports2.DocumentLinkRequest = exports2.CodeLensRefreshRequest = exports2.CodeLensResolveRequest = exports2.CodeLensRequest = exports2.WorkspaceSymbolRequest = exports2.CodeActionResolveRequest = exports2.CodeActionRequest = exports2.DocumentSymbolRequest = exports2.DocumentHighlightRequest = exports2.ReferencesRequest = exports2.DefinitionRequest = exports2.SignatureHelpRequest = exports2.SignatureHelpTriggerKind = exports2.HoverRequest = exports2.CompletionResolveRequest = exports2.CompletionRequest = exports2.CompletionTriggerKind = exports2.PublishDiagnosticsNotification = exports2.WatchKind = exports2.FileChangeType = exports2.DidChangeWatchedFilesNotification = exports2.WillSaveTextDocumentWaitUntilRequest = exports2.WillSaveTextDocumentNotification = exports2.TextDocumentSaveReason = exports2.DidSaveTextDocumentNotification = exports2.DidCloseTextDocumentNotification = exports2.DidChangeTextDocumentNotification = exports2.TextDocumentContentChangeEvent = exports2.DidOpenTextDocumentNotification = exports2.TextDocumentSyncKind = exports2.TelemetryEventNotification = exports2.LogMessageNotification = exports2.ShowMessageRequest = exports2.ShowMessageNotification = exports2.MessageType = exports2.DidChangeConfigurationNotification = exports2.ExitNotification = exports2.ShutdownRequest = exports2.InitializedNotification = exports2.InitializeError = exports2.InitializeRequest = exports2.WorkDoneProgressOptions = exports2.TextDocumentRegistrationOptions = exports2.StaticRegistrationOptions = exports2.FailureHandlingKind = exports2.ResourceOperationKind = exports2.UnregistrationRequest = exports2.RegistrationRequest = exports2.DocumentSelector = exports2.DocumentFilter = void 0;
4793   exports2.MonikerRequest = exports2.MonikerKind = exports2.UniquenessLevel = exports2.WillDeleteFilesRequest = exports2.DidDeleteFilesNotification = exports2.WillRenameFilesRequest = exports2.DidRenameFilesNotification = exports2.WillCreateFilesRequest = exports2.DidCreateFilesNotification = exports2.FileOperationPatternKind = exports2.LinkedEditingRangeRequest = exports2.ShowDocumentRequest = exports2.SemanticTokensRegistrationType = exports2.SemanticTokensRefreshRequest = exports2.SemanticTokensRangeRequest = exports2.SemanticTokensDeltaRequest = exports2.SemanticTokensRequest = exports2.TokenFormat = exports2.SemanticTokens = exports2.SemanticTokenModifiers = exports2.SemanticTokenTypes = exports2.CallHierarchyPrepareRequest = exports2.CallHierarchyOutgoingCallsRequest = exports2.CallHierarchyIncomingCallsRequest = exports2.WorkDoneProgressCancelNotification = exports2.WorkDoneProgressCreateRequest = exports2.WorkDoneProgress = exports2.SelectionRangeRequest = exports2.DeclarationRequest = exports2.FoldingRangeRequest = exports2.ColorPresentationRequest = exports2.DocumentColorRequest = exports2.ConfigurationRequest = exports2.DidChangeWorkspaceFoldersNotification = exports2.WorkspaceFoldersRequest = exports2.TypeDefinitionRequest = exports2.ImplementationRequest = exports2.ApplyWorkspaceEditRequest = exports2.ExecuteCommandRequest = exports2.PrepareRenameRequest = exports2.RenameRequest = exports2.PrepareSupportDefaultBehavior = exports2.DocumentOnTypeFormattingRequest = exports2.DocumentRangeFormattingRequest = exports2.DocumentFormattingRequest = exports2.DocumentLinkResolveRequest = void 0;
4794   var Is = require_is3();
4795   var messages_1 = require_messages2();
4796   var protocol_implementation_1 = require_protocol_implementation();
4797   Object.defineProperty(exports2, "ImplementationRequest", {enumerable: true, get: function() {
4798     return protocol_implementation_1.ImplementationRequest;
4799   }});
4800   var protocol_typeDefinition_1 = require_protocol_typeDefinition();
4801   Object.defineProperty(exports2, "TypeDefinitionRequest", {enumerable: true, get: function() {
4802     return protocol_typeDefinition_1.TypeDefinitionRequest;
4803   }});
4804   var protocol_workspaceFolders_1 = require_protocol_workspaceFolders();
4805   Object.defineProperty(exports2, "WorkspaceFoldersRequest", {enumerable: true, get: function() {
4806     return protocol_workspaceFolders_1.WorkspaceFoldersRequest;
4807   }});
4808   Object.defineProperty(exports2, "DidChangeWorkspaceFoldersNotification", {enumerable: true, get: function() {
4809     return protocol_workspaceFolders_1.DidChangeWorkspaceFoldersNotification;
4810   }});
4811   var protocol_configuration_1 = require_protocol_configuration();
4812   Object.defineProperty(exports2, "ConfigurationRequest", {enumerable: true, get: function() {
4813     return protocol_configuration_1.ConfigurationRequest;
4814   }});
4815   var protocol_colorProvider_1 = require_protocol_colorProvider();
4816   Object.defineProperty(exports2, "DocumentColorRequest", {enumerable: true, get: function() {
4817     return protocol_colorProvider_1.DocumentColorRequest;
4818   }});
4819   Object.defineProperty(exports2, "ColorPresentationRequest", {enumerable: true, get: function() {
4820     return protocol_colorProvider_1.ColorPresentationRequest;
4821   }});
4822   var protocol_foldingRange_1 = require_protocol_foldingRange();
4823   Object.defineProperty(exports2, "FoldingRangeRequest", {enumerable: true, get: function() {
4824     return protocol_foldingRange_1.FoldingRangeRequest;
4825   }});
4826   var protocol_declaration_1 = require_protocol_declaration();
4827   Object.defineProperty(exports2, "DeclarationRequest", {enumerable: true, get: function() {
4828     return protocol_declaration_1.DeclarationRequest;
4829   }});
4830   var protocol_selectionRange_1 = require_protocol_selectionRange();
4831   Object.defineProperty(exports2, "SelectionRangeRequest", {enumerable: true, get: function() {
4832     return protocol_selectionRange_1.SelectionRangeRequest;
4833   }});
4834   var protocol_progress_1 = require_protocol_progress();
4835   Object.defineProperty(exports2, "WorkDoneProgress", {enumerable: true, get: function() {
4836     return protocol_progress_1.WorkDoneProgress;
4837   }});
4838   Object.defineProperty(exports2, "WorkDoneProgressCreateRequest", {enumerable: true, get: function() {
4839     return protocol_progress_1.WorkDoneProgressCreateRequest;
4840   }});
4841   Object.defineProperty(exports2, "WorkDoneProgressCancelNotification", {enumerable: true, get: function() {
4842     return protocol_progress_1.WorkDoneProgressCancelNotification;
4843   }});
4844   var protocol_callHierarchy_1 = require_protocol_callHierarchy();
4845   Object.defineProperty(exports2, "CallHierarchyIncomingCallsRequest", {enumerable: true, get: function() {
4846     return protocol_callHierarchy_1.CallHierarchyIncomingCallsRequest;
4847   }});
4848   Object.defineProperty(exports2, "CallHierarchyOutgoingCallsRequest", {enumerable: true, get: function() {
4849     return protocol_callHierarchy_1.CallHierarchyOutgoingCallsRequest;
4850   }});
4851   Object.defineProperty(exports2, "CallHierarchyPrepareRequest", {enumerable: true, get: function() {
4852     return protocol_callHierarchy_1.CallHierarchyPrepareRequest;
4853   }});
4854   var protocol_semanticTokens_1 = require_protocol_semanticTokens();
4855   Object.defineProperty(exports2, "SemanticTokenTypes", {enumerable: true, get: function() {
4856     return protocol_semanticTokens_1.SemanticTokenTypes;
4857   }});
4858   Object.defineProperty(exports2, "SemanticTokenModifiers", {enumerable: true, get: function() {
4859     return protocol_semanticTokens_1.SemanticTokenModifiers;
4860   }});
4861   Object.defineProperty(exports2, "SemanticTokens", {enumerable: true, get: function() {
4862     return protocol_semanticTokens_1.SemanticTokens;
4863   }});
4864   Object.defineProperty(exports2, "TokenFormat", {enumerable: true, get: function() {
4865     return protocol_semanticTokens_1.TokenFormat;
4866   }});
4867   Object.defineProperty(exports2, "SemanticTokensRequest", {enumerable: true, get: function() {
4868     return protocol_semanticTokens_1.SemanticTokensRequest;
4869   }});
4870   Object.defineProperty(exports2, "SemanticTokensDeltaRequest", {enumerable: true, get: function() {
4871     return protocol_semanticTokens_1.SemanticTokensDeltaRequest;
4872   }});
4873   Object.defineProperty(exports2, "SemanticTokensRangeRequest", {enumerable: true, get: function() {
4874     return protocol_semanticTokens_1.SemanticTokensRangeRequest;
4875   }});
4876   Object.defineProperty(exports2, "SemanticTokensRefreshRequest", {enumerable: true, get: function() {
4877     return protocol_semanticTokens_1.SemanticTokensRefreshRequest;
4878   }});
4879   Object.defineProperty(exports2, "SemanticTokensRegistrationType", {enumerable: true, get: function() {
4880     return protocol_semanticTokens_1.SemanticTokensRegistrationType;
4881   }});
4882   var protocol_showDocument_1 = require_protocol_showDocument();
4883   Object.defineProperty(exports2, "ShowDocumentRequest", {enumerable: true, get: function() {
4884     return protocol_showDocument_1.ShowDocumentRequest;
4885   }});
4886   var protocol_linkedEditingRange_1 = require_protocol_linkedEditingRange();
4887   Object.defineProperty(exports2, "LinkedEditingRangeRequest", {enumerable: true, get: function() {
4888     return protocol_linkedEditingRange_1.LinkedEditingRangeRequest;
4889   }});
4890   var protocol_fileOperations_1 = require_protocol_fileOperations();
4891   Object.defineProperty(exports2, "FileOperationPatternKind", {enumerable: true, get: function() {
4892     return protocol_fileOperations_1.FileOperationPatternKind;
4893   }});
4894   Object.defineProperty(exports2, "DidCreateFilesNotification", {enumerable: true, get: function() {
4895     return protocol_fileOperations_1.DidCreateFilesNotification;
4896   }});
4897   Object.defineProperty(exports2, "WillCreateFilesRequest", {enumerable: true, get: function() {
4898     return protocol_fileOperations_1.WillCreateFilesRequest;
4899   }});
4900   Object.defineProperty(exports2, "DidRenameFilesNotification", {enumerable: true, get: function() {
4901     return protocol_fileOperations_1.DidRenameFilesNotification;
4902   }});
4903   Object.defineProperty(exports2, "WillRenameFilesRequest", {enumerable: true, get: function() {
4904     return protocol_fileOperations_1.WillRenameFilesRequest;
4905   }});
4906   Object.defineProperty(exports2, "DidDeleteFilesNotification", {enumerable: true, get: function() {
4907     return protocol_fileOperations_1.DidDeleteFilesNotification;
4908   }});
4909   Object.defineProperty(exports2, "WillDeleteFilesRequest", {enumerable: true, get: function() {
4910     return protocol_fileOperations_1.WillDeleteFilesRequest;
4911   }});
4912   var protocol_moniker_1 = require_protocol_moniker();
4913   Object.defineProperty(exports2, "UniquenessLevel", {enumerable: true, get: function() {
4914     return protocol_moniker_1.UniquenessLevel;
4915   }});
4916   Object.defineProperty(exports2, "MonikerKind", {enumerable: true, get: function() {
4917     return protocol_moniker_1.MonikerKind;
4918   }});
4919   Object.defineProperty(exports2, "MonikerRequest", {enumerable: true, get: function() {
4920     return protocol_moniker_1.MonikerRequest;
4921   }});
4922   var DocumentFilter;
4923   (function(DocumentFilter2) {
4924     function is(value) {
4925       const candidate = value;
4926       return Is.string(candidate.language) || Is.string(candidate.scheme) || Is.string(candidate.pattern);
4927     }
4928     DocumentFilter2.is = is;
4929   })(DocumentFilter = exports2.DocumentFilter || (exports2.DocumentFilter = {}));
4930   var DocumentSelector;
4931   (function(DocumentSelector2) {
4932     function is(value) {
4933       if (!Array.isArray(value)) {
4934         return false;
4935       }
4936       for (let elem of value) {
4937         if (!Is.string(elem) && !DocumentFilter.is(elem)) {
4938           return false;
4939         }
4940       }
4941       return true;
4942     }
4943     DocumentSelector2.is = is;
4944   })(DocumentSelector = exports2.DocumentSelector || (exports2.DocumentSelector = {}));
4945   var RegistrationRequest;
4946   (function(RegistrationRequest2) {
4947     RegistrationRequest2.type = new messages_1.ProtocolRequestType("client/registerCapability");
4948   })(RegistrationRequest = exports2.RegistrationRequest || (exports2.RegistrationRequest = {}));
4949   var UnregistrationRequest;
4950   (function(UnregistrationRequest2) {
4951     UnregistrationRequest2.type = new messages_1.ProtocolRequestType("client/unregisterCapability");
4952   })(UnregistrationRequest = exports2.UnregistrationRequest || (exports2.UnregistrationRequest = {}));
4953   var ResourceOperationKind;
4954   (function(ResourceOperationKind2) {
4955     ResourceOperationKind2.Create = "create";
4956     ResourceOperationKind2.Rename = "rename";
4957     ResourceOperationKind2.Delete = "delete";
4958   })(ResourceOperationKind = exports2.ResourceOperationKind || (exports2.ResourceOperationKind = {}));
4959   var FailureHandlingKind;
4960   (function(FailureHandlingKind2) {
4961     FailureHandlingKind2.Abort = "abort";
4962     FailureHandlingKind2.Transactional = "transactional";
4963     FailureHandlingKind2.TextOnlyTransactional = "textOnlyTransactional";
4964     FailureHandlingKind2.Undo = "undo";
4965   })(FailureHandlingKind = exports2.FailureHandlingKind || (exports2.FailureHandlingKind = {}));
4966   var StaticRegistrationOptions;
4967   (function(StaticRegistrationOptions2) {
4968     function hasId(value) {
4969       const candidate = value;
4970       return candidate && Is.string(candidate.id) && candidate.id.length > 0;
4971     }
4972     StaticRegistrationOptions2.hasId = hasId;
4973   })(StaticRegistrationOptions = exports2.StaticRegistrationOptions || (exports2.StaticRegistrationOptions = {}));
4974   var TextDocumentRegistrationOptions;
4975   (function(TextDocumentRegistrationOptions2) {
4976     function is(value) {
4977       const candidate = value;
4978       return candidate && (candidate.documentSelector === null || DocumentSelector.is(candidate.documentSelector));
4979     }
4980     TextDocumentRegistrationOptions2.is = is;
4981   })(TextDocumentRegistrationOptions = exports2.TextDocumentRegistrationOptions || (exports2.TextDocumentRegistrationOptions = {}));
4982   var WorkDoneProgressOptions;
4983   (function(WorkDoneProgressOptions2) {
4984     function is(value) {
4985       const candidate = value;
4986       return Is.objectLiteral(candidate) && (candidate.workDoneProgress === void 0 || Is.boolean(candidate.workDoneProgress));
4987     }
4988     WorkDoneProgressOptions2.is = is;
4989     function hasWorkDoneProgress(value) {
4990       const candidate = value;
4991       return candidate && Is.boolean(candidate.workDoneProgress);
4992     }
4993     WorkDoneProgressOptions2.hasWorkDoneProgress = hasWorkDoneProgress;
4994   })(WorkDoneProgressOptions = exports2.WorkDoneProgressOptions || (exports2.WorkDoneProgressOptions = {}));
4995   var InitializeRequest;
4996   (function(InitializeRequest2) {
4997     InitializeRequest2.type = new messages_1.ProtocolRequestType("initialize");
4998   })(InitializeRequest = exports2.InitializeRequest || (exports2.InitializeRequest = {}));
4999   var InitializeError;
5000   (function(InitializeError2) {
5001     InitializeError2.unknownProtocolVersion = 1;
5002   })(InitializeError = exports2.InitializeError || (exports2.InitializeError = {}));
5003   var InitializedNotification;
5004   (function(InitializedNotification2) {
5005     InitializedNotification2.type = new messages_1.ProtocolNotificationType("initialized");
5006   })(InitializedNotification = exports2.InitializedNotification || (exports2.InitializedNotification = {}));
5007   var ShutdownRequest;
5008   (function(ShutdownRequest2) {
5009     ShutdownRequest2.type = new messages_1.ProtocolRequestType0("shutdown");
5010   })(ShutdownRequest = exports2.ShutdownRequest || (exports2.ShutdownRequest = {}));
5011   var ExitNotification;
5012   (function(ExitNotification2) {
5013     ExitNotification2.type = new messages_1.ProtocolNotificationType0("exit");
5014   })(ExitNotification = exports2.ExitNotification || (exports2.ExitNotification = {}));
5015   var DidChangeConfigurationNotification;
5016   (function(DidChangeConfigurationNotification2) {
5017     DidChangeConfigurationNotification2.type = new messages_1.ProtocolNotificationType("workspace/didChangeConfiguration");
5018   })(DidChangeConfigurationNotification = exports2.DidChangeConfigurationNotification || (exports2.DidChangeConfigurationNotification = {}));
5019   var MessageType;
5020   (function(MessageType2) {
5021     MessageType2.Error = 1;
5022     MessageType2.Warning = 2;
5023     MessageType2.Info = 3;
5024     MessageType2.Log = 4;
5025   })(MessageType = exports2.MessageType || (exports2.MessageType = {}));
5026   var ShowMessageNotification;
5027   (function(ShowMessageNotification2) {
5028     ShowMessageNotification2.type = new messages_1.ProtocolNotificationType("window/showMessage");
5029   })(ShowMessageNotification = exports2.ShowMessageNotification || (exports2.ShowMessageNotification = {}));
5030   var ShowMessageRequest;
5031   (function(ShowMessageRequest2) {
5032     ShowMessageRequest2.type = new messages_1.ProtocolRequestType("window/showMessageRequest");
5033   })(ShowMessageRequest = exports2.ShowMessageRequest || (exports2.ShowMessageRequest = {}));
5034   var LogMessageNotification;
5035   (function(LogMessageNotification2) {
5036     LogMessageNotification2.type = new messages_1.ProtocolNotificationType("window/logMessage");
5037   })(LogMessageNotification = exports2.LogMessageNotification || (exports2.LogMessageNotification = {}));
5038   var TelemetryEventNotification;
5039   (function(TelemetryEventNotification2) {
5040     TelemetryEventNotification2.type = new messages_1.ProtocolNotificationType("telemetry/event");
5041   })(TelemetryEventNotification = exports2.TelemetryEventNotification || (exports2.TelemetryEventNotification = {}));
5042   var TextDocumentSyncKind;
5043   (function(TextDocumentSyncKind2) {
5044     TextDocumentSyncKind2.None = 0;
5045     TextDocumentSyncKind2.Full = 1;
5046     TextDocumentSyncKind2.Incremental = 2;
5047   })(TextDocumentSyncKind = exports2.TextDocumentSyncKind || (exports2.TextDocumentSyncKind = {}));
5048   var DidOpenTextDocumentNotification;
5049   (function(DidOpenTextDocumentNotification2) {
5050     DidOpenTextDocumentNotification2.method = "textDocument/didOpen";
5051     DidOpenTextDocumentNotification2.type = new messages_1.ProtocolNotificationType(DidOpenTextDocumentNotification2.method);
5052   })(DidOpenTextDocumentNotification = exports2.DidOpenTextDocumentNotification || (exports2.DidOpenTextDocumentNotification = {}));
5053   var TextDocumentContentChangeEvent;
5054   (function(TextDocumentContentChangeEvent2) {
5055     function isIncremental(event) {
5056       let candidate = event;
5057       return candidate !== void 0 && candidate !== null && typeof candidate.text === "string" && candidate.range !== void 0 && (candidate.rangeLength === void 0 || typeof candidate.rangeLength === "number");
5058     }
5059     TextDocumentContentChangeEvent2.isIncremental = isIncremental;
5060     function isFull(event) {
5061       let candidate = event;
5062       return candidate !== void 0 && candidate !== null && typeof candidate.text === "string" && candidate.range === void 0 && candidate.rangeLength === void 0;
5063     }
5064     TextDocumentContentChangeEvent2.isFull = isFull;
5065   })(TextDocumentContentChangeEvent = exports2.TextDocumentContentChangeEvent || (exports2.TextDocumentContentChangeEvent = {}));
5066   var DidChangeTextDocumentNotification;
5067   (function(DidChangeTextDocumentNotification2) {
5068     DidChangeTextDocumentNotification2.method = "textDocument/didChange";
5069     DidChangeTextDocumentNotification2.type = new messages_1.ProtocolNotificationType(DidChangeTextDocumentNotification2.method);
5070   })(DidChangeTextDocumentNotification = exports2.DidChangeTextDocumentNotification || (exports2.DidChangeTextDocumentNotification = {}));
5071   var DidCloseTextDocumentNotification;
5072   (function(DidCloseTextDocumentNotification2) {
5073     DidCloseTextDocumentNotification2.method = "textDocument/didClose";
5074     DidCloseTextDocumentNotification2.type = new messages_1.ProtocolNotificationType(DidCloseTextDocumentNotification2.method);
5075   })(DidCloseTextDocumentNotification = exports2.DidCloseTextDocumentNotification || (exports2.DidCloseTextDocumentNotification = {}));
5076   var DidSaveTextDocumentNotification;
5077   (function(DidSaveTextDocumentNotification2) {
5078     DidSaveTextDocumentNotification2.method = "textDocument/didSave";
5079     DidSaveTextDocumentNotification2.type = new messages_1.ProtocolNotificationType(DidSaveTextDocumentNotification2.method);
5080   })(DidSaveTextDocumentNotification = exports2.DidSaveTextDocumentNotification || (exports2.DidSaveTextDocumentNotification = {}));
5081   var TextDocumentSaveReason;
5082   (function(TextDocumentSaveReason2) {
5083     TextDocumentSaveReason2.Manual = 1;
5084     TextDocumentSaveReason2.AfterDelay = 2;
5085     TextDocumentSaveReason2.FocusOut = 3;
5086   })(TextDocumentSaveReason = exports2.TextDocumentSaveReason || (exports2.TextDocumentSaveReason = {}));
5087   var WillSaveTextDocumentNotification;
5088   (function(WillSaveTextDocumentNotification2) {
5089     WillSaveTextDocumentNotification2.method = "textDocument/willSave";
5090     WillSaveTextDocumentNotification2.type = new messages_1.ProtocolNotificationType(WillSaveTextDocumentNotification2.method);
5091   })(WillSaveTextDocumentNotification = exports2.WillSaveTextDocumentNotification || (exports2.WillSaveTextDocumentNotification = {}));
5092   var WillSaveTextDocumentWaitUntilRequest;
5093   (function(WillSaveTextDocumentWaitUntilRequest2) {
5094     WillSaveTextDocumentWaitUntilRequest2.method = "textDocument/willSaveWaitUntil";
5095     WillSaveTextDocumentWaitUntilRequest2.type = new messages_1.ProtocolRequestType(WillSaveTextDocumentWaitUntilRequest2.method);
5096   })(WillSaveTextDocumentWaitUntilRequest = exports2.WillSaveTextDocumentWaitUntilRequest || (exports2.WillSaveTextDocumentWaitUntilRequest = {}));
5097   var DidChangeWatchedFilesNotification;
5098   (function(DidChangeWatchedFilesNotification2) {
5099     DidChangeWatchedFilesNotification2.type = new messages_1.ProtocolNotificationType("workspace/didChangeWatchedFiles");
5100   })(DidChangeWatchedFilesNotification = exports2.DidChangeWatchedFilesNotification || (exports2.DidChangeWatchedFilesNotification = {}));
5101   var FileChangeType;
5102   (function(FileChangeType2) {
5103     FileChangeType2.Created = 1;
5104     FileChangeType2.Changed = 2;
5105     FileChangeType2.Deleted = 3;
5106   })(FileChangeType = exports2.FileChangeType || (exports2.FileChangeType = {}));
5107   var WatchKind;
5108   (function(WatchKind2) {
5109     WatchKind2.Create = 1;
5110     WatchKind2.Change = 2;
5111     WatchKind2.Delete = 4;
5112   })(WatchKind = exports2.WatchKind || (exports2.WatchKind = {}));
5113   var PublishDiagnosticsNotification;
5114   (function(PublishDiagnosticsNotification2) {
5115     PublishDiagnosticsNotification2.type = new messages_1.ProtocolNotificationType("textDocument/publishDiagnostics");
5116   })(PublishDiagnosticsNotification = exports2.PublishDiagnosticsNotification || (exports2.PublishDiagnosticsNotification = {}));
5117   var CompletionTriggerKind;
5118   (function(CompletionTriggerKind2) {
5119     CompletionTriggerKind2.Invoked = 1;
5120     CompletionTriggerKind2.TriggerCharacter = 2;
5121     CompletionTriggerKind2.TriggerForIncompleteCompletions = 3;
5122   })(CompletionTriggerKind = exports2.CompletionTriggerKind || (exports2.CompletionTriggerKind = {}));
5123   var CompletionRequest;
5124   (function(CompletionRequest2) {
5125     CompletionRequest2.method = "textDocument/completion";
5126     CompletionRequest2.type = new messages_1.ProtocolRequestType(CompletionRequest2.method);
5127   })(CompletionRequest = exports2.CompletionRequest || (exports2.CompletionRequest = {}));
5128   var CompletionResolveRequest;
5129   (function(CompletionResolveRequest2) {
5130     CompletionResolveRequest2.method = "completionItem/resolve";
5131     CompletionResolveRequest2.type = new messages_1.ProtocolRequestType(CompletionResolveRequest2.method);
5132   })(CompletionResolveRequest = exports2.CompletionResolveRequest || (exports2.CompletionResolveRequest = {}));
5133   var HoverRequest;
5134   (function(HoverRequest2) {
5135     HoverRequest2.method = "textDocument/hover";
5136     HoverRequest2.type = new messages_1.ProtocolRequestType(HoverRequest2.method);
5137   })(HoverRequest = exports2.HoverRequest || (exports2.HoverRequest = {}));
5138   var SignatureHelpTriggerKind;
5139   (function(SignatureHelpTriggerKind2) {
5140     SignatureHelpTriggerKind2.Invoked = 1;
5141     SignatureHelpTriggerKind2.TriggerCharacter = 2;
5142     SignatureHelpTriggerKind2.ContentChange = 3;
5143   })(SignatureHelpTriggerKind = exports2.SignatureHelpTriggerKind || (exports2.SignatureHelpTriggerKind = {}));
5144   var SignatureHelpRequest;
5145   (function(SignatureHelpRequest2) {
5146     SignatureHelpRequest2.method = "textDocument/signatureHelp";
5147     SignatureHelpRequest2.type = new messages_1.ProtocolRequestType(SignatureHelpRequest2.method);
5148   })(SignatureHelpRequest = exports2.SignatureHelpRequest || (exports2.SignatureHelpRequest = {}));
5149   var DefinitionRequest;
5150   (function(DefinitionRequest2) {
5151     DefinitionRequest2.method = "textDocument/definition";
5152     DefinitionRequest2.type = new messages_1.ProtocolRequestType(DefinitionRequest2.method);
5153   })(DefinitionRequest = exports2.DefinitionRequest || (exports2.DefinitionRequest = {}));
5154   var ReferencesRequest;
5155   (function(ReferencesRequest2) {
5156     ReferencesRequest2.method = "textDocument/references";
5157     ReferencesRequest2.type = new messages_1.ProtocolRequestType(ReferencesRequest2.method);
5158   })(ReferencesRequest = exports2.ReferencesRequest || (exports2.ReferencesRequest = {}));
5159   var DocumentHighlightRequest;
5160   (function(DocumentHighlightRequest2) {
5161     DocumentHighlightRequest2.method = "textDocument/documentHighlight";
5162     DocumentHighlightRequest2.type = new messages_1.ProtocolRequestType(DocumentHighlightRequest2.method);
5163   })(DocumentHighlightRequest = exports2.DocumentHighlightRequest || (exports2.DocumentHighlightRequest = {}));
5164   var DocumentSymbolRequest;
5165   (function(DocumentSymbolRequest2) {
5166     DocumentSymbolRequest2.method = "textDocument/documentSymbol";
5167     DocumentSymbolRequest2.type = new messages_1.ProtocolRequestType(DocumentSymbolRequest2.method);
5168   })(DocumentSymbolRequest = exports2.DocumentSymbolRequest || (exports2.DocumentSymbolRequest = {}));
5169   var CodeActionRequest;
5170   (function(CodeActionRequest2) {
5171     CodeActionRequest2.method = "textDocument/codeAction";
5172     CodeActionRequest2.type = new messages_1.ProtocolRequestType(CodeActionRequest2.method);
5173   })(CodeActionRequest = exports2.CodeActionRequest || (exports2.CodeActionRequest = {}));
5174   var CodeActionResolveRequest;
5175   (function(CodeActionResolveRequest2) {
5176     CodeActionResolveRequest2.method = "codeAction/resolve";
5177     CodeActionResolveRequest2.type = new messages_1.ProtocolRequestType(CodeActionResolveRequest2.method);
5178   })(CodeActionResolveRequest = exports2.CodeActionResolveRequest || (exports2.CodeActionResolveRequest = {}));
5179   var WorkspaceSymbolRequest;
5180   (function(WorkspaceSymbolRequest2) {
5181     WorkspaceSymbolRequest2.method = "workspace/symbol";
5182     WorkspaceSymbolRequest2.type = new messages_1.ProtocolRequestType(WorkspaceSymbolRequest2.method);
5183   })(WorkspaceSymbolRequest = exports2.WorkspaceSymbolRequest || (exports2.WorkspaceSymbolRequest = {}));
5184   var CodeLensRequest;
5185   (function(CodeLensRequest2) {
5186     CodeLensRequest2.method = "textDocument/codeLens";
5187     CodeLensRequest2.type = new messages_1.ProtocolRequestType(CodeLensRequest2.method);
5188   })(CodeLensRequest = exports2.CodeLensRequest || (exports2.CodeLensRequest = {}));
5189   var CodeLensResolveRequest;
5190   (function(CodeLensResolveRequest2) {
5191     CodeLensResolveRequest2.method = "codeLens/resolve";
5192     CodeLensResolveRequest2.type = new messages_1.ProtocolRequestType(CodeLensResolveRequest2.method);
5193   })(CodeLensResolveRequest = exports2.CodeLensResolveRequest || (exports2.CodeLensResolveRequest = {}));
5194   var CodeLensRefreshRequest;
5195   (function(CodeLensRefreshRequest2) {
5196     CodeLensRefreshRequest2.method = `workspace/codeLens/refresh`;
5197     CodeLensRefreshRequest2.type = new messages_1.ProtocolRequestType0(CodeLensRefreshRequest2.method);
5198   })(CodeLensRefreshRequest = exports2.CodeLensRefreshRequest || (exports2.CodeLensRefreshRequest = {}));
5199   var DocumentLinkRequest;
5200   (function(DocumentLinkRequest2) {
5201     DocumentLinkRequest2.method = "textDocument/documentLink";
5202     DocumentLinkRequest2.type = new messages_1.ProtocolRequestType(DocumentLinkRequest2.method);
5203   })(DocumentLinkRequest = exports2.DocumentLinkRequest || (exports2.DocumentLinkRequest = {}));
5204   var DocumentLinkResolveRequest;
5205   (function(DocumentLinkResolveRequest2) {
5206     DocumentLinkResolveRequest2.method = "documentLink/resolve";
5207     DocumentLinkResolveRequest2.type = new messages_1.ProtocolRequestType(DocumentLinkResolveRequest2.method);
5208   })(DocumentLinkResolveRequest = exports2.DocumentLinkResolveRequest || (exports2.DocumentLinkResolveRequest = {}));
5209   var DocumentFormattingRequest;
5210   (function(DocumentFormattingRequest2) {
5211     DocumentFormattingRequest2.method = "textDocument/formatting";
5212     DocumentFormattingRequest2.type = new messages_1.ProtocolRequestType(DocumentFormattingRequest2.method);
5213   })(DocumentFormattingRequest = exports2.DocumentFormattingRequest || (exports2.DocumentFormattingRequest = {}));
5214   var DocumentRangeFormattingRequest;
5215   (function(DocumentRangeFormattingRequest2) {
5216     DocumentRangeFormattingRequest2.method = "textDocument/rangeFormatting";
5217     DocumentRangeFormattingRequest2.type = new messages_1.ProtocolRequestType(DocumentRangeFormattingRequest2.method);
5218   })(DocumentRangeFormattingRequest = exports2.DocumentRangeFormattingRequest || (exports2.DocumentRangeFormattingRequest = {}));
5219   var DocumentOnTypeFormattingRequest;
5220   (function(DocumentOnTypeFormattingRequest2) {
5221     DocumentOnTypeFormattingRequest2.method = "textDocument/onTypeFormatting";
5222     DocumentOnTypeFormattingRequest2.type = new messages_1.ProtocolRequestType(DocumentOnTypeFormattingRequest2.method);
5223   })(DocumentOnTypeFormattingRequest = exports2.DocumentOnTypeFormattingRequest || (exports2.DocumentOnTypeFormattingRequest = {}));
5224   var PrepareSupportDefaultBehavior;
5225   (function(PrepareSupportDefaultBehavior2) {
5226     PrepareSupportDefaultBehavior2.Identifier = 1;
5227   })(PrepareSupportDefaultBehavior = exports2.PrepareSupportDefaultBehavior || (exports2.PrepareSupportDefaultBehavior = {}));
5228   var RenameRequest;
5229   (function(RenameRequest2) {
5230     RenameRequest2.method = "textDocument/rename";
5231     RenameRequest2.type = new messages_1.ProtocolRequestType(RenameRequest2.method);
5232   })(RenameRequest = exports2.RenameRequest || (exports2.RenameRequest = {}));
5233   var PrepareRenameRequest;
5234   (function(PrepareRenameRequest2) {
5235     PrepareRenameRequest2.method = "textDocument/prepareRename";
5236     PrepareRenameRequest2.type = new messages_1.ProtocolRequestType(PrepareRenameRequest2.method);
5237   })(PrepareRenameRequest = exports2.PrepareRenameRequest || (exports2.PrepareRenameRequest = {}));
5238   var ExecuteCommandRequest;
5239   (function(ExecuteCommandRequest2) {
5240     ExecuteCommandRequest2.type = new messages_1.ProtocolRequestType("workspace/executeCommand");
5241   })(ExecuteCommandRequest = exports2.ExecuteCommandRequest || (exports2.ExecuteCommandRequest = {}));
5242   var ApplyWorkspaceEditRequest;
5243   (function(ApplyWorkspaceEditRequest2) {
5244     ApplyWorkspaceEditRequest2.type = new messages_1.ProtocolRequestType("workspace/applyEdit");
5245   })(ApplyWorkspaceEditRequest = exports2.ApplyWorkspaceEditRequest || (exports2.ApplyWorkspaceEditRequest = {}));
5246 });
5247
5248 // node_modules/vscode-languageserver/node_modules/vscode-languageserver-protocol/lib/common/connection.js
5249 var require_connection2 = __commonJS((exports2) => {
5250   "use strict";
5251   Object.defineProperty(exports2, "__esModule", {value: true});
5252   exports2.createProtocolConnection = void 0;
5253   var vscode_jsonrpc_1 = require_main();
5254   function createProtocolConnection(input, output, logger, options) {
5255     if (vscode_jsonrpc_1.ConnectionStrategy.is(options)) {
5256       options = {connectionStrategy: options};
5257     }
5258     return vscode_jsonrpc_1.createMessageConnection(input, output, logger, options);
5259   }
5260   exports2.createProtocolConnection = createProtocolConnection;
5261 });
5262
5263 // node_modules/vscode-languageserver/node_modules/vscode-languageserver-protocol/lib/common/api.js
5264 var require_api2 = __commonJS((exports2) => {
5265   "use strict";
5266   var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
5267     if (k2 === void 0)
5268       k2 = k;
5269     Object.defineProperty(o, k2, {enumerable: true, get: function() {
5270       return m[k];
5271     }});
5272   } : function(o, m, k, k2) {
5273     if (k2 === void 0)
5274       k2 = k;
5275     o[k2] = m[k];
5276   });
5277   var __exportStar2 = exports2 && exports2.__exportStar || function(m, exports3) {
5278     for (var p in m)
5279       if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p))
5280         __createBinding(exports3, m, p);
5281   };
5282   Object.defineProperty(exports2, "__esModule", {value: true});
5283   exports2.LSPErrorCodes = exports2.createProtocolConnection = void 0;
5284   __exportStar2(require_main(), exports2);
5285   __exportStar2(require_main2(), exports2);
5286   __exportStar2(require_messages2(), exports2);
5287   __exportStar2(require_protocol(), exports2);
5288   var connection_1 = require_connection2();
5289   Object.defineProperty(exports2, "createProtocolConnection", {enumerable: true, get: function() {
5290     return connection_1.createProtocolConnection;
5291   }});
5292   var LSPErrorCodes;
5293   (function(LSPErrorCodes2) {
5294     LSPErrorCodes2.lspReservedErrorRangeStart = -32899;
5295     LSPErrorCodes2.ContentModified = -32801;
5296     LSPErrorCodes2.RequestCancelled = -32800;
5297     LSPErrorCodes2.lspReservedErrorRangeEnd = -32800;
5298   })(LSPErrorCodes = exports2.LSPErrorCodes || (exports2.LSPErrorCodes = {}));
5299 });
5300
5301 // node_modules/vscode-languageserver/node_modules/vscode-languageserver-protocol/lib/node/main.js
5302 var require_main3 = __commonJS((exports2) => {
5303   "use strict";
5304   var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
5305     if (k2 === void 0)
5306       k2 = k;
5307     Object.defineProperty(o, k2, {enumerable: true, get: function() {
5308       return m[k];
5309     }});
5310   } : function(o, m, k, k2) {
5311     if (k2 === void 0)
5312       k2 = k;
5313     o[k2] = m[k];
5314   });
5315   var __exportStar2 = exports2 && exports2.__exportStar || function(m, exports3) {
5316     for (var p in m)
5317       if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p))
5318         __createBinding(exports3, m, p);
5319   };
5320   Object.defineProperty(exports2, "__esModule", {value: true});
5321   exports2.createProtocolConnection = void 0;
5322   var node_1 = require_node();
5323   __exportStar2(require_node(), exports2);
5324   __exportStar2(require_api2(), exports2);
5325   function createProtocolConnection(input, output, logger, options) {
5326     return node_1.createMessageConnection(input, output, logger, options);
5327   }
5328   exports2.createProtocolConnection = createProtocolConnection;
5329 });
5330
5331 // node_modules/vscode-languageserver/lib/common/utils/uuid.js
5332 var require_uuid = __commonJS((exports2) => {
5333   "use strict";
5334   Object.defineProperty(exports2, "__esModule", {value: true});
5335   exports2.generateUuid = exports2.parse = exports2.isUUID = exports2.v4 = exports2.empty = void 0;
5336   var ValueUUID = class {
5337     constructor(_value) {
5338       this._value = _value;
5339     }
5340     asHex() {
5341       return this._value;
5342     }
5343     equals(other) {
5344       return this.asHex() === other.asHex();
5345     }
5346   };
5347   var V4UUID = class extends ValueUUID {
5348     constructor() {
5349       super([
5350         V4UUID._randomHex(),
5351         V4UUID._randomHex(),
5352         V4UUID._randomHex(),
5353         V4UUID._randomHex(),
5354         V4UUID._randomHex(),
5355         V4UUID._randomHex(),
5356         V4UUID._randomHex(),
5357         V4UUID._randomHex(),
5358         "-",
5359         V4UUID._randomHex(),
5360         V4UUID._randomHex(),
5361         V4UUID._randomHex(),
5362         V4UUID._randomHex(),
5363         "-",
5364         "4",
5365         V4UUID._randomHex(),
5366         V4UUID._randomHex(),
5367         V4UUID._randomHex(),
5368         "-",
5369         V4UUID._oneOf(V4UUID._timeHighBits),
5370         V4UUID._randomHex(),
5371         V4UUID._randomHex(),
5372         V4UUID._randomHex(),
5373         "-",
5374         V4UUID._randomHex(),
5375         V4UUID._randomHex(),
5376         V4UUID._randomHex(),
5377         V4UUID._randomHex(),
5378         V4UUID._randomHex(),
5379         V4UUID._randomHex(),
5380         V4UUID._randomHex(),
5381         V4UUID._randomHex(),
5382         V4UUID._randomHex(),
5383         V4UUID._randomHex(),
5384         V4UUID._randomHex(),
5385         V4UUID._randomHex()
5386       ].join(""));
5387     }
5388     static _oneOf(array) {
5389       return array[Math.floor(array.length * Math.random())];
5390     }
5391     static _randomHex() {
5392       return V4UUID._oneOf(V4UUID._chars);
5393     }
5394   };
5395   V4UUID._chars = ["0", "1", "2", "3", "4", "5", "6", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];
5396   V4UUID._timeHighBits = ["8", "9", "a", "b"];
5397   exports2.empty = new ValueUUID("00000000-0000-0000-0000-000000000000");
5398   function v4() {
5399     return new V4UUID();
5400   }
5401   exports2.v4 = v4;
5402   var _UUIDPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
5403   function isUUID(value) {
5404     return _UUIDPattern.test(value);
5405   }
5406   exports2.isUUID = isUUID;
5407   function parse(value) {
5408     if (!isUUID(value)) {
5409       throw new Error("invalid uuid");
5410     }
5411     return new ValueUUID(value);
5412   }
5413   exports2.parse = parse;
5414   function generateUuid() {
5415     return v4().asHex();
5416   }
5417   exports2.generateUuid = generateUuid;
5418 });
5419
5420 // node_modules/vscode-languageserver/lib/common/progress.js
5421 var require_progress = __commonJS((exports2) => {
5422   "use strict";
5423   Object.defineProperty(exports2, "__esModule", {value: true});
5424   exports2.attachPartialResult = exports2.ProgressFeature = exports2.attachWorkDone = void 0;
5425   var vscode_languageserver_protocol_1 = require_main3();
5426   var uuid_1 = require_uuid();
5427   var WorkDoneProgressReporterImpl = class {
5428     constructor(_connection, _token) {
5429       this._connection = _connection;
5430       this._token = _token;
5431       WorkDoneProgressReporterImpl.Instances.set(this._token, this);
5432     }
5433     begin(title, percentage, message, cancellable) {
5434       let param = {
5435         kind: "begin",
5436         title,
5437         percentage,
5438         message,
5439         cancellable
5440       };
5441       this._connection.sendProgress(vscode_languageserver_protocol_1.WorkDoneProgress.type, this._token, param);
5442     }
5443     report(arg0, arg1) {
5444       let param = {
5445         kind: "report"
5446       };
5447       if (typeof arg0 === "number") {
5448         param.percentage = arg0;
5449         if (arg1 !== void 0) {
5450           param.message = arg1;
5451         }
5452       } else {
5453         param.message = arg0;
5454       }
5455       this._connection.sendProgress(vscode_languageserver_protocol_1.WorkDoneProgress.type, this._token, param);
5456     }
5457     done() {
5458       WorkDoneProgressReporterImpl.Instances.delete(this._token);
5459       this._connection.sendProgress(vscode_languageserver_protocol_1.WorkDoneProgress.type, this._token, {kind: "end"});
5460     }
5461   };
5462   WorkDoneProgressReporterImpl.Instances = new Map();
5463   var WorkDoneProgressServerReporterImpl = class extends WorkDoneProgressReporterImpl {
5464     constructor(connection, token) {
5465       super(connection, token);
5466       this._source = new vscode_languageserver_protocol_1.CancellationTokenSource();
5467     }
5468     get token() {
5469       return this._source.token;
5470     }
5471     done() {
5472       this._source.dispose();
5473       super.done();
5474     }
5475     cancel() {
5476       this._source.cancel();
5477     }
5478   };
5479   var NullProgressReporter = class {
5480     constructor() {
5481     }
5482     begin() {
5483     }
5484     report() {
5485     }
5486     done() {
5487     }
5488   };
5489   var NullProgressServerReporter = class extends NullProgressReporter {
5490     constructor() {
5491       super();
5492       this._source = new vscode_languageserver_protocol_1.CancellationTokenSource();
5493     }
5494     get token() {
5495       return this._source.token;
5496     }
5497     done() {
5498       this._source.dispose();
5499     }
5500     cancel() {
5501       this._source.cancel();
5502     }
5503   };
5504   function attachWorkDone(connection, params) {
5505     if (params === void 0 || params.workDoneToken === void 0) {
5506       return new NullProgressReporter();
5507     }
5508     const token = params.workDoneToken;
5509     delete params.workDoneToken;
5510     return new WorkDoneProgressReporterImpl(connection, token);
5511   }
5512   exports2.attachWorkDone = attachWorkDone;
5513   var ProgressFeature = (Base) => {
5514     return class extends Base {
5515       constructor() {
5516         super();
5517         this._progressSupported = false;
5518       }
5519       initialize(capabilities) {
5520         var _a2;
5521         if (((_a2 = capabilities === null || capabilities === void 0 ? void 0 : capabilities.window) === null || _a2 === void 0 ? void 0 : _a2.workDoneProgress) === true) {
5522           this._progressSupported = true;
5523           this.connection.onNotification(vscode_languageserver_protocol_1.WorkDoneProgressCancelNotification.type, (params) => {
5524             let progress = WorkDoneProgressReporterImpl.Instances.get(params.token);
5525             if (progress instanceof WorkDoneProgressServerReporterImpl || progress instanceof NullProgressServerReporter) {
5526               progress.cancel();
5527             }
5528           });
5529         }
5530       }
5531       attachWorkDoneProgress(token) {
5532         if (token === void 0) {
5533           return new NullProgressReporter();
5534         } else {
5535           return new WorkDoneProgressReporterImpl(this.connection, token);
5536         }
5537       }
5538       createWorkDoneProgress() {
5539         if (this._progressSupported) {
5540           const token = uuid_1.generateUuid();
5541           return this.connection.sendRequest(vscode_languageserver_protocol_1.WorkDoneProgressCreateRequest.type, {token}).then(() => {
5542             const result = new WorkDoneProgressServerReporterImpl(this.connection, token);
5543             return result;
5544           });
5545         } else {
5546           return Promise.resolve(new NullProgressServerReporter());
5547         }
5548       }
5549     };
5550   };
5551   exports2.ProgressFeature = ProgressFeature;
5552   var ResultProgress;
5553   (function(ResultProgress2) {
5554     ResultProgress2.type = new vscode_languageserver_protocol_1.ProgressType();
5555   })(ResultProgress || (ResultProgress = {}));
5556   var ResultProgressReporterImpl = class {
5557     constructor(_connection, _token) {
5558       this._connection = _connection;
5559       this._token = _token;
5560     }
5561     report(data) {
5562       this._connection.sendProgress(ResultProgress.type, this._token, data);
5563     }
5564   };
5565   function attachPartialResult(connection, params) {
5566     if (params === void 0 || params.partialResultToken === void 0) {
5567       return void 0;
5568     }
5569     const token = params.partialResultToken;
5570     delete params.partialResultToken;
5571     return new ResultProgressReporterImpl(connection, token);
5572   }
5573   exports2.attachPartialResult = attachPartialResult;
5574 });
5575
5576 // node_modules/vscode-languageserver/lib/common/configuration.js
5577 var require_configuration = __commonJS((exports2) => {
5578   "use strict";
5579   Object.defineProperty(exports2, "__esModule", {value: true});
5580   exports2.ConfigurationFeature = void 0;
5581   var vscode_languageserver_protocol_1 = require_main3();
5582   var Is = require_is();
5583   var ConfigurationFeature = (Base) => {
5584     return class extends Base {
5585       getConfiguration(arg) {
5586         if (!arg) {
5587           return this._getConfiguration({});
5588         } else if (Is.string(arg)) {
5589           return this._getConfiguration({section: arg});
5590         } else {
5591           return this._getConfiguration(arg);
5592         }
5593       }
5594       _getConfiguration(arg) {
5595         let params = {
5596           items: Array.isArray(arg) ? arg : [arg]
5597         };
5598         return this.connection.sendRequest(vscode_languageserver_protocol_1.ConfigurationRequest.type, params).then((result) => {
5599           return Array.isArray(arg) ? result : result[0];
5600         });
5601       }
5602     };
5603   };
5604   exports2.ConfigurationFeature = ConfigurationFeature;
5605 });
5606
5607 // node_modules/vscode-languageserver/lib/common/workspaceFolders.js
5608 var require_workspaceFolders = __commonJS((exports2) => {
5609   "use strict";
5610   Object.defineProperty(exports2, "__esModule", {value: true});
5611   exports2.WorkspaceFoldersFeature = void 0;
5612   var vscode_languageserver_protocol_1 = require_main3();
5613   var WorkspaceFoldersFeature = (Base) => {
5614     return class extends Base {
5615       initialize(capabilities) {
5616         let workspaceCapabilities = capabilities.workspace;
5617         if (workspaceCapabilities && workspaceCapabilities.workspaceFolders) {
5618           this._onDidChangeWorkspaceFolders = new vscode_languageserver_protocol_1.Emitter();
5619           this.connection.onNotification(vscode_languageserver_protocol_1.DidChangeWorkspaceFoldersNotification.type, (params) => {
5620             this._onDidChangeWorkspaceFolders.fire(params.event);
5621           });
5622         }
5623       }
5624       getWorkspaceFolders() {
5625         return this.connection.sendRequest(vscode_languageserver_protocol_1.WorkspaceFoldersRequest.type);
5626       }
5627       get onDidChangeWorkspaceFolders() {
5628         if (!this._onDidChangeWorkspaceFolders) {
5629           throw new Error("Client doesn't support sending workspace folder change events.");
5630         }
5631         if (!this._unregistration) {
5632           this._unregistration = this.connection.client.register(vscode_languageserver_protocol_1.DidChangeWorkspaceFoldersNotification.type);
5633         }
5634         return this._onDidChangeWorkspaceFolders.event;
5635       }
5636     };
5637   };
5638   exports2.WorkspaceFoldersFeature = WorkspaceFoldersFeature;
5639 });
5640
5641 // node_modules/vscode-languageserver/lib/common/callHierarchy.js
5642 var require_callHierarchy = __commonJS((exports2) => {
5643   "use strict";
5644   Object.defineProperty(exports2, "__esModule", {value: true});
5645   exports2.CallHierarchyFeature = void 0;
5646   var vscode_languageserver_protocol_1 = require_main3();
5647   var CallHierarchyFeature = (Base) => {
5648     return class extends Base {
5649       get callHierarchy() {
5650         return {
5651           onPrepare: (handler) => {
5652             this.connection.onRequest(vscode_languageserver_protocol_1.CallHierarchyPrepareRequest.type, (params, cancel) => {
5653               return handler(params, cancel, this.attachWorkDoneProgress(params), void 0);
5654             });
5655           },
5656           onIncomingCalls: (handler) => {
5657             const type = vscode_languageserver_protocol_1.CallHierarchyIncomingCallsRequest.type;
5658             this.connection.onRequest(type, (params, cancel) => {
5659               return handler(params, cancel, this.attachWorkDoneProgress(params), this.attachPartialResultProgress(type, params));
5660             });
5661           },
5662           onOutgoingCalls: (handler) => {
5663             const type = vscode_languageserver_protocol_1.CallHierarchyOutgoingCallsRequest.type;
5664             this.connection.onRequest(type, (params, cancel) => {
5665               return handler(params, cancel, this.attachWorkDoneProgress(params), this.attachPartialResultProgress(type, params));
5666             });
5667           }
5668         };
5669       }
5670     };
5671   };
5672   exports2.CallHierarchyFeature = CallHierarchyFeature;
5673 });
5674
5675 // node_modules/vscode-languageserver/lib/common/semanticTokens.js
5676 var require_semanticTokens = __commonJS((exports2) => {
5677   "use strict";
5678   Object.defineProperty(exports2, "__esModule", {value: true});
5679   exports2.SemanticTokensBuilder = exports2.SemanticTokensFeature = void 0;
5680   var vscode_languageserver_protocol_1 = require_main3();
5681   var SemanticTokensFeature = (Base) => {
5682     return class extends Base {
5683       get semanticTokens() {
5684         return {
5685           on: (handler) => {
5686             const type = vscode_languageserver_protocol_1.SemanticTokensRequest.type;
5687             this.connection.onRequest(type, (params, cancel) => {
5688               return handler(params, cancel, this.attachWorkDoneProgress(params), this.attachPartialResultProgress(type, params));
5689             });
5690           },
5691           onDelta: (handler) => {
5692             const type = vscode_languageserver_protocol_1.SemanticTokensDeltaRequest.type;
5693             this.connection.onRequest(type, (params, cancel) => {
5694               return handler(params, cancel, this.attachWorkDoneProgress(params), this.attachPartialResultProgress(type, params));
5695             });
5696           },
5697           onRange: (handler) => {
5698             const type = vscode_languageserver_protocol_1.SemanticTokensRangeRequest.type;
5699             this.connection.onRequest(type, (params, cancel) => {
5700               return handler(params, cancel, this.attachWorkDoneProgress(params), this.attachPartialResultProgress(type, params));
5701             });
5702           }
5703         };
5704       }
5705     };
5706   };
5707   exports2.SemanticTokensFeature = SemanticTokensFeature;
5708   var SemanticTokensBuilder = class {
5709     constructor() {
5710       this._prevData = void 0;
5711       this.initialize();
5712     }
5713     initialize() {
5714       this._id = Date.now();
5715       this._prevLine = 0;
5716       this._prevChar = 0;
5717       this._data = [];
5718       this._dataLen = 0;
5719     }
5720     push(line, char, length, tokenType, tokenModifiers) {
5721       let pushLine = line;
5722       let pushChar = char;
5723       if (this._dataLen > 0) {
5724         pushLine -= this._prevLine;
5725         if (pushLine === 0) {
5726           pushChar -= this._prevChar;
5727         }
5728       }
5729       this._data[this._dataLen++] = pushLine;
5730       this._data[this._dataLen++] = pushChar;
5731       this._data[this._dataLen++] = length;
5732       this._data[this._dataLen++] = tokenType;
5733       this._data[this._dataLen++] = tokenModifiers;
5734       this._prevLine = line;
5735       this._prevChar = char;
5736     }
5737     get id() {
5738       return this._id.toString();
5739     }
5740     previousResult(id) {
5741       if (this.id === id) {
5742         this._prevData = this._data;
5743       }
5744       this.initialize();
5745     }
5746     build() {
5747       this._prevData = void 0;
5748       return {
5749         resultId: this.id,
5750         data: this._data
5751       };
5752     }
5753     canBuildEdits() {
5754       return this._prevData !== void 0;
5755     }
5756     buildEdits() {
5757       if (this._prevData !== void 0) {
5758         const prevDataLength = this._prevData.length;
5759         const dataLength = this._data.length;
5760         let startIndex = 0;
5761         while (startIndex < dataLength && startIndex < prevDataLength && this._prevData[startIndex] === this._data[startIndex]) {
5762           startIndex++;
5763         }
5764         if (startIndex < dataLength && startIndex < prevDataLength) {
5765           let endIndex = 0;
5766           while (endIndex < dataLength && endIndex < prevDataLength && this._prevData[prevDataLength - 1 - endIndex] === this._data[dataLength - 1 - endIndex]) {
5767             endIndex++;
5768           }
5769           const newData = this._data.slice(startIndex, dataLength - endIndex);
5770           const result = {
5771             resultId: this.id,
5772             edits: [
5773               {start: startIndex, deleteCount: prevDataLength - endIndex - startIndex, data: newData}
5774             ]
5775           };
5776           return result;
5777         } else if (startIndex < dataLength) {
5778           return {resultId: this.id, edits: [
5779             {start: startIndex, deleteCount: 0, data: this._data.slice(startIndex)}
5780           ]};
5781         } else if (startIndex < prevDataLength) {
5782           return {resultId: this.id, edits: [
5783             {start: startIndex, deleteCount: prevDataLength - startIndex}
5784           ]};
5785         } else {
5786           return {resultId: this.id, edits: []};
5787         }
5788       } else {
5789         return this.build();
5790       }
5791     }
5792   };
5793   exports2.SemanticTokensBuilder = SemanticTokensBuilder;
5794 });
5795
5796 // node_modules/vscode-languageserver/lib/common/showDocument.js
5797 var require_showDocument = __commonJS((exports2) => {
5798   "use strict";
5799   Object.defineProperty(exports2, "__esModule", {value: true});
5800   exports2.ShowDocumentFeature = void 0;
5801   var vscode_languageserver_protocol_1 = require_main3();
5802   var ShowDocumentFeature = (Base) => {
5803     return class extends Base {
5804       showDocument(params) {
5805         return this.connection.sendRequest(vscode_languageserver_protocol_1.ShowDocumentRequest.type, params);
5806       }
5807     };
5808   };
5809   exports2.ShowDocumentFeature = ShowDocumentFeature;
5810 });
5811
5812 // node_modules/vscode-languageserver/lib/common/fileOperations.js
5813 var require_fileOperations = __commonJS((exports2) => {
5814   "use strict";
5815   Object.defineProperty(exports2, "__esModule", {value: true});
5816   exports2.FileOperationsFeature = void 0;
5817   var vscode_languageserver_protocol_1 = require_main3();
5818   var FileOperationsFeature = (Base) => {
5819     return class extends Base {
5820       onDidCreateFiles(handler) {
5821         this.connection.onNotification(vscode_languageserver_protocol_1.DidCreateFilesNotification.type, (params) => {
5822           handler(params);
5823         });
5824       }
5825       onDidRenameFiles(handler) {
5826         this.connection.onNotification(vscode_languageserver_protocol_1.DidRenameFilesNotification.type, (params) => {
5827           handler(params);
5828         });
5829       }
5830       onDidDeleteFiles(handler) {
5831         this.connection.onNotification(vscode_languageserver_protocol_1.DidDeleteFilesNotification.type, (params) => {
5832           handler(params);
5833         });
5834       }
5835       onWillCreateFiles(handler) {
5836         return this.connection.onRequest(vscode_languageserver_protocol_1.WillCreateFilesRequest.type, (params, cancel) => {
5837           return handler(params, cancel);
5838         });
5839       }
5840       onWillRenameFiles(handler) {
5841         return this.connection.onRequest(vscode_languageserver_protocol_1.WillRenameFilesRequest.type, (params, cancel) => {
5842           return handler(params, cancel);
5843         });
5844       }
5845       onWillDeleteFiles(handler) {
5846         return this.connection.onRequest(vscode_languageserver_protocol_1.WillDeleteFilesRequest.type, (params, cancel) => {
5847           return handler(params, cancel);
5848         });
5849       }
5850     };
5851   };
5852   exports2.FileOperationsFeature = FileOperationsFeature;
5853 });
5854
5855 // node_modules/vscode-languageserver/lib/common/linkedEditingRange.js
5856 var require_linkedEditingRange = __commonJS((exports2) => {
5857   "use strict";
5858   Object.defineProperty(exports2, "__esModule", {value: true});
5859   exports2.LinkedEditingRangeFeature = void 0;
5860   var vscode_languageserver_protocol_1 = require_main3();
5861   var LinkedEditingRangeFeature = (Base) => {
5862     return class extends Base {
5863       onLinkedEditingRange(handler) {
5864         this.connection.onRequest(vscode_languageserver_protocol_1.LinkedEditingRangeRequest.type, (params, cancel) => {
5865           return handler(params, cancel, this.attachWorkDoneProgress(params), void 0);
5866         });
5867       }
5868     };
5869   };
5870   exports2.LinkedEditingRangeFeature = LinkedEditingRangeFeature;
5871 });
5872
5873 // node_modules/vscode-languageserver/lib/common/moniker.js
5874 var require_moniker = __commonJS((exports2) => {
5875   "use strict";
5876   Object.defineProperty(exports2, "__esModule", {value: true});
5877   exports2.MonikerFeature = void 0;
5878   var vscode_languageserver_protocol_1 = require_main3();
5879   var MonikerFeature = (Base) => {
5880     return class extends Base {
5881       get moniker() {
5882         return {
5883           on: (handler) => {
5884             const type = vscode_languageserver_protocol_1.MonikerRequest.type;
5885             this.connection.onRequest(type, (params, cancel) => {
5886               return handler(params, cancel, this.attachWorkDoneProgress(params), this.attachPartialResultProgress(type, params));
5887             });
5888           }
5889         };
5890       }
5891     };
5892   };
5893   exports2.MonikerFeature = MonikerFeature;
5894 });
5895
5896 // node_modules/vscode-languageserver/lib/common/server.js
5897 var require_server = __commonJS((exports2) => {
5898   "use strict";
5899   Object.defineProperty(exports2, "__esModule", {value: true});
5900   exports2.createConnection = exports2.combineFeatures = exports2.combineLanguagesFeatures = exports2.combineWorkspaceFeatures = exports2.combineWindowFeatures = exports2.combineClientFeatures = exports2.combineTracerFeatures = exports2.combineTelemetryFeatures = exports2.combineConsoleFeatures = exports2._LanguagesImpl = exports2.BulkUnregistration = exports2.BulkRegistration = exports2.ErrorMessageTracker = exports2.TextDocuments = void 0;
5901   var vscode_languageserver_protocol_1 = require_main3();
5902   var Is = require_is();
5903   var UUID = require_uuid();
5904   var progress_1 = require_progress();
5905   var configuration_1 = require_configuration();
5906   var workspaceFolders_1 = require_workspaceFolders();
5907   var callHierarchy_1 = require_callHierarchy();
5908   var semanticTokens_1 = require_semanticTokens();
5909   var showDocument_1 = require_showDocument();
5910   var fileOperations_1 = require_fileOperations();
5911   var linkedEditingRange_1 = require_linkedEditingRange();
5912   var moniker_1 = require_moniker();
5913   function null2Undefined(value) {
5914     if (value === null) {
5915       return void 0;
5916     }
5917     return value;
5918   }
5919   var TextDocuments = class {
5920     constructor(configuration) {
5921       this._documents = Object.create(null);
5922       this._configuration = configuration;
5923       this._onDidChangeContent = new vscode_languageserver_protocol_1.Emitter();
5924       this._onDidOpen = new vscode_languageserver_protocol_1.Emitter();
5925       this._onDidClose = new vscode_languageserver_protocol_1.Emitter();
5926       this._onDidSave = new vscode_languageserver_protocol_1.Emitter();
5927       this._onWillSave = new vscode_languageserver_protocol_1.Emitter();
5928     }
5929     get onDidChangeContent() {
5930       return this._onDidChangeContent.event;
5931     }
5932     get onDidOpen() {
5933       return this._onDidOpen.event;
5934     }
5935     get onWillSave() {
5936       return this._onWillSave.event;
5937     }
5938     onWillSaveWaitUntil(handler) {
5939       this._willSaveWaitUntil = handler;
5940     }
5941     get onDidSave() {
5942       return this._onDidSave.event;
5943     }
5944     get onDidClose() {
5945       return this._onDidClose.event;
5946     }
5947     get(uri) {
5948       return this._documents[uri];
5949     }
5950     all() {
5951       return Object.keys(this._documents).map((key) => this._documents[key]);
5952     }
5953     keys() {
5954       return Object.keys(this._documents);
5955     }
5956     listen(connection) {
5957       connection.__textDocumentSync = vscode_languageserver_protocol_1.TextDocumentSyncKind.Full;
5958       connection.onDidOpenTextDocument((event) => {
5959         let td = event.textDocument;
5960         let document = this._configuration.create(td.uri, td.languageId, td.version, td.text);
5961         this._documents[td.uri] = document;
5962         let toFire = Object.freeze({document});
5963         this._onDidOpen.fire(toFire);
5964         this._onDidChangeContent.fire(toFire);
5965       });
5966       connection.onDidChangeTextDocument((event) => {
5967         let td = event.textDocument;
5968         let changes = event.contentChanges;
5969         if (changes.length === 0) {
5970           return;
5971         }
5972         let document = this._documents[td.uri];
5973         const {version} = td;
5974         if (version === null || version === void 0) {
5975           throw new Error(`Received document change event for ${td.uri} without valid version identifier`);
5976         }
5977         document = this._configuration.update(document, changes, version);
5978         this._documents[td.uri] = document;
5979         this._onDidChangeContent.fire(Object.freeze({document}));
5980       });
5981       connection.onDidCloseTextDocument((event) => {
5982         let document = this._documents[event.textDocument.uri];
5983         if (document) {
5984           delete this._documents[event.textDocument.uri];
5985           this._onDidClose.fire(Object.freeze({document}));
5986         }
5987       });
5988       connection.onWillSaveTextDocument((event) => {
5989         let document = this._documents[event.textDocument.uri];
5990         if (document) {
5991           this._onWillSave.fire(Object.freeze({document, reason: event.reason}));
5992         }
5993       });
5994       connection.onWillSaveTextDocumentWaitUntil((event, token) => {
5995         let document = this._documents[event.textDocument.uri];
5996         if (document && this._willSaveWaitUntil) {
5997           return this._willSaveWaitUntil(Object.freeze({document, reason: event.reason}), token);
5998         } else {
5999           return [];
6000         }
6001       });
6002       connection.onDidSaveTextDocument((event) => {
6003         let document = this._documents[event.textDocument.uri];
6004         if (document) {
6005           this._onDidSave.fire(Object.freeze({document}));
6006         }
6007       });
6008     }
6009   };
6010   exports2.TextDocuments = TextDocuments;
6011   var ErrorMessageTracker = class {
6012     constructor() {
6013       this._messages = Object.create(null);
6014     }
6015     add(message) {
6016       let count = this._messages[message];
6017       if (!count) {
6018         count = 0;
6019       }
6020       count++;
6021       this._messages[message] = count;
6022     }
6023     sendErrors(connection) {
6024       Object.keys(this._messages).forEach((message) => {
6025         connection.window.showErrorMessage(message);
6026       });
6027     }
6028   };
6029   exports2.ErrorMessageTracker = ErrorMessageTracker;
6030   var RemoteConsoleImpl = class {
6031     constructor() {
6032     }
6033     rawAttach(connection) {
6034       this._rawConnection = connection;
6035     }
6036     attach(connection) {
6037       this._connection = connection;
6038     }
6039     get connection() {
6040       if (!this._connection) {
6041         throw new Error("Remote is not attached to a connection yet.");
6042       }
6043       return this._connection;
6044     }
6045     fillServerCapabilities(_capabilities) {
6046     }
6047     initialize(_capabilities) {
6048     }
6049     error(message) {
6050       this.send(vscode_languageserver_protocol_1.MessageType.Error, message);
6051     }
6052     warn(message) {
6053       this.send(vscode_languageserver_protocol_1.MessageType.Warning, message);
6054     }
6055     info(message) {
6056       this.send(vscode_languageserver_protocol_1.MessageType.Info, message);
6057     }
6058     log(message) {
6059       this.send(vscode_languageserver_protocol_1.MessageType.Log, message);
6060     }
6061     send(type, message) {
6062       if (this._rawConnection) {
6063         this._rawConnection.sendNotification(vscode_languageserver_protocol_1.LogMessageNotification.type, {type, message});
6064       }
6065     }
6066   };
6067   var _RemoteWindowImpl = class {
6068     constructor() {
6069     }
6070     attach(connection) {
6071       this._connection = connection;
6072     }
6073     get connection() {
6074       if (!this._connection) {
6075         throw new Error("Remote is not attached to a connection yet.");
6076       }
6077       return this._connection;
6078     }
6079     initialize(_capabilities) {
6080     }
6081     fillServerCapabilities(_capabilities) {
6082     }
6083     showErrorMessage(message, ...actions) {
6084       let params = {type: vscode_languageserver_protocol_1.MessageType.Error, message, actions};
6085       return this.connection.sendRequest(vscode_languageserver_protocol_1.ShowMessageRequest.type, params).then(null2Undefined);
6086     }
6087     showWarningMessage(message, ...actions) {
6088       let params = {type: vscode_languageserver_protocol_1.MessageType.Warning, message, actions};
6089       return this.connection.sendRequest(vscode_languageserver_protocol_1.ShowMessageRequest.type, params).then(null2Undefined);
6090     }
6091     showInformationMessage(message, ...actions) {
6092       let params = {type: vscode_languageserver_protocol_1.MessageType.Info, message, actions};
6093       return this.connection.sendRequest(vscode_languageserver_protocol_1.ShowMessageRequest.type, params).then(null2Undefined);
6094     }
6095   };
6096   var RemoteWindowImpl = showDocument_1.ShowDocumentFeature(progress_1.ProgressFeature(_RemoteWindowImpl));
6097   var BulkRegistration;
6098   (function(BulkRegistration2) {
6099     function create() {
6100       return new BulkRegistrationImpl();
6101     }
6102     BulkRegistration2.create = create;
6103   })(BulkRegistration = exports2.BulkRegistration || (exports2.BulkRegistration = {}));
6104   var BulkRegistrationImpl = class {
6105     constructor() {
6106       this._registrations = [];
6107       this._registered = new Set();
6108     }
6109     add(type, registerOptions) {
6110       const method = Is.string(type) ? type : type.method;
6111       if (this._registered.has(method)) {
6112         throw new Error(`${method} is already added to this registration`);
6113       }
6114       const id = UUID.generateUuid();
6115       this._registrations.push({
6116         id,
6117         method,
6118         registerOptions: registerOptions || {}
6119       });
6120       this._registered.add(method);
6121     }
6122     asRegistrationParams() {
6123       return {
6124         registrations: this._registrations
6125       };
6126     }
6127   };
6128   var BulkUnregistration;
6129   (function(BulkUnregistration2) {
6130     function create() {
6131       return new BulkUnregistrationImpl(void 0, []);
6132     }
6133     BulkUnregistration2.create = create;
6134   })(BulkUnregistration = exports2.BulkUnregistration || (exports2.BulkUnregistration = {}));
6135   var BulkUnregistrationImpl = class {
6136     constructor(_connection, unregistrations) {
6137       this._connection = _connection;
6138       this._unregistrations = new Map();
6139       unregistrations.forEach((unregistration) => {
6140         this._unregistrations.set(unregistration.method, unregistration);
6141       });
6142     }
6143     get isAttached() {
6144       return !!this._connection;
6145     }
6146     attach(connection) {
6147       this._connection = connection;
6148     }
6149     add(unregistration) {
6150       this._unregistrations.set(unregistration.method, unregistration);
6151     }
6152     dispose() {
6153       let unregistrations = [];
6154       for (let unregistration of this._unregistrations.values()) {
6155         unregistrations.push(unregistration);
6156       }
6157       let params = {
6158         unregisterations: unregistrations
6159       };
6160       this._connection.sendRequest(vscode_languageserver_protocol_1.UnregistrationRequest.type, params).then(void 0, (_error) => {
6161         this._connection.console.info(`Bulk unregistration failed.`);
6162       });
6163     }
6164     disposeSingle(arg) {
6165       const method = Is.string(arg) ? arg : arg.method;
6166       const unregistration = this._unregistrations.get(method);
6167       if (!unregistration) {
6168         return false;
6169       }
6170       let params = {
6171         unregisterations: [unregistration]
6172       };
6173       this._connection.sendRequest(vscode_languageserver_protocol_1.UnregistrationRequest.type, params).then(() => {
6174         this._unregistrations.delete(method);
6175       }, (_error) => {
6176         this._connection.console.info(`Un-registering request handler for ${unregistration.id} failed.`);
6177       });
6178       return true;
6179     }
6180   };
6181   var RemoteClientImpl = class {
6182     attach(connection) {
6183       this._connection = connection;
6184     }
6185     get connection() {
6186       if (!this._connection) {
6187         throw new Error("Remote is not attached to a connection yet.");
6188       }
6189       return this._connection;
6190     }
6191     initialize(_capabilities) {
6192     }
6193     fillServerCapabilities(_capabilities) {
6194     }
6195     register(typeOrRegistrations, registerOptionsOrType, registerOptions) {
6196       if (typeOrRegistrations instanceof BulkRegistrationImpl) {
6197         return this.registerMany(typeOrRegistrations);
6198       } else if (typeOrRegistrations instanceof BulkUnregistrationImpl) {
6199         return this.registerSingle1(typeOrRegistrations, registerOptionsOrType, registerOptions);
6200       } else {
6201         return this.registerSingle2(typeOrRegistrations, registerOptionsOrType);
6202       }
6203     }
6204     registerSingle1(unregistration, type, registerOptions) {
6205       const method = Is.string(type) ? type : type.method;
6206       const id = UUID.generateUuid();
6207       let params = {
6208         registrations: [{id, method, registerOptions: registerOptions || {}}]
6209       };
6210       if (!unregistration.isAttached) {
6211         unregistration.attach(this.connection);
6212       }
6213       return this.connection.sendRequest(vscode_languageserver_protocol_1.RegistrationRequest.type, params).then((_result) => {
6214         unregistration.add({id, method});
6215         return unregistration;
6216       }, (_error) => {
6217         this.connection.console.info(`Registering request handler for ${method} failed.`);
6218         return Promise.reject(_error);
6219       });
6220     }
6221     registerSingle2(type, registerOptions) {
6222       const method = Is.string(type) ? type : type.method;
6223       const id = UUID.generateUuid();
6224       let params = {
6225         registrations: [{id, method, registerOptions: registerOptions || {}}]
6226       };
6227       return this.connection.sendRequest(vscode_languageserver_protocol_1.RegistrationRequest.type, params).then((_result) => {
6228         return vscode_languageserver_protocol_1.Disposable.create(() => {
6229           this.unregisterSingle(id, method);
6230         });
6231       }, (_error) => {
6232         this.connection.console.info(`Registering request handler for ${method} failed.`);
6233         return Promise.reject(_error);
6234       });
6235     }
6236     unregisterSingle(id, method) {
6237       let params = {
6238         unregisterations: [{id, method}]
6239       };
6240       return this.connection.sendRequest(vscode_languageserver_protocol_1.UnregistrationRequest.type, params).then(void 0, (_error) => {
6241         this.connection.console.info(`Un-registering request handler for ${id} failed.`);
6242       });
6243     }
6244     registerMany(registrations) {
6245       let params = registrations.asRegistrationParams();
6246       return this.connection.sendRequest(vscode_languageserver_protocol_1.RegistrationRequest.type, params).then(() => {
6247         return new BulkUnregistrationImpl(this._connection, params.registrations.map((registration) => {
6248           return {id: registration.id, method: registration.method};
6249         }));
6250       }, (_error) => {
6251         this.connection.console.info(`Bulk registration failed.`);
6252         return Promise.reject(_error);
6253       });
6254     }
6255   };
6256   var _RemoteWorkspaceImpl = class {
6257     constructor() {
6258     }
6259     attach(connection) {
6260       this._connection = connection;
6261     }
6262     get connection() {
6263       if (!this._connection) {
6264         throw new Error("Remote is not attached to a connection yet.");
6265       }
6266       return this._connection;
6267     }
6268     initialize(_capabilities) {
6269     }
6270     fillServerCapabilities(_capabilities) {
6271     }
6272     applyEdit(paramOrEdit) {
6273       function isApplyWorkspaceEditParams(value) {
6274         return value && !!value.edit;
6275       }
6276       let params = isApplyWorkspaceEditParams(paramOrEdit) ? paramOrEdit : {edit: paramOrEdit};
6277       return this.connection.sendRequest(vscode_languageserver_protocol_1.ApplyWorkspaceEditRequest.type, params);
6278     }
6279   };
6280   var RemoteWorkspaceImpl = fileOperations_1.FileOperationsFeature(workspaceFolders_1.WorkspaceFoldersFeature(configuration_1.ConfigurationFeature(_RemoteWorkspaceImpl)));
6281   var TracerImpl = class {
6282     constructor() {
6283       this._trace = vscode_languageserver_protocol_1.Trace.Off;
6284     }
6285     attach(connection) {
6286       this._connection = connection;
6287     }
6288     get connection() {
6289       if (!this._connection) {
6290         throw new Error("Remote is not attached to a connection yet.");
6291       }
6292       return this._connection;
6293     }
6294     initialize(_capabilities) {
6295     }
6296     fillServerCapabilities(_capabilities) {
6297     }
6298     set trace(value) {
6299       this._trace = value;
6300     }
6301     log(message, verbose) {
6302       if (this._trace === vscode_languageserver_protocol_1.Trace.Off) {
6303         return;
6304       }
6305       this.connection.sendNotification(vscode_languageserver_protocol_1.LogTraceNotification.type, {
6306         message,
6307         verbose: this._trace === vscode_languageserver_protocol_1.Trace.Verbose ? verbose : void 0
6308       });
6309     }
6310   };
6311   var TelemetryImpl = class {
6312     constructor() {
6313     }
6314     attach(connection) {
6315       this._connection = connection;
6316     }
6317     get connection() {
6318       if (!this._connection) {
6319         throw new Error("Remote is not attached to a connection yet.");
6320       }
6321       return this._connection;
6322     }
6323     initialize(_capabilities) {
6324     }
6325     fillServerCapabilities(_capabilities) {
6326     }
6327     logEvent(data) {
6328       this.connection.sendNotification(vscode_languageserver_protocol_1.TelemetryEventNotification.type, data);
6329     }
6330   };
6331   var _LanguagesImpl = class {
6332     constructor() {
6333     }
6334     attach(connection) {
6335       this._connection = connection;
6336     }
6337     get connection() {
6338       if (!this._connection) {
6339         throw new Error("Remote is not attached to a connection yet.");
6340       }
6341       return this._connection;
6342     }
6343     initialize(_capabilities) {
6344     }
6345     fillServerCapabilities(_capabilities) {
6346     }
6347     attachWorkDoneProgress(params) {
6348       return progress_1.attachWorkDone(this.connection, params);
6349     }
6350     attachPartialResultProgress(_type, params) {
6351       return progress_1.attachPartialResult(this.connection, params);
6352     }
6353   };
6354   exports2._LanguagesImpl = _LanguagesImpl;
6355   var LanguagesImpl = moniker_1.MonikerFeature(linkedEditingRange_1.LinkedEditingRangeFeature(semanticTokens_1.SemanticTokensFeature(callHierarchy_1.CallHierarchyFeature(_LanguagesImpl))));
6356   function combineConsoleFeatures(one, two) {
6357     return function(Base) {
6358       return two(one(Base));
6359     };
6360   }
6361   exports2.combineConsoleFeatures = combineConsoleFeatures;
6362   function combineTelemetryFeatures(one, two) {
6363     return function(Base) {
6364       return two(one(Base));
6365     };
6366   }
6367   exports2.combineTelemetryFeatures = combineTelemetryFeatures;
6368   function combineTracerFeatures(one, two) {
6369     return function(Base) {
6370       return two(one(Base));
6371     };
6372   }
6373   exports2.combineTracerFeatures = combineTracerFeatures;
6374   function combineClientFeatures(one, two) {
6375     return function(Base) {
6376       return two(one(Base));
6377     };
6378   }
6379   exports2.combineClientFeatures = combineClientFeatures;
6380   function combineWindowFeatures(one, two) {
6381     return function(Base) {
6382       return two(one(Base));
6383     };
6384   }
6385   exports2.combineWindowFeatures = combineWindowFeatures;
6386   function combineWorkspaceFeatures(one, two) {
6387     return function(Base) {
6388       return two(one(Base));
6389     };
6390   }
6391   exports2.combineWorkspaceFeatures = combineWorkspaceFeatures;
6392   function combineLanguagesFeatures(one, two) {
6393     return function(Base) {
6394       return two(one(Base));
6395     };
6396   }
6397   exports2.combineLanguagesFeatures = combineLanguagesFeatures;
6398   function combineFeatures(one, two) {
6399     function combine(one2, two2, func) {
6400       if (one2 && two2) {
6401         return func(one2, two2);
6402       } else if (one2) {
6403         return one2;
6404       } else {
6405         return two2;
6406       }
6407     }
6408     let result = {
6409       __brand: "features",
6410       console: combine(one.console, two.console, combineConsoleFeatures),
6411       tracer: combine(one.tracer, two.tracer, combineTracerFeatures),
6412       telemetry: combine(one.telemetry, two.telemetry, combineTelemetryFeatures),
6413       client: combine(one.client, two.client, combineClientFeatures),
6414       window: combine(one.window, two.window, combineWindowFeatures),
6415       workspace: combine(one.workspace, two.workspace, combineWorkspaceFeatures)
6416     };
6417     return result;
6418   }
6419   exports2.combineFeatures = combineFeatures;
6420   function createConnection(connectionFactory, watchDog, factories) {
6421     const logger = factories && factories.console ? new (factories.console(RemoteConsoleImpl))() : new RemoteConsoleImpl();
6422     const connection = connectionFactory(logger);
6423     logger.rawAttach(connection);
6424     const tracer = factories && factories.tracer ? new (factories.tracer(TracerImpl))() : new TracerImpl();
6425     const telemetry = factories && factories.telemetry ? new (factories.telemetry(TelemetryImpl))() : new TelemetryImpl();
6426     const client = factories && factories.client ? new (factories.client(RemoteClientImpl))() : new RemoteClientImpl();
6427     const remoteWindow = factories && factories.window ? new (factories.window(RemoteWindowImpl))() : new RemoteWindowImpl();
6428     const workspace = factories && factories.workspace ? new (factories.workspace(RemoteWorkspaceImpl))() : new RemoteWorkspaceImpl();
6429     const languages = factories && factories.languages ? new (factories.languages(LanguagesImpl))() : new LanguagesImpl();
6430     const allRemotes = [logger, tracer, telemetry, client, remoteWindow, workspace, languages];
6431     function asPromise(value) {
6432       if (value instanceof Promise) {
6433         return value;
6434       } else if (Is.thenable(value)) {
6435         return new Promise((resolve, reject) => {
6436           value.then((resolved) => resolve(resolved), (error) => reject(error));
6437         });
6438       } else {
6439         return Promise.resolve(value);
6440       }
6441     }
6442     let shutdownHandler = void 0;
6443     let initializeHandler = void 0;
6444     let exitHandler = void 0;
6445     let protocolConnection = {
6446       listen: () => connection.listen(),
6447       sendRequest: (type, ...params) => connection.sendRequest(Is.string(type) ? type : type.method, ...params),
6448       onRequest: (type, handler) => connection.onRequest(type, handler),
6449       sendNotification: (type, param) => {
6450         const method = Is.string(type) ? type : type.method;
6451         if (arguments.length === 1) {
6452           connection.sendNotification(method);
6453         } else {
6454           connection.sendNotification(method, param);
6455         }
6456       },
6457       onNotification: (type, handler) => connection.onNotification(type, handler),
6458       onProgress: connection.onProgress,
6459       sendProgress: connection.sendProgress,
6460       onInitialize: (handler) => initializeHandler = handler,
6461       onInitialized: (handler) => connection.onNotification(vscode_languageserver_protocol_1.InitializedNotification.type, handler),
6462       onShutdown: (handler) => shutdownHandler = handler,
6463       onExit: (handler) => exitHandler = handler,
6464       get console() {
6465         return logger;
6466       },
6467       get telemetry() {
6468         return telemetry;
6469       },
6470       get tracer() {
6471         return tracer;
6472       },
6473       get client() {
6474         return client;
6475       },
6476       get window() {
6477         return remoteWindow;
6478       },
6479       get workspace() {
6480         return workspace;
6481       },
6482       get languages() {
6483         return languages;
6484       },
6485       onDidChangeConfiguration: (handler) => connection.onNotification(vscode_languageserver_protocol_1.DidChangeConfigurationNotification.type, handler),
6486       onDidChangeWatchedFiles: (handler) => connection.onNotification(vscode_languageserver_protocol_1.DidChangeWatchedFilesNotification.type, handler),
6487       __textDocumentSync: void 0,
6488       onDidOpenTextDocument: (handler) => connection.onNotification(vscode_languageserver_protocol_1.DidOpenTextDocumentNotification.type, handler),
6489       onDidChangeTextDocument: (handler) => connection.onNotification(vscode_languageserver_protocol_1.DidChangeTextDocumentNotification.type, handler),
6490       onDidCloseTextDocument: (handler) => connection.onNotification(vscode_languageserver_protocol_1.DidCloseTextDocumentNotification.type, handler),
6491       onWillSaveTextDocument: (handler) => connection.onNotification(vscode_languageserver_protocol_1.WillSaveTextDocumentNotification.type, handler),
6492       onWillSaveTextDocumentWaitUntil: (handler) => connection.onRequest(vscode_languageserver_protocol_1.WillSaveTextDocumentWaitUntilRequest.type, handler),
6493       onDidSaveTextDocument: (handler) => connection.onNotification(vscode_languageserver_protocol_1.DidSaveTextDocumentNotification.type, handler),
6494       sendDiagnostics: (params) => connection.sendNotification(vscode_languageserver_protocol_1.PublishDiagnosticsNotification.type, params),
6495       onHover: (handler) => connection.onRequest(vscode_languageserver_protocol_1.HoverRequest.type, (params, cancel) => {
6496         return handler(params, cancel, progress_1.attachWorkDone(connection, params), void 0);
6497       }),
6498       onCompletion: (handler) => connection.onRequest(vscode_languageserver_protocol_1.CompletionRequest.type, (params, cancel) => {
6499         return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));
6500       }),
6501       onCompletionResolve: (handler) => connection.onRequest(vscode_languageserver_protocol_1.CompletionResolveRequest.type, handler),
6502       onSignatureHelp: (handler) => connection.onRequest(vscode_languageserver_protocol_1.SignatureHelpRequest.type, (params, cancel) => {
6503         return handler(params, cancel, progress_1.attachWorkDone(connection, params), void 0);
6504       }),
6505       onDeclaration: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DeclarationRequest.type, (params, cancel) => {
6506         return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));
6507       }),
6508       onDefinition: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DefinitionRequest.type, (params, cancel) => {
6509         return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));
6510       }),
6511       onTypeDefinition: (handler) => connection.onRequest(vscode_languageserver_protocol_1.TypeDefinitionRequest.type, (params, cancel) => {
6512         return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));
6513       }),
6514       onImplementation: (handler) => connection.onRequest(vscode_languageserver_protocol_1.ImplementationRequest.type, (params, cancel) => {
6515         return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));
6516       }),
6517       onReferences: (handler) => connection.onRequest(vscode_languageserver_protocol_1.ReferencesRequest.type, (params, cancel) => {
6518         return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));
6519       }),
6520       onDocumentHighlight: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DocumentHighlightRequest.type, (params, cancel) => {
6521         return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));
6522       }),
6523       onDocumentSymbol: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DocumentSymbolRequest.type, (params, cancel) => {
6524         return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));
6525       }),
6526       onWorkspaceSymbol: (handler) => connection.onRequest(vscode_languageserver_protocol_1.WorkspaceSymbolRequest.type, (params, cancel) => {
6527         return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));
6528       }),
6529       onCodeAction: (handler) => connection.onRequest(vscode_languageserver_protocol_1.CodeActionRequest.type, (params, cancel) => {
6530         return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));
6531       }),
6532       onCodeActionResolve: (handler) => connection.onRequest(vscode_languageserver_protocol_1.CodeActionResolveRequest.type, (params, cancel) => {
6533         return handler(params, cancel);
6534       }),
6535       onCodeLens: (handler) => connection.onRequest(vscode_languageserver_protocol_1.CodeLensRequest.type, (params, cancel) => {
6536         return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));
6537       }),
6538       onCodeLensResolve: (handler) => connection.onRequest(vscode_languageserver_protocol_1.CodeLensResolveRequest.type, (params, cancel) => {
6539         return handler(params, cancel);
6540       }),
6541       onDocumentFormatting: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DocumentFormattingRequest.type, (params, cancel) => {
6542         return handler(params, cancel, progress_1.attachWorkDone(connection, params), void 0);
6543       }),
6544       onDocumentRangeFormatting: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DocumentRangeFormattingRequest.type, (params, cancel) => {
6545         return handler(params, cancel, progress_1.attachWorkDone(connection, params), void 0);
6546       }),
6547       onDocumentOnTypeFormatting: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DocumentOnTypeFormattingRequest.type, (params, cancel) => {
6548         return handler(params, cancel);
6549       }),
6550       onRenameRequest: (handler) => connection.onRequest(vscode_languageserver_protocol_1.RenameRequest.type, (params, cancel) => {
6551         return handler(params, cancel, progress_1.attachWorkDone(connection, params), void 0);
6552       }),
6553       onPrepareRename: (handler) => connection.onRequest(vscode_languageserver_protocol_1.PrepareRenameRequest.type, (params, cancel) => {
6554         return handler(params, cancel);
6555       }),
6556       onDocumentLinks: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DocumentLinkRequest.type, (params, cancel) => {
6557         return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));
6558       }),
6559       onDocumentLinkResolve: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DocumentLinkResolveRequest.type, (params, cancel) => {
6560         return handler(params, cancel);
6561       }),
6562       onDocumentColor: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DocumentColorRequest.type, (params, cancel) => {
6563         return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));
6564       }),
6565       onColorPresentation: (handler) => connection.onRequest(vscode_languageserver_protocol_1.ColorPresentationRequest.type, (params, cancel) => {
6566         return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));
6567       }),
6568       onFoldingRanges: (handler) => connection.onRequest(vscode_languageserver_protocol_1.FoldingRangeRequest.type, (params, cancel) => {
6569         return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));
6570       }),
6571       onSelectionRanges: (handler) => connection.onRequest(vscode_languageserver_protocol_1.SelectionRangeRequest.type, (params, cancel) => {
6572         return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));
6573       }),
6574       onExecuteCommand: (handler) => connection.onRequest(vscode_languageserver_protocol_1.ExecuteCommandRequest.type, (params, cancel) => {
6575         return handler(params, cancel, progress_1.attachWorkDone(connection, params), void 0);
6576       }),
6577       dispose: () => connection.dispose()
6578     };
6579     for (let remote of allRemotes) {
6580       remote.attach(protocolConnection);
6581     }
6582     connection.onRequest(vscode_languageserver_protocol_1.InitializeRequest.type, (params) => {
6583       watchDog.initialize(params);
6584       if (Is.string(params.trace)) {
6585         tracer.trace = vscode_languageserver_protocol_1.Trace.fromString(params.trace);
6586       }
6587       for (let remote of allRemotes) {
6588         remote.initialize(params.capabilities);
6589       }
6590       if (initializeHandler) {
6591         let result = initializeHandler(params, new vscode_languageserver_protocol_1.CancellationTokenSource().token, progress_1.attachWorkDone(connection, params), void 0);
6592         return asPromise(result).then((value) => {
6593           if (value instanceof vscode_languageserver_protocol_1.ResponseError) {
6594             return value;
6595           }
6596           let result2 = value;
6597           if (!result2) {
6598             result2 = {capabilities: {}};
6599           }
6600           let capabilities = result2.capabilities;
6601           if (!capabilities) {
6602             capabilities = {};
6603             result2.capabilities = capabilities;
6604           }
6605           if (capabilities.textDocumentSync === void 0 || capabilities.textDocumentSync === null) {
6606             capabilities.textDocumentSync = Is.number(protocolConnection.__textDocumentSync) ? protocolConnection.__textDocumentSync : vscode_languageserver_protocol_1.TextDocumentSyncKind.None;
6607           } else if (!Is.number(capabilities.textDocumentSync) && !Is.number(capabilities.textDocumentSync.change)) {
6608             capabilities.textDocumentSync.change = Is.number(protocolConnection.__textDocumentSync) ? protocolConnection.__textDocumentSync : vscode_languageserver_protocol_1.TextDocumentSyncKind.None;
6609           }
6610           for (let remote of allRemotes) {
6611             remote.fillServerCapabilities(capabilities);
6612           }
6613           return result2;
6614         });
6615       } else {
6616         let result = {capabilities: {textDocumentSync: vscode_languageserver_protocol_1.TextDocumentSyncKind.None}};
6617         for (let remote of allRemotes) {
6618           remote.fillServerCapabilities(result.capabilities);
6619         }
6620         return result;
6621       }
6622     });
6623     connection.onRequest(vscode_languageserver_protocol_1.ShutdownRequest.type, () => {
6624       watchDog.shutdownReceived = true;
6625       if (shutdownHandler) {
6626         return shutdownHandler(new vscode_languageserver_protocol_1.CancellationTokenSource().token);
6627       } else {
6628         return void 0;
6629       }
6630     });
6631     connection.onNotification(vscode_languageserver_protocol_1.ExitNotification.type, () => {
6632       try {
6633         if (exitHandler) {
6634           exitHandler();
6635         }
6636       } finally {
6637         if (watchDog.shutdownReceived) {
6638           watchDog.exit(0);
6639         } else {
6640           watchDog.exit(1);
6641         }
6642       }
6643     });
6644     connection.onNotification(vscode_languageserver_protocol_1.SetTraceNotification.type, (params) => {
6645       tracer.trace = vscode_languageserver_protocol_1.Trace.fromString(params.value);
6646     });
6647     return protocolConnection;
6648   }
6649   exports2.createConnection = createConnection;
6650 });
6651
6652 // node_modules/vscode-languageserver/lib/node/files.js
6653 var require_files = __commonJS((exports2) => {
6654   "use strict";
6655   Object.defineProperty(exports2, "__esModule", {value: true});
6656   exports2.resolveModulePath = exports2.FileSystem = exports2.resolveGlobalYarnPath = exports2.resolveGlobalNodePath = exports2.resolve = exports2.uriToFilePath = void 0;
6657   var url = require("url");
6658   var path = require("path");
6659   var fs = require("fs");
6660   var child_process_1 = require("child_process");
6661   function uriToFilePath(uri) {
6662     let parsed = url.parse(uri);
6663     if (parsed.protocol !== "file:" || !parsed.path) {
6664       return void 0;
6665     }
6666     let segments = parsed.path.split("/");
6667     for (var i = 0, len = segments.length; i < len; i++) {
6668       segments[i] = decodeURIComponent(segments[i]);
6669     }
6670     if (process.platform === "win32" && segments.length > 1) {
6671       let first = segments[0];
6672       let second = segments[1];
6673       if (first.length === 0 && second.length > 1 && second[1] === ":") {
6674         segments.shift();
6675       }
6676     }
6677     return path.normalize(segments.join("/"));
6678   }
6679   exports2.uriToFilePath = uriToFilePath;
6680   function isWindows2() {
6681     return process.platform === "win32";
6682   }
6683   function resolve(moduleName, nodePath, cwd, tracer) {
6684     const nodePathKey = "NODE_PATH";
6685     const app = [
6686       "var p = process;",
6687       "p.on('message',function(m){",
6688       "if(m.c==='e'){",
6689       "p.exit(0);",
6690       "}",
6691       "else if(m.c==='rs'){",
6692       "try{",
6693       "var r=require.resolve(m.a);",
6694       "p.send({c:'r',s:true,r:r});",
6695       "}",
6696       "catch(err){",
6697       "p.send({c:'r',s:false});",
6698       "}",
6699       "}",
6700       "});"
6701     ].join("");
6702     return new Promise((resolve2, reject) => {
6703       let env = process.env;
6704       let newEnv = Object.create(null);
6705       Object.keys(env).forEach((key) => newEnv[key] = env[key]);
6706       if (nodePath && fs.existsSync(nodePath)) {
6707         if (newEnv[nodePathKey]) {
6708           newEnv[nodePathKey] = nodePath + path.delimiter + newEnv[nodePathKey];
6709         } else {
6710           newEnv[nodePathKey] = nodePath;
6711         }
6712         if (tracer) {
6713           tracer(`NODE_PATH value is: ${newEnv[nodePathKey]}`);
6714         }
6715       }
6716       newEnv["ELECTRON_RUN_AS_NODE"] = "1";
6717       try {
6718         let cp = child_process_1.fork("", [], {
6719           cwd,
6720           env: newEnv,
6721           execArgv: ["-e", app]
6722         });
6723         if (cp.pid === void 0) {
6724           reject(new Error(`Starting process to resolve node module  ${moduleName} failed`));
6725           return;
6726         }
6727         cp.on("error", (error) => {
6728           reject(error);
6729         });
6730         cp.on("message", (message2) => {
6731           if (message2.c === "r") {
6732             cp.send({c: "e"});
6733             if (message2.s) {
6734               resolve2(message2.r);
6735             } else {
6736               reject(new Error(`Failed to resolve module: ${moduleName}`));
6737             }
6738           }
6739         });
6740         let message = {
6741           c: "rs",
6742           a: moduleName
6743         };
6744         cp.send(message);
6745       } catch (error) {
6746         reject(error);
6747       }
6748     });
6749   }
6750   exports2.resolve = resolve;
6751   function resolveGlobalNodePath(tracer) {
6752     let npmCommand = "npm";
6753     const env = Object.create(null);
6754     Object.keys(process.env).forEach((key) => env[key] = process.env[key]);
6755     env["NO_UPDATE_NOTIFIER"] = "true";
6756     const options = {
6757       encoding: "utf8",
6758       env
6759     };
6760     if (isWindows2()) {
6761       npmCommand = "npm.cmd";
6762       options.shell = true;
6763     }
6764     let handler = () => {
6765     };
6766     try {
6767       process.on("SIGPIPE", handler);
6768       let stdout = child_process_1.spawnSync(npmCommand, ["config", "get", "prefix"], options).stdout;
6769       if (!stdout) {
6770         if (tracer) {
6771           tracer(`'npm config get prefix' didn't return a value.`);
6772         }
6773         return void 0;
6774       }
6775       let prefix = stdout.trim();
6776       if (tracer) {
6777         tracer(`'npm config get prefix' value is: ${prefix}`);
6778       }
6779       if (prefix.length > 0) {
6780         if (isWindows2()) {
6781           return path.join(prefix, "node_modules");
6782         } else {
6783           return path.join(prefix, "lib", "node_modules");
6784         }
6785       }
6786       return void 0;
6787     } catch (err) {
6788       return void 0;
6789     } finally {
6790       process.removeListener("SIGPIPE", handler);
6791     }
6792   }
6793   exports2.resolveGlobalNodePath = resolveGlobalNodePath;
6794   function resolveGlobalYarnPath(tracer) {
6795     let yarnCommand = "yarn";
6796     let options = {
6797       encoding: "utf8"
6798     };
6799     if (isWindows2()) {
6800       yarnCommand = "yarn.cmd";
6801       options.shell = true;
6802     }
6803     let handler = () => {
6804     };
6805     try {
6806       process.on("SIGPIPE", handler);
6807       let results = child_process_1.spawnSync(yarnCommand, ["global", "dir", "--json"], options);
6808       let stdout = results.stdout;
6809       if (!stdout) {
6810         if (tracer) {
6811           tracer(`'yarn global dir' didn't return a value.`);
6812           if (results.stderr) {
6813             tracer(results.stderr);
6814           }
6815         }
6816         return void 0;
6817       }
6818       let lines = stdout.trim().split(/\r?\n/);
6819       for (let line of lines) {
6820         try {
6821           let yarn = JSON.parse(line);
6822           if (yarn.type === "log") {
6823             return path.join(yarn.data, "node_modules");
6824           }
6825         } catch (e) {
6826         }
6827       }
6828       return void 0;
6829     } catch (err) {
6830       return void 0;
6831     } finally {
6832       process.removeListener("SIGPIPE", handler);
6833     }
6834   }
6835   exports2.resolveGlobalYarnPath = resolveGlobalYarnPath;
6836   var FileSystem;
6837   (function(FileSystem2) {
6838     let _isCaseSensitive = void 0;
6839     function isCaseSensitive() {
6840       if (_isCaseSensitive !== void 0) {
6841         return _isCaseSensitive;
6842       }
6843       if (process.platform === "win32") {
6844         _isCaseSensitive = false;
6845       } else {
6846         _isCaseSensitive = !fs.existsSync(__filename.toUpperCase()) || !fs.existsSync(__filename.toLowerCase());
6847       }
6848       return _isCaseSensitive;
6849     }
6850     FileSystem2.isCaseSensitive = isCaseSensitive;
6851     function isParent(parent, child) {
6852       if (isCaseSensitive()) {
6853         return path.normalize(child).indexOf(path.normalize(parent)) === 0;
6854       } else {
6855         return path.normalize(child).toLowerCase().indexOf(path.normalize(parent).toLowerCase()) === 0;
6856       }
6857     }
6858     FileSystem2.isParent = isParent;
6859   })(FileSystem = exports2.FileSystem || (exports2.FileSystem = {}));
6860   function resolveModulePath(workspaceRoot, moduleName, nodePath, tracer) {
6861     if (nodePath) {
6862       if (!path.isAbsolute(nodePath)) {
6863         nodePath = path.join(workspaceRoot, nodePath);
6864       }
6865       return resolve(moduleName, nodePath, nodePath, tracer).then((value) => {
6866         if (FileSystem.isParent(nodePath, value)) {
6867           return value;
6868         } else {
6869           return Promise.reject(new Error(`Failed to load ${moduleName} from node path location.`));
6870         }
6871       }).then(void 0, (_error) => {
6872         return resolve(moduleName, resolveGlobalNodePath(tracer), workspaceRoot, tracer);
6873       });
6874     } else {
6875       return resolve(moduleName, resolveGlobalNodePath(tracer), workspaceRoot, tracer);
6876     }
6877   }
6878   exports2.resolveModulePath = resolveModulePath;
6879 });
6880
6881 // node_modules/vscode-languageserver/node_modules/vscode-languageserver-protocol/node.js
6882 var require_node2 = __commonJS((exports2, module2) => {
6883   "use strict";
6884   module2.exports = require_main3();
6885 });
6886
6887 // node_modules/vscode-languageserver/lib/common/api.js
6888 var require_api3 = __commonJS((exports2) => {
6889   "use strict";
6890   var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
6891     if (k2 === void 0)
6892       k2 = k;
6893     Object.defineProperty(o, k2, {enumerable: true, get: function() {
6894       return m[k];
6895     }});
6896   } : function(o, m, k, k2) {
6897     if (k2 === void 0)
6898       k2 = k;
6899     o[k2] = m[k];
6900   });
6901   var __exportStar2 = exports2 && exports2.__exportStar || function(m, exports3) {
6902     for (var p in m)
6903       if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p))
6904         __createBinding(exports3, m, p);
6905   };
6906   Object.defineProperty(exports2, "__esModule", {value: true});
6907   exports2.ProposedFeatures = exports2.SemanticTokensBuilder = void 0;
6908   var semanticTokens_1 = require_semanticTokens();
6909   Object.defineProperty(exports2, "SemanticTokensBuilder", {enumerable: true, get: function() {
6910     return semanticTokens_1.SemanticTokensBuilder;
6911   }});
6912   __exportStar2(require_main3(), exports2);
6913   __exportStar2(require_server(), exports2);
6914   var ProposedFeatures;
6915   (function(ProposedFeatures2) {
6916     ProposedFeatures2.all = {
6917       __brand: "features"
6918     };
6919   })(ProposedFeatures = exports2.ProposedFeatures || (exports2.ProposedFeatures = {}));
6920 });
6921
6922 // node_modules/vscode-languageserver/lib/node/main.js
6923 var require_main4 = __commonJS((exports2) => {
6924   "use strict";
6925   var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
6926     if (k2 === void 0)
6927       k2 = k;
6928     Object.defineProperty(o, k2, {enumerable: true, get: function() {
6929       return m[k];
6930     }});
6931   } : function(o, m, k, k2) {
6932     if (k2 === void 0)
6933       k2 = k;
6934     o[k2] = m[k];
6935   });
6936   var __exportStar2 = exports2 && exports2.__exportStar || function(m, exports3) {
6937     for (var p in m)
6938       if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p))
6939         __createBinding(exports3, m, p);
6940   };
6941   Object.defineProperty(exports2, "__esModule", {value: true});
6942   exports2.createConnection = exports2.Files = void 0;
6943   var Is = require_is();
6944   var server_1 = require_server();
6945   var fm = require_files();
6946   var node_1 = require_node2();
6947   __exportStar2(require_node2(), exports2);
6948   __exportStar2(require_api3(), exports2);
6949   var Files;
6950   (function(Files2) {
6951     Files2.uriToFilePath = fm.uriToFilePath;
6952     Files2.resolveGlobalNodePath = fm.resolveGlobalNodePath;
6953     Files2.resolveGlobalYarnPath = fm.resolveGlobalYarnPath;
6954     Files2.resolve = fm.resolve;
6955     Files2.resolveModulePath = fm.resolveModulePath;
6956   })(Files = exports2.Files || (exports2.Files = {}));
6957   var _protocolConnection;
6958   function endProtocolConnection() {
6959     if (_protocolConnection === void 0) {
6960       return;
6961     }
6962     try {
6963       _protocolConnection.end();
6964     } catch (_err) {
6965     }
6966   }
6967   var _shutdownReceived = false;
6968   var exitTimer = void 0;
6969   function setupExitTimer() {
6970     const argName = "--clientProcessId";
6971     function runTimer(value) {
6972       try {
6973         let processId = parseInt(value);
6974         if (!isNaN(processId)) {
6975           exitTimer = setInterval(() => {
6976             try {
6977               process.kill(processId, 0);
6978             } catch (ex) {
6979               endProtocolConnection();
6980               process.exit(_shutdownReceived ? 0 : 1);
6981             }
6982           }, 3e3);
6983         }
6984       } catch (e) {
6985       }
6986     }
6987     for (let i = 2; i < process.argv.length; i++) {
6988       let arg = process.argv[i];
6989       if (arg === argName && i + 1 < process.argv.length) {
6990         runTimer(process.argv[i + 1]);
6991         return;
6992       } else {
6993         let args = arg.split("=");
6994         if (args[0] === argName) {
6995           runTimer(args[1]);
6996         }
6997       }
6998     }
6999   }
7000   setupExitTimer();
7001   var watchDog = {
7002     initialize: (params) => {
7003       const processId = params.processId;
7004       if (Is.number(processId) && exitTimer === void 0) {
7005         setInterval(() => {
7006           try {
7007             process.kill(processId, 0);
7008           } catch (ex) {
7009             process.exit(_shutdownReceived ? 0 : 1);
7010           }
7011         }, 3e3);
7012       }
7013     },
7014     get shutdownReceived() {
7015       return _shutdownReceived;
7016     },
7017     set shutdownReceived(value) {
7018       _shutdownReceived = value;
7019     },
7020     exit: (code) => {
7021       endProtocolConnection();
7022       process.exit(code);
7023     }
7024   };
7025   function createConnection(arg1, arg2, arg3, arg4) {
7026     let factories;
7027     let input;
7028     let output;
7029     let options;
7030     if (arg1 !== void 0 && arg1.__brand === "features") {
7031       factories = arg1;
7032       arg1 = arg2;
7033       arg2 = arg3;
7034       arg3 = arg4;
7035     }
7036     if (node_1.ConnectionStrategy.is(arg1) || node_1.ConnectionOptions.is(arg1)) {
7037       options = arg1;
7038     } else {
7039       input = arg1;
7040       output = arg2;
7041       options = arg3;
7042     }
7043     return _createConnection(input, output, options, factories);
7044   }
7045   exports2.createConnection = createConnection;
7046   function _createConnection(input, output, options, factories) {
7047     if (!input && !output && process.argv.length > 2) {
7048       let port = void 0;
7049       let pipeName = void 0;
7050       let argv = process.argv.slice(2);
7051       for (let i = 0; i < argv.length; i++) {
7052         let arg = argv[i];
7053         if (arg === "--node-ipc") {
7054           input = new node_1.IPCMessageReader(process);
7055           output = new node_1.IPCMessageWriter(process);
7056           break;
7057         } else if (arg === "--stdio") {
7058           input = process.stdin;
7059           output = process.stdout;
7060           break;
7061         } else if (arg === "--socket") {
7062           port = parseInt(argv[i + 1]);
7063           break;
7064         } else if (arg === "--pipe") {
7065           pipeName = argv[i + 1];
7066           break;
7067         } else {
7068           var args = arg.split("=");
7069           if (args[0] === "--socket") {
7070             port = parseInt(args[1]);
7071             break;
7072           } else if (args[0] === "--pipe") {
7073             pipeName = args[1];
7074             break;
7075           }
7076         }
7077       }
7078       if (port) {
7079         let transport = node_1.createServerSocketTransport(port);
7080         input = transport[0];
7081         output = transport[1];
7082       } else if (pipeName) {
7083         let transport = node_1.createServerPipeTransport(pipeName);
7084         input = transport[0];
7085         output = transport[1];
7086       }
7087     }
7088     var commandLineMessage = "Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";
7089     if (!input) {
7090       throw new Error("Connection input stream is not set. " + commandLineMessage);
7091     }
7092     if (!output) {
7093       throw new Error("Connection output stream is not set. " + commandLineMessage);
7094     }
7095     if (Is.func(input.read) && Is.func(input.on)) {
7096       let inputStream = input;
7097       inputStream.on("end", () => {
7098         endProtocolConnection();
7099         process.exit(_shutdownReceived ? 0 : 1);
7100       });
7101       inputStream.on("close", () => {
7102         endProtocolConnection();
7103         process.exit(_shutdownReceived ? 0 : 1);
7104       });
7105     }
7106     const connectionFactory = (logger) => {
7107       const result = node_1.createProtocolConnection(input, output, logger, options);
7108       return result;
7109     };
7110     return server_1.createConnection(connectionFactory, watchDog, factories);
7111   }
7112 });
7113
7114 // node_modules/vscode-languageserver/node.js
7115 var require_node3 = __commonJS((exports2, module2) => {
7116   "use strict";
7117   module2.exports = require_main4();
7118 });
7119
7120 // server/eslintServer.ts
7121 var require_eslintServer = __commonJS(() => {
7122   var import_node = __toModule(require_node3());
7123   var path = __toModule(require("path"));
7124   var fs = __toModule(require("fs"));
7125   var import_child_process = __toModule(require("child_process"));
7126   var import_os = __toModule(require("os"));
7127   "use strict";
7128   var Is;
7129   (function(Is2) {
7130     const toString = Object.prototype.toString;
7131     function boolean(value) {
7132       return value === true || value === false;
7133     }
7134     Is2.boolean = boolean;
7135     function nullOrUndefined(value) {
7136       return value === null || value === void 0;
7137     }
7138     Is2.nullOrUndefined = nullOrUndefined;
7139     function string(value) {
7140       return toString.call(value) === "[object String]";
7141     }
7142     Is2.string = string;
7143   })(Is || (Is = {}));
7144   var CommandIds;
7145   (function(CommandIds2) {
7146     CommandIds2.applySingleFix = "eslint.applySingleFix";
7147     CommandIds2.applySuggestion = "eslint.applySuggestion";
7148     CommandIds2.applySameFixes = "eslint.applySameFixes";
7149     CommandIds2.applyAllFixes = "eslint.applyAllFixes";
7150     CommandIds2.applyDisableLine = "eslint.applyDisableLine";
7151     CommandIds2.applyDisableFile = "eslint.applyDisableFile";
7152     CommandIds2.openRuleDoc = "eslint.openRuleDoc";
7153   })(CommandIds || (CommandIds = {}));
7154   var Status;
7155   (function(Status2) {
7156     Status2[Status2["ok"] = 1] = "ok";
7157     Status2[Status2["warn"] = 2] = "warn";
7158     Status2[Status2["error"] = 3] = "error";
7159     Status2[Status2["confirmationPending"] = 4] = "confirmationPending";
7160     Status2[Status2["confirmationCanceled"] = 5] = "confirmationCanceled";
7161     Status2[Status2["executionDenied"] = 6] = "executionDenied";
7162   })(Status || (Status = {}));
7163   var StatusNotification;
7164   (function(StatusNotification2) {
7165     StatusNotification2.type = new import_node.NotificationType("eslint/status");
7166   })(StatusNotification || (StatusNotification = {}));
7167   var NoConfigRequest;
7168   (function(NoConfigRequest2) {
7169     NoConfigRequest2.type = new import_node.RequestType("eslint/noConfig");
7170   })(NoConfigRequest || (NoConfigRequest = {}));
7171   var NoESLintLibraryRequest;
7172   (function(NoESLintLibraryRequest2) {
7173     NoESLintLibraryRequest2.type = new import_node.RequestType("eslint/noLibrary");
7174   })(NoESLintLibraryRequest || (NoESLintLibraryRequest = {}));
7175   var OpenESLintDocRequest;
7176   (function(OpenESLintDocRequest2) {
7177     OpenESLintDocRequest2.type = new import_node.RequestType("eslint/openDoc");
7178   })(OpenESLintDocRequest || (OpenESLintDocRequest = {}));
7179   var ProbeFailedRequest;
7180   (function(ProbeFailedRequest2) {
7181     ProbeFailedRequest2.type = new import_node.RequestType("eslint/probeFailed");
7182   })(ProbeFailedRequest || (ProbeFailedRequest = {}));
7183   var ConfirmExecutionResult;
7184   (function(ConfirmExecutionResult2) {
7185     ConfirmExecutionResult2[ConfirmExecutionResult2["deny"] = 1] = "deny";
7186     ConfirmExecutionResult2[ConfirmExecutionResult2["confirmationPending"] = 2] = "confirmationPending";
7187     ConfirmExecutionResult2[ConfirmExecutionResult2["confirmationCanceled"] = 3] = "confirmationCanceled";
7188     ConfirmExecutionResult2[ConfirmExecutionResult2["approved"] = 4] = "approved";
7189   })(ConfirmExecutionResult || (ConfirmExecutionResult = {}));
7190   (function(ConfirmExecutionResult2) {
7191     function toStatus(value) {
7192       switch (value) {
7193         case ConfirmExecutionResult2.deny:
7194           return 6;
7195         case ConfirmExecutionResult2.confirmationPending:
7196           return 4;
7197         case ConfirmExecutionResult2.confirmationCanceled:
7198           return 5;
7199         case ConfirmExecutionResult2.approved:
7200           return 1;
7201       }
7202     }
7203     ConfirmExecutionResult2.toStatus = toStatus;
7204   })(ConfirmExecutionResult || (ConfirmExecutionResult = {}));
7205   var ConfirmExecution;
7206   (function(ConfirmExecution2) {
7207     ConfirmExecution2.type = new import_node.RequestType("eslint/confirmESLintExecution");
7208   })(ConfirmExecution || (ConfirmExecution = {}));
7209   var ShowOutputChannel;
7210   (function(ShowOutputChannel2) {
7211     ShowOutputChannel2.type = new import_node.NotificationType0("eslint/showOutputChannel");
7212   })(ShowOutputChannel || (ShowOutputChannel = {}));
7213   var ModeEnum;
7214   (function(ModeEnum2) {
7215     ModeEnum2["auto"] = "auto";
7216     ModeEnum2["location"] = "location";
7217   })(ModeEnum || (ModeEnum = {}));
7218   (function(ModeEnum2) {
7219     function is(value) {
7220       return value === ModeEnum2.auto || value === ModeEnum2.location;
7221     }
7222     ModeEnum2.is = is;
7223   })(ModeEnum || (ModeEnum = {}));
7224   var ModeItem;
7225   (function(ModeItem2) {
7226     function is(item) {
7227       const candidate = item;
7228       return candidate && ModeEnum.is(candidate.mode);
7229     }
7230     ModeItem2.is = is;
7231   })(ModeItem || (ModeItem = {}));
7232   var DirectoryItem;
7233   (function(DirectoryItem2) {
7234     function is(item) {
7235       const candidate = item;
7236       return candidate && Is.string(candidate.directory) && (Is.boolean(candidate["!cwd"]) || candidate["!cwd"] === void 0);
7237     }
7238     DirectoryItem2.is = is;
7239   })(DirectoryItem || (DirectoryItem = {}));
7240   var Validate;
7241   (function(Validate2) {
7242     Validate2["on"] = "on";
7243     Validate2["off"] = "off";
7244     Validate2["probe"] = "probe";
7245   })(Validate || (Validate = {}));
7246   var ESLintSeverity;
7247   (function(ESLintSeverity2) {
7248     ESLintSeverity2["off"] = "off";
7249     ESLintSeverity2["warn"] = "warn";
7250     ESLintSeverity2["error"] = "error";
7251   })(ESLintSeverity || (ESLintSeverity = {}));
7252   var CodeActionsOnSaveMode;
7253   (function(CodeActionsOnSaveMode2) {
7254     CodeActionsOnSaveMode2["all"] = "all";
7255     CodeActionsOnSaveMode2["problems"] = "problems";
7256   })(CodeActionsOnSaveMode || (CodeActionsOnSaveMode = {}));
7257   var TextDocumentSettings;
7258   (function(TextDocumentSettings2) {
7259     function hasLibrary(settings) {
7260       return settings.library !== void 0;
7261     }
7262     TextDocumentSettings2.hasLibrary = hasLibrary;
7263   })(TextDocumentSettings || (TextDocumentSettings = {}));
7264   var RuleData;
7265   (function(RuleData2) {
7266     function hasMetaType(value) {
7267       return value !== void 0 && value.meta !== void 0 && value.meta.type !== void 0;
7268     }
7269     RuleData2.hasMetaType = hasMetaType;
7270   })(RuleData || (RuleData = {}));
7271   var CLIEngine;
7272   (function(CLIEngine2) {
7273     function hasRule(value) {
7274       return value.getRules !== void 0;
7275     }
7276     CLIEngine2.hasRule = hasRule;
7277   })(CLIEngine || (CLIEngine = {}));
7278   function loadNodeModule(moduleName) {
7279     try {
7280       return require(moduleName);
7281     } catch (err) {
7282       connection.console.error(err.stack.toString());
7283     }
7284     return void 0;
7285   }
7286   function makeDiagnostic(problem) {
7287     const message = problem.message;
7288     const startLine = Is.nullOrUndefined(problem.line) ? 0 : Math.max(0, problem.line - 1);
7289     const startChar = Is.nullOrUndefined(problem.column) ? 0 : Math.max(0, problem.column - 1);
7290     const endLine = Is.nullOrUndefined(problem.endLine) ? startLine : Math.max(0, problem.endLine - 1);
7291     const endChar = Is.nullOrUndefined(problem.endColumn) ? startChar : Math.max(0, problem.endColumn - 1);
7292     const result = {
7293       message,
7294       severity: convertSeverity(problem.severity),
7295       source: "eslint",
7296       range: {
7297         start: {line: startLine, character: startChar},
7298         end: {line: endLine, character: endChar}
7299       }
7300     };
7301     if (problem.ruleId) {
7302       const url = ruleDocData.urls.get(problem.ruleId);
7303       result.code = problem.ruleId;
7304       if (url !== void 0) {
7305         result.codeDescription = {
7306           href: url
7307         };
7308       }
7309       if (problem.ruleId === "no-unused-vars") {
7310         result.tags = [import_node.DiagnosticTag.Unnecessary];
7311       }
7312     }
7313     return result;
7314   }
7315   var Problem;
7316   (function(Problem2) {
7317     function isFixable(problem) {
7318       return problem.edit !== void 0;
7319     }
7320     Problem2.isFixable = isFixable;
7321     function hasSuggestions(problem) {
7322       return problem.suggestions !== void 0;
7323     }
7324     Problem2.hasSuggestions = hasSuggestions;
7325   })(Problem || (Problem = {}));
7326   var FixableProblem;
7327   (function(FixableProblem2) {
7328     function createTextEdit(document, editInfo) {
7329       return import_node.TextEdit.replace(import_node.Range.create(document.positionAt(editInfo.edit.range[0]), document.positionAt(editInfo.edit.range[1])), editInfo.edit.text || "");
7330     }
7331     FixableProblem2.createTextEdit = createTextEdit;
7332   })(FixableProblem || (FixableProblem = {}));
7333   var SuggestionsProblem;
7334   (function(SuggestionsProblem2) {
7335     function createTextEdit(document, suggestion) {
7336       return import_node.TextEdit.replace(import_node.Range.create(document.positionAt(suggestion.fix.range[0]), document.positionAt(suggestion.fix.range[1])), suggestion.fix.text || "");
7337     }
7338     SuggestionsProblem2.createTextEdit = createTextEdit;
7339   })(SuggestionsProblem || (SuggestionsProblem = {}));
7340   function computeKey(diagnostic) {
7341     const range = diagnostic.range;
7342     return `[${range.start.line},${range.start.character},${range.end.line},${range.end.character}]-${diagnostic.code}`;
7343   }
7344   var codeActions = new Map();
7345   function recordCodeAction(document, diagnostic, problem) {
7346     if (!problem.ruleId) {
7347       return;
7348     }
7349     const uri = document.uri;
7350     let edits = codeActions.get(uri);
7351     if (edits === void 0) {
7352       edits = new Map();
7353       codeActions.set(uri, edits);
7354     }
7355     edits.set(computeKey(diagnostic), {
7356       label: `Fix this ${problem.ruleId} problem`,
7357       documentVersion: document.version,
7358       ruleId: problem.ruleId,
7359       line: problem.line,
7360       diagnostic,
7361       edit: problem.fix,
7362       suggestions: problem.suggestions
7363     });
7364   }
7365   function convertSeverity(severity) {
7366     switch (severity) {
7367       case 1:
7368         return import_node.DiagnosticSeverity.Warning;
7369       case 2:
7370         return import_node.DiagnosticSeverity.Error;
7371       default:
7372         return import_node.DiagnosticSeverity.Error;
7373     }
7374   }
7375   var CharCode;
7376   (function(CharCode2) {
7377     CharCode2[CharCode2["Backslash"] = 92] = "Backslash";
7378   })(CharCode || (CharCode = {}));
7379   function isUNC(path2) {
7380     if (process.platform !== "win32") {
7381       return false;
7382     }
7383     if (!path2 || path2.length < 5) {
7384       return false;
7385     }
7386     let code = path2.charCodeAt(0);
7387     if (code !== 92) {
7388       return false;
7389     }
7390     code = path2.charCodeAt(1);
7391     if (code !== 92) {
7392       return false;
7393     }
7394     let pos = 2;
7395     const start = pos;
7396     for (; pos < path2.length; pos++) {
7397       code = path2.charCodeAt(pos);
7398       if (code === 92) {
7399         break;
7400       }
7401     }
7402     if (start === pos) {
7403       return false;
7404     }
7405     code = path2.charCodeAt(pos + 1);
7406     if (isNaN(code) || code === 92) {
7407       return false;
7408     }
7409     return true;
7410   }
7411   function getFileSystemPath(uri) {
7412     let result = uri.fsPath;
7413     if (process.platform === "win32" && result.length >= 2 && result[1] === ":") {
7414       result = result[0].toUpperCase() + result.substr(1);
7415     }
7416     if (!fs.existsSync(result)) {
7417       return result;
7418     }
7419     if (process.platform === "win32" || process.platform === "darwin") {
7420       const realpath = fs.realpathSync.native(result);
7421       if (realpath.toLowerCase() === result.toLowerCase()) {
7422         result = realpath;
7423       }
7424     }
7425     return result;
7426   }
7427   function getFilePath(documentOrUri) {
7428     if (!documentOrUri) {
7429       return void 0;
7430     }
7431     const uri = Is.string(documentOrUri) ? URI.parse(documentOrUri) : documentOrUri instanceof URI ? documentOrUri : URI.parse(documentOrUri.uri);
7432     if (uri.scheme !== "file") {
7433       return void 0;
7434     }
7435     return getFileSystemPath(uri);
7436   }
7437   var exitCalled = new import_node.NotificationType("eslint/exitCalled");
7438   var nodeExit = process.exit;
7439   process.exit = (code) => {
7440     const stack = new Error("stack");
7441     connection.sendNotification(exitCalled, [code ? code : 0, stack.stack]);
7442     setTimeout(() => {
7443       nodeExit(code);
7444     }, 1e3);
7445   };
7446   process.on("uncaughtException", (error) => {
7447     let message;
7448     if (error) {
7449       if (typeof error.stack === "string") {
7450         message = error.stack;
7451       } else if (typeof error.message === "string") {
7452         message = error.message;
7453       } else if (typeof error === "string") {
7454         message = error;
7455       }
7456       if (message === void 0 || message.length === 0) {
7457         try {
7458           message = JSON.stringify(error, void 0, 4);
7459         } catch (e) {
7460         }
7461       }
7462     }
7463     console.error("Uncaught exception received.");
7464     if (message) {
7465       console.error(message);
7466     }
7467   });
7468   var connection = import_node.createConnection();
7469   connection.console.info(`ESLint server running in node ${process.version}`);
7470   var documents;
7471   var _globalPaths = {
7472     yarn: {
7473       cache: void 0,
7474       get() {
7475         return import_node.Files.resolveGlobalYarnPath(trace);
7476       }
7477     },
7478     npm: {
7479       cache: void 0,
7480       get() {
7481         return import_node.Files.resolveGlobalNodePath(trace);
7482       }
7483     },
7484     pnpm: {
7485       cache: void 0,
7486       get() {
7487         const pnpmPath = import_child_process.execSync("pnpm root -g").toString().trim();
7488         return pnpmPath;
7489       }
7490     }
7491   };
7492   function globalPathGet(packageManager) {
7493     const pm = _globalPaths[packageManager];
7494     if (pm) {
7495       if (pm.cache === void 0) {
7496         pm.cache = pm.get();
7497       }
7498       return pm.cache;
7499     }
7500     return void 0;
7501   }
7502   var languageId2DefaultExt = new Map([
7503     ["javascript", "js"],
7504     ["javascriptreact", "jsx"],
7505     ["typescript", "ts"],
7506     ["typescriptreact", "tsx"],
7507     ["html", "html"],
7508     ["vue", "vue"]
7509   ]);
7510   var languageId2ParserRegExp = function createLanguageId2ParserRegExp() {
7511     const result = new Map();
7512     const typescript = /\/@typescript-eslint\/parser\//;
7513     const babelESLint = /\/babel-eslint\/lib\/index.js$/;
7514     result.set("typescript", [typescript, babelESLint]);
7515     result.set("typescriptreact", [typescript, babelESLint]);
7516     return result;
7517   }();
7518   var languageId2ParserOptions = function createLanguageId2ParserOptionsRegExp() {
7519     const result = new Map();
7520     const vue = /vue-eslint-parser\/.*\.js$/;
7521     const typescriptEslintParser = /@typescript-eslint\/parser\/.*\.js$/;
7522     result.set("typescript", {regExps: [vue], parsers: new Set(["@typescript-eslint/parser"]), parserRegExps: [typescriptEslintParser]});
7523     return result;
7524   }();
7525   var languageId2PluginName = new Map([
7526     ["html", "html"],
7527     ["vue", "vue"],
7528     ["markdown", "markdown"]
7529   ]);
7530   var defaultLanguageIds = new Set([
7531     "javascript",
7532     "javascriptreact"
7533   ]);
7534   var path2Library = new Map();
7535   var document2Settings = new Map();
7536   var executionConfirmations = new Map();
7537   var projectFolderIndicators = [
7538     ["package.json", true],
7539     [".eslintignore", true],
7540     [".eslintrc", false],
7541     [".eslintrc.json", false],
7542     [".eslintrc.js", false],
7543     [".eslintrc.yaml", false],
7544     [".eslintrc.yml", false]
7545   ];
7546   function findWorkingDirectory(workspaceFolder, file) {
7547     if (file === void 0 || isUNC(file)) {
7548       return workspaceFolder;
7549     }
7550     if (file.indexOf(`${path.sep}node_modules${path.sep}`) !== -1) {
7551       return workspaceFolder;
7552     }
7553     let result = workspaceFolder;
7554     let directory = path.dirname(file);
7555     outer:
7556       while (directory !== void 0 && directory.startsWith(workspaceFolder)) {
7557         for (const item of projectFolderIndicators) {
7558           if (fs.existsSync(path.join(directory, item[0]))) {
7559             result = directory;
7560             if (item[1]) {
7561               break outer;
7562             } else {
7563               break;
7564             }
7565           }
7566         }
7567         const parent = path.dirname(directory);
7568         directory = parent !== directory ? parent : void 0;
7569       }
7570     return result;
7571   }
7572   function resolveSettings(document) {
7573     const uri = document.uri;
7574     let resultPromise = document2Settings.get(uri);
7575     if (resultPromise) {
7576       return resultPromise;
7577     }
7578     resultPromise = connection.workspace.getConfiguration({scopeUri: uri, section: ""}).then((configuration) => {
7579       var _a2;
7580       const settings = Object.assign({}, configuration, {silent: false, library: void 0, resolvedGlobalPackageManagerPath: void 0}, {workingDirectory: void 0});
7581       if (settings.validate === Validate.off) {
7582         return settings;
7583       }
7584       settings.resolvedGlobalPackageManagerPath = globalPathGet(settings.packageManager);
7585       const filePath = getFilePath(document);
7586       const workspaceFolderPath = settings.workspaceFolder !== void 0 ? getFilePath(settings.workspaceFolder.uri) : void 0;
7587       const hasUserDefinedWorkingDirectories = configuration.workingDirectory !== void 0;
7588       const workingDirectoryConfig = (_a2 = configuration.workingDirectory) != null ? _a2 : {mode: ModeEnum.location};
7589       if (ModeItem.is(workingDirectoryConfig)) {
7590         let candidate;
7591         if (workingDirectoryConfig.mode === ModeEnum.location) {
7592           if (workspaceFolderPath !== void 0) {
7593             candidate = workspaceFolderPath;
7594           } else if (filePath !== void 0 && !isUNC(filePath)) {
7595             candidate = path.dirname(filePath);
7596           }
7597         } else if (workingDirectoryConfig.mode === ModeEnum.auto) {
7598           if (workspaceFolderPath !== void 0) {
7599             candidate = findWorkingDirectory(workspaceFolderPath, filePath);
7600           } else if (filePath !== void 0 && !isUNC(filePath)) {
7601             candidate = path.dirname(filePath);
7602           }
7603         }
7604         if (candidate !== void 0 && fs.existsSync(candidate)) {
7605           settings.workingDirectory = {directory: candidate};
7606         }
7607       } else {
7608         settings.workingDirectory = workingDirectoryConfig;
7609       }
7610       let promise;
7611       let nodePath;
7612       if (settings.nodePath !== null) {
7613         nodePath = settings.nodePath;
7614         if (!path.isAbsolute(nodePath) && settings.workspaceFolder !== void 0) {
7615           const workspaceFolderPath2 = getFilePath(settings.workspaceFolder.uri);
7616           if (workspaceFolderPath2 !== void 0) {
7617             nodePath = path.join(workspaceFolderPath2, nodePath);
7618           }
7619         }
7620       }
7621       let moduleResolveWorkingDirectory;
7622       if (!hasUserDefinedWorkingDirectories && filePath !== void 0) {
7623         moduleResolveWorkingDirectory = path.dirname(filePath);
7624       }
7625       if (moduleResolveWorkingDirectory === void 0 && settings.workingDirectory !== void 0 && !settings.workingDirectory["!cwd"]) {
7626         moduleResolveWorkingDirectory = settings.workingDirectory.directory;
7627       }
7628       if (nodePath !== void 0) {
7629         promise = import_node.Files.resolve("eslint", nodePath, nodePath, trace).then(void 0, () => {
7630           return import_node.Files.resolve("eslint", settings.resolvedGlobalPackageManagerPath, moduleResolveWorkingDirectory, trace);
7631         });
7632       } else {
7633         promise = import_node.Files.resolve("eslint", settings.resolvedGlobalPackageManagerPath, moduleResolveWorkingDirectory, trace);
7634       }
7635       settings.silent = settings.validate === Validate.probe;
7636       return promise.then((libraryPath) => {
7637         const scope = settings.resolvedGlobalPackageManagerPath !== void 0 && libraryPath.startsWith(settings.resolvedGlobalPackageManagerPath) ? "global" : "local";
7638         const cachedExecutionConfirmation = executionConfirmations.get(libraryPath);
7639         const confirmationPromise = cachedExecutionConfirmation === void 0 ? connection.sendRequest(ConfirmExecution.type, {scope, uri, libraryPath}) : Promise.resolve(cachedExecutionConfirmation);
7640         return confirmationPromise.then((confirmed) => {
7641           var _a3;
7642           if (confirmed !== 4) {
7643             settings.validate = Validate.off;
7644             connection.sendDiagnostics({uri, diagnostics: []});
7645             connection.sendNotification(StatusNotification.type, {uri, state: ConfirmExecutionResult.toStatus(confirmed)});
7646             return settings;
7647           } else {
7648             executionConfirmations.set(libraryPath, confirmed);
7649           }
7650           let library = path2Library.get(libraryPath);
7651           if (library === void 0) {
7652             library = loadNodeModule(libraryPath);
7653             if (library === void 0) {
7654               settings.validate = Validate.off;
7655               if (!settings.silent) {
7656                 connection.console.error(`Failed to load eslint library from ${libraryPath}. See output panel for more information.`);
7657               }
7658             } else if (library.CLIEngine === void 0) {
7659               settings.validate = Validate.off;
7660               connection.console.error(`The eslint library loaded from ${libraryPath} doesn't export a CLIEngine. You need at least eslint@1.0.0`);
7661             } else {
7662               connection.console.info(`ESLint library loaded from: ${libraryPath}`);
7663               settings.library = library;
7664               path2Library.set(libraryPath, library);
7665             }
7666           } else {
7667             settings.library = library;
7668           }
7669           if (settings.validate === Validate.probe && TextDocumentSettings.hasLibrary(settings)) {
7670             settings.validate = Validate.off;
7671             const uri2 = URI.parse(document.uri);
7672             let filePath2 = getFilePath(document);
7673             if (filePath2 === void 0 && uri2.scheme === "untitled" && settings.workspaceFolder !== void 0) {
7674               const ext = languageId2DefaultExt.get(document.languageId);
7675               const workspacePath = getFilePath(settings.workspaceFolder.uri);
7676               if (workspacePath !== void 0 && ext !== void 0) {
7677                 filePath2 = path.join(workspacePath, `test${ext}`);
7678               }
7679             }
7680             if (filePath2 !== void 0) {
7681               const parserRegExps = languageId2ParserRegExp.get(document.languageId);
7682               const pluginName = languageId2PluginName.get(document.languageId);
7683               const parserOptions = languageId2ParserOptions.get(document.languageId);
7684               if (defaultLanguageIds.has(document.languageId)) {
7685                 settings.validate = Validate.on;
7686               } else if (parserRegExps !== void 0 || pluginName !== void 0 || parserOptions !== void 0) {
7687                 const eslintConfig = withCLIEngine((cli) => {
7688                   try {
7689                     if (typeof cli.getConfigForFile === "function") {
7690                       return cli.getConfigForFile(filePath2);
7691                     } else {
7692                       return void 0;
7693                     }
7694                   } catch (err) {
7695                     return void 0;
7696                   }
7697                 }, settings);
7698                 if (eslintConfig !== void 0) {
7699                   const parser = eslintConfig.parser !== null ? process.platform === "win32" ? eslintConfig.parser.replace(/\\/g, "/") : eslintConfig.parser : void 0;
7700                   if (parser !== void 0) {
7701                     if (parserRegExps !== void 0) {
7702                       for (const regExp of parserRegExps) {
7703                         if (regExp.test(parser)) {
7704                           settings.validate = Validate.on;
7705                           break;
7706                         }
7707                       }
7708                     }
7709                     if (settings.validate !== Validate.on && parserOptions !== void 0 && typeof ((_a3 = eslintConfig.parserOptions) == null ? void 0 : _a3.parser) === "string") {
7710                       for (const regExp of parserOptions.regExps) {
7711                         if (regExp.test(parser) && (parserOptions.parsers.has(eslintConfig.parserOptions.parser) || parserOptions.parserRegExps !== void 0 && parserOptions.parserRegExps.some((parserRegExp) => parserRegExp.test(eslintConfig.parserOptions.parser)))) {
7712                           settings.validate = Validate.on;
7713                           break;
7714                         }
7715                       }
7716                     }
7717                   }
7718                   if (settings.validate !== Validate.on && Array.isArray(eslintConfig.plugins) && eslintConfig.plugins.length > 0 && pluginName !== void 0) {
7719                     for (const name of eslintConfig.plugins) {
7720                       if (name === pluginName) {
7721                         settings.validate = Validate.on;
7722                         break;
7723                       }
7724                     }
7725                   }
7726                 }
7727               }
7728             }
7729             if (settings.validate === Validate.off) {
7730               const params = {textDocument: {uri: document.uri}};
7731               connection.sendRequest(ProbeFailedRequest.type, params);
7732             }
7733           }
7734           if (settings.format && settings.validate === Validate.on && TextDocumentSettings.hasLibrary(settings)) {
7735             const Uri = URI.parse(uri);
7736             const isFile = Uri.scheme === "file";
7737             let pattern = isFile ? Uri.fsPath.replace(/\\/g, "/") : Uri.fsPath;
7738             pattern = pattern.replace(/[\[\]\{\}]/g, "?");
7739             const filter = {scheme: Uri.scheme, pattern};
7740             const options = {documentSelector: [filter]};
7741             if (!isFile) {
7742               formatterRegistrations.set(uri, connection.client.register(import_node.DocumentFormattingRequest.type, options));
7743             } else {
7744               const filePath2 = getFilePath(uri);
7745               withCLIEngine((cli) => {
7746                 if (!cli.isPathIgnored(filePath2)) {
7747                   formatterRegistrations.set(uri, connection.client.register(import_node.DocumentFormattingRequest.type, options));
7748                 }
7749               }, settings);
7750             }
7751           }
7752           return settings;
7753         });
7754       }, () => {
7755         settings.validate = Validate.off;
7756         if (!settings.silent) {
7757           connection.sendRequest(NoESLintLibraryRequest.type, {source: {uri: document.uri}});
7758         }
7759         return settings;
7760       });
7761     });
7762     document2Settings.set(uri, resultPromise);
7763     return resultPromise;
7764   }
7765   var Request;
7766   (function(Request2) {
7767     function is(value) {
7768       const candidate = value;
7769       return candidate && candidate.token !== void 0 && candidate.resolve !== void 0 && candidate.reject !== void 0;
7770     }
7771     Request2.is = is;
7772   })(Request || (Request = {}));
7773   var Thenable;
7774   (function(Thenable2) {
7775     function is(value) {
7776       const candidate = value;
7777       return candidate && typeof candidate.then === "function";
7778     }
7779     Thenable2.is = is;
7780   })(Thenable || (Thenable = {}));
7781   var BufferedMessageQueue = class {
7782     constructor(connection2) {
7783       this.connection = connection2;
7784       this.queue = [];
7785       this.requestHandlers = new Map();
7786       this.notificationHandlers = new Map();
7787     }
7788     registerRequest(type, handler, versionProvider) {
7789       this.connection.onRequest(type, (params, token) => {
7790         return new Promise((resolve, reject) => {
7791           this.queue.push({
7792             method: type.method,
7793             params,
7794             documentVersion: versionProvider ? versionProvider(params) : void 0,
7795             resolve,
7796             reject,
7797             token
7798           });
7799           this.trigger();
7800         });
7801       });
7802       this.requestHandlers.set(type.method, {handler, versionProvider});
7803     }
7804     registerNotification(type, handler, versionProvider) {
7805       connection.onNotification(type, (params) => {
7806         this.queue.push({
7807           method: type.method,
7808           params,
7809           documentVersion: versionProvider ? versionProvider(params) : void 0
7810         });
7811         this.trigger();
7812       });
7813       this.notificationHandlers.set(type.method, {handler, versionProvider});
7814     }
7815     addNotificationMessage(type, params, version) {
7816       this.queue.push({
7817         method: type.method,
7818         params,
7819         documentVersion: version
7820       });
7821       this.trigger();
7822     }
7823     onNotification(type, handler, versionProvider) {
7824       this.notificationHandlers.set(type.method, {handler, versionProvider});
7825     }
7826     trigger() {
7827       if (this.timer || this.queue.length === 0) {
7828         return;
7829       }
7830       this.timer = setImmediate(() => {
7831         this.timer = void 0;
7832         this.processQueue();
7833         this.trigger();
7834       });
7835     }
7836     processQueue() {
7837       const message = this.queue.shift();
7838       if (!message) {
7839         return;
7840       }
7841       if (Request.is(message)) {
7842         const requestMessage = message;
7843         if (requestMessage.token.isCancellationRequested) {
7844           requestMessage.reject(new import_node.ResponseError(import_node.LSPErrorCodes.RequestCancelled, "Request got cancelled"));
7845           return;
7846         }
7847         const elem = this.requestHandlers.get(requestMessage.method);
7848         if (elem === void 0) {
7849           throw new Error(`No handler registered`);
7850         }
7851         if (elem.versionProvider && requestMessage.documentVersion !== void 0 && requestMessage.documentVersion !== elem.versionProvider(requestMessage.params)) {
7852           requestMessage.reject(new import_node.ResponseError(import_node.LSPErrorCodes.RequestCancelled, "Request got cancelled"));
7853           return;
7854         }
7855         const result = elem.handler(requestMessage.params, requestMessage.token);
7856         if (Thenable.is(result)) {
7857           result.then((value) => {
7858             requestMessage.resolve(value);
7859           }, (error) => {
7860             requestMessage.reject(error);
7861           });
7862         } else {
7863           requestMessage.resolve(result);
7864         }
7865       } else {
7866         const notificationMessage = message;
7867         const elem = this.notificationHandlers.get(notificationMessage.method);
7868         if (elem === void 0) {
7869           throw new Error(`No handler registered`);
7870         }
7871         if (elem.versionProvider && notificationMessage.documentVersion !== void 0 && notificationMessage.documentVersion !== elem.versionProvider(notificationMessage.params)) {
7872           return;
7873         }
7874         elem.handler(notificationMessage.params);
7875       }
7876     }
7877   };
7878   var messageQueue = new BufferedMessageQueue(connection);
7879   var formatterRegistrations = new Map();
7880   var ValidateNotification;
7881   (function(ValidateNotification2) {
7882     ValidateNotification2.type = new import_node.NotificationType("eslint/validate");
7883   })(ValidateNotification || (ValidateNotification = {}));
7884   messageQueue.onNotification(ValidateNotification.type, (document) => {
7885     validateSingle(document, true);
7886   }, (document) => {
7887     return document.version;
7888   });
7889   function setupDocumentsListeners() {
7890     documents.listen(connection);
7891     documents.onDidOpen((event) => {
7892       resolveSettings(event.document).then((settings) => {
7893         if (settings.validate !== Validate.on || !TextDocumentSettings.hasLibrary(settings)) {
7894           return;
7895         }
7896         if (settings.run === "onSave") {
7897           messageQueue.addNotificationMessage(ValidateNotification.type, event.document, event.document.version);
7898         }
7899       });
7900     });
7901     documents.onDidChangeContent((event) => {
7902       const uri = event.document.uri;
7903       codeActions.delete(uri);
7904       resolveSettings(event.document).then((settings) => {
7905         if (settings.validate !== Validate.on || settings.run !== "onType") {
7906           return;
7907         }
7908         messageQueue.addNotificationMessage(ValidateNotification.type, event.document, event.document.version);
7909       });
7910     });
7911     documents.onDidSave((event) => {
7912       resolveSettings(event.document).then((settings) => {
7913         if (settings.validate !== Validate.on || settings.run !== "onSave") {
7914           return;
7915         }
7916         messageQueue.addNotificationMessage(ValidateNotification.type, event.document, event.document.version);
7917       });
7918     });
7919     documents.onDidClose((event) => {
7920       resolveSettings(event.document).then((settings) => {
7921         const uri = event.document.uri;
7922         document2Settings.delete(uri);
7923         codeActions.delete(uri);
7924         const unregister = formatterRegistrations.get(event.document.uri);
7925         if (unregister !== void 0) {
7926           unregister.then((disposable) => disposable.dispose());
7927           formatterRegistrations.delete(event.document.uri);
7928         }
7929         if (settings.validate === Validate.on) {
7930           connection.sendDiagnostics({uri, diagnostics: []});
7931         }
7932       });
7933     });
7934   }
7935   function environmentChanged() {
7936     document2Settings.clear();
7937     executionConfirmations.clear();
7938     for (let document of documents.all()) {
7939       messageQueue.addNotificationMessage(ValidateNotification.type, document, document.version);
7940     }
7941     for (const unregistration of formatterRegistrations.values()) {
7942       unregistration.then((disposable) => disposable.dispose());
7943     }
7944     formatterRegistrations.clear();
7945   }
7946   function trace(message, verbose) {
7947     connection.tracer.log(message, verbose);
7948   }
7949   connection.onInitialize((_params, _cancel, progress) => {
7950     progress.begin("Initializing ESLint Server");
7951     const syncKind = import_node.TextDocumentSyncKind.Incremental;
7952     documents = new import_node.TextDocuments(TextDocument);
7953     setupDocumentsListeners();
7954     progress.done();
7955     return {
7956       capabilities: {
7957         textDocumentSync: {
7958           openClose: true,
7959           change: syncKind,
7960           willSaveWaitUntil: false,
7961           save: {
7962             includeText: false
7963           }
7964         },
7965         workspace: {
7966           workspaceFolders: {
7967             supported: true
7968           }
7969         },
7970         codeActionProvider: {codeActionKinds: [import_node.CodeActionKind.QuickFix, `${import_node.CodeActionKind.SourceFixAll}.eslint`]},
7971         executeCommandProvider: {
7972           commands: [
7973             CommandIds.applySingleFix,
7974             CommandIds.applySuggestion,
7975             CommandIds.applySameFixes,
7976             CommandIds.applyAllFixes,
7977             CommandIds.applyDisableLine,
7978             CommandIds.applyDisableFile,
7979             CommandIds.openRuleDoc
7980           ]
7981         }
7982       }
7983     };
7984   });
7985   connection.onInitialized(() => {
7986     connection.client.register(import_node.DidChangeConfigurationNotification.type, void 0);
7987     connection.client.register(import_node.DidChangeWorkspaceFoldersNotification.type, void 0);
7988   });
7989   messageQueue.registerNotification(import_node.DidChangeConfigurationNotification.type, (_params) => {
7990     environmentChanged();
7991   });
7992   messageQueue.registerNotification(import_node.DidChangeWorkspaceFoldersNotification.type, (_params) => {
7993     environmentChanged();
7994   });
7995   var singleErrorHandlers = [
7996     tryHandleNoConfig,
7997     tryHandleConfigError,
7998     tryHandleMissingModule,
7999     showErrorMessage
8000   ];
8001   function validateSingle(document, publishDiagnostics = true) {
8002     if (!documents.get(document.uri)) {
8003       return Promise.resolve(void 0);
8004     }
8005     return resolveSettings(document).then((settings) => {
8006       if (settings.validate !== Validate.on || !TextDocumentSettings.hasLibrary(settings)) {
8007         return;
8008       }
8009       try {
8010         validate(document, settings, publishDiagnostics);
8011         connection.sendNotification(StatusNotification.type, {uri: document.uri, state: 1});
8012       } catch (err) {
8013         connection.sendDiagnostics({uri: document.uri, diagnostics: []});
8014         if (!settings.silent) {
8015           let status = void 0;
8016           for (let handler of singleErrorHandlers) {
8017             status = handler(err, document, settings.library);
8018             if (status) {
8019               break;
8020             }
8021           }
8022           status = status || 3;
8023           connection.sendNotification(StatusNotification.type, {uri: document.uri, state: status});
8024         } else {
8025           connection.console.info(getMessage(err, document));
8026           connection.sendNotification(StatusNotification.type, {uri: document.uri, state: 1});
8027         }
8028       }
8029     });
8030   }
8031   function validateMany(documents2) {
8032     documents2.forEach((document) => {
8033       messageQueue.addNotificationMessage(ValidateNotification.type, document, document.version);
8034     });
8035   }
8036   function getMessage(err, document) {
8037     let result = void 0;
8038     if (typeof err.message === "string" || err.message instanceof String) {
8039       result = err.message;
8040       result = result.replace(/\r?\n/g, " ");
8041       if (/^CLI: /.test(result)) {
8042         result = result.substr(5);
8043       }
8044     } else {
8045       result = `An unknown error occurred while validating document: ${document.uri}`;
8046     }
8047     return result;
8048   }
8049   var ruleDocData = {
8050     handled: new Set(),
8051     urls: new Map()
8052   };
8053   var validFixTypes = new Set(["problem", "suggestion", "layout"]);
8054   function validate(document, settings, publishDiagnostics = true) {
8055     const newOptions = Object.assign(Object.create(null), settings.options);
8056     let fixTypes = void 0;
8057     if (Array.isArray(newOptions.fixTypes) && newOptions.fixTypes.length > 0) {
8058       fixTypes = new Set();
8059       for (let item of newOptions.fixTypes) {
8060         if (validFixTypes.has(item)) {
8061           fixTypes.add(item);
8062         }
8063       }
8064       if (fixTypes.size === 0) {
8065         fixTypes = void 0;
8066       }
8067     }
8068     const content = document.getText();
8069     const uri = document.uri;
8070     const file = getFilePath(document);
8071     withCLIEngine((cli) => {
8072       codeActions.delete(uri);
8073       const report = cli.executeOnText(content, file, settings.onIgnoredFiles !== ESLintSeverity.off);
8074       if (CLIEngine.hasRule(cli) && !ruleDocData.handled.has(uri)) {
8075         ruleDocData.handled.add(uri);
8076         cli.getRules().forEach((rule, key) => {
8077           if (rule.meta && rule.meta.docs && Is.string(rule.meta.docs.url)) {
8078             ruleDocData.urls.set(key, rule.meta.docs.url);
8079           }
8080         });
8081       }
8082       const diagnostics = [];
8083       if (report && report.results && Array.isArray(report.results) && report.results.length > 0) {
8084         const docReport = report.results[0];
8085         if (docReport.messages && Array.isArray(docReport.messages)) {
8086           docReport.messages.forEach((problem) => {
8087             if (problem) {
8088               const isWarning = convertSeverity(problem.severity) === import_node.DiagnosticSeverity.Warning;
8089               if (settings.quiet && isWarning) {
8090                 return;
8091               }
8092               const diagnostic = makeDiagnostic(problem);
8093               diagnostics.push(diagnostic);
8094               if (fixTypes !== void 0 && CLIEngine.hasRule(cli) && problem.ruleId !== void 0 && problem.fix !== void 0) {
8095                 const rule = cli.getRules().get(problem.ruleId);
8096                 if (RuleData.hasMetaType(rule) && fixTypes.has(rule.meta.type)) {
8097                   recordCodeAction(document, diagnostic, problem);
8098                 }
8099               } else {
8100                 recordCodeAction(document, diagnostic, problem);
8101               }
8102             }
8103           });
8104         }
8105       }
8106       if (publishDiagnostics) {
8107         connection.sendDiagnostics({uri, diagnostics});
8108       }
8109     }, settings);
8110   }
8111   function withCLIEngine(func, settings, options) {
8112     const newOptions = options === void 0 ? Object.assign(Object.create(null), settings.options) : Object.assign(Object.create(null), settings.options, options);
8113     const cwd = process.cwd();
8114     try {
8115       if (settings.workingDirectory) {
8116         newOptions.cwd = settings.workingDirectory.directory;
8117         if (settings.workingDirectory["!cwd"] !== true && fs.existsSync(settings.workingDirectory.directory)) {
8118           process.chdir(settings.workingDirectory.directory);
8119         }
8120       }
8121       const cli = new settings.library.CLIEngine(newOptions);
8122       return func(cli);
8123     } finally {
8124       if (cwd !== process.cwd()) {
8125         process.chdir(cwd);
8126       }
8127     }
8128   }
8129   var noConfigReported = new Map();
8130   function isNoConfigFoundError(error) {
8131     const candidate = error;
8132     return candidate.messageTemplate === "no-config-found" || candidate.message === "No ESLint configuration found.";
8133   }
8134   function tryHandleNoConfig(error, document, library) {
8135     if (!isNoConfigFoundError(error)) {
8136       return void 0;
8137     }
8138     if (!noConfigReported.has(document.uri)) {
8139       connection.sendRequest(NoConfigRequest.type, {
8140         message: getMessage(error, document),
8141         document: {
8142           uri: document.uri
8143         }
8144       }).then(void 0, () => {
8145       });
8146       noConfigReported.set(document.uri, library);
8147     }
8148     return 2;
8149   }
8150   var configErrorReported = new Map();
8151   function tryHandleConfigError(error, document, library) {
8152     if (!error.message) {
8153       return void 0;
8154     }
8155     function handleFileName(filename) {
8156       if (!configErrorReported.has(filename)) {
8157         connection.console.error(getMessage(error, document));
8158         if (!documents.get(URI.file(filename).toString())) {
8159           connection.window.showInformationMessage(getMessage(error, document));
8160         }
8161         configErrorReported.set(filename, library);
8162       }
8163       return 2;
8164     }
8165     let matches = /Cannot read config file:\s+(.*)\nError:\s+(.*)/.exec(error.message);
8166     if (matches && matches.length === 3) {
8167       return handleFileName(matches[1]);
8168     }
8169     matches = /(.*):\n\s*Configuration for rule \"(.*)\" is /.exec(error.message);
8170     if (matches && matches.length === 3) {
8171       return handleFileName(matches[1]);
8172     }
8173     matches = /Cannot find module '([^']*)'\nReferenced from:\s+(.*)/.exec(error.message);
8174     if (matches && matches.length === 3) {
8175       return handleFileName(matches[2]);
8176     }
8177     return void 0;
8178   }
8179   var missingModuleReported = new Map();
8180   function tryHandleMissingModule(error, document, library) {
8181     if (!error.message) {
8182       return void 0;
8183     }
8184     function handleMissingModule(plugin, module3, error2) {
8185       if (!missingModuleReported.has(plugin)) {
8186         const fsPath = getFilePath(document);
8187         missingModuleReported.set(plugin, library);
8188         if (error2.messageTemplate === "plugin-missing") {
8189           connection.console.error([
8190             "",
8191             `${error2.message.toString()}`,
8192             `Happened while validating ${fsPath ? fsPath : document.uri}`,
8193             `This can happen for a couple of reasons:`,
8194             `1. The plugin name is spelled incorrectly in an ESLint configuration file (e.g. .eslintrc).`,
8195             `2. If ESLint is installed globally, then make sure ${module3} is installed globally as well.`,
8196             `3. If ESLint is installed locally, then ${module3} isn't installed correctly.`,
8197             "",
8198             `Consider running eslint --debug ${fsPath ? fsPath : document.uri} from a terminal to obtain a trace about the configuration files used.`
8199           ].join("\n"));
8200         } else {
8201           connection.console.error([
8202             `${error2.message.toString()}`,
8203             `Happened while validating ${fsPath ? fsPath : document.uri}`
8204           ].join("\n"));
8205         }
8206       }
8207       return 2;
8208     }
8209     const matches = /Failed to load plugin (.*): Cannot find module (.*)/.exec(error.message);
8210     if (matches && matches.length === 3) {
8211       return handleMissingModule(matches[1], matches[2], error);
8212     }
8213     return void 0;
8214   }
8215   function showErrorMessage(error, document) {
8216     connection.window.showErrorMessage(`ESLint: ${getMessage(error, document)}. Please see the 'ESLint' output channel for details.`, {title: "Open Output", id: 1}).then((value) => {
8217       if (value !== void 0 && value.id === 1) {
8218         connection.sendNotification(ShowOutputChannel.type);
8219       }
8220     });
8221     if (Is.string(error.stack)) {
8222       connection.console.error("ESLint stack trace:");
8223       connection.console.error(error.stack);
8224     }
8225     return 3;
8226   }
8227   messageQueue.registerNotification(import_node.DidChangeWatchedFilesNotification.type, (params) => {
8228     ruleDocData.handled.clear();
8229     ruleDocData.urls.clear();
8230     noConfigReported.clear();
8231     missingModuleReported.clear();
8232     document2Settings.clear();
8233     params.changes.forEach((change) => {
8234       const fsPath = getFilePath(change.uri);
8235       if (fsPath === void 0 || fsPath.length === 0 || isUNC(fsPath)) {
8236         return;
8237       }
8238       const dirname2 = path.dirname(fsPath);
8239       if (dirname2) {
8240         const library = configErrorReported.get(fsPath);
8241         if (library !== void 0) {
8242           const cli = new library.CLIEngine({});
8243           try {
8244             cli.executeOnText("", path.join(dirname2, "___test___.js"));
8245             configErrorReported.delete(fsPath);
8246           } catch (error) {
8247           }
8248         }
8249       }
8250     });
8251     validateMany(documents.all());
8252   });
8253   var Fixes = class {
8254     constructor(edits) {
8255       this.edits = edits;
8256     }
8257     static overlaps(a, b) {
8258       return a !== void 0 && a.edit.range[1] > b.edit.range[0];
8259     }
8260     static isSame(a, b) {
8261       return a.edit.range[0] === b.edit.range[0] && a.edit.range[1] === b.edit.range[1] && a.edit.text === b.edit.text;
8262     }
8263     isEmpty() {
8264       return this.edits.size === 0;
8265     }
8266     getDocumentVersion() {
8267       if (this.isEmpty()) {
8268         throw new Error("No edits recorded.");
8269       }
8270       return this.edits.values().next().value.documentVersion;
8271     }
8272     getScoped(diagnostics) {
8273       const result = [];
8274       for (let diagnostic of diagnostics) {
8275         const key = computeKey(diagnostic);
8276         const editInfo = this.edits.get(key);
8277         if (editInfo) {
8278           result.push(editInfo);
8279         }
8280       }
8281       return result;
8282     }
8283     getAllSorted() {
8284       const result = [];
8285       this.edits.forEach((value) => {
8286         if (Problem.isFixable(value)) {
8287           result.push(value);
8288         }
8289       });
8290       return result.sort((a, b) => {
8291         const d = a.edit.range[0] - b.edit.range[0];
8292         if (d !== 0) {
8293           return d;
8294         }
8295         if (a.edit.range[1] === 0) {
8296           return -1;
8297         }
8298         if (b.edit.range[1] === 0) {
8299           return 1;
8300         }
8301         return a.edit.range[1] - b.edit.range[1];
8302       });
8303     }
8304     getApplicable() {
8305       const sorted = this.getAllSorted();
8306       if (sorted.length <= 1) {
8307         return sorted;
8308       }
8309       const result = [];
8310       let last = sorted[0];
8311       result.push(last);
8312       for (let i = 1; i < sorted.length; i++) {
8313         let current = sorted[i];
8314         if (!Fixes.overlaps(last, current) && !Fixes.isSame(last, current)) {
8315           result.push(current);
8316           last = current;
8317         }
8318       }
8319       return result;
8320     }
8321   };
8322   var CodeActionResult = class {
8323     constructor() {
8324       this._actions = new Map();
8325     }
8326     get(ruleId) {
8327       let result = this._actions.get(ruleId);
8328       if (result === void 0) {
8329         result = {fixes: [], suggestions: []};
8330         this._actions.set(ruleId, result);
8331       }
8332       return result;
8333     }
8334     get fixAll() {
8335       if (this._fixAll === void 0) {
8336         this._fixAll = [];
8337       }
8338       return this._fixAll;
8339     }
8340     all() {
8341       const result = [];
8342       for (let actions of this._actions.values()) {
8343         result.push(...actions.fixes);
8344         result.push(...actions.suggestions);
8345         if (actions.disable) {
8346           result.push(actions.disable);
8347         }
8348         if (actions.fixAll) {
8349           result.push(actions.fixAll);
8350         }
8351         if (actions.disableFile) {
8352           result.push(actions.disableFile);
8353         }
8354         if (actions.showDocumentation) {
8355           result.push(actions.showDocumentation);
8356         }
8357       }
8358       if (this._fixAll !== void 0) {
8359         result.push(...this._fixAll);
8360       }
8361       return result;
8362     }
8363     get length() {
8364       let result = 0;
8365       for (let actions of this._actions.values()) {
8366         result += actions.fixes.length;
8367       }
8368       return result;
8369     }
8370   };
8371   var Changes = class {
8372     constructor() {
8373       this.values = new Map();
8374       this.uri = void 0;
8375       this.version = void 0;
8376     }
8377     clear(textDocument) {
8378       if (textDocument === void 0) {
8379         this.uri = void 0;
8380         this.version = void 0;
8381       } else {
8382         this.uri = textDocument.uri;
8383         this.version = textDocument.version;
8384       }
8385       this.values.clear();
8386     }
8387     isUsable(uri, version) {
8388       return this.uri === uri && this.version === version;
8389     }
8390     set(key, change) {
8391       this.values.set(key, change);
8392     }
8393     get(key) {
8394       return this.values.get(key);
8395     }
8396   };
8397   var CommandParams;
8398   (function(CommandParams2) {
8399     function create(textDocument, ruleId, sequence) {
8400       return {uri: textDocument.uri, version: textDocument.version, ruleId, sequence};
8401     }
8402     CommandParams2.create = create;
8403     function hasRuleId(value) {
8404       return value.ruleId !== void 0;
8405     }
8406     CommandParams2.hasRuleId = hasRuleId;
8407   })(CommandParams || (CommandParams = {}));
8408   var changes = new Changes();
8409   var ESLintSourceFixAll = `${import_node.CodeActionKind.SourceFixAll}.eslint`;
8410   messageQueue.registerRequest(import_node.CodeActionRequest.type, (params) => {
8411     const result = new CodeActionResult();
8412     const uri = params.textDocument.uri;
8413     const textDocument = documents.get(uri);
8414     if (textDocument === void 0) {
8415       changes.clear(textDocument);
8416       return result.all();
8417     }
8418     function createCodeAction(title, kind, commandId, arg, diagnostic) {
8419       const command = import_node.Command.create(title, commandId, arg);
8420       const action = import_node.CodeAction.create(title, command, kind);
8421       if (diagnostic !== void 0) {
8422         action.diagnostics = [diagnostic];
8423       }
8424       return action;
8425     }
8426     function createDisableLineTextEdit(editInfo, indentationText) {
8427       return import_node.TextEdit.insert(import_node.Position.create(editInfo.line - 1, 0), `${indentationText}// eslint-disable-next-line ${editInfo.ruleId}${import_os.EOL}`);
8428     }
8429     function createDisableSameLineTextEdit(editInfo) {
8430       return import_node.TextEdit.insert(import_node.Position.create(editInfo.line - 1, 2147483647), ` // eslint-disable-line ${editInfo.ruleId}`);
8431     }
8432     function createDisableFileTextEdit(editInfo) {
8433       const shebang = textDocument == null ? void 0 : textDocument.getText(import_node.Range.create(import_node.Position.create(0, 0), import_node.Position.create(0, 2)));
8434       const line = shebang === "#!" ? 1 : 0;
8435       return import_node.TextEdit.insert(import_node.Position.create(line, 0), `/* eslint-disable ${editInfo.ruleId} */${import_os.EOL}`);
8436     }
8437     function getLastEdit(array) {
8438       const length = array.length;
8439       if (length === 0) {
8440         return void 0;
8441       }
8442       return array[length - 1];
8443     }
8444     return resolveSettings(textDocument).then(async (settings) => {
8445       if (settings.validate !== Validate.on || !TextDocumentSettings.hasLibrary(settings)) {
8446         return result.all();
8447       }
8448       const problems = codeActions.get(uri);
8449       if (problems === void 0 && settings.run === "onType") {
8450         return result.all();
8451       }
8452       const only = params.context.only !== void 0 && params.context.only.length > 0 ? params.context.only[0] : void 0;
8453       const isSource = only === import_node.CodeActionKind.Source;
8454       const isSourceFixAll = only === ESLintSourceFixAll || only === import_node.CodeActionKind.SourceFixAll;
8455       if (isSourceFixAll || isSource) {
8456         if (isSourceFixAll && settings.codeActionOnSave.enable) {
8457           const textDocumentIdentifer = {uri: textDocument.uri, version: textDocument.version};
8458           const edits = await computeAllFixes(textDocumentIdentifer, AllFixesMode.onSave);
8459           if (edits !== void 0) {
8460             result.fixAll.push(import_node.CodeAction.create(`Fix all ESLint auto-fixable problems`, {documentChanges: [import_node.TextDocumentEdit.create(textDocumentIdentifer, edits)]}, ESLintSourceFixAll));
8461           }
8462         } else if (isSource) {
8463           result.fixAll.push(createCodeAction(`Fix all ESLint auto-fixable problems`, import_node.CodeActionKind.Source, CommandIds.applyAllFixes, CommandParams.create(textDocument)));
8464         }
8465         return result.all();
8466       }
8467       if (problems === void 0) {
8468         return result.all();
8469       }
8470       const fixes = new Fixes(problems);
8471       if (fixes.isEmpty()) {
8472         return result.all();
8473       }
8474       let documentVersion = -1;
8475       const allFixableRuleIds = [];
8476       const kind = only != null ? only : import_node.CodeActionKind.QuickFix;
8477       for (let editInfo of fixes.getScoped(params.context.diagnostics)) {
8478         documentVersion = editInfo.documentVersion;
8479         const ruleId = editInfo.ruleId;
8480         allFixableRuleIds.push(ruleId);
8481         if (Problem.isFixable(editInfo)) {
8482           const workspaceChange = new import_node.WorkspaceChange();
8483           workspaceChange.getTextEditChange({uri, version: documentVersion}).add(FixableProblem.createTextEdit(textDocument, editInfo));
8484           changes.set(`${CommandIds.applySingleFix}:${ruleId}`, workspaceChange);
8485           const action = createCodeAction(editInfo.label, kind, CommandIds.applySingleFix, CommandParams.create(textDocument, ruleId), editInfo.diagnostic);
8486           action.isPreferred = true;
8487           result.get(ruleId).fixes.push(action);
8488         }
8489         if (Problem.hasSuggestions(editInfo)) {
8490           editInfo.suggestions.forEach((suggestion, suggestionSequence) => {
8491             const workspaceChange = new import_node.WorkspaceChange();
8492             workspaceChange.getTextEditChange({uri, version: documentVersion}).add(SuggestionsProblem.createTextEdit(textDocument, suggestion));
8493             changes.set(`${CommandIds.applySuggestion}:${ruleId}:${suggestionSequence}`, workspaceChange);
8494             const action = createCodeAction(`${suggestion.desc} (${editInfo.ruleId})`, import_node.CodeActionKind.QuickFix, CommandIds.applySuggestion, CommandParams.create(textDocument, ruleId, suggestionSequence), editInfo.diagnostic);
8495             result.get(ruleId).suggestions.push(action);
8496           });
8497         }
8498         if (settings.codeAction.disableRuleComment.enable) {
8499           let workspaceChange = new import_node.WorkspaceChange();
8500           if (settings.codeAction.disableRuleComment.location === "sameLine") {
8501             workspaceChange.getTextEditChange({uri, version: documentVersion}).add(createDisableSameLineTextEdit(editInfo));
8502           } else {
8503             const lineText = textDocument.getText(import_node.Range.create(import_node.Position.create(editInfo.line - 1, 0), import_node.Position.create(editInfo.line - 1, 2147483647)));
8504             const matches = /^([ \t]*)/.exec(lineText);
8505             const indentationText = matches !== null && matches.length > 0 ? matches[1] : "";
8506             workspaceChange.getTextEditChange({uri, version: documentVersion}).add(createDisableLineTextEdit(editInfo, indentationText));
8507           }
8508           changes.set(`${CommandIds.applyDisableLine}:${ruleId}`, workspaceChange);
8509           result.get(ruleId).disable = createCodeAction(`Disable ${ruleId} for this line`, kind, CommandIds.applyDisableLine, CommandParams.create(textDocument, ruleId));
8510           if (result.get(ruleId).disableFile === void 0) {
8511             workspaceChange = new import_node.WorkspaceChange();
8512             workspaceChange.getTextEditChange({uri, version: documentVersion}).add(createDisableFileTextEdit(editInfo));
8513             changes.set(`${CommandIds.applyDisableFile}:${ruleId}`, workspaceChange);
8514             result.get(ruleId).disableFile = createCodeAction(`Disable ${ruleId} for the entire file`, kind, CommandIds.applyDisableFile, CommandParams.create(textDocument, ruleId));
8515           }
8516         }
8517         if (settings.codeAction.showDocumentation.enable && result.get(ruleId).showDocumentation === void 0) {
8518           if (ruleDocData.urls.has(ruleId)) {
8519             result.get(ruleId).showDocumentation = createCodeAction(`Show documentation for ${ruleId}`, kind, CommandIds.openRuleDoc, CommandParams.create(textDocument, ruleId));
8520           }
8521         }
8522       }
8523       if (result.length > 0) {
8524         const sameProblems = new Map(allFixableRuleIds.map((s) => [s, []]));
8525         for (let editInfo of fixes.getAllSorted()) {
8526           if (documentVersion === -1) {
8527             documentVersion = editInfo.documentVersion;
8528           }
8529           if (sameProblems.has(editInfo.ruleId)) {
8530             const same = sameProblems.get(editInfo.ruleId);
8531             if (!Fixes.overlaps(getLastEdit(same), editInfo)) {
8532               same.push(editInfo);
8533             }
8534           }
8535         }
8536         sameProblems.forEach((same, ruleId) => {
8537           if (same.length > 1) {
8538             const sameFixes = new import_node.WorkspaceChange();
8539             const sameTextChange = sameFixes.getTextEditChange({uri, version: documentVersion});
8540             same.map((fix) => FixableProblem.createTextEdit(textDocument, fix)).forEach((edit) => sameTextChange.add(edit));
8541             changes.set(CommandIds.applySameFixes, sameFixes);
8542             result.get(ruleId).fixAll = createCodeAction(`Fix all ${ruleId} problems`, kind, CommandIds.applySameFixes, CommandParams.create(textDocument));
8543           }
8544         });
8545         result.fixAll.push(createCodeAction(`Fix all auto-fixable problems`, kind, CommandIds.applyAllFixes, CommandParams.create(textDocument)));
8546       }
8547       return result.all();
8548     });
8549   }, (params) => {
8550     const document = documents.get(params.textDocument.uri);
8551     return document !== void 0 ? document.version : void 0;
8552   });
8553   var AllFixesMode;
8554   (function(AllFixesMode2) {
8555     AllFixesMode2["onSave"] = "onsave";
8556     AllFixesMode2["format"] = "format";
8557     AllFixesMode2["command"] = "command";
8558   })(AllFixesMode || (AllFixesMode = {}));
8559   function computeAllFixes(identifier, mode) {
8560     const uri = identifier.uri;
8561     const textDocument = documents.get(uri);
8562     if (textDocument === void 0 || identifier.version !== textDocument.version) {
8563       return void 0;
8564     }
8565     return resolveSettings(textDocument).then((settings) => {
8566       if (settings.validate !== Validate.on || !TextDocumentSettings.hasLibrary(settings) || mode === AllFixesMode.format && !settings.format) {
8567         return [];
8568       }
8569       const filePath = getFilePath(textDocument);
8570       return withCLIEngine((cli) => {
8571         const problems = codeActions.get(uri);
8572         const originalContent = textDocument.getText();
8573         let problemFixes;
8574         const result = [];
8575         let start = Date.now();
8576         if (mode === AllFixesMode.onSave && problems !== void 0 && problems.size > 0) {
8577           const fixes = new Fixes(problems).getApplicable();
8578           if (fixes.length > 0) {
8579             problemFixes = fixes.map((fix) => FixableProblem.createTextEdit(textDocument, fix));
8580           }
8581         }
8582         if (mode === AllFixesMode.onSave && settings.codeActionOnSave.mode === CodeActionsOnSaveMode.problems) {
8583           connection.tracer.log(`Computing all fixes took: ${Date.now() - start} ms.`);
8584           if (problemFixes !== void 0) {
8585             result.push(...problemFixes);
8586           }
8587         } else {
8588           let content;
8589           if (problemFixes !== void 0) {
8590             content = TextDocument.applyEdits(textDocument, problemFixes);
8591           } else {
8592             content = originalContent;
8593           }
8594           const report = cli.executeOnText(content, filePath);
8595           connection.tracer.log(`Computing all fixes took: ${Date.now() - start} ms.`);
8596           if (Array.isArray(report.results) && report.results.length === 1 && report.results[0].output !== void 0) {
8597             const fixedContent = report.results[0].output;
8598             start = Date.now();
8599             const diffs = stringDiff(originalContent, fixedContent, false);
8600             connection.tracer.log(`Computing minimal edits took: ${Date.now() - start} ms.`);
8601             for (let diff of diffs) {
8602               result.push({
8603                 range: {
8604                   start: textDocument.positionAt(diff.originalStart),
8605                   end: textDocument.positionAt(diff.originalStart + diff.originalLength)
8606                 },
8607                 newText: fixedContent.substr(diff.modifiedStart, diff.modifiedLength)
8608               });
8609             }
8610           } else if (problemFixes !== void 0) {
8611             result.push(...problemFixes);
8612           }
8613         }
8614         return result;
8615       }, settings, {fix: true});
8616     });
8617   }
8618   messageQueue.registerRequest(import_node.ExecuteCommandRequest.type, async (params) => {
8619     let workspaceChange;
8620     const commandParams = params.arguments[0];
8621     if (params.command === CommandIds.applyAllFixes) {
8622       const edits = await computeAllFixes(commandParams, AllFixesMode.command);
8623       if (edits !== void 0) {
8624         workspaceChange = new import_node.WorkspaceChange();
8625         const textChange = workspaceChange.getTextEditChange(commandParams);
8626         edits.forEach((edit) => textChange.add(edit));
8627       }
8628     } else {
8629       if ([CommandIds.applySingleFix, CommandIds.applyDisableLine, CommandIds.applyDisableFile].indexOf(params.command) !== -1) {
8630         workspaceChange = changes.get(`${params.command}:${commandParams.ruleId}`);
8631       } else if ([CommandIds.applySuggestion].indexOf(params.command) !== -1) {
8632         workspaceChange = changes.get(`${params.command}:${commandParams.ruleId}:${commandParams.sequence}`);
8633       } else if (params.command === CommandIds.openRuleDoc && CommandParams.hasRuleId(commandParams)) {
8634         const url = ruleDocData.urls.get(commandParams.ruleId);
8635         if (url) {
8636           connection.sendRequest(OpenESLintDocRequest.type, {url});
8637         }
8638       } else {
8639         workspaceChange = changes.get(params.command);
8640       }
8641     }
8642     if (workspaceChange === void 0) {
8643       return {};
8644     }
8645     return connection.workspace.applyEdit(workspaceChange.edit).then((response) => {
8646       if (!response.applied) {
8647         connection.console.error(`Failed to apply command: ${params.command}`);
8648       }
8649       return {};
8650     }, () => {
8651       connection.console.error(`Failed to apply command: ${params.command}`);
8652     });
8653   }, (params) => {
8654     const commandParam = params.arguments[0];
8655     if (changes.isUsable(commandParam.uri, commandParam.version)) {
8656       return commandParam.version;
8657     } else {
8658       return void 0;
8659     }
8660   });
8661   messageQueue.registerRequest(import_node.DocumentFormattingRequest.type, (params) => {
8662     const textDocument = documents.get(params.textDocument.uri);
8663     if (textDocument === void 0) {
8664       return [];
8665     }
8666     return computeAllFixes({uri: textDocument.uri, version: textDocument.version}, AllFixesMode.format);
8667   }, (params) => {
8668     const document = documents.get(params.textDocument.uri);
8669     return document !== void 0 ? document.version : void 0;
8670   });
8671   connection.listen();
8672 });
8673
8674 // node_modules/vscode-languageserver-textdocument/lib/esm/main.js
8675 "use strict";
8676 var FullTextDocument = function() {
8677   function FullTextDocument2(uri, languageId, version, content) {
8678     this._uri = uri;
8679     this._languageId = languageId;
8680     this._version = version;
8681     this._content = content;
8682     this._lineOffsets = void 0;
8683   }
8684   Object.defineProperty(FullTextDocument2.prototype, "uri", {
8685     get: function() {
8686       return this._uri;
8687     },
8688     enumerable: true,
8689     configurable: true
8690   });
8691   Object.defineProperty(FullTextDocument2.prototype, "languageId", {
8692     get: function() {
8693       return this._languageId;
8694     },
8695     enumerable: true,
8696     configurable: true
8697   });
8698   Object.defineProperty(FullTextDocument2.prototype, "version", {
8699     get: function() {
8700       return this._version;
8701     },
8702     enumerable: true,
8703     configurable: true
8704   });
8705   FullTextDocument2.prototype.getText = function(range) {
8706     if (range) {
8707       var start = this.offsetAt(range.start);
8708       var end = this.offsetAt(range.end);
8709       return this._content.substring(start, end);
8710     }
8711     return this._content;
8712   };
8713   FullTextDocument2.prototype.update = function(changes, version) {
8714     for (var _i = 0, changes_1 = changes; _i < changes_1.length; _i++) {
8715       var change = changes_1[_i];
8716       if (FullTextDocument2.isIncremental(change)) {
8717         var range = getWellformedRange(change.range);
8718         var startOffset = this.offsetAt(range.start);
8719         var endOffset = this.offsetAt(range.end);
8720         this._content = this._content.substring(0, startOffset) + change.text + this._content.substring(endOffset, this._content.length);
8721         var startLine = Math.max(range.start.line, 0);
8722         var endLine = Math.max(range.end.line, 0);
8723         var lineOffsets = this._lineOffsets;
8724         var addedLineOffsets = computeLineOffsets(change.text, false, startOffset);
8725         if (endLine - startLine === addedLineOffsets.length) {
8726           for (var i = 0, len = addedLineOffsets.length; i < len; i++) {
8727             lineOffsets[i + startLine + 1] = addedLineOffsets[i];
8728           }
8729         } else {
8730           if (addedLineOffsets.length < 1e4) {
8731             lineOffsets.splice.apply(lineOffsets, [startLine + 1, endLine - startLine].concat(addedLineOffsets));
8732           } else {
8733             this._lineOffsets = lineOffsets = lineOffsets.slice(0, startLine + 1).concat(addedLineOffsets, lineOffsets.slice(endLine + 1));
8734           }
8735         }
8736         var diff = change.text.length - (endOffset - startOffset);
8737         if (diff !== 0) {
8738           for (var i = startLine + 1 + addedLineOffsets.length, len = lineOffsets.length; i < len; i++) {
8739             lineOffsets[i] = lineOffsets[i] + diff;
8740           }
8741         }
8742       } else if (FullTextDocument2.isFull(change)) {
8743         this._content = change.text;
8744         this._lineOffsets = void 0;
8745       } else {
8746         throw new Error("Unknown change event received");
8747       }
8748     }
8749     this._version = version;
8750   };
8751   FullTextDocument2.prototype.getLineOffsets = function() {
8752     if (this._lineOffsets === void 0) {
8753       this._lineOffsets = computeLineOffsets(this._content, true);
8754     }
8755     return this._lineOffsets;
8756   };
8757   FullTextDocument2.prototype.positionAt = function(offset) {
8758     offset = Math.max(Math.min(offset, this._content.length), 0);
8759     var lineOffsets = this.getLineOffsets();
8760     var low = 0, high = lineOffsets.length;
8761     if (high === 0) {
8762       return {line: 0, character: offset};
8763     }
8764     while (low < high) {
8765       var mid = Math.floor((low + high) / 2);
8766       if (lineOffsets[mid] > offset) {
8767         high = mid;
8768       } else {
8769         low = mid + 1;
8770       }
8771     }
8772     var line = low - 1;
8773     return {line, character: offset - lineOffsets[line]};
8774   };
8775   FullTextDocument2.prototype.offsetAt = function(position) {
8776     var lineOffsets = this.getLineOffsets();
8777     if (position.line >= lineOffsets.length) {
8778       return this._content.length;
8779     } else if (position.line < 0) {
8780       return 0;
8781     }
8782     var lineOffset = lineOffsets[position.line];
8783     var nextLineOffset = position.line + 1 < lineOffsets.length ? lineOffsets[position.line + 1] : this._content.length;
8784     return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset);
8785   };
8786   Object.defineProperty(FullTextDocument2.prototype, "lineCount", {
8787     get: function() {
8788       return this.getLineOffsets().length;
8789     },
8790     enumerable: true,
8791     configurable: true
8792   });
8793   FullTextDocument2.isIncremental = function(event) {
8794     var candidate = event;
8795     return candidate !== void 0 && candidate !== null && typeof candidate.text === "string" && candidate.range !== void 0 && (candidate.rangeLength === void 0 || typeof candidate.rangeLength === "number");
8796   };
8797   FullTextDocument2.isFull = function(event) {
8798     var candidate = event;
8799     return candidate !== void 0 && candidate !== null && typeof candidate.text === "string" && candidate.range === void 0 && candidate.rangeLength === void 0;
8800   };
8801   return FullTextDocument2;
8802 }();
8803 var TextDocument;
8804 (function(TextDocument2) {
8805   function create(uri, languageId, version, content) {
8806     return new FullTextDocument(uri, languageId, version, content);
8807   }
8808   TextDocument2.create = create;
8809   function update(document, changes, version) {
8810     if (document instanceof FullTextDocument) {
8811       document.update(changes, version);
8812       return document;
8813     } else {
8814       throw new Error("TextDocument.update: document must be created by TextDocument.create");
8815     }
8816   }
8817   TextDocument2.update = update;
8818   function applyEdits(document, edits) {
8819     var text = document.getText();
8820     var sortedEdits = mergeSort(edits.map(getWellformedEdit), function(a, b) {
8821       var diff = a.range.start.line - b.range.start.line;
8822       if (diff === 0) {
8823         return a.range.start.character - b.range.start.character;
8824       }
8825       return diff;
8826     });
8827     var lastModifiedOffset = 0;
8828     var spans = [];
8829     for (var _i = 0, sortedEdits_1 = sortedEdits; _i < sortedEdits_1.length; _i++) {
8830       var e = sortedEdits_1[_i];
8831       var startOffset = document.offsetAt(e.range.start);
8832       if (startOffset < lastModifiedOffset) {
8833         throw new Error("Overlapping edit");
8834       } else if (startOffset > lastModifiedOffset) {
8835         spans.push(text.substring(lastModifiedOffset, startOffset));
8836       }
8837       if (e.newText.length) {
8838         spans.push(e.newText);
8839       }
8840       lastModifiedOffset = document.offsetAt(e.range.end);
8841     }
8842     spans.push(text.substr(lastModifiedOffset));
8843     return spans.join("");
8844   }
8845   TextDocument2.applyEdits = applyEdits;
8846 })(TextDocument || (TextDocument = {}));
8847 function mergeSort(data, compare) {
8848   if (data.length <= 1) {
8849     return data;
8850   }
8851   var p = data.length / 2 | 0;
8852   var left = data.slice(0, p);
8853   var right = data.slice(p);
8854   mergeSort(left, compare);
8855   mergeSort(right, compare);
8856   var leftIdx = 0;
8857   var rightIdx = 0;
8858   var i = 0;
8859   while (leftIdx < left.length && rightIdx < right.length) {
8860     var ret = compare(left[leftIdx], right[rightIdx]);
8861     if (ret <= 0) {
8862       data[i++] = left[leftIdx++];
8863     } else {
8864       data[i++] = right[rightIdx++];
8865     }
8866   }
8867   while (leftIdx < left.length) {
8868     data[i++] = left[leftIdx++];
8869   }
8870   while (rightIdx < right.length) {
8871     data[i++] = right[rightIdx++];
8872   }
8873   return data;
8874 }
8875 function computeLineOffsets(text, isAtLineStart, textOffset) {
8876   if (textOffset === void 0) {
8877     textOffset = 0;
8878   }
8879   var result = isAtLineStart ? [textOffset] : [];
8880   for (var i = 0; i < text.length; i++) {
8881     var ch = text.charCodeAt(i);
8882     if (ch === 13 || ch === 10) {
8883       if (ch === 13 && i + 1 < text.length && text.charCodeAt(i + 1) === 10) {
8884         i++;
8885       }
8886       result.push(textOffset + i + 1);
8887     }
8888   }
8889   return result;
8890 }
8891 function getWellformedRange(range) {
8892   var start = range.start;
8893   var end = range.end;
8894   if (start.line > end.line || start.line === end.line && start.character > end.character) {
8895     return {start: end, end: start};
8896   }
8897   return range;
8898 }
8899 function getWellformedEdit(textEdit) {
8900   var range = getWellformedRange(textEdit.range);
8901   if (range !== textEdit.range) {
8902     return {newText: textEdit.newText, range};
8903   }
8904   return textEdit;
8905 }
8906
8907 // node_modules/vscode-uri/lib/esm/index.js
8908 "use strict";
8909 var __extends = function() {
8910   var extendStatics = function(d, b) {
8911     extendStatics = Object.setPrototypeOf || {__proto__: []} instanceof Array && function(d2, b2) {
8912       d2.__proto__ = b2;
8913     } || function(d2, b2) {
8914       for (var p in b2)
8915         if (b2.hasOwnProperty(p))
8916           d2[p] = b2[p];
8917     };
8918     return extendStatics(d, b);
8919   };
8920   return function(d, b) {
8921     extendStatics(d, b);
8922     function __() {
8923       this.constructor = d;
8924     }
8925     d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
8926   };
8927 }();
8928 var _a;
8929 var isWindows;
8930 if (typeof process === "object") {
8931   isWindows = process.platform === "win32";
8932 } else if (typeof navigator === "object") {
8933   userAgent = navigator.userAgent;
8934   isWindows = userAgent.indexOf("Windows") >= 0;
8935 }
8936 var userAgent;
8937 var _schemePattern = /^\w[\w\d+.-]*$/;
8938 var _singleSlashStart = /^\//;
8939 var _doubleSlashStart = /^\/\//;
8940 function _validateUri(ret, _strict) {
8941   if (!ret.scheme && _strict) {
8942     throw new Error('[UriError]: Scheme is missing: {scheme: "", authority: "' + ret.authority + '", path: "' + ret.path + '", query: "' + ret.query + '", fragment: "' + ret.fragment + '"}');
8943   }
8944   if (ret.scheme && !_schemePattern.test(ret.scheme)) {
8945     throw new Error("[UriError]: Scheme contains illegal characters.");
8946   }
8947   if (ret.path) {
8948     if (ret.authority) {
8949       if (!_singleSlashStart.test(ret.path)) {
8950         throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character');
8951       }
8952     } else {
8953       if (_doubleSlashStart.test(ret.path)) {
8954         throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")');
8955       }
8956     }
8957   }
8958 }
8959 function _schemeFix(scheme, _strict) {
8960   if (!scheme && !_strict) {
8961     return "file";
8962   }
8963   return scheme;
8964 }
8965 function _referenceResolution(scheme, path) {
8966   switch (scheme) {
8967     case "https":
8968     case "http":
8969     case "file":
8970       if (!path) {
8971         path = _slash;
8972       } else if (path[0] !== _slash) {
8973         path = _slash + path;
8974       }
8975       break;
8976   }
8977   return path;
8978 }
8979 var _empty = "";
8980 var _slash = "/";
8981 var _regexp = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;
8982 var URI = function() {
8983   function URI2(schemeOrData, authority, path, query, fragment, _strict) {
8984     if (_strict === void 0) {
8985       _strict = false;
8986     }
8987     if (typeof schemeOrData === "object") {
8988       this.scheme = schemeOrData.scheme || _empty;
8989       this.authority = schemeOrData.authority || _empty;
8990       this.path = schemeOrData.path || _empty;
8991       this.query = schemeOrData.query || _empty;
8992       this.fragment = schemeOrData.fragment || _empty;
8993     } else {
8994       this.scheme = _schemeFix(schemeOrData, _strict);
8995       this.authority = authority || _empty;
8996       this.path = _referenceResolution(this.scheme, path || _empty);
8997       this.query = query || _empty;
8998       this.fragment = fragment || _empty;
8999       _validateUri(this, _strict);
9000     }
9001   }
9002   URI2.isUri = function(thing) {
9003     if (thing instanceof URI2) {
9004       return true;
9005     }
9006     if (!thing) {
9007       return false;
9008     }
9009     return typeof thing.authority === "string" && typeof thing.fragment === "string" && typeof thing.path === "string" && typeof thing.query === "string" && typeof thing.scheme === "string" && typeof thing.fsPath === "function" && typeof thing.with === "function" && typeof thing.toString === "function";
9010   };
9011   Object.defineProperty(URI2.prototype, "fsPath", {
9012     get: function() {
9013       return _makeFsPath(this);
9014     },
9015     enumerable: true,
9016     configurable: true
9017   });
9018   URI2.prototype.with = function(change) {
9019     if (!change) {
9020       return this;
9021     }
9022     var scheme = change.scheme, authority = change.authority, path = change.path, query = change.query, fragment = change.fragment;
9023     if (scheme === void 0) {
9024       scheme = this.scheme;
9025     } else if (scheme === null) {
9026       scheme = _empty;
9027     }
9028     if (authority === void 0) {
9029       authority = this.authority;
9030     } else if (authority === null) {
9031       authority = _empty;
9032     }
9033     if (path === void 0) {
9034       path = this.path;
9035     } else if (path === null) {
9036       path = _empty;
9037     }
9038     if (query === void 0) {
9039       query = this.query;
9040     } else if (query === null) {
9041       query = _empty;
9042     }
9043     if (fragment === void 0) {
9044       fragment = this.fragment;
9045     } else if (fragment === null) {
9046       fragment = _empty;
9047     }
9048     if (scheme === this.scheme && authority === this.authority && path === this.path && query === this.query && fragment === this.fragment) {
9049       return this;
9050     }
9051     return new _URI(scheme, authority, path, query, fragment);
9052   };
9053   URI2.parse = function(value, _strict) {
9054     if (_strict === void 0) {
9055       _strict = false;
9056     }
9057     var match = _regexp.exec(value);
9058     if (!match) {
9059       return new _URI(_empty, _empty, _empty, _empty, _empty);
9060     }
9061     return new _URI(match[2] || _empty, decodeURIComponent(match[4] || _empty), decodeURIComponent(match[5] || _empty), decodeURIComponent(match[7] || _empty), decodeURIComponent(match[9] || _empty), _strict);
9062   };
9063   URI2.file = function(path) {
9064     var authority = _empty;
9065     if (isWindows) {
9066       path = path.replace(/\\/g, _slash);
9067     }
9068     if (path[0] === _slash && path[1] === _slash) {
9069       var idx = path.indexOf(_slash, 2);
9070       if (idx === -1) {
9071         authority = path.substring(2);
9072         path = _slash;
9073       } else {
9074         authority = path.substring(2, idx);
9075         path = path.substring(idx) || _slash;
9076       }
9077     }
9078     return new _URI("file", authority, path, _empty, _empty);
9079   };
9080   URI2.from = function(components) {
9081     return new _URI(components.scheme, components.authority, components.path, components.query, components.fragment);
9082   };
9083   URI2.prototype.toString = function(skipEncoding) {
9084     if (skipEncoding === void 0) {
9085       skipEncoding = false;
9086     }
9087     return _asFormatted(this, skipEncoding);
9088   };
9089   URI2.prototype.toJSON = function() {
9090     return this;
9091   };
9092   URI2.revive = function(data) {
9093     if (!data) {
9094       return data;
9095     } else if (data instanceof URI2) {
9096       return data;
9097     } else {
9098       var result = new _URI(data);
9099       result._formatted = data.external;
9100       result._fsPath = data._sep === _pathSepMarker ? data.fsPath : null;
9101       return result;
9102     }
9103   };
9104   return URI2;
9105 }();
9106 var _pathSepMarker = isWindows ? 1 : void 0;
9107 var _URI = function(_super) {
9108   __extends(_URI2, _super);
9109   function _URI2() {
9110     var _this = _super !== null && _super.apply(this, arguments) || this;
9111     _this._formatted = null;
9112     _this._fsPath = null;
9113     return _this;
9114   }
9115   Object.defineProperty(_URI2.prototype, "fsPath", {
9116     get: function() {
9117       if (!this._fsPath) {
9118         this._fsPath = _makeFsPath(this);
9119       }
9120       return this._fsPath;
9121     },
9122     enumerable: true,
9123     configurable: true
9124   });
9125   _URI2.prototype.toString = function(skipEncoding) {
9126     if (skipEncoding === void 0) {
9127       skipEncoding = false;
9128     }
9129     if (!skipEncoding) {
9130       if (!this._formatted) {
9131         this._formatted = _asFormatted(this, false);
9132       }
9133       return this._formatted;
9134     } else {
9135       return _asFormatted(this, true);
9136     }
9137   };
9138   _URI2.prototype.toJSON = function() {
9139     var res = {
9140       $mid: 1
9141     };
9142     if (this._fsPath) {
9143       res.fsPath = this._fsPath;
9144       res._sep = _pathSepMarker;
9145     }
9146     if (this._formatted) {
9147       res.external = this._formatted;
9148     }
9149     if (this.path) {
9150       res.path = this.path;
9151     }
9152     if (this.scheme) {
9153       res.scheme = this.scheme;
9154     }
9155     if (this.authority) {
9156       res.authority = this.authority;
9157     }
9158     if (this.query) {
9159       res.query = this.query;
9160     }
9161     if (this.fragment) {
9162       res.fragment = this.fragment;
9163     }
9164     return res;
9165   };
9166   return _URI2;
9167 }(URI);
9168 var encodeTable = (_a = {}, _a[58] = "%3A", _a[47] = "%2F", _a[63] = "%3F", _a[35] = "%23", _a[91] = "%5B", _a[93] = "%5D", _a[64] = "%40", _a[33] = "%21", _a[36] = "%24", _a[38] = "%26", _a[39] = "%27", _a[40] = "%28", _a[41] = "%29", _a[42] = "%2A", _a[43] = "%2B", _a[44] = "%2C", _a[59] = "%3B", _a[61] = "%3D", _a[32] = "%20", _a);
9169 function encodeURIComponentFast(uriComponent, allowSlash) {
9170   var res = void 0;
9171   var nativeEncodePos = -1;
9172   for (var pos = 0; pos < uriComponent.length; pos++) {
9173     var code = uriComponent.charCodeAt(pos);
9174     if (code >= 97 && code <= 122 || code >= 65 && code <= 90 || code >= 48 && code <= 57 || code === 45 || code === 46 || code === 95 || code === 126 || allowSlash && code === 47) {
9175       if (nativeEncodePos !== -1) {
9176         res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos));
9177         nativeEncodePos = -1;
9178       }
9179       if (res !== void 0) {
9180         res += uriComponent.charAt(pos);
9181       }
9182     } else {
9183       if (res === void 0) {
9184         res = uriComponent.substr(0, pos);
9185       }
9186       var escaped = encodeTable[code];
9187       if (escaped !== void 0) {
9188         if (nativeEncodePos !== -1) {
9189           res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos));
9190           nativeEncodePos = -1;
9191         }
9192         res += escaped;
9193       } else if (nativeEncodePos === -1) {
9194         nativeEncodePos = pos;
9195       }
9196     }
9197   }
9198   if (nativeEncodePos !== -1) {
9199     res += encodeURIComponent(uriComponent.substring(nativeEncodePos));
9200   }
9201   return res !== void 0 ? res : uriComponent;
9202 }
9203 function encodeURIComponentMinimal(path) {
9204   var res = void 0;
9205   for (var pos = 0; pos < path.length; pos++) {
9206     var code = path.charCodeAt(pos);
9207     if (code === 35 || code === 63) {
9208       if (res === void 0) {
9209         res = path.substr(0, pos);
9210       }
9211       res += encodeTable[code];
9212     } else {
9213       if (res !== void 0) {
9214         res += path[pos];
9215       }
9216     }
9217   }
9218   return res !== void 0 ? res : path;
9219 }
9220 function _makeFsPath(uri) {
9221   var value;
9222   if (uri.authority && uri.path.length > 1 && uri.scheme === "file") {
9223     value = "//" + uri.authority + uri.path;
9224   } else if (uri.path.charCodeAt(0) === 47 && (uri.path.charCodeAt(1) >= 65 && uri.path.charCodeAt(1) <= 90 || uri.path.charCodeAt(1) >= 97 && uri.path.charCodeAt(1) <= 122) && uri.path.charCodeAt(2) === 58) {
9225     value = uri.path[1].toLowerCase() + uri.path.substr(2);
9226   } else {
9227     value = uri.path;
9228   }
9229   if (isWindows) {
9230     value = value.replace(/\//g, "\\");
9231   }
9232   return value;
9233 }
9234 function _asFormatted(uri, skipEncoding) {
9235   var encoder = !skipEncoding ? encodeURIComponentFast : encodeURIComponentMinimal;
9236   var res = "";
9237   var scheme = uri.scheme, authority = uri.authority, path = uri.path, query = uri.query, fragment = uri.fragment;
9238   if (scheme) {
9239     res += scheme;
9240     res += ":";
9241   }
9242   if (authority || scheme === "file") {
9243     res += _slash;
9244     res += _slash;
9245   }
9246   if (authority) {
9247     var idx = authority.indexOf("@");
9248     if (idx !== -1) {
9249       var userinfo = authority.substr(0, idx);
9250       authority = authority.substr(idx + 1);
9251       idx = userinfo.indexOf(":");
9252       if (idx === -1) {
9253         res += encoder(userinfo, false);
9254       } else {
9255         res += encoder(userinfo.substr(0, idx), false);
9256         res += ":";
9257         res += encoder(userinfo.substr(idx + 1), false);
9258       }
9259       res += "@";
9260     }
9261     authority = authority.toLowerCase();
9262     idx = authority.indexOf(":");
9263     if (idx === -1) {
9264       res += encoder(authority, false);
9265     } else {
9266       res += encoder(authority.substr(0, idx), false);
9267       res += authority.substr(idx);
9268     }
9269   }
9270   if (path) {
9271     if (path.length >= 3 && path.charCodeAt(0) === 47 && path.charCodeAt(2) === 58) {
9272       var code = path.charCodeAt(1);
9273       if (code >= 65 && code <= 90) {
9274         path = "/" + String.fromCharCode(code + 32) + ":" + path.substr(3);
9275       }
9276     } else if (path.length >= 2 && path.charCodeAt(1) === 58) {
9277       var code = path.charCodeAt(0);
9278       if (code >= 65 && code <= 90) {
9279         path = String.fromCharCode(code + 32) + ":" + path.substr(2);
9280       }
9281     }
9282     res += encoder(path, true);
9283   }
9284   if (query) {
9285     res += "?";
9286     res += encoder(query, false);
9287   }
9288   if (fragment) {
9289     res += "#";
9290     res += !skipEncoding ? encodeURIComponentFast(fragment, false) : fragment;
9291   }
9292   return res;
9293 }
9294
9295 // server/diff.ts
9296 function stringDiff(original, modified, pretty) {
9297   return new LcsDiff(new StringDiffSequence(original), new StringDiffSequence(modified)).ComputeDiff(pretty).changes;
9298 }
9299 var StringDiffSequence = class {
9300   constructor(source) {
9301     this.source = source;
9302   }
9303   getElements() {
9304     const source = this.source;
9305     const characters = new Int32Array(source.length);
9306     for (let i = 0, len = source.length; i < len; i++) {
9307       characters[i] = source.charCodeAt(i);
9308     }
9309     return characters;
9310   }
9311 };
9312 var DiffChange = class {
9313   constructor(originalStart, originalLength, modifiedStart, modifiedLength) {
9314     this.originalStart = originalStart;
9315     this.originalLength = originalLength;
9316     this.modifiedStart = modifiedStart;
9317     this.modifiedLength = modifiedLength;
9318   }
9319   getOriginalEnd() {
9320     return this.originalStart + this.originalLength;
9321   }
9322   getModifiedEnd() {
9323     return this.modifiedStart + this.modifiedLength;
9324   }
9325 };
9326 var Debug = class {
9327   static Assert(condition, message) {
9328     if (!condition) {
9329       throw new Error(message);
9330     }
9331   }
9332 };
9333 var Constants;
9334 (function(Constants2) {
9335   Constants2[Constants2["MAX_SAFE_SMALL_INTEGER"] = 1073741824] = "MAX_SAFE_SMALL_INTEGER";
9336   Constants2[Constants2["MIN_SAFE_SMALL_INTEGER"] = -1073741824] = "MIN_SAFE_SMALL_INTEGER";
9337   Constants2[Constants2["MAX_UINT_8"] = 255] = "MAX_UINT_8";
9338   Constants2[Constants2["MAX_UINT_16"] = 65535] = "MAX_UINT_16";
9339   Constants2[Constants2["MAX_UINT_32"] = 4294967295] = "MAX_UINT_32";
9340   Constants2[Constants2["UNICODE_SUPPLEMENTARY_PLANE_BEGIN"] = 65536] = "UNICODE_SUPPLEMENTARY_PLANE_BEGIN";
9341 })(Constants || (Constants = {}));
9342 var LocalConstants;
9343 (function(LocalConstants2) {
9344   LocalConstants2[LocalConstants2["MaxDifferencesHistory"] = 1447] = "MaxDifferencesHistory";
9345 })(LocalConstants || (LocalConstants = {}));
9346 var MyArray = class {
9347   static Copy(sourceArray, sourceIndex, destinationArray, destinationIndex, length) {
9348     for (let i = 0; i < length; i++) {
9349       destinationArray[destinationIndex + i] = sourceArray[sourceIndex + i];
9350     }
9351   }
9352   static Copy2(sourceArray, sourceIndex, destinationArray, destinationIndex, length) {
9353     for (let i = 0; i < length; i++) {
9354       destinationArray[destinationIndex + i] = sourceArray[sourceIndex + i];
9355     }
9356   }
9357 };
9358 var DiffChangeHelper = class {
9359   constructor() {
9360     this.m_changes = [];
9361     this.m_originalStart = 1073741824;
9362     this.m_modifiedStart = 1073741824;
9363     this.m_originalCount = 0;
9364     this.m_modifiedCount = 0;
9365   }
9366   MarkNextChange() {
9367     if (this.m_originalCount > 0 || this.m_modifiedCount > 0) {
9368       this.m_changes.push(new DiffChange(this.m_originalStart, this.m_originalCount, this.m_modifiedStart, this.m_modifiedCount));
9369     }
9370     this.m_originalCount = 0;
9371     this.m_modifiedCount = 0;
9372     this.m_originalStart = 1073741824;
9373     this.m_modifiedStart = 1073741824;
9374   }
9375   AddOriginalElement(originalIndex, modifiedIndex) {
9376     this.m_originalStart = Math.min(this.m_originalStart, originalIndex);
9377     this.m_modifiedStart = Math.min(this.m_modifiedStart, modifiedIndex);
9378     this.m_originalCount++;
9379   }
9380   AddModifiedElement(originalIndex, modifiedIndex) {
9381     this.m_originalStart = Math.min(this.m_originalStart, originalIndex);
9382     this.m_modifiedStart = Math.min(this.m_modifiedStart, modifiedIndex);
9383     this.m_modifiedCount++;
9384   }
9385   getChanges() {
9386     if (this.m_originalCount > 0 || this.m_modifiedCount > 0) {
9387       this.MarkNextChange();
9388     }
9389     return this.m_changes;
9390   }
9391   getReverseChanges() {
9392     if (this.m_originalCount > 0 || this.m_modifiedCount > 0) {
9393       this.MarkNextChange();
9394     }
9395     this.m_changes.reverse();
9396     return this.m_changes;
9397   }
9398 };
9399 var LcsDiff = class {
9400   constructor(originalSequence, modifiedSequence, continueProcessingPredicate = null) {
9401     this.ContinueProcessingPredicate = continueProcessingPredicate;
9402     const [originalStringElements, originalElementsOrHash, originalHasStrings] = LcsDiff._getElements(originalSequence);
9403     const [modifiedStringElements, modifiedElementsOrHash, modifiedHasStrings] = LcsDiff._getElements(modifiedSequence);
9404     this._hasStrings = originalHasStrings && modifiedHasStrings;
9405     this._originalStringElements = originalStringElements;
9406     this._originalElementsOrHash = originalElementsOrHash;
9407     this._modifiedStringElements = modifiedStringElements;
9408     this._modifiedElementsOrHash = modifiedElementsOrHash;
9409     this.m_forwardHistory = [];
9410     this.m_reverseHistory = [];
9411   }
9412   static _getElements(sequence) {
9413     const elements = sequence.getElements();
9414     if (elements instanceof Int32Array) {
9415       return [[], elements, false];
9416     }
9417     return [[], new Int32Array(elements), false];
9418   }
9419   ElementsAreEqual(originalIndex, newIndex) {
9420     if (this._originalElementsOrHash[originalIndex] !== this._modifiedElementsOrHash[newIndex]) {
9421       return false;
9422     }
9423     return this._hasStrings ? this._originalStringElements[originalIndex] === this._modifiedStringElements[newIndex] : true;
9424   }
9425   OriginalElementsAreEqual(index1, index2) {
9426     if (this._originalElementsOrHash[index1] !== this._originalElementsOrHash[index2]) {
9427       return false;
9428     }
9429     return this._hasStrings ? this._originalStringElements[index1] === this._originalStringElements[index2] : true;
9430   }
9431   ModifiedElementsAreEqual(index1, index2) {
9432     if (this._modifiedElementsOrHash[index1] !== this._modifiedElementsOrHash[index2]) {
9433       return false;
9434     }
9435     return this._hasStrings ? this._modifiedStringElements[index1] === this._modifiedStringElements[index2] : true;
9436   }
9437   ComputeDiff(pretty) {
9438     return this._ComputeDiff(0, this._originalElementsOrHash.length - 1, 0, this._modifiedElementsOrHash.length - 1, pretty);
9439   }
9440   _ComputeDiff(originalStart, originalEnd, modifiedStart, modifiedEnd, pretty) {
9441     const quitEarlyArr = [false];
9442     let changes = this.ComputeDiffRecursive(originalStart, originalEnd, modifiedStart, modifiedEnd, quitEarlyArr);
9443     if (pretty) {
9444       changes = this.PrettifyChanges(changes);
9445     }
9446     return {
9447       quitEarly: quitEarlyArr[0],
9448       changes
9449     };
9450   }
9451   ComputeDiffRecursive(originalStart, originalEnd, modifiedStart, modifiedEnd, quitEarlyArr) {
9452     quitEarlyArr[0] = false;
9453     while (originalStart <= originalEnd && modifiedStart <= modifiedEnd && this.ElementsAreEqual(originalStart, modifiedStart)) {
9454       originalStart++;
9455       modifiedStart++;
9456     }
9457     while (originalEnd >= originalStart && modifiedEnd >= modifiedStart && this.ElementsAreEqual(originalEnd, modifiedEnd)) {
9458       originalEnd--;
9459       modifiedEnd--;
9460     }
9461     if (originalStart > originalEnd || modifiedStart > modifiedEnd) {
9462       let changes;
9463       if (modifiedStart <= modifiedEnd) {
9464         Debug.Assert(originalStart === originalEnd + 1, "originalStart should only be one more than originalEnd");
9465         changes = [
9466           new DiffChange(originalStart, 0, modifiedStart, modifiedEnd - modifiedStart + 1)
9467         ];
9468       } else if (originalStart <= originalEnd) {
9469         Debug.Assert(modifiedStart === modifiedEnd + 1, "modifiedStart should only be one more than modifiedEnd");
9470         changes = [
9471           new DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, 0)
9472         ];
9473       } else {
9474         Debug.Assert(originalStart === originalEnd + 1, "originalStart should only be one more than originalEnd");
9475         Debug.Assert(modifiedStart === modifiedEnd + 1, "modifiedStart should only be one more than modifiedEnd");
9476         changes = [];
9477       }
9478       return changes;
9479     }
9480     const midOriginalArr = [0];
9481     const midModifiedArr = [0];
9482     const result = this.ComputeRecursionPoint(originalStart, originalEnd, modifiedStart, modifiedEnd, midOriginalArr, midModifiedArr, quitEarlyArr);
9483     const midOriginal = midOriginalArr[0];
9484     const midModified = midModifiedArr[0];
9485     if (result !== null) {
9486       return result;
9487     } else if (!quitEarlyArr[0]) {
9488       const leftChanges = this.ComputeDiffRecursive(originalStart, midOriginal, modifiedStart, midModified, quitEarlyArr);
9489       let rightChanges = [];
9490       if (!quitEarlyArr[0]) {
9491         rightChanges = this.ComputeDiffRecursive(midOriginal + 1, originalEnd, midModified + 1, modifiedEnd, quitEarlyArr);
9492       } else {
9493         rightChanges = [
9494           new DiffChange(midOriginal + 1, originalEnd - (midOriginal + 1) + 1, midModified + 1, modifiedEnd - (midModified + 1) + 1)
9495         ];
9496       }
9497       return this.ConcatenateChanges(leftChanges, rightChanges);
9498     }
9499     return [
9500       new DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1)
9501     ];
9502   }
9503   WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr) {
9504     let forwardChanges = null;
9505     let reverseChanges = null;
9506     let changeHelper = new DiffChangeHelper();
9507     let diagonalMin = diagonalForwardStart;
9508     let diagonalMax = diagonalForwardEnd;
9509     let diagonalRelative = midOriginalArr[0] - midModifiedArr[0] - diagonalForwardOffset;
9510     let lastOriginalIndex = -1073741824;
9511     let historyIndex = this.m_forwardHistory.length - 1;
9512     do {
9513       const diagonal = diagonalRelative + diagonalForwardBase;
9514       if (diagonal === diagonalMin || diagonal < diagonalMax && forwardPoints[diagonal - 1] < forwardPoints[diagonal + 1]) {
9515         originalIndex = forwardPoints[diagonal + 1];
9516         modifiedIndex = originalIndex - diagonalRelative - diagonalForwardOffset;
9517         if (originalIndex < lastOriginalIndex) {
9518           changeHelper.MarkNextChange();
9519         }
9520         lastOriginalIndex = originalIndex;
9521         changeHelper.AddModifiedElement(originalIndex + 1, modifiedIndex);
9522         diagonalRelative = diagonal + 1 - diagonalForwardBase;
9523       } else {
9524         originalIndex = forwardPoints[diagonal - 1] + 1;
9525         modifiedIndex = originalIndex - diagonalRelative - diagonalForwardOffset;
9526         if (originalIndex < lastOriginalIndex) {
9527           changeHelper.MarkNextChange();
9528         }
9529         lastOriginalIndex = originalIndex - 1;
9530         changeHelper.AddOriginalElement(originalIndex, modifiedIndex + 1);
9531         diagonalRelative = diagonal - 1 - diagonalForwardBase;
9532       }
9533       if (historyIndex >= 0) {
9534         forwardPoints = this.m_forwardHistory[historyIndex];
9535         diagonalForwardBase = forwardPoints[0];
9536         diagonalMin = 1;
9537         diagonalMax = forwardPoints.length - 1;
9538       }
9539     } while (--historyIndex >= -1);
9540     forwardChanges = changeHelper.getReverseChanges();
9541     if (quitEarlyArr[0]) {
9542       let originalStartPoint = midOriginalArr[0] + 1;
9543       let modifiedStartPoint = midModifiedArr[0] + 1;
9544       if (forwardChanges !== null && forwardChanges.length > 0) {
9545         const lastForwardChange = forwardChanges[forwardChanges.length - 1];
9546         originalStartPoint = Math.max(originalStartPoint, lastForwardChange.getOriginalEnd());
9547         modifiedStartPoint = Math.max(modifiedStartPoint, lastForwardChange.getModifiedEnd());
9548       }
9549       reverseChanges = [
9550         new DiffChange(originalStartPoint, originalEnd - originalStartPoint + 1, modifiedStartPoint, modifiedEnd - modifiedStartPoint + 1)
9551       ];
9552     } else {
9553       changeHelper = new DiffChangeHelper();
9554       diagonalMin = diagonalReverseStart;
9555       diagonalMax = diagonalReverseEnd;
9556       diagonalRelative = midOriginalArr[0] - midModifiedArr[0] - diagonalReverseOffset;
9557       lastOriginalIndex = 1073741824;
9558       historyIndex = deltaIsEven ? this.m_reverseHistory.length - 1 : this.m_reverseHistory.length - 2;
9559       do {
9560         const diagonal = diagonalRelative + diagonalReverseBase;
9561         if (diagonal === diagonalMin || diagonal < diagonalMax && reversePoints[diagonal - 1] >= reversePoints[diagonal + 1]) {
9562           originalIndex = reversePoints[diagonal + 1] - 1;
9563           modifiedIndex = originalIndex - diagonalRelative - diagonalReverseOffset;
9564           if (originalIndex > lastOriginalIndex) {
9565             changeHelper.MarkNextChange();
9566           }
9567           lastOriginalIndex = originalIndex + 1;
9568           changeHelper.AddOriginalElement(originalIndex + 1, modifiedIndex + 1);
9569           diagonalRelative = diagonal + 1 - diagonalReverseBase;
9570         } else {
9571           originalIndex = reversePoints[diagonal - 1];
9572           modifiedIndex = originalIndex - diagonalRelative - diagonalReverseOffset;
9573           if (originalIndex > lastOriginalIndex) {
9574             changeHelper.MarkNextChange();
9575           }
9576           lastOriginalIndex = originalIndex;
9577           changeHelper.AddModifiedElement(originalIndex + 1, modifiedIndex + 1);
9578           diagonalRelative = diagonal - 1 - diagonalReverseBase;
9579         }
9580         if (historyIndex >= 0) {
9581           reversePoints = this.m_reverseHistory[historyIndex];
9582           diagonalReverseBase = reversePoints[0];
9583           diagonalMin = 1;
9584           diagonalMax = reversePoints.length - 1;
9585         }
9586       } while (--historyIndex >= -1);
9587       reverseChanges = changeHelper.getChanges();
9588     }
9589     return this.ConcatenateChanges(forwardChanges, reverseChanges);
9590   }
9591   ComputeRecursionPoint(originalStart, originalEnd, modifiedStart, modifiedEnd, midOriginalArr, midModifiedArr, quitEarlyArr) {
9592     let originalIndex = 0, modifiedIndex = 0;
9593     let diagonalForwardStart = 0, diagonalForwardEnd = 0;
9594     let diagonalReverseStart = 0, diagonalReverseEnd = 0;
9595     originalStart--;
9596     modifiedStart--;
9597     midOriginalArr[0] = 0;
9598     midModifiedArr[0] = 0;
9599     this.m_forwardHistory = [];
9600     this.m_reverseHistory = [];
9601     const maxDifferences = originalEnd - originalStart + (modifiedEnd - modifiedStart);
9602     const numDiagonals = maxDifferences + 1;
9603     const forwardPoints = new Int32Array(numDiagonals);
9604     const reversePoints = new Int32Array(numDiagonals);
9605     const diagonalForwardBase = modifiedEnd - modifiedStart;
9606     const diagonalReverseBase = originalEnd - originalStart;
9607     const diagonalForwardOffset = originalStart - modifiedStart;
9608     const diagonalReverseOffset = originalEnd - modifiedEnd;
9609     const delta = diagonalReverseBase - diagonalForwardBase;
9610     const deltaIsEven = delta % 2 === 0;
9611     forwardPoints[diagonalForwardBase] = originalStart;
9612     reversePoints[diagonalReverseBase] = originalEnd;
9613     quitEarlyArr[0] = false;
9614     for (let numDifferences = 1; numDifferences <= maxDifferences / 2 + 1; numDifferences++) {
9615       let furthestOriginalIndex = 0;
9616       let furthestModifiedIndex = 0;
9617       diagonalForwardStart = this.ClipDiagonalBound(diagonalForwardBase - numDifferences, numDifferences, diagonalForwardBase, numDiagonals);
9618       diagonalForwardEnd = this.ClipDiagonalBound(diagonalForwardBase + numDifferences, numDifferences, diagonalForwardBase, numDiagonals);
9619       for (let diagonal = diagonalForwardStart; diagonal <= diagonalForwardEnd; diagonal += 2) {
9620         if (diagonal === diagonalForwardStart || diagonal < diagonalForwardEnd && forwardPoints[diagonal - 1] < forwardPoints[diagonal + 1]) {
9621           originalIndex = forwardPoints[diagonal + 1];
9622         } else {
9623           originalIndex = forwardPoints[diagonal - 1] + 1;
9624         }
9625         modifiedIndex = originalIndex - (diagonal - diagonalForwardBase) - diagonalForwardOffset;
9626         const tempOriginalIndex = originalIndex;
9627         while (originalIndex < originalEnd && modifiedIndex < modifiedEnd && this.ElementsAreEqual(originalIndex + 1, modifiedIndex + 1)) {
9628           originalIndex++;
9629           modifiedIndex++;
9630         }
9631         forwardPoints[diagonal] = originalIndex;
9632         if (originalIndex + modifiedIndex > furthestOriginalIndex + furthestModifiedIndex) {
9633           furthestOriginalIndex = originalIndex;
9634           furthestModifiedIndex = modifiedIndex;
9635         }
9636         if (!deltaIsEven && Math.abs(diagonal - diagonalReverseBase) <= numDifferences - 1) {
9637           if (originalIndex >= reversePoints[diagonal]) {
9638             midOriginalArr[0] = originalIndex;
9639             midModifiedArr[0] = modifiedIndex;
9640             if (tempOriginalIndex <= reversePoints[diagonal] && 1447 > 0 && numDifferences <= 1447 + 1) {
9641               return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr);
9642             } else {
9643               return null;
9644             }
9645           }
9646         }
9647       }
9648       const matchLengthOfLongest = (furthestOriginalIndex - originalStart + (furthestModifiedIndex - modifiedStart) - numDifferences) / 2;
9649       if (this.ContinueProcessingPredicate !== null && !this.ContinueProcessingPredicate(furthestOriginalIndex, matchLengthOfLongest)) {
9650         quitEarlyArr[0] = true;
9651         midOriginalArr[0] = furthestOriginalIndex;
9652         midModifiedArr[0] = furthestModifiedIndex;
9653         if (matchLengthOfLongest > 0 && 1447 > 0 && numDifferences <= 1447 + 1) {
9654           return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr);
9655         } else {
9656           originalStart++;
9657           modifiedStart++;
9658           return [
9659             new DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1)
9660           ];
9661         }
9662       }
9663       diagonalReverseStart = this.ClipDiagonalBound(diagonalReverseBase - numDifferences, numDifferences, diagonalReverseBase, numDiagonals);
9664       diagonalReverseEnd = this.ClipDiagonalBound(diagonalReverseBase + numDifferences, numDifferences, diagonalReverseBase, numDiagonals);
9665       for (let diagonal = diagonalReverseStart; diagonal <= diagonalReverseEnd; diagonal += 2) {
9666         if (diagonal === diagonalReverseStart || diagonal < diagonalReverseEnd && reversePoints[diagonal - 1] >= reversePoints[diagonal + 1]) {
9667           originalIndex = reversePoints[diagonal + 1] - 1;
9668         } else {
9669           originalIndex = reversePoints[diagonal - 1];
9670         }
9671         modifiedIndex = originalIndex - (diagonal - diagonalReverseBase) - diagonalReverseOffset;
9672         const tempOriginalIndex = originalIndex;
9673         while (originalIndex > originalStart && modifiedIndex > modifiedStart && this.ElementsAreEqual(originalIndex, modifiedIndex)) {
9674           originalIndex--;
9675           modifiedIndex--;
9676         }
9677         reversePoints[diagonal] = originalIndex;
9678         if (deltaIsEven && Math.abs(diagonal - diagonalForwardBase) <= numDifferences) {
9679           if (originalIndex <= forwardPoints[diagonal]) {
9680             midOriginalArr[0] = originalIndex;
9681             midModifiedArr[0] = modifiedIndex;
9682             if (tempOriginalIndex >= forwardPoints[diagonal] && 1447 > 0 && numDifferences <= 1447 + 1) {
9683               return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr);
9684             } else {
9685               return null;
9686             }
9687           }
9688         }
9689       }
9690       if (numDifferences <= 1447) {
9691         let temp = new Int32Array(diagonalForwardEnd - diagonalForwardStart + 2);
9692         temp[0] = diagonalForwardBase - diagonalForwardStart + 1;
9693         MyArray.Copy2(forwardPoints, diagonalForwardStart, temp, 1, diagonalForwardEnd - diagonalForwardStart + 1);
9694         this.m_forwardHistory.push(temp);
9695         temp = new Int32Array(diagonalReverseEnd - diagonalReverseStart + 2);
9696         temp[0] = diagonalReverseBase - diagonalReverseStart + 1;
9697         MyArray.Copy2(reversePoints, diagonalReverseStart, temp, 1, diagonalReverseEnd - diagonalReverseStart + 1);
9698         this.m_reverseHistory.push(temp);
9699       }
9700     }
9701     return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr);
9702   }
9703   PrettifyChanges(changes) {
9704     for (let i = 0; i < changes.length; i++) {
9705       const change = changes[i];
9706       const originalStop = i < changes.length - 1 ? changes[i + 1].originalStart : this._originalElementsOrHash.length;
9707       const modifiedStop = i < changes.length - 1 ? changes[i + 1].modifiedStart : this._modifiedElementsOrHash.length;
9708       const checkOriginal = change.originalLength > 0;
9709       const checkModified = change.modifiedLength > 0;
9710       while (change.originalStart + change.originalLength < originalStop && change.modifiedStart + change.modifiedLength < modifiedStop && (!checkOriginal || this.OriginalElementsAreEqual(change.originalStart, change.originalStart + change.originalLength)) && (!checkModified || this.ModifiedElementsAreEqual(change.modifiedStart, change.modifiedStart + change.modifiedLength))) {
9711         change.originalStart++;
9712         change.modifiedStart++;
9713       }
9714       let mergedChangeArr = [null];
9715       if (i < changes.length - 1 && this.ChangesOverlap(changes[i], changes[i + 1], mergedChangeArr)) {
9716         changes[i] = mergedChangeArr[0];
9717         changes.splice(i + 1, 1);
9718         i--;
9719         continue;
9720       }
9721     }
9722     for (let i = changes.length - 1; i >= 0; i--) {
9723       const change = changes[i];
9724       let originalStop = 0;
9725       let modifiedStop = 0;
9726       if (i > 0) {
9727         const prevChange = changes[i - 1];
9728         if (prevChange.originalLength > 0) {
9729           originalStop = prevChange.originalStart + prevChange.originalLength;
9730         }
9731         if (prevChange.modifiedLength > 0) {
9732           modifiedStop = prevChange.modifiedStart + prevChange.modifiedLength;
9733         }
9734       }
9735       const checkOriginal = change.originalLength > 0;
9736       const checkModified = change.modifiedLength > 0;
9737       let bestDelta = 0;
9738       let bestScore = this._boundaryScore(change.originalStart, change.originalLength, change.modifiedStart, change.modifiedLength);
9739       for (let delta = 1; ; delta++) {
9740         const originalStart = change.originalStart - delta;
9741         const modifiedStart = change.modifiedStart - delta;
9742         if (originalStart < originalStop || modifiedStart < modifiedStop) {
9743           break;
9744         }
9745         if (checkOriginal && !this.OriginalElementsAreEqual(originalStart, originalStart + change.originalLength)) {
9746           break;
9747         }
9748         if (checkModified && !this.ModifiedElementsAreEqual(modifiedStart, modifiedStart + change.modifiedLength)) {
9749           break;
9750         }
9751         const score = this._boundaryScore(originalStart, change.originalLength, modifiedStart, change.modifiedLength);
9752         if (score > bestScore) {
9753           bestScore = score;
9754           bestDelta = delta;
9755         }
9756       }
9757       change.originalStart -= bestDelta;
9758       change.modifiedStart -= bestDelta;
9759     }
9760     return changes;
9761   }
9762   _OriginalIsBoundary(index) {
9763     if (index <= 0 || index >= this._originalElementsOrHash.length - 1) {
9764       return true;
9765     }
9766     return this._hasStrings && /^\s*$/.test(this._originalStringElements[index]);
9767   }
9768   _OriginalRegionIsBoundary(originalStart, originalLength) {
9769     if (this._OriginalIsBoundary(originalStart) || this._OriginalIsBoundary(originalStart - 1)) {
9770       return true;
9771     }
9772     if (originalLength > 0) {
9773       const originalEnd = originalStart + originalLength;
9774       if (this._OriginalIsBoundary(originalEnd - 1) || this._OriginalIsBoundary(originalEnd)) {
9775         return true;
9776       }
9777     }
9778     return false;
9779   }
9780   _ModifiedIsBoundary(index) {
9781     if (index <= 0 || index >= this._modifiedElementsOrHash.length - 1) {
9782       return true;
9783     }
9784     return this._hasStrings && /^\s*$/.test(this._modifiedStringElements[index]);
9785   }
9786   _ModifiedRegionIsBoundary(modifiedStart, modifiedLength) {
9787     if (this._ModifiedIsBoundary(modifiedStart) || this._ModifiedIsBoundary(modifiedStart - 1)) {
9788       return true;
9789     }
9790     if (modifiedLength > 0) {
9791       const modifiedEnd = modifiedStart + modifiedLength;
9792       if (this._ModifiedIsBoundary(modifiedEnd - 1) || this._ModifiedIsBoundary(modifiedEnd)) {
9793         return true;
9794       }
9795     }
9796     return false;
9797   }
9798   _boundaryScore(originalStart, originalLength, modifiedStart, modifiedLength) {
9799     const originalScore = this._OriginalRegionIsBoundary(originalStart, originalLength) ? 1 : 0;
9800     const modifiedScore = this._ModifiedRegionIsBoundary(modifiedStart, modifiedLength) ? 1 : 0;
9801     return originalScore + modifiedScore;
9802   }
9803   ConcatenateChanges(left, right) {
9804     let mergedChangeArr = [];
9805     if (left.length === 0 || right.length === 0) {
9806       return right.length > 0 ? right : left;
9807     } else if (this.ChangesOverlap(left[left.length - 1], right[0], mergedChangeArr)) {
9808       const result = new Array(left.length + right.length - 1);
9809       MyArray.Copy(left, 0, result, 0, left.length - 1);
9810       result[left.length - 1] = mergedChangeArr[0];
9811       MyArray.Copy(right, 1, result, left.length, right.length - 1);
9812       return result;
9813     } else {
9814       const result = new Array(left.length + right.length);
9815       MyArray.Copy(left, 0, result, 0, left.length);
9816       MyArray.Copy(right, 0, result, left.length, right.length);
9817       return result;
9818     }
9819   }
9820   ChangesOverlap(left, right, mergedChangeArr) {
9821     Debug.Assert(left.originalStart <= right.originalStart, "Left change is not less than or equal to right change");
9822     Debug.Assert(left.modifiedStart <= right.modifiedStart, "Left change is not less than or equal to right change");
9823     if (left.originalStart + left.originalLength >= right.originalStart || left.modifiedStart + left.modifiedLength >= right.modifiedStart) {
9824       const originalStart = left.originalStart;
9825       let originalLength = left.originalLength;
9826       const modifiedStart = left.modifiedStart;
9827       let modifiedLength = left.modifiedLength;
9828       if (left.originalStart + left.originalLength >= right.originalStart) {
9829         originalLength = right.originalStart + right.originalLength - left.originalStart;
9830       }
9831       if (left.modifiedStart + left.modifiedLength >= right.modifiedStart) {
9832         modifiedLength = right.modifiedStart + right.modifiedLength - left.modifiedStart;
9833       }
9834       mergedChangeArr[0] = new DiffChange(originalStart, originalLength, modifiedStart, modifiedLength);
9835       return true;
9836     } else {
9837       mergedChangeArr[0] = null;
9838       return false;
9839     }
9840   }
9841   ClipDiagonalBound(diagonal, numDifferences, diagonalBaseIndex, numDiagonals) {
9842     if (diagonal >= 0 && diagonal < numDiagonals) {
9843       return diagonal;
9844     }
9845     const diagonalsBelow = diagonalBaseIndex;
9846     const diagonalsAbove = numDiagonals - diagonalBaseIndex - 1;
9847     const diffEven = numDifferences % 2 === 0;
9848     if (diagonal < 0) {
9849       const lowerBoundEven = diagonalsBelow % 2 === 0;
9850       return diffEven === lowerBoundEven ? 0 : 1;
9851     } else {
9852       const upperBoundEven = diagonalsAbove % 2 === 0;
9853       return diffEven === upperBoundEven ? numDiagonals - 1 : numDiagonals - 2;
9854     }
9855   }
9856 };
9857
9858 // entry-ns:server.ts
9859 require_eslintServer();
9860 //# sourceMappingURL=server.js.map