Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-css / lib / index.js
1 (function(e, a) { for(var i in a) e[i] = a[i]; if(a.__esModule) Object.defineProperty(e, "__esModule", { value: true }); }(exports,
2 /******/ (() => { // webpackBootstrap
3 /******/        "use strict";
4 /******/        var __webpack_modules__ = ([
5 /* 0 */
6 /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
7
8
9 var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
10     function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
11     return new (P || (P = Promise))(function (resolve, reject) {
12         function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
13         function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
14         function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
15         step((generator = generator.apply(thisArg, _arguments || [])).next());
16     });
17 };
18 Object.defineProperty(exports, "__esModule", ({ value: true }));
19 exports.activate = void 0;
20 const coc_nvim_1 = __webpack_require__(1);
21 const customData_1 = __webpack_require__(2);
22 const vscode_languageserver_protocol_1 = __webpack_require__(4);
23 var CustomDataChangedNotification;
24 (function (CustomDataChangedNotification) {
25     CustomDataChangedNotification.type = new vscode_languageserver_protocol_1.NotificationType('css/customDataChanged');
26 })(CustomDataChangedNotification || (CustomDataChangedNotification = {}));
27 function activate(context) {
28     return __awaiter(this, void 0, void 0, function* () {
29         let { subscriptions } = context;
30         const config = coc_nvim_1.workspace.getConfiguration().get('css', {});
31         if (!config.enable)
32             return;
33         const file = context.asAbsolutePath('./lib/server.js');
34         const selector = ['css', 'less', 'scss', 'wxss'];
35         const customDataSource = customData_1.getCustomDataSource(context.subscriptions);
36         let serverOptions = {
37             module: file,
38             transport: coc_nvim_1.TransportKind.ipc,
39             options: {
40                 cwd: coc_nvim_1.workspace.root,
41                 execArgv: config.execArgv || []
42             }
43         };
44         let clientOptions = {
45             documentSelector: selector,
46             synchronize: {
47                 configurationSection: ['css', 'less', 'scss', 'wxss']
48             },
49             outputChannelName: 'css',
50             initializationOptions: {
51                 handledSchemas: ['file']
52             },
53             middleware: {}
54         };
55         let client = new coc_nvim_1.LanguageClient('css', 'Css language server', serverOptions, clientOptions);
56         // tslint:disable-next-line: no-floating-promises
57         client.onReady().then(() => {
58             client.sendNotification(CustomDataChangedNotification.type, customDataSource.uris);
59             customDataSource.onDidChange(() => {
60                 client.sendNotification(CustomDataChangedNotification.type, customDataSource.uris);
61             });
62         });
63         subscriptions.push(coc_nvim_1.services.registLanguageClient(client));
64     });
65 }
66 exports.activate = activate;
67
68
69 /***/ }),
70 /* 1 */
71 /***/ ((module) => {
72
73 module.exports = require("coc.nvim");;
74
75 /***/ }),
76 /* 2 */
77 /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
78
79
80 /*---------------------------------------------------------------------------------------------
81  *  Copyright (c) Microsoft Corporation. All rights reserved.
82  *  Licensed under the MIT License. See License.txt in the project root for license information.
83  *--------------------------------------------------------------------------------------------*/
84 var __importDefault = (this && this.__importDefault) || function (mod) {
85     return (mod && mod.__esModule) ? mod : { "default": mod };
86 };
87 Object.defineProperty(exports, "__esModule", ({ value: true }));
88 exports.getCustomDataSource = void 0;
89 const coc_nvim_1 = __webpack_require__(1);
90 const path_1 = __importDefault(__webpack_require__(3));
91 const vscode_languageserver_protocol_1 = __webpack_require__(4);
92 const requests_1 = __webpack_require__(33);
93 function getCustomDataSource(toDispose) {
94     let pathsInWorkspace = getCustomDataPathsInAllWorkspaces();
95     let pathsInExtensions = getCustomDataPathsFromAllExtensions();
96     const onChange = new vscode_languageserver_protocol_1.Emitter();
97     toDispose.push(coc_nvim_1.extensions.onDidActiveExtension(_ => {
98         const newPathsInExtensions = getCustomDataPathsFromAllExtensions();
99         if (newPathsInExtensions.length !== pathsInExtensions.length || !newPathsInExtensions.every((val, idx) => val === pathsInExtensions[idx])) {
100             pathsInExtensions = newPathsInExtensions;
101             onChange.fire();
102         }
103     }));
104     toDispose.push(coc_nvim_1.workspace.onDidChangeConfiguration(e => {
105         if (e.affectsConfiguration('css.customData')) {
106             pathsInWorkspace = getCustomDataPathsInAllWorkspaces();
107             onChange.fire();
108         }
109     }));
110     return {
111         get uris() {
112             return pathsInWorkspace.concat(pathsInExtensions);
113         },
114         get onDidChange() {
115             return onChange.event;
116         }
117     };
118 }
119 exports.getCustomDataSource = getCustomDataSource;
120 function getCustomDataPathsInAllWorkspaces() {
121     const workspaceFolders = coc_nvim_1.workspace.workspaceFolders;
122     const dataPaths = [];
123     if (!workspaceFolders) {
124         return dataPaths;
125     }
126     const collect = (paths, rootFolder) => {
127         if (Array.isArray(paths)) {
128             for (const path of paths) {
129                 if (typeof path === 'string') {
130                     dataPaths.push(requests_1.resolvePath(rootFolder, path).toString());
131                 }
132             }
133         }
134     };
135     for (let i = 0; i < workspaceFolders.length; i++) {
136         const folderUri = workspaceFolders[i].uri;
137         const allCssConfig = coc_nvim_1.workspace.getConfiguration('css', folderUri);
138         const customDataInspect = allCssConfig.inspect('customData');
139         if (customDataInspect) {
140             collect(customDataInspect.workspaceValue, coc_nvim_1.Uri.parse(folderUri));
141             if (i === 0) {
142                 collect(customDataInspect.globalValue, coc_nvim_1.Uri.parse(folderUri));
143             }
144         }
145     }
146     return dataPaths;
147 }
148 function getCustomDataPathsFromAllExtensions() {
149     var _a, _b, _c;
150     const dataPaths = [];
151     for (const extension of coc_nvim_1.extensions.all) {
152         const customData = (_c = (_b = (_a = extension.packageJSON) === null || _a === void 0 ? void 0 : _a.contributes) === null || _b === void 0 ? void 0 : _b.css) === null || _c === void 0 ? void 0 : _c.customData;
153         if (Array.isArray(customData)) {
154             for (const rp of customData) {
155                 dataPaths.push(path_1.default.join(extension.extensionPath, rp).toString());
156             }
157         }
158     }
159     return dataPaths;
160 }
161
162
163 /***/ }),
164 /* 3 */
165 /***/ ((module) => {
166
167 module.exports = require("path");;
168
169 /***/ }),
170 /* 4 */
171 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
172
173 /* --------------------------------------------------------------------------------------------\r
174  * Copyright (c) Microsoft Corporation. All rights reserved.\r
175  * Licensed under the MIT License. See License.txt in the project root for license information.\r
176  * ------------------------------------------------------------------------------------------ */\r
177 \r
178 function __export(m) {\r
179     for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r
180 }\r
181 Object.defineProperty(exports, "__esModule", ({ value: true }));\r
182 const vscode_jsonrpc_1 = __webpack_require__(5);\r
183 exports.ErrorCodes = vscode_jsonrpc_1.ErrorCodes;\r
184 exports.ResponseError = vscode_jsonrpc_1.ResponseError;\r
185 exports.CancellationToken = vscode_jsonrpc_1.CancellationToken;\r
186 exports.CancellationTokenSource = vscode_jsonrpc_1.CancellationTokenSource;\r
187 exports.Disposable = vscode_jsonrpc_1.Disposable;\r
188 exports.Event = vscode_jsonrpc_1.Event;\r
189 exports.Emitter = vscode_jsonrpc_1.Emitter;\r
190 exports.Trace = vscode_jsonrpc_1.Trace;\r
191 exports.TraceFormat = vscode_jsonrpc_1.TraceFormat;\r
192 exports.SetTraceNotification = vscode_jsonrpc_1.SetTraceNotification;\r
193 exports.LogTraceNotification = vscode_jsonrpc_1.LogTraceNotification;\r
194 exports.RequestType = vscode_jsonrpc_1.RequestType;\r
195 exports.RequestType0 = vscode_jsonrpc_1.RequestType0;\r
196 exports.NotificationType = vscode_jsonrpc_1.NotificationType;\r
197 exports.NotificationType0 = vscode_jsonrpc_1.NotificationType0;\r
198 exports.MessageReader = vscode_jsonrpc_1.MessageReader;\r
199 exports.MessageWriter = vscode_jsonrpc_1.MessageWriter;\r
200 exports.ConnectionStrategy = vscode_jsonrpc_1.ConnectionStrategy;\r
201 exports.StreamMessageReader = vscode_jsonrpc_1.StreamMessageReader;\r
202 exports.StreamMessageWriter = vscode_jsonrpc_1.StreamMessageWriter;\r
203 exports.IPCMessageReader = vscode_jsonrpc_1.IPCMessageReader;\r
204 exports.IPCMessageWriter = vscode_jsonrpc_1.IPCMessageWriter;\r
205 exports.createClientPipeTransport = vscode_jsonrpc_1.createClientPipeTransport;\r
206 exports.createServerPipeTransport = vscode_jsonrpc_1.createServerPipeTransport;\r
207 exports.generateRandomPipeName = vscode_jsonrpc_1.generateRandomPipeName;\r
208 exports.createClientSocketTransport = vscode_jsonrpc_1.createClientSocketTransport;\r
209 exports.createServerSocketTransport = vscode_jsonrpc_1.createServerSocketTransport;\r
210 exports.ProgressType = vscode_jsonrpc_1.ProgressType;\r
211 __export(__webpack_require__(18));\r
212 __export(__webpack_require__(19));\r
213 const callHierarchy = __webpack_require__(31);\r
214 const st = __webpack_require__(32);\r
215 var Proposed;\r
216 (function (Proposed) {\r
217     let CallHierarchyPrepareRequest;\r
218     (function (CallHierarchyPrepareRequest) {\r
219         CallHierarchyPrepareRequest.method = callHierarchy.CallHierarchyPrepareRequest.method;\r
220         CallHierarchyPrepareRequest.type = callHierarchy.CallHierarchyPrepareRequest.type;\r
221     })(CallHierarchyPrepareRequest = Proposed.CallHierarchyPrepareRequest || (Proposed.CallHierarchyPrepareRequest = {}));\r
222     let CallHierarchyIncomingCallsRequest;\r
223     (function (CallHierarchyIncomingCallsRequest) {\r
224         CallHierarchyIncomingCallsRequest.method = callHierarchy.CallHierarchyIncomingCallsRequest.method;\r
225         CallHierarchyIncomingCallsRequest.type = callHierarchy.CallHierarchyIncomingCallsRequest.type;\r
226     })(CallHierarchyIncomingCallsRequest = Proposed.CallHierarchyIncomingCallsRequest || (Proposed.CallHierarchyIncomingCallsRequest = {}));\r
227     let CallHierarchyOutgoingCallsRequest;\r
228     (function (CallHierarchyOutgoingCallsRequest) {\r
229         CallHierarchyOutgoingCallsRequest.method = callHierarchy.CallHierarchyOutgoingCallsRequest.method;\r
230         CallHierarchyOutgoingCallsRequest.type = callHierarchy.CallHierarchyOutgoingCallsRequest.type;\r
231     })(CallHierarchyOutgoingCallsRequest = Proposed.CallHierarchyOutgoingCallsRequest || (Proposed.CallHierarchyOutgoingCallsRequest = {}));\r
232     Proposed.SemanticTokenTypes = st.SemanticTokenTypes;\r
233     Proposed.SemanticTokenModifiers = st.SemanticTokenModifiers;\r
234     Proposed.SemanticTokens = st.SemanticTokens;\r
235     let SemanticTokensRequest;\r
236     (function (SemanticTokensRequest) {\r
237         SemanticTokensRequest.method = st.SemanticTokensRequest.method;\r
238         SemanticTokensRequest.type = st.SemanticTokensRequest.type;\r
239     })(SemanticTokensRequest = Proposed.SemanticTokensRequest || (Proposed.SemanticTokensRequest = {}));\r
240     let SemanticTokensEditsRequest;\r
241     (function (SemanticTokensEditsRequest) {\r
242         SemanticTokensEditsRequest.method = st.SemanticTokensEditsRequest.method;\r
243         SemanticTokensEditsRequest.type = st.SemanticTokensEditsRequest.type;\r
244     })(SemanticTokensEditsRequest = Proposed.SemanticTokensEditsRequest || (Proposed.SemanticTokensEditsRequest = {}));\r
245     let SemanticTokensRangeRequest;\r
246     (function (SemanticTokensRangeRequest) {\r
247         SemanticTokensRangeRequest.method = st.SemanticTokensRangeRequest.method;\r
248         SemanticTokensRangeRequest.type = st.SemanticTokensRangeRequest.type;\r
249     })(SemanticTokensRangeRequest = Proposed.SemanticTokensRangeRequest || (Proposed.SemanticTokensRangeRequest = {}));\r
250 })(Proposed = exports.Proposed || (exports.Proposed = {}));\r
251 function createProtocolConnection(reader, writer, logger, strategy) {\r
252     return vscode_jsonrpc_1.createMessageConnection(reader, writer, logger, strategy);\r
253 }\r
254 exports.createProtocolConnection = createProtocolConnection;\r
255
256
257 /***/ }),
258 /* 5 */
259 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
260
261 /* --------------------------------------------------------------------------------------------\r
262  * Copyright (c) Microsoft Corporation. All rights reserved.\r
263  * Licensed under the MIT License. See License.txt in the project root for license information.\r
264  * ------------------------------------------------------------------------------------------ */\r
265 /// <reference path="../typings/thenable.d.ts" />\r
266 \r
267 function __export(m) {\r
268     for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r
269 }\r
270 Object.defineProperty(exports, "__esModule", ({ value: true }));\r
271 const Is = __webpack_require__(6);\r
272 const messages_1 = __webpack_require__(7);\r
273 exports.RequestType = messages_1.RequestType;\r
274 exports.RequestType0 = messages_1.RequestType0;\r
275 exports.RequestType1 = messages_1.RequestType1;\r
276 exports.RequestType2 = messages_1.RequestType2;\r
277 exports.RequestType3 = messages_1.RequestType3;\r
278 exports.RequestType4 = messages_1.RequestType4;\r
279 exports.RequestType5 = messages_1.RequestType5;\r
280 exports.RequestType6 = messages_1.RequestType6;\r
281 exports.RequestType7 = messages_1.RequestType7;\r
282 exports.RequestType8 = messages_1.RequestType8;\r
283 exports.RequestType9 = messages_1.RequestType9;\r
284 exports.ResponseError = messages_1.ResponseError;\r
285 exports.ErrorCodes = messages_1.ErrorCodes;\r
286 exports.NotificationType = messages_1.NotificationType;\r
287 exports.NotificationType0 = messages_1.NotificationType0;\r
288 exports.NotificationType1 = messages_1.NotificationType1;\r
289 exports.NotificationType2 = messages_1.NotificationType2;\r
290 exports.NotificationType3 = messages_1.NotificationType3;\r
291 exports.NotificationType4 = messages_1.NotificationType4;\r
292 exports.NotificationType5 = messages_1.NotificationType5;\r
293 exports.NotificationType6 = messages_1.NotificationType6;\r
294 exports.NotificationType7 = messages_1.NotificationType7;\r
295 exports.NotificationType8 = messages_1.NotificationType8;\r
296 exports.NotificationType9 = messages_1.NotificationType9;\r
297 const messageReader_1 = __webpack_require__(8);\r
298 exports.MessageReader = messageReader_1.MessageReader;\r
299 exports.StreamMessageReader = messageReader_1.StreamMessageReader;\r
300 exports.IPCMessageReader = messageReader_1.IPCMessageReader;\r
301 exports.SocketMessageReader = messageReader_1.SocketMessageReader;\r
302 const messageWriter_1 = __webpack_require__(10);\r
303 exports.MessageWriter = messageWriter_1.MessageWriter;\r
304 exports.StreamMessageWriter = messageWriter_1.StreamMessageWriter;\r
305 exports.IPCMessageWriter = messageWriter_1.IPCMessageWriter;\r
306 exports.SocketMessageWriter = messageWriter_1.SocketMessageWriter;\r
307 const events_1 = __webpack_require__(9);\r
308 exports.Disposable = events_1.Disposable;\r
309 exports.Event = events_1.Event;\r
310 exports.Emitter = events_1.Emitter;\r
311 const cancellation_1 = __webpack_require__(11);\r
312 exports.CancellationTokenSource = cancellation_1.CancellationTokenSource;\r
313 exports.CancellationToken = cancellation_1.CancellationToken;\r
314 const linkedMap_1 = __webpack_require__(12);\r
315 __export(__webpack_require__(13));\r
316 __export(__webpack_require__(17));\r
317 var CancelNotification;\r
318 (function (CancelNotification) {\r
319     CancelNotification.type = new messages_1.NotificationType('$/cancelRequest');\r
320 })(CancelNotification || (CancelNotification = {}));\r
321 var ProgressNotification;\r
322 (function (ProgressNotification) {\r
323     ProgressNotification.type = new messages_1.NotificationType('$/progress');\r
324 })(ProgressNotification || (ProgressNotification = {}));\r
325 class ProgressType {\r
326     constructor() {\r
327     }\r
328 }\r
329 exports.ProgressType = ProgressType;\r
330 exports.NullLogger = Object.freeze({\r
331     error: () => { },\r
332     warn: () => { },\r
333     info: () => { },\r
334     log: () => { }\r
335 });\r
336 var Trace;\r
337 (function (Trace) {\r
338     Trace[Trace["Off"] = 0] = "Off";\r
339     Trace[Trace["Messages"] = 1] = "Messages";\r
340     Trace[Trace["Verbose"] = 2] = "Verbose";\r
341 })(Trace = exports.Trace || (exports.Trace = {}));\r
342 (function (Trace) {\r
343     function fromString(value) {\r
344         if (!Is.string(value)) {\r
345             return Trace.Off;\r
346         }\r
347         value = value.toLowerCase();\r
348         switch (value) {\r
349             case 'off':\r
350                 return Trace.Off;\r
351             case 'messages':\r
352                 return Trace.Messages;\r
353             case 'verbose':\r
354                 return Trace.Verbose;\r
355             default:\r
356                 return Trace.Off;\r
357         }\r
358     }\r
359     Trace.fromString = fromString;\r
360     function toString(value) {\r
361         switch (value) {\r
362             case Trace.Off:\r
363                 return 'off';\r
364             case Trace.Messages:\r
365                 return 'messages';\r
366             case Trace.Verbose:\r
367                 return 'verbose';\r
368             default:\r
369                 return 'off';\r
370         }\r
371     }\r
372     Trace.toString = toString;\r
373 })(Trace = exports.Trace || (exports.Trace = {}));\r
374 var TraceFormat;\r
375 (function (TraceFormat) {\r
376     TraceFormat["Text"] = "text";\r
377     TraceFormat["JSON"] = "json";\r
378 })(TraceFormat = exports.TraceFormat || (exports.TraceFormat = {}));\r
379 (function (TraceFormat) {\r
380     function fromString(value) {\r
381         value = value.toLowerCase();\r
382         if (value === 'json') {\r
383             return TraceFormat.JSON;\r
384         }\r
385         else {\r
386             return TraceFormat.Text;\r
387         }\r
388     }\r
389     TraceFormat.fromString = fromString;\r
390 })(TraceFormat = exports.TraceFormat || (exports.TraceFormat = {}));\r
391 var SetTraceNotification;\r
392 (function (SetTraceNotification) {\r
393     SetTraceNotification.type = new messages_1.NotificationType('$/setTraceNotification');\r
394 })(SetTraceNotification = exports.SetTraceNotification || (exports.SetTraceNotification = {}));\r
395 var LogTraceNotification;\r
396 (function (LogTraceNotification) {\r
397     LogTraceNotification.type = new messages_1.NotificationType('$/logTraceNotification');\r
398 })(LogTraceNotification = exports.LogTraceNotification || (exports.LogTraceNotification = {}));\r
399 var ConnectionErrors;\r
400 (function (ConnectionErrors) {\r
401     /**\r
402      * The connection is closed.\r
403      */\r
404     ConnectionErrors[ConnectionErrors["Closed"] = 1] = "Closed";\r
405     /**\r
406      * The connection got disposed.\r
407      */\r
408     ConnectionErrors[ConnectionErrors["Disposed"] = 2] = "Disposed";\r
409     /**\r
410      * The connection is already in listening mode.\r
411      */\r
412     ConnectionErrors[ConnectionErrors["AlreadyListening"] = 3] = "AlreadyListening";\r
413 })(ConnectionErrors = exports.ConnectionErrors || (exports.ConnectionErrors = {}));\r
414 class ConnectionError extends Error {\r
415     constructor(code, message) {\r
416         super(message);\r
417         this.code = code;\r
418         Object.setPrototypeOf(this, ConnectionError.prototype);\r
419     }\r
420 }\r
421 exports.ConnectionError = ConnectionError;\r
422 var ConnectionStrategy;\r
423 (function (ConnectionStrategy) {\r
424     function is(value) {\r
425         let candidate = value;\r
426         return candidate && Is.func(candidate.cancelUndispatched);\r
427     }\r
428     ConnectionStrategy.is = is;\r
429 })(ConnectionStrategy = exports.ConnectionStrategy || (exports.ConnectionStrategy = {}));\r
430 var ConnectionState;\r
431 (function (ConnectionState) {\r
432     ConnectionState[ConnectionState["New"] = 1] = "New";\r
433     ConnectionState[ConnectionState["Listening"] = 2] = "Listening";\r
434     ConnectionState[ConnectionState["Closed"] = 3] = "Closed";\r
435     ConnectionState[ConnectionState["Disposed"] = 4] = "Disposed";\r
436 })(ConnectionState || (ConnectionState = {}));\r
437 function _createMessageConnection(messageReader, messageWriter, logger, strategy) {\r
438     let sequenceNumber = 0;\r
439     let notificationSquenceNumber = 0;\r
440     let unknownResponseSquenceNumber = 0;\r
441     const version = '2.0';\r
442     let starRequestHandler = undefined;\r
443     let requestHandlers = Object.create(null);\r
444     let starNotificationHandler = undefined;\r
445     let notificationHandlers = Object.create(null);\r
446     let progressHandlers = new Map();\r
447     let timer;\r
448     let messageQueue = new linkedMap_1.LinkedMap();\r
449     let responsePromises = Object.create(null);\r
450     let requestTokens = Object.create(null);\r
451     let trace = Trace.Off;\r
452     let traceFormat = TraceFormat.Text;\r
453     let tracer;\r
454     let state = ConnectionState.New;\r
455     let errorEmitter = new events_1.Emitter();\r
456     let closeEmitter = new events_1.Emitter();\r
457     let unhandledNotificationEmitter = new events_1.Emitter();\r
458     let unhandledProgressEmitter = new events_1.Emitter();\r
459     let disposeEmitter = new events_1.Emitter();\r
460     function createRequestQueueKey(id) {\r
461         return 'req-' + id.toString();\r
462     }\r
463     function createResponseQueueKey(id) {\r
464         if (id === null) {\r
465             return 'res-unknown-' + (++unknownResponseSquenceNumber).toString();\r
466         }\r
467         else {\r
468             return 'res-' + id.toString();\r
469         }\r
470     }\r
471     function createNotificationQueueKey() {\r
472         return 'not-' + (++notificationSquenceNumber).toString();\r
473     }\r
474     function addMessageToQueue(queue, message) {\r
475         if (messages_1.isRequestMessage(message)) {\r
476             queue.set(createRequestQueueKey(message.id), message);\r
477         }\r
478         else if (messages_1.isResponseMessage(message)) {\r
479             queue.set(createResponseQueueKey(message.id), message);\r
480         }\r
481         else {\r
482             queue.set(createNotificationQueueKey(), message);\r
483         }\r
484     }\r
485     function cancelUndispatched(_message) {\r
486         return undefined;\r
487     }\r
488     function isListening() {\r
489         return state === ConnectionState.Listening;\r
490     }\r
491     function isClosed() {\r
492         return state === ConnectionState.Closed;\r
493     }\r
494     function isDisposed() {\r
495         return state === ConnectionState.Disposed;\r
496     }\r
497     function closeHandler() {\r
498         if (state === ConnectionState.New || state === ConnectionState.Listening) {\r
499             state = ConnectionState.Closed;\r
500             closeEmitter.fire(undefined);\r
501         }\r
502         // If the connection is disposed don't sent close events.\r
503     }\r
504     function readErrorHandler(error) {\r
505         errorEmitter.fire([error, undefined, undefined]);\r
506     }\r
507     function writeErrorHandler(data) {\r
508         errorEmitter.fire(data);\r
509     }\r
510     messageReader.onClose(closeHandler);\r
511     messageReader.onError(readErrorHandler);\r
512     messageWriter.onClose(closeHandler);\r
513     messageWriter.onError(writeErrorHandler);\r
514     function triggerMessageQueue() {\r
515         if (timer || messageQueue.size === 0) {\r
516             return;\r
517         }\r
518         timer = setImmediate(() => {\r
519             timer = undefined;\r
520             processMessageQueue();\r
521         });\r
522     }\r
523     function processMessageQueue() {\r
524         if (messageQueue.size === 0) {\r
525             return;\r
526         }\r
527         let message = messageQueue.shift();\r
528         try {\r
529             if (messages_1.isRequestMessage(message)) {\r
530                 handleRequest(message);\r
531             }\r
532             else if (messages_1.isNotificationMessage(message)) {\r
533                 handleNotification(message);\r
534             }\r
535             else if (messages_1.isResponseMessage(message)) {\r
536                 handleResponse(message);\r
537             }\r
538             else {\r
539                 handleInvalidMessage(message);\r
540             }\r
541         }\r
542         finally {\r
543             triggerMessageQueue();\r
544         }\r
545     }\r
546     let callback = (message) => {\r
547         try {\r
548             // We have received a cancellation message. Check if the message is still in the queue\r
549             // and cancel it if allowed to do so.\r
550             if (messages_1.isNotificationMessage(message) && message.method === CancelNotification.type.method) {\r
551                 let key = createRequestQueueKey(message.params.id);\r
552                 let toCancel = messageQueue.get(key);\r
553                 if (messages_1.isRequestMessage(toCancel)) {\r
554                     let response = strategy && strategy.cancelUndispatched ? strategy.cancelUndispatched(toCancel, cancelUndispatched) : cancelUndispatched(toCancel);\r
555                     if (response && (response.error !== void 0 || response.result !== void 0)) {\r
556                         messageQueue.delete(key);\r
557                         response.id = toCancel.id;\r
558                         traceSendingResponse(response, message.method, Date.now());\r
559                         messageWriter.write(response);\r
560                         return;\r
561                     }\r
562                 }\r
563             }\r
564             addMessageToQueue(messageQueue, message);\r
565         }\r
566         finally {\r
567             triggerMessageQueue();\r
568         }\r
569     };\r
570     function handleRequest(requestMessage) {\r
571         if (isDisposed()) {\r
572             // we return here silently since we fired an event when the\r
573             // connection got disposed.\r
574             return;\r
575         }\r
576         function reply(resultOrError, method, startTime) {\r
577             let message = {\r
578                 jsonrpc: version,\r
579                 id: requestMessage.id\r
580             };\r
581             if (resultOrError instanceof messages_1.ResponseError) {\r
582                 message.error = resultOrError.toJson();\r
583             }\r
584             else {\r
585                 message.result = resultOrError === void 0 ? null : resultOrError;\r
586             }\r
587             traceSendingResponse(message, method, startTime);\r
588             messageWriter.write(message);\r
589         }\r
590         function replyError(error, method, startTime) {\r
591             let message = {\r
592                 jsonrpc: version,\r
593                 id: requestMessage.id,\r
594                 error: error.toJson()\r
595             };\r
596             traceSendingResponse(message, method, startTime);\r
597             messageWriter.write(message);\r
598         }\r
599         function replySuccess(result, method, startTime) {\r
600             // The JSON RPC defines that a response must either have a result or an error\r
601             // So we can't treat undefined as a valid response result.\r
602             if (result === void 0) {\r
603                 result = null;\r
604             }\r
605             let message = {\r
606                 jsonrpc: version,\r
607                 id: requestMessage.id,\r
608                 result: result\r
609             };\r
610             traceSendingResponse(message, method, startTime);\r
611             messageWriter.write(message);\r
612         }\r
613         traceReceivedRequest(requestMessage);\r
614         let element = requestHandlers[requestMessage.method];\r
615         let type;\r
616         let requestHandler;\r
617         if (element) {\r
618             type = element.type;\r
619             requestHandler = element.handler;\r
620         }\r
621         let startTime = Date.now();\r
622         if (requestHandler || starRequestHandler) {\r
623             let cancellationSource = new cancellation_1.CancellationTokenSource();\r
624             let tokenKey = String(requestMessage.id);\r
625             requestTokens[tokenKey] = cancellationSource;\r
626             try {\r
627                 let handlerResult;\r
628                 if (requestMessage.params === void 0 || (type !== void 0 && type.numberOfParams === 0)) {\r
629                     handlerResult = requestHandler\r
630                         ? requestHandler(cancellationSource.token)\r
631                         : starRequestHandler(requestMessage.method, cancellationSource.token);\r
632                 }\r
633                 else if (Is.array(requestMessage.params) && (type === void 0 || type.numberOfParams > 1)) {\r
634                     handlerResult = requestHandler\r
635                         ? requestHandler(...requestMessage.params, cancellationSource.token)\r
636                         : starRequestHandler(requestMessage.method, ...requestMessage.params, cancellationSource.token);\r
637                 }\r
638                 else {\r
639                     handlerResult = requestHandler\r
640                         ? requestHandler(requestMessage.params, cancellationSource.token)\r
641                         : starRequestHandler(requestMessage.method, requestMessage.params, cancellationSource.token);\r
642                 }\r
643                 let promise = handlerResult;\r
644                 if (!handlerResult) {\r
645                     delete requestTokens[tokenKey];\r
646                     replySuccess(handlerResult, requestMessage.method, startTime);\r
647                 }\r
648                 else if (promise.then) {\r
649                     promise.then((resultOrError) => {\r
650                         delete requestTokens[tokenKey];\r
651                         reply(resultOrError, requestMessage.method, startTime);\r
652                     }, error => {\r
653                         delete requestTokens[tokenKey];\r
654                         if (error instanceof messages_1.ResponseError) {\r
655                             replyError(error, requestMessage.method, startTime);\r
656                         }\r
657                         else if (error && Is.string(error.message)) {\r
658                             replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed with message: ${error.message}`), requestMessage.method, startTime);\r
659                         }\r
660                         else {\r
661                             replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed unexpectedly without providing any details.`), requestMessage.method, startTime);\r
662                         }\r
663                     });\r
664                 }\r
665                 else {\r
666                     delete requestTokens[tokenKey];\r
667                     reply(handlerResult, requestMessage.method, startTime);\r
668                 }\r
669             }\r
670             catch (error) {\r
671                 delete requestTokens[tokenKey];\r
672                 if (error instanceof messages_1.ResponseError) {\r
673                     reply(error, requestMessage.method, startTime);\r
674                 }\r
675                 else if (error && Is.string(error.message)) {\r
676                     replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed with message: ${error.message}`), requestMessage.method, startTime);\r
677                 }\r
678                 else {\r
679                     replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed unexpectedly without providing any details.`), requestMessage.method, startTime);\r
680                 }\r
681             }\r
682         }\r
683         else {\r
684             replyError(new messages_1.ResponseError(messages_1.ErrorCodes.MethodNotFound, `Unhandled method ${requestMessage.method}`), requestMessage.method, startTime);\r
685         }\r
686     }\r
687     function handleResponse(responseMessage) {\r
688         if (isDisposed()) {\r
689             // See handle request.\r
690             return;\r
691         }\r
692         if (responseMessage.id === null) {\r
693             if (responseMessage.error) {\r
694                 logger.error(`Received response message without id: Error is: \n${JSON.stringify(responseMessage.error, undefined, 4)}`);\r
695             }\r
696             else {\r
697                 logger.error(`Received response message without id. No further error information provided.`);\r
698             }\r
699         }\r
700         else {\r
701             let key = String(responseMessage.id);\r
702             let responsePromise = responsePromises[key];\r
703             traceReceivedResponse(responseMessage, responsePromise);\r
704             if (responsePromise) {\r
705                 delete responsePromises[key];\r
706                 try {\r
707                     if (responseMessage.error) {\r
708                         let error = responseMessage.error;\r
709                         responsePromise.reject(new messages_1.ResponseError(error.code, error.message, error.data));\r
710                     }\r
711                     else if (responseMessage.result !== void 0) {\r
712                         responsePromise.resolve(responseMessage.result);\r
713                     }\r
714                     else {\r
715                         throw new Error('Should never happen.');\r
716                     }\r
717                 }\r
718                 catch (error) {\r
719                     if (error.message) {\r
720                         logger.error(`Response handler '${responsePromise.method}' failed with message: ${error.message}`);\r
721                     }\r
722                     else {\r
723                         logger.error(`Response handler '${responsePromise.method}' failed unexpectedly.`);\r
724                     }\r
725                 }\r
726             }\r
727         }\r
728     }\r
729     function handleNotification(message) {\r
730         if (isDisposed()) {\r
731             // See handle request.\r
732             return;\r
733         }\r
734         let type = undefined;\r
735         let notificationHandler;\r
736         if (message.method === CancelNotification.type.method) {\r
737             notificationHandler = (params) => {\r
738                 let id = params.id;\r
739                 let source = requestTokens[String(id)];\r
740                 if (source) {\r
741                     source.cancel();\r
742                 }\r
743             };\r
744         }\r
745         else {\r
746             let element = notificationHandlers[message.method];\r
747             if (element) {\r
748                 notificationHandler = element.handler;\r
749                 type = element.type;\r
750             }\r
751         }\r
752         if (notificationHandler || starNotificationHandler) {\r
753             try {\r
754                 traceReceivedNotification(message);\r
755                 if (message.params === void 0 || (type !== void 0 && type.numberOfParams === 0)) {\r
756                     notificationHandler ? notificationHandler() : starNotificationHandler(message.method);\r
757                 }\r
758                 else if (Is.array(message.params) && (type === void 0 || type.numberOfParams > 1)) {\r
759                     notificationHandler ? notificationHandler(...message.params) : starNotificationHandler(message.method, ...message.params);\r
760                 }\r
761                 else {\r
762                     notificationHandler ? notificationHandler(message.params) : starNotificationHandler(message.method, message.params);\r
763                 }\r
764             }\r
765             catch (error) {\r
766                 if (error.message) {\r
767                     logger.error(`Notification handler '${message.method}' failed with message: ${error.message}`);\r
768                 }\r
769                 else {\r
770                     logger.error(`Notification handler '${message.method}' failed unexpectedly.`);\r
771                 }\r
772             }\r
773         }\r
774         else {\r
775             unhandledNotificationEmitter.fire(message);\r
776         }\r
777     }\r
778     function handleInvalidMessage(message) {\r
779         if (!message) {\r
780             logger.error('Received empty message.');\r
781             return;\r
782         }\r
783         logger.error(`Received message which is neither a response nor a notification message:\n${JSON.stringify(message, null, 4)}`);\r
784         // Test whether we find an id to reject the promise\r
785         let responseMessage = message;\r
786         if (Is.string(responseMessage.id) || Is.number(responseMessage.id)) {\r
787             let key = String(responseMessage.id);\r
788             let responseHandler = responsePromises[key];\r
789             if (responseHandler) {\r
790                 responseHandler.reject(new Error('The received response has neither a result nor an error property.'));\r
791             }\r
792         }\r
793     }\r
794     function traceSendingRequest(message) {\r
795         if (trace === Trace.Off || !tracer) {\r
796             return;\r
797         }\r
798         if (traceFormat === TraceFormat.Text) {\r
799             let data = undefined;\r
800             if (trace === Trace.Verbose && message.params) {\r
801                 data = `Params: ${JSON.stringify(message.params, null, 4)}\n\n`;\r
802             }\r
803             tracer.log(`Sending request '${message.method} - (${message.id})'.`, data);\r
804         }\r
805         else {\r
806             logLSPMessage('send-request', message);\r
807         }\r
808     }\r
809     function traceSendingNotification(message) {\r
810         if (trace === Trace.Off || !tracer) {\r
811             return;\r
812         }\r
813         if (traceFormat === TraceFormat.Text) {\r
814             let data = undefined;\r
815             if (trace === Trace.Verbose) {\r
816                 if (message.params) {\r
817                     data = `Params: ${JSON.stringify(message.params, null, 4)}\n\n`;\r
818                 }\r
819                 else {\r
820                     data = 'No parameters provided.\n\n';\r
821                 }\r
822             }\r
823             tracer.log(`Sending notification '${message.method}'.`, data);\r
824         }\r
825         else {\r
826             logLSPMessage('send-notification', message);\r
827         }\r
828     }\r
829     function traceSendingResponse(message, method, startTime) {\r
830         if (trace === Trace.Off || !tracer) {\r
831             return;\r
832         }\r
833         if (traceFormat === TraceFormat.Text) {\r
834             let data = undefined;\r
835             if (trace === Trace.Verbose) {\r
836                 if (message.error && message.error.data) {\r
837                     data = `Error data: ${JSON.stringify(message.error.data, null, 4)}\n\n`;\r
838                 }\r
839                 else {\r
840                     if (message.result) {\r
841                         data = `Result: ${JSON.stringify(message.result, null, 4)}\n\n`;\r
842                     }\r
843                     else if (message.error === void 0) {\r
844                         data = 'No result returned.\n\n';\r
845                     }\r
846                 }\r
847             }\r
848             tracer.log(`Sending response '${method} - (${message.id})'. Processing request took ${Date.now() - startTime}ms`, data);\r
849         }\r
850         else {\r
851             logLSPMessage('send-response', message);\r
852         }\r
853     }\r
854     function traceReceivedRequest(message) {\r
855         if (trace === Trace.Off || !tracer) {\r
856             return;\r
857         }\r
858         if (traceFormat === TraceFormat.Text) {\r
859             let data = undefined;\r
860             if (trace === Trace.Verbose && message.params) {\r
861                 data = `Params: ${JSON.stringify(message.params, null, 4)}\n\n`;\r
862             }\r
863             tracer.log(`Received request '${message.method} - (${message.id})'.`, data);\r
864         }\r
865         else {\r
866             logLSPMessage('receive-request', message);\r
867         }\r
868     }\r
869     function traceReceivedNotification(message) {\r
870         if (trace === Trace.Off || !tracer || message.method === LogTraceNotification.type.method) {\r
871             return;\r
872         }\r
873         if (traceFormat === TraceFormat.Text) {\r
874             let data = undefined;\r
875             if (trace === Trace.Verbose) {\r
876                 if (message.params) {\r
877                     data = `Params: ${JSON.stringify(message.params, null, 4)}\n\n`;\r
878                 }\r
879                 else {\r
880                     data = 'No parameters provided.\n\n';\r
881                 }\r
882             }\r
883             tracer.log(`Received notification '${message.method}'.`, data);\r
884         }\r
885         else {\r
886             logLSPMessage('receive-notification', message);\r
887         }\r
888     }\r
889     function traceReceivedResponse(message, responsePromise) {\r
890         if (trace === Trace.Off || !tracer) {\r
891             return;\r
892         }\r
893         if (traceFormat === TraceFormat.Text) {\r
894             let data = undefined;\r
895             if (trace === Trace.Verbose) {\r
896                 if (message.error && message.error.data) {\r
897                     data = `Error data: ${JSON.stringify(message.error.data, null, 4)}\n\n`;\r
898                 }\r
899                 else {\r
900                     if (message.result) {\r
901                         data = `Result: ${JSON.stringify(message.result, null, 4)}\n\n`;\r
902                     }\r
903                     else if (message.error === void 0) {\r
904                         data = 'No result returned.\n\n';\r
905                     }\r
906                 }\r
907             }\r
908             if (responsePromise) {\r
909                 let error = message.error ? ` Request failed: ${message.error.message} (${message.error.code}).` : '';\r
910                 tracer.log(`Received response '${responsePromise.method} - (${message.id})' in ${Date.now() - responsePromise.timerStart}ms.${error}`, data);\r
911             }\r
912             else {\r
913                 tracer.log(`Received response ${message.id} without active response promise.`, data);\r
914             }\r
915         }\r
916         else {\r
917             logLSPMessage('receive-response', message);\r
918         }\r
919     }\r
920     function logLSPMessage(type, message) {\r
921         if (!tracer || trace === Trace.Off) {\r
922             return;\r
923         }\r
924         const lspMessage = {\r
925             isLSPMessage: true,\r
926             type,\r
927             message,\r
928             timestamp: Date.now()\r
929         };\r
930         tracer.log(lspMessage);\r
931     }\r
932     function throwIfClosedOrDisposed() {\r
933         if (isClosed()) {\r
934             throw new ConnectionError(ConnectionErrors.Closed, 'Connection is closed.');\r
935         }\r
936         if (isDisposed()) {\r
937             throw new ConnectionError(ConnectionErrors.Disposed, 'Connection is disposed.');\r
938         }\r
939     }\r
940     function throwIfListening() {\r
941         if (isListening()) {\r
942             throw new ConnectionError(ConnectionErrors.AlreadyListening, 'Connection is already listening');\r
943         }\r
944     }\r
945     function throwIfNotListening() {\r
946         if (!isListening()) {\r
947             throw new Error('Call listen() first.');\r
948         }\r
949     }\r
950     function undefinedToNull(param) {\r
951         if (param === void 0) {\r
952             return null;\r
953         }\r
954         else {\r
955             return param;\r
956         }\r
957     }\r
958     function computeMessageParams(type, params) {\r
959         let result;\r
960         let numberOfParams = type.numberOfParams;\r
961         switch (numberOfParams) {\r
962             case 0:\r
963                 result = null;\r
964                 break;\r
965             case 1:\r
966                 result = undefinedToNull(params[0]);\r
967                 break;\r
968             default:\r
969                 result = [];\r
970                 for (let i = 0; i < params.length && i < numberOfParams; i++) {\r
971                     result.push(undefinedToNull(params[i]));\r
972                 }\r
973                 if (params.length < numberOfParams) {\r
974                     for (let i = params.length; i < numberOfParams; i++) {\r
975                         result.push(null);\r
976                     }\r
977                 }\r
978                 break;\r
979         }\r
980         return result;\r
981     }\r
982     let connection = {\r
983         sendNotification: (type, ...params) => {\r
984             throwIfClosedOrDisposed();\r
985             let method;\r
986             let messageParams;\r
987             if (Is.string(type)) {\r
988                 method = type;\r
989                 switch (params.length) {\r
990                     case 0:\r
991                         messageParams = null;\r
992                         break;\r
993                     case 1:\r
994                         messageParams = params[0];\r
995                         break;\r
996                     default:\r
997                         messageParams = params;\r
998                         break;\r
999                 }\r
1000             }\r
1001             else {\r
1002                 method = type.method;\r
1003                 messageParams = computeMessageParams(type, params);\r
1004             }\r
1005             let notificationMessage = {\r
1006                 jsonrpc: version,\r
1007                 method: method,\r
1008                 params: messageParams\r
1009             };\r
1010             traceSendingNotification(notificationMessage);\r
1011             messageWriter.write(notificationMessage);\r
1012         },\r
1013         onNotification: (type, handler) => {\r
1014             throwIfClosedOrDisposed();\r
1015             if (Is.func(type)) {\r
1016                 starNotificationHandler = type;\r
1017             }\r
1018             else if (handler) {\r
1019                 if (Is.string(type)) {\r
1020                     notificationHandlers[type] = { type: undefined, handler };\r
1021                 }\r
1022                 else {\r
1023                     notificationHandlers[type.method] = { type, handler };\r
1024                 }\r
1025             }\r
1026         },\r
1027         onProgress: (_type, token, handler) => {\r
1028             if (progressHandlers.has(token)) {\r
1029                 throw new Error(`Progress handler for token ${token} already registered`);\r
1030             }\r
1031             progressHandlers.set(token, handler);\r
1032             return {\r
1033                 dispose: () => {\r
1034                     progressHandlers.delete(token);\r
1035                 }\r
1036             };\r
1037         },\r
1038         sendProgress: (_type, token, value) => {\r
1039             connection.sendNotification(ProgressNotification.type, { token, value });\r
1040         },\r
1041         onUnhandledProgress: unhandledProgressEmitter.event,\r
1042         sendRequest: (type, ...params) => {\r
1043             throwIfClosedOrDisposed();\r
1044             throwIfNotListening();\r
1045             let method;\r
1046             let messageParams;\r
1047             let token = undefined;\r
1048             if (Is.string(type)) {\r
1049                 method = type;\r
1050                 switch (params.length) {\r
1051                     case 0:\r
1052                         messageParams = null;\r
1053                         break;\r
1054                     case 1:\r
1055                         // The cancellation token is optional so it can also be undefined.\r
1056                         if (cancellation_1.CancellationToken.is(params[0])) {\r
1057                             messageParams = null;\r
1058                             token = params[0];\r
1059                         }\r
1060                         else {\r
1061                             messageParams = undefinedToNull(params[0]);\r
1062                         }\r
1063                         break;\r
1064                     default:\r
1065                         const last = params.length - 1;\r
1066                         if (cancellation_1.CancellationToken.is(params[last])) {\r
1067                             token = params[last];\r
1068                             if (params.length === 2) {\r
1069                                 messageParams = undefinedToNull(params[0]);\r
1070                             }\r
1071                             else {\r
1072                                 messageParams = params.slice(0, last).map(value => undefinedToNull(value));\r
1073                             }\r
1074                         }\r
1075                         else {\r
1076                             messageParams = params.map(value => undefinedToNull(value));\r
1077                         }\r
1078                         break;\r
1079                 }\r
1080             }\r
1081             else {\r
1082                 method = type.method;\r
1083                 messageParams = computeMessageParams(type, params);\r
1084                 let numberOfParams = type.numberOfParams;\r
1085                 token = cancellation_1.CancellationToken.is(params[numberOfParams]) ? params[numberOfParams] : undefined;\r
1086             }\r
1087             let id = sequenceNumber++;\r
1088             let result = new Promise((resolve, reject) => {\r
1089                 let requestMessage = {\r
1090                     jsonrpc: version,\r
1091                     id: id,\r
1092                     method: method,\r
1093                     params: messageParams\r
1094                 };\r
1095                 let responsePromise = { method: method, timerStart: Date.now(), resolve, reject };\r
1096                 traceSendingRequest(requestMessage);\r
1097                 try {\r
1098                     messageWriter.write(requestMessage);\r
1099                 }\r
1100                 catch (e) {\r
1101                     // Writing the message failed. So we need to reject the promise.\r
1102                     responsePromise.reject(new messages_1.ResponseError(messages_1.ErrorCodes.MessageWriteError, e.message ? e.message : 'Unknown reason'));\r
1103                     responsePromise = null;\r
1104                 }\r
1105                 if (responsePromise) {\r
1106                     responsePromises[String(id)] = responsePromise;\r
1107                 }\r
1108             });\r
1109             if (token) {\r
1110                 token.onCancellationRequested(() => {\r
1111                     connection.sendNotification(CancelNotification.type, { id });\r
1112                 });\r
1113             }\r
1114             return result;\r
1115         },\r
1116         onRequest: (type, handler) => {\r
1117             throwIfClosedOrDisposed();\r
1118             if (Is.func(type)) {\r
1119                 starRequestHandler = type;\r
1120             }\r
1121             else if (handler) {\r
1122                 if (Is.string(type)) {\r
1123                     requestHandlers[type] = { type: undefined, handler };\r
1124                 }\r
1125                 else {\r
1126                     requestHandlers[type.method] = { type, handler };\r
1127                 }\r
1128             }\r
1129         },\r
1130         trace: (_value, _tracer, sendNotificationOrTraceOptions) => {\r
1131             let _sendNotification = false;\r
1132             let _traceFormat = TraceFormat.Text;\r
1133             if (sendNotificationOrTraceOptions !== void 0) {\r
1134                 if (Is.boolean(sendNotificationOrTraceOptions)) {\r
1135                     _sendNotification = sendNotificationOrTraceOptions;\r
1136                 }\r
1137                 else {\r
1138                     _sendNotification = sendNotificationOrTraceOptions.sendNotification || false;\r
1139                     _traceFormat = sendNotificationOrTraceOptions.traceFormat || TraceFormat.Text;\r
1140                 }\r
1141             }\r
1142             trace = _value;\r
1143             traceFormat = _traceFormat;\r
1144             if (trace === Trace.Off) {\r
1145                 tracer = undefined;\r
1146             }\r
1147             else {\r
1148                 tracer = _tracer;\r
1149             }\r
1150             if (_sendNotification && !isClosed() && !isDisposed()) {\r
1151                 connection.sendNotification(SetTraceNotification.type, { value: Trace.toString(_value) });\r
1152             }\r
1153         },\r
1154         onError: errorEmitter.event,\r
1155         onClose: closeEmitter.event,\r
1156         onUnhandledNotification: unhandledNotificationEmitter.event,\r
1157         onDispose: disposeEmitter.event,\r
1158         dispose: () => {\r
1159             if (isDisposed()) {\r
1160                 return;\r
1161             }\r
1162             state = ConnectionState.Disposed;\r
1163             disposeEmitter.fire(undefined);\r
1164             let error = new Error('Connection got disposed.');\r
1165             Object.keys(responsePromises).forEach((key) => {\r
1166                 responsePromises[key].reject(error);\r
1167             });\r
1168             responsePromises = Object.create(null);\r
1169             requestTokens = Object.create(null);\r
1170             messageQueue = new linkedMap_1.LinkedMap();\r
1171             // Test for backwards compatibility\r
1172             if (Is.func(messageWriter.dispose)) {\r
1173                 messageWriter.dispose();\r
1174             }\r
1175             if (Is.func(messageReader.dispose)) {\r
1176                 messageReader.dispose();\r
1177             }\r
1178         },\r
1179         listen: () => {\r
1180             throwIfClosedOrDisposed();\r
1181             throwIfListening();\r
1182             state = ConnectionState.Listening;\r
1183             messageReader.listen(callback);\r
1184         },\r
1185         inspect: () => {\r
1186             // eslint-disable-next-line no-console\r
1187             console.log('inspect');\r
1188         }\r
1189     };\r
1190     connection.onNotification(LogTraceNotification.type, (params) => {\r
1191         if (trace === Trace.Off || !tracer) {\r
1192             return;\r
1193         }\r
1194         tracer.log(params.message, trace === Trace.Verbose ? params.verbose : undefined);\r
1195     });\r
1196     connection.onNotification(ProgressNotification.type, (params) => {\r
1197         const handler = progressHandlers.get(params.token);\r
1198         if (handler) {\r
1199             handler(params.value);\r
1200         }\r
1201         else {\r
1202             unhandledProgressEmitter.fire(params);\r
1203         }\r
1204     });\r
1205     return connection;\r
1206 }\r
1207 function isMessageReader(value) {\r
1208     return value.listen !== void 0 && value.read === void 0;\r
1209 }\r
1210 function isMessageWriter(value) {\r
1211     return value.write !== void 0 && value.end === void 0;\r
1212 }\r
1213 function createMessageConnection(input, output, logger, strategy) {\r
1214     if (!logger) {\r
1215         logger = exports.NullLogger;\r
1216     }\r
1217     let reader = isMessageReader(input) ? input : new messageReader_1.StreamMessageReader(input);\r
1218     let writer = isMessageWriter(output) ? output : new messageWriter_1.StreamMessageWriter(output);\r
1219     return _createMessageConnection(reader, writer, logger, strategy);\r
1220 }\r
1221 exports.createMessageConnection = createMessageConnection;\r
1222
1223
1224 /***/ }),
1225 /* 6 */
1226 /***/ ((__unused_webpack_module, exports) => {
1227
1228 /* --------------------------------------------------------------------------------------------\r
1229  * Copyright (c) Microsoft Corporation. All rights reserved.\r
1230  * Licensed under the MIT License. See License.txt in the project root for license information.\r
1231  * ------------------------------------------------------------------------------------------ */\r
1232 \r
1233 Object.defineProperty(exports, "__esModule", ({ value: true }));\r
1234 function boolean(value) {\r
1235     return value === true || value === false;\r
1236 }\r
1237 exports.boolean = boolean;\r
1238 function string(value) {\r
1239     return typeof value === 'string' || value instanceof String;\r
1240 }\r
1241 exports.string = string;\r
1242 function number(value) {\r
1243     return typeof value === 'number' || value instanceof Number;\r
1244 }\r
1245 exports.number = number;\r
1246 function error(value) {\r
1247     return value instanceof Error;\r
1248 }\r
1249 exports.error = error;\r
1250 function func(value) {\r
1251     return typeof value === 'function';\r
1252 }\r
1253 exports.func = func;\r
1254 function array(value) {\r
1255     return Array.isArray(value);\r
1256 }\r
1257 exports.array = array;\r
1258 function stringArray(value) {\r
1259     return array(value) && value.every(elem => string(elem));\r
1260 }\r
1261 exports.stringArray = stringArray;\r
1262
1263
1264 /***/ }),
1265 /* 7 */
1266 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1267
1268 /* --------------------------------------------------------------------------------------------\r
1269  * Copyright (c) Microsoft Corporation. All rights reserved.\r
1270  * Licensed under the MIT License. See License.txt in the project root for license information.\r
1271  * ------------------------------------------------------------------------------------------ */\r
1272 \r
1273 Object.defineProperty(exports, "__esModule", ({ value: true }));\r
1274 const is = __webpack_require__(6);\r
1275 /**\r
1276  * Predefined error codes.\r
1277  */\r
1278 var ErrorCodes;\r
1279 (function (ErrorCodes) {\r
1280     // Defined by JSON RPC\r
1281     ErrorCodes.ParseError = -32700;\r
1282     ErrorCodes.InvalidRequest = -32600;\r
1283     ErrorCodes.MethodNotFound = -32601;\r
1284     ErrorCodes.InvalidParams = -32602;\r
1285     ErrorCodes.InternalError = -32603;\r
1286     ErrorCodes.serverErrorStart = -32099;\r
1287     ErrorCodes.serverErrorEnd = -32000;\r
1288     ErrorCodes.ServerNotInitialized = -32002;\r
1289     ErrorCodes.UnknownErrorCode = -32001;\r
1290     // Defined by the protocol.\r
1291     ErrorCodes.RequestCancelled = -32800;\r
1292     ErrorCodes.ContentModified = -32801;\r
1293     // Defined by VSCode library.\r
1294     ErrorCodes.MessageWriteError = 1;\r
1295     ErrorCodes.MessageReadError = 2;\r
1296 })(ErrorCodes = exports.ErrorCodes || (exports.ErrorCodes = {}));\r
1297 /**\r
1298  * An error object return in a response in case a request\r
1299  * has failed.\r
1300  */\r
1301 class ResponseError extends Error {\r
1302     constructor(code, message, data) {\r
1303         super(message);\r
1304         this.code = is.number(code) ? code : ErrorCodes.UnknownErrorCode;\r
1305         this.data = data;\r
1306         Object.setPrototypeOf(this, ResponseError.prototype);\r
1307     }\r
1308     toJson() {\r
1309         return {\r
1310             code: this.code,\r
1311             message: this.message,\r
1312             data: this.data,\r
1313         };\r
1314     }\r
1315 }\r
1316 exports.ResponseError = ResponseError;\r
1317 /**\r
1318  * An abstract implementation of a MessageType.\r
1319  */\r
1320 class AbstractMessageType {\r
1321     constructor(_method, _numberOfParams) {\r
1322         this._method = _method;\r
1323         this._numberOfParams = _numberOfParams;\r
1324     }\r
1325     get method() {\r
1326         return this._method;\r
1327     }\r
1328     get numberOfParams() {\r
1329         return this._numberOfParams;\r
1330     }\r
1331 }\r
1332 exports.AbstractMessageType = AbstractMessageType;\r
1333 /**\r
1334  * Classes to type request response pairs\r
1335  *\r
1336  * The type parameter RO will be removed in the next major version\r
1337  * of the JSON RPC library since it is a LSP concept and doesn't\r
1338  * belong here. For now it is tagged as default never.\r
1339  */\r
1340 class RequestType0 extends AbstractMessageType {\r
1341     constructor(method) {\r
1342         super(method, 0);\r
1343     }\r
1344 }\r
1345 exports.RequestType0 = RequestType0;\r
1346 class RequestType extends AbstractMessageType {\r
1347     constructor(method) {\r
1348         super(method, 1);\r
1349     }\r
1350 }\r
1351 exports.RequestType = RequestType;\r
1352 class RequestType1 extends AbstractMessageType {\r
1353     constructor(method) {\r
1354         super(method, 1);\r
1355     }\r
1356 }\r
1357 exports.RequestType1 = RequestType1;\r
1358 class RequestType2 extends AbstractMessageType {\r
1359     constructor(method) {\r
1360         super(method, 2);\r
1361     }\r
1362 }\r
1363 exports.RequestType2 = RequestType2;\r
1364 class RequestType3 extends AbstractMessageType {\r
1365     constructor(method) {\r
1366         super(method, 3);\r
1367     }\r
1368 }\r
1369 exports.RequestType3 = RequestType3;\r
1370 class RequestType4 extends AbstractMessageType {\r
1371     constructor(method) {\r
1372         super(method, 4);\r
1373     }\r
1374 }\r
1375 exports.RequestType4 = RequestType4;\r
1376 class RequestType5 extends AbstractMessageType {\r
1377     constructor(method) {\r
1378         super(method, 5);\r
1379     }\r
1380 }\r
1381 exports.RequestType5 = RequestType5;\r
1382 class RequestType6 extends AbstractMessageType {\r
1383     constructor(method) {\r
1384         super(method, 6);\r
1385     }\r
1386 }\r
1387 exports.RequestType6 = RequestType6;\r
1388 class RequestType7 extends AbstractMessageType {\r
1389     constructor(method) {\r
1390         super(method, 7);\r
1391     }\r
1392 }\r
1393 exports.RequestType7 = RequestType7;\r
1394 class RequestType8 extends AbstractMessageType {\r
1395     constructor(method) {\r
1396         super(method, 8);\r
1397     }\r
1398 }\r
1399 exports.RequestType8 = RequestType8;\r
1400 class RequestType9 extends AbstractMessageType {\r
1401     constructor(method) {\r
1402         super(method, 9);\r
1403     }\r
1404 }\r
1405 exports.RequestType9 = RequestType9;\r
1406 /**\r
1407  * The type parameter RO will be removed in the next major version\r
1408  * of the JSON RPC library since it is a LSP concept and doesn't\r
1409  * belong here. For now it is tagged as default never.\r
1410  */\r
1411 class NotificationType extends AbstractMessageType {\r
1412     constructor(method) {\r
1413         super(method, 1);\r
1414         this._ = undefined;\r
1415     }\r
1416 }\r
1417 exports.NotificationType = NotificationType;\r
1418 class NotificationType0 extends AbstractMessageType {\r
1419     constructor(method) {\r
1420         super(method, 0);\r
1421     }\r
1422 }\r
1423 exports.NotificationType0 = NotificationType0;\r
1424 class NotificationType1 extends AbstractMessageType {\r
1425     constructor(method) {\r
1426         super(method, 1);\r
1427     }\r
1428 }\r
1429 exports.NotificationType1 = NotificationType1;\r
1430 class NotificationType2 extends AbstractMessageType {\r
1431     constructor(method) {\r
1432         super(method, 2);\r
1433     }\r
1434 }\r
1435 exports.NotificationType2 = NotificationType2;\r
1436 class NotificationType3 extends AbstractMessageType {\r
1437     constructor(method) {\r
1438         super(method, 3);\r
1439     }\r
1440 }\r
1441 exports.NotificationType3 = NotificationType3;\r
1442 class NotificationType4 extends AbstractMessageType {\r
1443     constructor(method) {\r
1444         super(method, 4);\r
1445     }\r
1446 }\r
1447 exports.NotificationType4 = NotificationType4;\r
1448 class NotificationType5 extends AbstractMessageType {\r
1449     constructor(method) {\r
1450         super(method, 5);\r
1451     }\r
1452 }\r
1453 exports.NotificationType5 = NotificationType5;\r
1454 class NotificationType6 extends AbstractMessageType {\r
1455     constructor(method) {\r
1456         super(method, 6);\r
1457     }\r
1458 }\r
1459 exports.NotificationType6 = NotificationType6;\r
1460 class NotificationType7 extends AbstractMessageType {\r
1461     constructor(method) {\r
1462         super(method, 7);\r
1463     }\r
1464 }\r
1465 exports.NotificationType7 = NotificationType7;\r
1466 class NotificationType8 extends AbstractMessageType {\r
1467     constructor(method) {\r
1468         super(method, 8);\r
1469     }\r
1470 }\r
1471 exports.NotificationType8 = NotificationType8;\r
1472 class NotificationType9 extends AbstractMessageType {\r
1473     constructor(method) {\r
1474         super(method, 9);\r
1475     }\r
1476 }\r
1477 exports.NotificationType9 = NotificationType9;\r
1478 /**\r
1479  * Tests if the given message is a request message\r
1480  */\r
1481 function isRequestMessage(message) {\r
1482     let candidate = message;\r
1483     return candidate && is.string(candidate.method) && (is.string(candidate.id) || is.number(candidate.id));\r
1484 }\r
1485 exports.isRequestMessage = isRequestMessage;\r
1486 /**\r
1487  * Tests if the given message is a notification message\r
1488  */\r
1489 function isNotificationMessage(message) {\r
1490     let candidate = message;\r
1491     return candidate && is.string(candidate.method) && message.id === void 0;\r
1492 }\r
1493 exports.isNotificationMessage = isNotificationMessage;\r
1494 /**\r
1495  * Tests if the given message is a response message\r
1496  */\r
1497 function isResponseMessage(message) {\r
1498     let candidate = message;\r
1499     return candidate && (candidate.result !== void 0 || !!candidate.error) && (is.string(candidate.id) || is.number(candidate.id) || candidate.id === null);\r
1500 }\r
1501 exports.isResponseMessage = isResponseMessage;\r
1502
1503
1504 /***/ }),
1505 /* 8 */
1506 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1507
1508 /* --------------------------------------------------------------------------------------------\r
1509  * Copyright (c) Microsoft Corporation. All rights reserved.\r
1510  * Licensed under the MIT License. See License.txt in the project root for license information.\r
1511  * ------------------------------------------------------------------------------------------ */\r
1512 \r
1513 Object.defineProperty(exports, "__esModule", ({ value: true }));\r
1514 const events_1 = __webpack_require__(9);\r
1515 const Is = __webpack_require__(6);\r
1516 let DefaultSize = 8192;\r
1517 let CR = Buffer.from('\r', 'ascii')[0];\r
1518 let LF = Buffer.from('\n', 'ascii')[0];\r
1519 let CRLF = '\r\n';\r
1520 class MessageBuffer {\r
1521     constructor(encoding = 'utf8') {\r
1522         this.encoding = encoding;\r
1523         this.index = 0;\r
1524         this.buffer = Buffer.allocUnsafe(DefaultSize);\r
1525     }\r
1526     append(chunk) {\r
1527         var toAppend = chunk;\r
1528         if (typeof (chunk) === 'string') {\r
1529             var str = chunk;\r
1530             var bufferLen = Buffer.byteLength(str, this.encoding);\r
1531             toAppend = Buffer.allocUnsafe(bufferLen);\r
1532             toAppend.write(str, 0, bufferLen, this.encoding);\r
1533         }\r
1534         if (this.buffer.length - this.index >= toAppend.length) {\r
1535             toAppend.copy(this.buffer, this.index, 0, toAppend.length);\r
1536         }\r
1537         else {\r
1538             var newSize = (Math.ceil((this.index + toAppend.length) / DefaultSize) + 1) * DefaultSize;\r
1539             if (this.index === 0) {\r
1540                 this.buffer = Buffer.allocUnsafe(newSize);\r
1541                 toAppend.copy(this.buffer, 0, 0, toAppend.length);\r
1542             }\r
1543             else {\r
1544                 this.buffer = Buffer.concat([this.buffer.slice(0, this.index), toAppend], newSize);\r
1545             }\r
1546         }\r
1547         this.index += toAppend.length;\r
1548     }\r
1549     tryReadHeaders() {\r
1550         let result = undefined;\r
1551         let current = 0;\r
1552         while (current + 3 < this.index && (this.buffer[current] !== CR || this.buffer[current + 1] !== LF || this.buffer[current + 2] !== CR || this.buffer[current + 3] !== LF)) {\r
1553             current++;\r
1554         }\r
1555         // No header / body separator found (e.g CRLFCRLF)\r
1556         if (current + 3 >= this.index) {\r
1557             return result;\r
1558         }\r
1559         result = Object.create(null);\r
1560         let headers = this.buffer.toString('ascii', 0, current).split(CRLF);\r
1561         headers.forEach((header) => {\r
1562             let index = header.indexOf(':');\r
1563             if (index === -1) {\r
1564                 throw new Error('Message header must separate key and value using :');\r
1565             }\r
1566             let key = header.substr(0, index);\r
1567             let value = header.substr(index + 1).trim();\r
1568             result[key] = value;\r
1569         });\r
1570         let nextStart = current + 4;\r
1571         this.buffer = this.buffer.slice(nextStart);\r
1572         this.index = this.index - nextStart;\r
1573         return result;\r
1574     }\r
1575     tryReadContent(length) {\r
1576         if (this.index < length) {\r
1577             return null;\r
1578         }\r
1579         let result = this.buffer.toString(this.encoding, 0, length);\r
1580         let nextStart = length;\r
1581         this.buffer.copy(this.buffer, 0, nextStart);\r
1582         this.index = this.index - nextStart;\r
1583         return result;\r
1584     }\r
1585     get numberOfBytes() {\r
1586         return this.index;\r
1587     }\r
1588 }\r
1589 var MessageReader;\r
1590 (function (MessageReader) {\r
1591     function is(value) {\r
1592         let candidate = value;\r
1593         return candidate && Is.func(candidate.listen) && Is.func(candidate.dispose) &&\r
1594             Is.func(candidate.onError) && Is.func(candidate.onClose) && Is.func(candidate.onPartialMessage);\r
1595     }\r
1596     MessageReader.is = is;\r
1597 })(MessageReader = exports.MessageReader || (exports.MessageReader = {}));\r
1598 class AbstractMessageReader {\r
1599     constructor() {\r
1600         this.errorEmitter = new events_1.Emitter();\r
1601         this.closeEmitter = new events_1.Emitter();\r
1602         this.partialMessageEmitter = new events_1.Emitter();\r
1603     }\r
1604     dispose() {\r
1605         this.errorEmitter.dispose();\r
1606         this.closeEmitter.dispose();\r
1607     }\r
1608     get onError() {\r
1609         return this.errorEmitter.event;\r
1610     }\r
1611     fireError(error) {\r
1612         this.errorEmitter.fire(this.asError(error));\r
1613     }\r
1614     get onClose() {\r
1615         return this.closeEmitter.event;\r
1616     }\r
1617     fireClose() {\r
1618         this.closeEmitter.fire(undefined);\r
1619     }\r
1620     get onPartialMessage() {\r
1621         return this.partialMessageEmitter.event;\r
1622     }\r
1623     firePartialMessage(info) {\r
1624         this.partialMessageEmitter.fire(info);\r
1625     }\r
1626     asError(error) {\r
1627         if (error instanceof Error) {\r
1628             return error;\r
1629         }\r
1630         else {\r
1631             return new Error(`Reader received error. Reason: ${Is.string(error.message) ? error.message : 'unknown'}`);\r
1632         }\r
1633     }\r
1634 }\r
1635 exports.AbstractMessageReader = AbstractMessageReader;\r
1636 class StreamMessageReader extends AbstractMessageReader {\r
1637     constructor(readable, encoding = 'utf8') {\r
1638         super();\r
1639         this.readable = readable;\r
1640         this.buffer = new MessageBuffer(encoding);\r
1641         this._partialMessageTimeout = 10000;\r
1642     }\r
1643     set partialMessageTimeout(timeout) {\r
1644         this._partialMessageTimeout = timeout;\r
1645     }\r
1646     get partialMessageTimeout() {\r
1647         return this._partialMessageTimeout;\r
1648     }\r
1649     listen(callback) {\r
1650         this.nextMessageLength = -1;\r
1651         this.messageToken = 0;\r
1652         this.partialMessageTimer = undefined;\r
1653         this.callback = callback;\r
1654         this.readable.on('data', (data) => {\r
1655             this.onData(data);\r
1656         });\r
1657         this.readable.on('error', (error) => this.fireError(error));\r
1658         this.readable.on('close', () => this.fireClose());\r
1659     }\r
1660     onData(data) {\r
1661         this.buffer.append(data);\r
1662         while (true) {\r
1663             if (this.nextMessageLength === -1) {\r
1664                 let headers = this.buffer.tryReadHeaders();\r
1665                 if (!headers) {\r
1666                     return;\r
1667                 }\r
1668                 let contentLength = headers['Content-Length'];\r
1669                 if (!contentLength) {\r
1670                     throw new Error('Header must provide a Content-Length property.');\r
1671                 }\r
1672                 let length = parseInt(contentLength);\r
1673                 if (isNaN(length)) {\r
1674                     throw new Error('Content-Length value must be a number.');\r
1675                 }\r
1676                 this.nextMessageLength = length;\r
1677                 // Take the encoding form the header. For compatibility\r
1678                 // treat both utf-8 and utf8 as node utf8\r
1679             }\r
1680             var msg = this.buffer.tryReadContent(this.nextMessageLength);\r
1681             if (msg === null) {\r
1682                 /** We haven't received the full message yet. */\r
1683                 this.setPartialMessageTimer();\r
1684                 return;\r
1685             }\r
1686             this.clearPartialMessageTimer();\r
1687             this.nextMessageLength = -1;\r
1688             this.messageToken++;\r
1689             var json = JSON.parse(msg);\r
1690             this.callback(json);\r
1691         }\r
1692     }\r
1693     clearPartialMessageTimer() {\r
1694         if (this.partialMessageTimer) {\r
1695             clearTimeout(this.partialMessageTimer);\r
1696             this.partialMessageTimer = undefined;\r
1697         }\r
1698     }\r
1699     setPartialMessageTimer() {\r
1700         this.clearPartialMessageTimer();\r
1701         if (this._partialMessageTimeout <= 0) {\r
1702             return;\r
1703         }\r
1704         this.partialMessageTimer = setTimeout((token, timeout) => {\r
1705             this.partialMessageTimer = undefined;\r
1706             if (token === this.messageToken) {\r
1707                 this.firePartialMessage({ messageToken: token, waitingTime: timeout });\r
1708                 this.setPartialMessageTimer();\r
1709             }\r
1710         }, this._partialMessageTimeout, this.messageToken, this._partialMessageTimeout);\r
1711     }\r
1712 }\r
1713 exports.StreamMessageReader = StreamMessageReader;\r
1714 class IPCMessageReader extends AbstractMessageReader {\r
1715     constructor(process) {\r
1716         super();\r
1717         this.process = process;\r
1718         let eventEmitter = this.process;\r
1719         eventEmitter.on('error', (error) => this.fireError(error));\r
1720         eventEmitter.on('close', () => this.fireClose());\r
1721     }\r
1722     listen(callback) {\r
1723         this.process.on('message', callback);\r
1724     }\r
1725 }\r
1726 exports.IPCMessageReader = IPCMessageReader;\r
1727 class SocketMessageReader extends StreamMessageReader {\r
1728     constructor(socket, encoding = 'utf-8') {\r
1729         super(socket, encoding);\r
1730     }\r
1731 }\r
1732 exports.SocketMessageReader = SocketMessageReader;\r
1733
1734
1735 /***/ }),
1736 /* 9 */
1737 /***/ ((__unused_webpack_module, exports) => {
1738
1739 /* --------------------------------------------------------------------------------------------\r
1740  * Copyright (c) Microsoft Corporation. All rights reserved.\r
1741  * Licensed under the MIT License. See License.txt in the project root for license information.\r
1742  * ------------------------------------------------------------------------------------------ */\r
1743 \r
1744 Object.defineProperty(exports, "__esModule", ({ value: true }));\r
1745 var Disposable;\r
1746 (function (Disposable) {\r
1747     function create(func) {\r
1748         return {\r
1749             dispose: func\r
1750         };\r
1751     }\r
1752     Disposable.create = create;\r
1753 })(Disposable = exports.Disposable || (exports.Disposable = {}));\r
1754 var Event;\r
1755 (function (Event) {\r
1756     const _disposable = { dispose() { } };\r
1757     Event.None = function () { return _disposable; };\r
1758 })(Event = exports.Event || (exports.Event = {}));\r
1759 class CallbackList {\r
1760     add(callback, context = null, bucket) {\r
1761         if (!this._callbacks) {\r
1762             this._callbacks = [];\r
1763             this._contexts = [];\r
1764         }\r
1765         this._callbacks.push(callback);\r
1766         this._contexts.push(context);\r
1767         if (Array.isArray(bucket)) {\r
1768             bucket.push({ dispose: () => this.remove(callback, context) });\r
1769         }\r
1770     }\r
1771     remove(callback, context = null) {\r
1772         if (!this._callbacks) {\r
1773             return;\r
1774         }\r
1775         var foundCallbackWithDifferentContext = false;\r
1776         for (var i = 0, len = this._callbacks.length; i < len; i++) {\r
1777             if (this._callbacks[i] === callback) {\r
1778                 if (this._contexts[i] === context) {\r
1779                     // callback & context match => remove it\r
1780                     this._callbacks.splice(i, 1);\r
1781                     this._contexts.splice(i, 1);\r
1782                     return;\r
1783                 }\r
1784                 else {\r
1785                     foundCallbackWithDifferentContext = true;\r
1786                 }\r
1787             }\r
1788         }\r
1789         if (foundCallbackWithDifferentContext) {\r
1790             throw new Error('When adding a listener with a context, you should remove it with the same context');\r
1791         }\r
1792     }\r
1793     invoke(...args) {\r
1794         if (!this._callbacks) {\r
1795             return [];\r
1796         }\r
1797         var ret = [], callbacks = this._callbacks.slice(0), contexts = this._contexts.slice(0);\r
1798         for (var i = 0, len = callbacks.length; i < len; i++) {\r
1799             try {\r
1800                 ret.push(callbacks[i].apply(contexts[i], args));\r
1801             }\r
1802             catch (e) {\r
1803                 // eslint-disable-next-line no-console\r
1804                 console.error(e);\r
1805             }\r
1806         }\r
1807         return ret;\r
1808     }\r
1809     isEmpty() {\r
1810         return !this._callbacks || this._callbacks.length === 0;\r
1811     }\r
1812     dispose() {\r
1813         this._callbacks = undefined;\r
1814         this._contexts = undefined;\r
1815     }\r
1816 }\r
1817 class Emitter {\r
1818     constructor(_options) {\r
1819         this._options = _options;\r
1820     }\r
1821     /**\r
1822      * For the public to allow to subscribe\r
1823      * to events from this Emitter\r
1824      */\r
1825     get event() {\r
1826         if (!this._event) {\r
1827             this._event = (listener, thisArgs, disposables) => {\r
1828                 if (!this._callbacks) {\r
1829                     this._callbacks = new CallbackList();\r
1830                 }\r
1831                 if (this._options && this._options.onFirstListenerAdd && this._callbacks.isEmpty()) {\r
1832                     this._options.onFirstListenerAdd(this);\r
1833                 }\r
1834                 this._callbacks.add(listener, thisArgs);\r
1835                 let result;\r
1836                 result = {\r
1837                     dispose: () => {\r
1838                         this._callbacks.remove(listener, thisArgs);\r
1839                         result.dispose = Emitter._noop;\r
1840                         if (this._options && this._options.onLastListenerRemove && this._callbacks.isEmpty()) {\r
1841                             this._options.onLastListenerRemove(this);\r
1842                         }\r
1843                     }\r
1844                 };\r
1845                 if (Array.isArray(disposables)) {\r
1846                     disposables.push(result);\r
1847                 }\r
1848                 return result;\r
1849             };\r
1850         }\r
1851         return this._event;\r
1852     }\r
1853     /**\r
1854      * To be kept private to fire an event to\r
1855      * subscribers\r
1856      */\r
1857     fire(event) {\r
1858         if (this._callbacks) {\r
1859             this._callbacks.invoke.call(this._callbacks, event);\r
1860         }\r
1861     }\r
1862     dispose() {\r
1863         if (this._callbacks) {\r
1864             this._callbacks.dispose();\r
1865             this._callbacks = undefined;\r
1866         }\r
1867     }\r
1868 }\r
1869 exports.Emitter = Emitter;\r
1870 Emitter._noop = function () { };\r
1871
1872
1873 /***/ }),
1874 /* 10 */
1875 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1876
1877 /* --------------------------------------------------------------------------------------------\r
1878  * Copyright (c) Microsoft Corporation. All rights reserved.\r
1879  * Licensed under the MIT License. See License.txt in the project root for license information.\r
1880  * ------------------------------------------------------------------------------------------ */\r
1881 \r
1882 Object.defineProperty(exports, "__esModule", ({ value: true }));\r
1883 const events_1 = __webpack_require__(9);\r
1884 const Is = __webpack_require__(6);\r
1885 let ContentLength = 'Content-Length: ';\r
1886 let CRLF = '\r\n';\r
1887 var MessageWriter;\r
1888 (function (MessageWriter) {\r
1889     function is(value) {\r
1890         let candidate = value;\r
1891         return candidate && Is.func(candidate.dispose) && Is.func(candidate.onClose) &&\r
1892             Is.func(candidate.onError) && Is.func(candidate.write);\r
1893     }\r
1894     MessageWriter.is = is;\r
1895 })(MessageWriter = exports.MessageWriter || (exports.MessageWriter = {}));\r
1896 class AbstractMessageWriter {\r
1897     constructor() {\r
1898         this.errorEmitter = new events_1.Emitter();\r
1899         this.closeEmitter = new events_1.Emitter();\r
1900     }\r
1901     dispose() {\r
1902         this.errorEmitter.dispose();\r
1903         this.closeEmitter.dispose();\r
1904     }\r
1905     get onError() {\r
1906         return this.errorEmitter.event;\r
1907     }\r
1908     fireError(error, message, count) {\r
1909         this.errorEmitter.fire([this.asError(error), message, count]);\r
1910     }\r
1911     get onClose() {\r
1912         return this.closeEmitter.event;\r
1913     }\r
1914     fireClose() {\r
1915         this.closeEmitter.fire(undefined);\r
1916     }\r
1917     asError(error) {\r
1918         if (error instanceof Error) {\r
1919             return error;\r
1920         }\r
1921         else {\r
1922             return new Error(`Writer received error. Reason: ${Is.string(error.message) ? error.message : 'unknown'}`);\r
1923         }\r
1924     }\r
1925 }\r
1926 exports.AbstractMessageWriter = AbstractMessageWriter;\r
1927 class StreamMessageWriter extends AbstractMessageWriter {\r
1928     constructor(writable, encoding = 'utf8') {\r
1929         super();\r
1930         this.writable = writable;\r
1931         this.encoding = encoding;\r
1932         this.errorCount = 0;\r
1933         this.writable.on('error', (error) => this.fireError(error));\r
1934         this.writable.on('close', () => this.fireClose());\r
1935     }\r
1936     write(msg) {\r
1937         let json = JSON.stringify(msg);\r
1938         let contentLength = Buffer.byteLength(json, this.encoding);\r
1939         let headers = [\r
1940             ContentLength, contentLength.toString(), CRLF,\r
1941             CRLF\r
1942         ];\r
1943         try {\r
1944             // Header must be written in ASCII encoding\r
1945             this.writable.write(headers.join(''), 'ascii');\r
1946             // Now write the content. This can be written in any encoding\r
1947             this.writable.write(json, this.encoding);\r
1948             this.errorCount = 0;\r
1949         }\r
1950         catch (error) {\r
1951             this.errorCount++;\r
1952             this.fireError(error, msg, this.errorCount);\r
1953         }\r
1954     }\r
1955 }\r
1956 exports.StreamMessageWriter = StreamMessageWriter;\r
1957 class IPCMessageWriter extends AbstractMessageWriter {\r
1958     constructor(process) {\r
1959         super();\r
1960         this.process = process;\r
1961         this.errorCount = 0;\r
1962         this.queue = [];\r
1963         this.sending = false;\r
1964         let eventEmitter = this.process;\r
1965         eventEmitter.on('error', (error) => this.fireError(error));\r
1966         eventEmitter.on('close', () => this.fireClose);\r
1967     }\r
1968     write(msg) {\r
1969         if (!this.sending && this.queue.length === 0) {\r
1970             // See https://github.com/nodejs/node/issues/7657\r
1971             this.doWriteMessage(msg);\r
1972         }\r
1973         else {\r
1974             this.queue.push(msg);\r
1975         }\r
1976     }\r
1977     doWriteMessage(msg) {\r
1978         try {\r
1979             if (this.process.send) {\r
1980                 this.sending = true;\r
1981                 this.process.send(msg, undefined, undefined, (error) => {\r
1982                     this.sending = false;\r
1983                     if (error) {\r
1984                         this.errorCount++;\r
1985                         this.fireError(error, msg, this.errorCount);\r
1986                     }\r
1987                     else {\r
1988                         this.errorCount = 0;\r
1989                     }\r
1990                     if (this.queue.length > 0) {\r
1991                         this.doWriteMessage(this.queue.shift());\r
1992                     }\r
1993                 });\r
1994             }\r
1995         }\r
1996         catch (error) {\r
1997             this.errorCount++;\r
1998             this.fireError(error, msg, this.errorCount);\r
1999         }\r
2000     }\r
2001 }\r
2002 exports.IPCMessageWriter = IPCMessageWriter;\r
2003 class SocketMessageWriter extends AbstractMessageWriter {\r
2004     constructor(socket, encoding = 'utf8') {\r
2005         super();\r
2006         this.socket = socket;\r
2007         this.queue = [];\r
2008         this.sending = false;\r
2009         this.encoding = encoding;\r
2010         this.errorCount = 0;\r
2011         this.socket.on('error', (error) => this.fireError(error));\r
2012         this.socket.on('close', () => this.fireClose());\r
2013     }\r
2014     dispose() {\r
2015         super.dispose();\r
2016         this.socket.destroy();\r
2017     }\r
2018     write(msg) {\r
2019         if (!this.sending && this.queue.length === 0) {\r
2020             // See https://github.com/nodejs/node/issues/7657\r
2021             this.doWriteMessage(msg);\r
2022         }\r
2023         else {\r
2024             this.queue.push(msg);\r
2025         }\r
2026     }\r
2027     doWriteMessage(msg) {\r
2028         let json = JSON.stringify(msg);\r
2029         let contentLength = Buffer.byteLength(json, this.encoding);\r
2030         let headers = [\r
2031             ContentLength, contentLength.toString(), CRLF,\r
2032             CRLF\r
2033         ];\r
2034         try {\r
2035             // Header must be written in ASCII encoding\r
2036             this.sending = true;\r
2037             this.socket.write(headers.join(''), 'ascii', (error) => {\r
2038                 if (error) {\r
2039                     this.handleError(error, msg);\r
2040                 }\r
2041                 try {\r
2042                     // Now write the content. This can be written in any encoding\r
2043                     this.socket.write(json, this.encoding, (error) => {\r
2044                         this.sending = false;\r
2045                         if (error) {\r
2046                             this.handleError(error, msg);\r
2047                         }\r
2048                         else {\r
2049                             this.errorCount = 0;\r
2050                         }\r
2051                         if (this.queue.length > 0) {\r
2052                             this.doWriteMessage(this.queue.shift());\r
2053                         }\r
2054                     });\r
2055                 }\r
2056                 catch (error) {\r
2057                     this.handleError(error, msg);\r
2058                 }\r
2059             });\r
2060         }\r
2061         catch (error) {\r
2062             this.handleError(error, msg);\r
2063         }\r
2064     }\r
2065     handleError(error, msg) {\r
2066         this.errorCount++;\r
2067         this.fireError(error, msg, this.errorCount);\r
2068     }\r
2069 }\r
2070 exports.SocketMessageWriter = SocketMessageWriter;\r
2071
2072
2073 /***/ }),
2074 /* 11 */
2075 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2076
2077 /*---------------------------------------------------------------------------------------------\r
2078  *  Copyright (c) Microsoft Corporation. All rights reserved.\r
2079  *  Licensed under the MIT License. See License.txt in the project root for license information.\r
2080  *--------------------------------------------------------------------------------------------*/\r
2081 \r
2082 Object.defineProperty(exports, "__esModule", ({ value: true }));\r
2083 const events_1 = __webpack_require__(9);\r
2084 const Is = __webpack_require__(6);\r
2085 var CancellationToken;\r
2086 (function (CancellationToken) {\r
2087     CancellationToken.None = Object.freeze({\r
2088         isCancellationRequested: false,\r
2089         onCancellationRequested: events_1.Event.None\r
2090     });\r
2091     CancellationToken.Cancelled = Object.freeze({\r
2092         isCancellationRequested: true,\r
2093         onCancellationRequested: events_1.Event.None\r
2094     });\r
2095     function is(value) {\r
2096         let candidate = value;\r
2097         return candidate && (candidate === CancellationToken.None\r
2098             || candidate === CancellationToken.Cancelled\r
2099             || (Is.boolean(candidate.isCancellationRequested) && !!candidate.onCancellationRequested));\r
2100     }\r
2101     CancellationToken.is = is;\r
2102 })(CancellationToken = exports.CancellationToken || (exports.CancellationToken = {}));\r
2103 const shortcutEvent = Object.freeze(function (callback, context) {\r
2104     let handle = setTimeout(callback.bind(context), 0);\r
2105     return { dispose() { clearTimeout(handle); } };\r
2106 });\r
2107 class MutableToken {\r
2108     constructor() {\r
2109         this._isCancelled = false;\r
2110     }\r
2111     cancel() {\r
2112         if (!this._isCancelled) {\r
2113             this._isCancelled = true;\r
2114             if (this._emitter) {\r
2115                 this._emitter.fire(undefined);\r
2116                 this.dispose();\r
2117             }\r
2118         }\r
2119     }\r
2120     get isCancellationRequested() {\r
2121         return this._isCancelled;\r
2122     }\r
2123     get onCancellationRequested() {\r
2124         if (this._isCancelled) {\r
2125             return shortcutEvent;\r
2126         }\r
2127         if (!this._emitter) {\r
2128             this._emitter = new events_1.Emitter();\r
2129         }\r
2130         return this._emitter.event;\r
2131     }\r
2132     dispose() {\r
2133         if (this._emitter) {\r
2134             this._emitter.dispose();\r
2135             this._emitter = undefined;\r
2136         }\r
2137     }\r
2138 }\r
2139 class CancellationTokenSource {\r
2140     get token() {\r
2141         if (!this._token) {\r
2142             // be lazy and create the token only when\r
2143             // actually needed\r
2144             this._token = new MutableToken();\r
2145         }\r
2146         return this._token;\r
2147     }\r
2148     cancel() {\r
2149         if (!this._token) {\r
2150             // save an object by returning the default\r
2151             // cancelled token when cancellation happens\r
2152             // before someone asks for the token\r
2153             this._token = CancellationToken.Cancelled;\r
2154         }\r
2155         else {\r
2156             this._token.cancel();\r
2157         }\r
2158     }\r
2159     dispose() {\r
2160         if (!this._token) {\r
2161             // ensure to initialize with an empty token if we had none\r
2162             this._token = CancellationToken.None;\r
2163         }\r
2164         else if (this._token instanceof MutableToken) {\r
2165             // actually dispose\r
2166             this._token.dispose();\r
2167         }\r
2168     }\r
2169 }\r
2170 exports.CancellationTokenSource = CancellationTokenSource;\r
2171
2172
2173 /***/ }),
2174 /* 12 */
2175 /***/ ((__unused_webpack_module, exports) => {
2176
2177 \r
2178 /*---------------------------------------------------------------------------------------------\r
2179  *  Copyright (c) Microsoft Corporation. All rights reserved.\r
2180  *  Licensed under the MIT License. See License.txt in the project root for license information.\r
2181  *--------------------------------------------------------------------------------------------*/\r
2182 Object.defineProperty(exports, "__esModule", ({ value: true }));\r
2183 var Touch;\r
2184 (function (Touch) {\r
2185     Touch.None = 0;\r
2186     Touch.First = 1;\r
2187     Touch.Last = 2;\r
2188 })(Touch = exports.Touch || (exports.Touch = {}));\r
2189 class LinkedMap {\r
2190     constructor() {\r
2191         this._map = new Map();\r
2192         this._head = undefined;\r
2193         this._tail = undefined;\r
2194         this._size = 0;\r
2195     }\r
2196     clear() {\r
2197         this._map.clear();\r
2198         this._head = undefined;\r
2199         this._tail = undefined;\r
2200         this._size = 0;\r
2201     }\r
2202     isEmpty() {\r
2203         return !this._head && !this._tail;\r
2204     }\r
2205     get size() {\r
2206         return this._size;\r
2207     }\r
2208     has(key) {\r
2209         return this._map.has(key);\r
2210     }\r
2211     get(key) {\r
2212         const item = this._map.get(key);\r
2213         if (!item) {\r
2214             return undefined;\r
2215         }\r
2216         return item.value;\r
2217     }\r
2218     set(key, value, touch = Touch.None) {\r
2219         let item = this._map.get(key);\r
2220         if (item) {\r
2221             item.value = value;\r
2222             if (touch !== Touch.None) {\r
2223                 this.touch(item, touch);\r
2224             }\r
2225         }\r
2226         else {\r
2227             item = { key, value, next: undefined, previous: undefined };\r
2228             switch (touch) {\r
2229                 case Touch.None:\r
2230                     this.addItemLast(item);\r
2231                     break;\r
2232                 case Touch.First:\r
2233                     this.addItemFirst(item);\r
2234                     break;\r
2235                 case Touch.Last:\r
2236                     this.addItemLast(item);\r
2237                     break;\r
2238                 default:\r
2239                     this.addItemLast(item);\r
2240                     break;\r
2241             }\r
2242             this._map.set(key, item);\r
2243             this._size++;\r
2244         }\r
2245     }\r
2246     delete(key) {\r
2247         const item = this._map.get(key);\r
2248         if (!item) {\r
2249             return false;\r
2250         }\r
2251         this._map.delete(key);\r
2252         this.removeItem(item);\r
2253         this._size--;\r
2254         return true;\r
2255     }\r
2256     shift() {\r
2257         if (!this._head && !this._tail) {\r
2258             return undefined;\r
2259         }\r
2260         if (!this._head || !this._tail) {\r
2261             throw new Error('Invalid list');\r
2262         }\r
2263         const item = this._head;\r
2264         this._map.delete(item.key);\r
2265         this.removeItem(item);\r
2266         this._size--;\r
2267         return item.value;\r
2268     }\r
2269     forEach(callbackfn, thisArg) {\r
2270         let current = this._head;\r
2271         while (current) {\r
2272             if (thisArg) {\r
2273                 callbackfn.bind(thisArg)(current.value, current.key, this);\r
2274             }\r
2275             else {\r
2276                 callbackfn(current.value, current.key, this);\r
2277             }\r
2278             current = current.next;\r
2279         }\r
2280     }\r
2281     forEachReverse(callbackfn, thisArg) {\r
2282         let current = this._tail;\r
2283         while (current) {\r
2284             if (thisArg) {\r
2285                 callbackfn.bind(thisArg)(current.value, current.key, this);\r
2286             }\r
2287             else {\r
2288                 callbackfn(current.value, current.key, this);\r
2289             }\r
2290             current = current.previous;\r
2291         }\r
2292     }\r
2293     values() {\r
2294         let result = [];\r
2295         let current = this._head;\r
2296         while (current) {\r
2297             result.push(current.value);\r
2298             current = current.next;\r
2299         }\r
2300         return result;\r
2301     }\r
2302     keys() {\r
2303         let result = [];\r
2304         let current = this._head;\r
2305         while (current) {\r
2306             result.push(current.key);\r
2307             current = current.next;\r
2308         }\r
2309         return result;\r
2310     }\r
2311     /* JSON RPC run on es5 which has no Symbol.iterator\r
2312     public keys(): IterableIterator<K> {\r
2313         let current = this._head;\r
2314         let iterator: IterableIterator<K> = {\r
2315             [Symbol.iterator]() {\r
2316                 return iterator;\r
2317             },\r
2318             next():IteratorResult<K> {\r
2319                 if (current) {\r
2320                     let result = { value: current.key, done: false };\r
2321                     current = current.next;\r
2322                     return result;\r
2323                 } else {\r
2324                     return { value: undefined, done: true };\r
2325                 }\r
2326             }\r
2327         };\r
2328         return iterator;\r
2329     }\r
2330 \r
2331     public values(): IterableIterator<V> {\r
2332         let current = this._head;\r
2333         let iterator: IterableIterator<V> = {\r
2334             [Symbol.iterator]() {\r
2335                 return iterator;\r
2336             },\r
2337             next():IteratorResult<V> {\r
2338                 if (current) {\r
2339                     let result = { value: current.value, done: false };\r
2340                     current = current.next;\r
2341                     return result;\r
2342                 } else {\r
2343                     return { value: undefined, done: true };\r
2344                 }\r
2345             }\r
2346         };\r
2347         return iterator;\r
2348     }\r
2349     */\r
2350     addItemFirst(item) {\r
2351         // First time Insert\r
2352         if (!this._head && !this._tail) {\r
2353             this._tail = item;\r
2354         }\r
2355         else if (!this._head) {\r
2356             throw new Error('Invalid list');\r
2357         }\r
2358         else {\r
2359             item.next = this._head;\r
2360             this._head.previous = item;\r
2361         }\r
2362         this._head = item;\r
2363     }\r
2364     addItemLast(item) {\r
2365         // First time Insert\r
2366         if (!this._head && !this._tail) {\r
2367             this._head = item;\r
2368         }\r
2369         else if (!this._tail) {\r
2370             throw new Error('Invalid list');\r
2371         }\r
2372         else {\r
2373             item.previous = this._tail;\r
2374             this._tail.next = item;\r
2375         }\r
2376         this._tail = item;\r
2377     }\r
2378     removeItem(item) {\r
2379         if (item === this._head && item === this._tail) {\r
2380             this._head = undefined;\r
2381             this._tail = undefined;\r
2382         }\r
2383         else if (item === this._head) {\r
2384             this._head = item.next;\r
2385         }\r
2386         else if (item === this._tail) {\r
2387             this._tail = item.previous;\r
2388         }\r
2389         else {\r
2390             const next = item.next;\r
2391             const previous = item.previous;\r
2392             if (!next || !previous) {\r
2393                 throw new Error('Invalid list');\r
2394             }\r
2395             next.previous = previous;\r
2396             previous.next = next;\r
2397         }\r
2398     }\r
2399     touch(item, touch) {\r
2400         if (!this._head || !this._tail) {\r
2401             throw new Error('Invalid list');\r
2402         }\r
2403         if ((touch !== Touch.First && touch !== Touch.Last)) {\r
2404             return;\r
2405         }\r
2406         if (touch === Touch.First) {\r
2407             if (item === this._head) {\r
2408                 return;\r
2409             }\r
2410             const next = item.next;\r
2411             const previous = item.previous;\r
2412             // Unlink the item\r
2413             if (item === this._tail) {\r
2414                 // previous must be defined since item was not head but is tail\r
2415                 // So there are more than on item in the map\r
2416                 previous.next = undefined;\r
2417                 this._tail = previous;\r
2418             }\r
2419             else {\r
2420                 // Both next and previous are not undefined since item was neither head nor tail.\r
2421                 next.previous = previous;\r
2422                 previous.next = next;\r
2423             }\r
2424             // Insert the node at head\r
2425             item.previous = undefined;\r
2426             item.next = this._head;\r
2427             this._head.previous = item;\r
2428             this._head = item;\r
2429         }\r
2430         else if (touch === Touch.Last) {\r
2431             if (item === this._tail) {\r
2432                 return;\r
2433             }\r
2434             const next = item.next;\r
2435             const previous = item.previous;\r
2436             // Unlink the item.\r
2437             if (item === this._head) {\r
2438                 // next must be defined since item was not tail but is head\r
2439                 // So there are more than on item in the map\r
2440                 next.previous = undefined;\r
2441                 this._head = next;\r
2442             }\r
2443             else {\r
2444                 // Both next and previous are not undefined since item was neither head nor tail.\r
2445                 next.previous = previous;\r
2446                 previous.next = next;\r
2447             }\r
2448             item.next = undefined;\r
2449             item.previous = this._tail;\r
2450             this._tail.next = item;\r
2451             this._tail = item;\r
2452         }\r
2453     }\r
2454 }\r
2455 exports.LinkedMap = LinkedMap;\r
2456
2457
2458 /***/ }),
2459 /* 13 */
2460 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2461
2462 /* --------------------------------------------------------------------------------------------\r
2463  * Copyright (c) Microsoft Corporation. All rights reserved.\r
2464  * Licensed under the MIT License. See License.txt in the project root for license information.\r
2465  * ------------------------------------------------------------------------------------------ */\r
2466 \r
2467 Object.defineProperty(exports, "__esModule", ({ value: true }));\r
2468 const path_1 = __webpack_require__(3);\r
2469 const os_1 = __webpack_require__(14);\r
2470 const crypto_1 = __webpack_require__(15);\r
2471 const net_1 = __webpack_require__(16);\r
2472 const messageReader_1 = __webpack_require__(8);\r
2473 const messageWriter_1 = __webpack_require__(10);\r
2474 function generateRandomPipeName() {\r
2475     const randomSuffix = crypto_1.randomBytes(21).toString('hex');\r
2476     if (process.platform === 'win32') {\r
2477         return `\\\\.\\pipe\\vscode-jsonrpc-${randomSuffix}-sock`;\r
2478     }\r
2479     else {\r
2480         // Mac/Unix: use socket file\r
2481         return path_1.join(os_1.tmpdir(), `vscode-${randomSuffix}.sock`);\r
2482     }\r
2483 }\r
2484 exports.generateRandomPipeName = generateRandomPipeName;\r
2485 function createClientPipeTransport(pipeName, encoding = 'utf-8') {\r
2486     let connectResolve;\r
2487     let connected = new Promise((resolve, _reject) => {\r
2488         connectResolve = resolve;\r
2489     });\r
2490     return new Promise((resolve, reject) => {\r
2491         let server = net_1.createServer((socket) => {\r
2492             server.close();\r
2493             connectResolve([\r
2494                 new messageReader_1.SocketMessageReader(socket, encoding),\r
2495                 new messageWriter_1.SocketMessageWriter(socket, encoding)\r
2496             ]);\r
2497         });\r
2498         server.on('error', reject);\r
2499         server.listen(pipeName, () => {\r
2500             server.removeListener('error', reject);\r
2501             resolve({\r
2502                 onConnected: () => { return connected; }\r
2503             });\r
2504         });\r
2505     });\r
2506 }\r
2507 exports.createClientPipeTransport = createClientPipeTransport;\r
2508 function createServerPipeTransport(pipeName, encoding = 'utf-8') {\r
2509     const socket = net_1.createConnection(pipeName);\r
2510     return [\r
2511         new messageReader_1.SocketMessageReader(socket, encoding),\r
2512         new messageWriter_1.SocketMessageWriter(socket, encoding)\r
2513     ];\r
2514 }\r
2515 exports.createServerPipeTransport = createServerPipeTransport;\r
2516
2517
2518 /***/ }),
2519 /* 14 */
2520 /***/ ((module) => {
2521
2522 module.exports = require("os");;
2523
2524 /***/ }),
2525 /* 15 */
2526 /***/ ((module) => {
2527
2528 module.exports = require("crypto");;
2529
2530 /***/ }),
2531 /* 16 */
2532 /***/ ((module) => {
2533
2534 module.exports = require("net");;
2535
2536 /***/ }),
2537 /* 17 */
2538 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2539
2540 /* --------------------------------------------------------------------------------------------\r
2541  * Copyright (c) Microsoft Corporation. All rights reserved.\r
2542  * Licensed under the MIT License. See License.txt in the project root for license information.\r
2543  * ------------------------------------------------------------------------------------------ */\r
2544 \r
2545 Object.defineProperty(exports, "__esModule", ({ value: true }));\r
2546 const net_1 = __webpack_require__(16);\r
2547 const messageReader_1 = __webpack_require__(8);\r
2548 const messageWriter_1 = __webpack_require__(10);\r
2549 function createClientSocketTransport(port, encoding = 'utf-8') {\r
2550     let connectResolve;\r
2551     let connected = new Promise((resolve, _reject) => {\r
2552         connectResolve = resolve;\r
2553     });\r
2554     return new Promise((resolve, reject) => {\r
2555         let server = net_1.createServer((socket) => {\r
2556             server.close();\r
2557             connectResolve([\r
2558                 new messageReader_1.SocketMessageReader(socket, encoding),\r
2559                 new messageWriter_1.SocketMessageWriter(socket, encoding)\r
2560             ]);\r
2561         });\r
2562         server.on('error', reject);\r
2563         server.listen(port, '127.0.0.1', () => {\r
2564             server.removeListener('error', reject);\r
2565             resolve({\r
2566                 onConnected: () => { return connected; }\r
2567             });\r
2568         });\r
2569     });\r
2570 }\r
2571 exports.createClientSocketTransport = createClientSocketTransport;\r
2572 function createServerSocketTransport(port, encoding = 'utf-8') {\r
2573     const socket = net_1.createConnection(port, '127.0.0.1');\r
2574     return [\r
2575         new messageReader_1.SocketMessageReader(socket, encoding),\r
2576         new messageWriter_1.SocketMessageWriter(socket, encoding)\r
2577     ];\r
2578 }\r
2579 exports.createServerSocketTransport = createServerSocketTransport;\r
2580
2581
2582 /***/ }),
2583 /* 18 */
2584 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2585
2586 __webpack_require__.r(__webpack_exports__);
2587 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2588 /* harmony export */   "Position": () => /* binding */ Position,
2589 /* harmony export */   "Range": () => /* binding */ Range,
2590 /* harmony export */   "Location": () => /* binding */ Location,
2591 /* harmony export */   "LocationLink": () => /* binding */ LocationLink,
2592 /* harmony export */   "Color": () => /* binding */ Color,
2593 /* harmony export */   "ColorInformation": () => /* binding */ ColorInformation,
2594 /* harmony export */   "ColorPresentation": () => /* binding */ ColorPresentation,
2595 /* harmony export */   "FoldingRangeKind": () => /* binding */ FoldingRangeKind,
2596 /* harmony export */   "FoldingRange": () => /* binding */ FoldingRange,
2597 /* harmony export */   "DiagnosticRelatedInformation": () => /* binding */ DiagnosticRelatedInformation,
2598 /* harmony export */   "DiagnosticSeverity": () => /* binding */ DiagnosticSeverity,
2599 /* harmony export */   "DiagnosticTag": () => /* binding */ DiagnosticTag,
2600 /* harmony export */   "Diagnostic": () => /* binding */ Diagnostic,
2601 /* harmony export */   "Command": () => /* binding */ Command,
2602 /* harmony export */   "TextEdit": () => /* binding */ TextEdit,
2603 /* harmony export */   "TextDocumentEdit": () => /* binding */ TextDocumentEdit,
2604 /* harmony export */   "CreateFile": () => /* binding */ CreateFile,
2605 /* harmony export */   "RenameFile": () => /* binding */ RenameFile,
2606 /* harmony export */   "DeleteFile": () => /* binding */ DeleteFile,
2607 /* harmony export */   "WorkspaceEdit": () => /* binding */ WorkspaceEdit,
2608 /* harmony export */   "WorkspaceChange": () => /* binding */ WorkspaceChange,
2609 /* harmony export */   "TextDocumentIdentifier": () => /* binding */ TextDocumentIdentifier,
2610 /* harmony export */   "VersionedTextDocumentIdentifier": () => /* binding */ VersionedTextDocumentIdentifier,
2611 /* harmony export */   "TextDocumentItem": () => /* binding */ TextDocumentItem,
2612 /* harmony export */   "MarkupKind": () => /* binding */ MarkupKind,
2613 /* harmony export */   "MarkupContent": () => /* binding */ MarkupContent,
2614 /* harmony export */   "CompletionItemKind": () => /* binding */ CompletionItemKind,
2615 /* harmony export */   "InsertTextFormat": () => /* binding */ InsertTextFormat,
2616 /* harmony export */   "CompletionItemTag": () => /* binding */ CompletionItemTag,
2617 /* harmony export */   "CompletionItem": () => /* binding */ CompletionItem,
2618 /* harmony export */   "CompletionList": () => /* binding */ CompletionList,
2619 /* harmony export */   "MarkedString": () => /* binding */ MarkedString,
2620 /* harmony export */   "Hover": () => /* binding */ Hover,
2621 /* harmony export */   "ParameterInformation": () => /* binding */ ParameterInformation,
2622 /* harmony export */   "SignatureInformation": () => /* binding */ SignatureInformation,
2623 /* harmony export */   "DocumentHighlightKind": () => /* binding */ DocumentHighlightKind,
2624 /* harmony export */   "DocumentHighlight": () => /* binding */ DocumentHighlight,
2625 /* harmony export */   "SymbolKind": () => /* binding */ SymbolKind,
2626 /* harmony export */   "SymbolTag": () => /* binding */ SymbolTag,
2627 /* harmony export */   "SymbolInformation": () => /* binding */ SymbolInformation,
2628 /* harmony export */   "DocumentSymbol": () => /* binding */ DocumentSymbol,
2629 /* harmony export */   "CodeActionKind": () => /* binding */ CodeActionKind,
2630 /* harmony export */   "CodeActionContext": () => /* binding */ CodeActionContext,
2631 /* harmony export */   "CodeAction": () => /* binding */ CodeAction,
2632 /* harmony export */   "CodeLens": () => /* binding */ CodeLens,
2633 /* harmony export */   "FormattingOptions": () => /* binding */ FormattingOptions,
2634 /* harmony export */   "DocumentLink": () => /* binding */ DocumentLink,
2635 /* harmony export */   "SelectionRange": () => /* binding */ SelectionRange,
2636 /* harmony export */   "EOL": () => /* binding */ EOL,
2637 /* harmony export */   "TextDocument": () => /* binding */ TextDocument
2638 /* harmony export */ });
2639 /* --------------------------------------------------------------------------------------------\r
2640  * Copyright (c) Microsoft Corporation. All rights reserved.\r
2641  * Licensed under the MIT License. See License.txt in the project root for license information.\r
2642  * ------------------------------------------------------------------------------------------ */\r
2643 \r
2644 /**\r
2645  * The Position namespace provides helper functions to work with\r
2646  * [Position](#Position) literals.\r
2647  */\r
2648 var Position;\r
2649 (function (Position) {\r
2650     /**\r
2651      * Creates a new Position literal from the given line and character.\r
2652      * @param line The position's line.\r
2653      * @param character The position's character.\r
2654      */\r
2655     function create(line, character) {\r
2656         return { line: line, character: character };\r
2657     }\r
2658     Position.create = create;\r
2659     /**\r
2660      * Checks whether the given liternal conforms to the [Position](#Position) interface.\r
2661      */\r
2662     function is(value) {\r
2663         var candidate = value;\r
2664         return Is.objectLiteral(candidate) && Is.number(candidate.line) && Is.number(candidate.character);\r
2665     }\r
2666     Position.is = is;\r
2667 })(Position || (Position = {}));\r
2668 /**\r
2669  * The Range namespace provides helper functions to work with\r
2670  * [Range](#Range) literals.\r
2671  */\r
2672 var Range;\r
2673 (function (Range) {\r
2674     function create(one, two, three, four) {\r
2675         if (Is.number(one) && Is.number(two) && Is.number(three) && Is.number(four)) {\r
2676             return { start: Position.create(one, two), end: Position.create(three, four) };\r
2677         }\r
2678         else if (Position.is(one) && Position.is(two)) {\r
2679             return { start: one, end: two };\r
2680         }\r
2681         else {\r
2682             throw new Error("Range#create called with invalid arguments[" + one + ", " + two + ", " + three + ", " + four + "]");\r
2683         }\r
2684     }\r
2685     Range.create = create;\r
2686     /**\r
2687      * Checks whether the given literal conforms to the [Range](#Range) interface.\r
2688      */\r
2689     function is(value) {\r
2690         var candidate = value;\r
2691         return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);\r
2692     }\r
2693     Range.is = is;\r
2694 })(Range || (Range = {}));\r
2695 /**\r
2696  * The Location namespace provides helper functions to work with\r
2697  * [Location](#Location) literals.\r
2698  */\r
2699 var Location;\r
2700 (function (Location) {\r
2701     /**\r
2702      * Creates a Location literal.\r
2703      * @param uri The location's uri.\r
2704      * @param range The location's range.\r
2705      */\r
2706     function create(uri, range) {\r
2707         return { uri: uri, range: range };\r
2708     }\r
2709     Location.create = create;\r
2710     /**\r
2711      * Checks whether the given literal conforms to the [Location](#Location) interface.\r
2712      */\r
2713     function is(value) {\r
2714         var candidate = value;\r
2715         return Is.defined(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri));\r
2716     }\r
2717     Location.is = is;\r
2718 })(Location || (Location = {}));\r
2719 /**\r
2720  * The LocationLink namespace provides helper functions to work with\r
2721  * [LocationLink](#LocationLink) literals.\r
2722  */\r
2723 var LocationLink;\r
2724 (function (LocationLink) {\r
2725     /**\r
2726      * Creates a LocationLink literal.\r
2727      * @param targetUri The definition's uri.\r
2728      * @param targetRange The full range of the definition.\r
2729      * @param targetSelectionRange The span of the symbol definition at the target.\r
2730      * @param originSelectionRange The span of the symbol being defined in the originating source file.\r
2731      */\r
2732     function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) {\r
2733         return { targetUri: targetUri, targetRange: targetRange, targetSelectionRange: targetSelectionRange, originSelectionRange: originSelectionRange };\r
2734     }\r
2735     LocationLink.create = create;\r
2736     /**\r
2737      * Checks whether the given literal conforms to the [LocationLink](#LocationLink) interface.\r
2738      */\r
2739     function is(value) {\r
2740         var candidate = value;\r
2741         return Is.defined(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri)\r
2742             && (Range.is(candidate.targetSelectionRange) || Is.undefined(candidate.targetSelectionRange))\r
2743             && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange));\r
2744     }\r
2745     LocationLink.is = is;\r
2746 })(LocationLink || (LocationLink = {}));\r
2747 /**\r
2748  * The Color namespace provides helper functions to work with\r
2749  * [Color](#Color) literals.\r
2750  */\r
2751 var Color;\r
2752 (function (Color) {\r
2753     /**\r
2754      * Creates a new Color literal.\r
2755      */\r
2756     function create(red, green, blue, alpha) {\r
2757         return {\r
2758             red: red,\r
2759             green: green,\r
2760             blue: blue,\r
2761             alpha: alpha,\r
2762         };\r
2763     }\r
2764     Color.create = create;\r
2765     /**\r
2766      * Checks whether the given literal conforms to the [Color](#Color) interface.\r
2767      */\r
2768     function is(value) {\r
2769         var candidate = value;\r
2770         return Is.number(candidate.red)\r
2771             && Is.number(candidate.green)\r
2772             && Is.number(candidate.blue)\r
2773             && Is.number(candidate.alpha);\r
2774     }\r
2775     Color.is = is;\r
2776 })(Color || (Color = {}));\r
2777 /**\r
2778  * The ColorInformation namespace provides helper functions to work with\r
2779  * [ColorInformation](#ColorInformation) literals.\r
2780  */\r
2781 var ColorInformation;\r
2782 (function (ColorInformation) {\r
2783     /**\r
2784      * Creates a new ColorInformation literal.\r
2785      */\r
2786     function create(range, color) {\r
2787         return {\r
2788             range: range,\r
2789             color: color,\r
2790         };\r
2791     }\r
2792     ColorInformation.create = create;\r
2793     /**\r
2794      * Checks whether the given literal conforms to the [ColorInformation](#ColorInformation) interface.\r
2795      */\r
2796     function is(value) {\r
2797         var candidate = value;\r
2798         return Range.is(candidate.range) && Color.is(candidate.color);\r
2799     }\r
2800     ColorInformation.is = is;\r
2801 })(ColorInformation || (ColorInformation = {}));\r
2802 /**\r
2803  * The Color namespace provides helper functions to work with\r
2804  * [ColorPresentation](#ColorPresentation) literals.\r
2805  */\r
2806 var ColorPresentation;\r
2807 (function (ColorPresentation) {\r
2808     /**\r
2809      * Creates a new ColorInformation literal.\r
2810      */\r
2811     function create(label, textEdit, additionalTextEdits) {\r
2812         return {\r
2813             label: label,\r
2814             textEdit: textEdit,\r
2815             additionalTextEdits: additionalTextEdits,\r
2816         };\r
2817     }\r
2818     ColorPresentation.create = create;\r
2819     /**\r
2820      * Checks whether the given literal conforms to the [ColorInformation](#ColorInformation) interface.\r
2821      */\r
2822     function is(value) {\r
2823         var candidate = value;\r
2824         return Is.string(candidate.label)\r
2825             && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate))\r
2826             && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is));\r
2827     }\r
2828     ColorPresentation.is = is;\r
2829 })(ColorPresentation || (ColorPresentation = {}));\r
2830 /**\r
2831  * Enum of known range kinds\r
2832  */\r
2833 var FoldingRangeKind;\r
2834 (function (FoldingRangeKind) {\r
2835     /**\r
2836      * Folding range for a comment\r
2837      */\r
2838     FoldingRangeKind["Comment"] = "comment";\r
2839     /**\r
2840      * Folding range for a imports or includes\r
2841      */\r
2842     FoldingRangeKind["Imports"] = "imports";\r
2843     /**\r
2844      * Folding range for a region (e.g. `#region`)\r
2845      */\r
2846     FoldingRangeKind["Region"] = "region";\r
2847 })(FoldingRangeKind || (FoldingRangeKind = {}));\r
2848 /**\r
2849  * The folding range namespace provides helper functions to work with\r
2850  * [FoldingRange](#FoldingRange) literals.\r
2851  */\r
2852 var FoldingRange;\r
2853 (function (FoldingRange) {\r
2854     /**\r
2855      * Creates a new FoldingRange literal.\r
2856      */\r
2857     function create(startLine, endLine, startCharacter, endCharacter, kind) {\r
2858         var result = {\r
2859             startLine: startLine,\r
2860             endLine: endLine\r
2861         };\r
2862         if (Is.defined(startCharacter)) {\r
2863             result.startCharacter = startCharacter;\r
2864         }\r
2865         if (Is.defined(endCharacter)) {\r
2866             result.endCharacter = endCharacter;\r
2867         }\r
2868         if (Is.defined(kind)) {\r
2869             result.kind = kind;\r
2870         }\r
2871         return result;\r
2872     }\r
2873     FoldingRange.create = create;\r
2874     /**\r
2875      * Checks whether the given literal conforms to the [FoldingRange](#FoldingRange) interface.\r
2876      */\r
2877     function is(value) {\r
2878         var candidate = value;\r
2879         return Is.number(candidate.startLine) && Is.number(candidate.startLine)\r
2880             && (Is.undefined(candidate.startCharacter) || Is.number(candidate.startCharacter))\r
2881             && (Is.undefined(candidate.endCharacter) || Is.number(candidate.endCharacter))\r
2882             && (Is.undefined(candidate.kind) || Is.string(candidate.kind));\r
2883     }\r
2884     FoldingRange.is = is;\r
2885 })(FoldingRange || (FoldingRange = {}));\r
2886 /**\r
2887  * The DiagnosticRelatedInformation namespace provides helper functions to work with\r
2888  * [DiagnosticRelatedInformation](#DiagnosticRelatedInformation) literals.\r
2889  */\r
2890 var DiagnosticRelatedInformation;\r
2891 (function (DiagnosticRelatedInformation) {\r
2892     /**\r
2893      * Creates a new DiagnosticRelatedInformation literal.\r
2894      */\r
2895     function create(location, message) {\r
2896         return {\r
2897             location: location,\r
2898             message: message\r
2899         };\r
2900     }\r
2901     DiagnosticRelatedInformation.create = create;\r
2902     /**\r
2903      * Checks whether the given literal conforms to the [DiagnosticRelatedInformation](#DiagnosticRelatedInformation) interface.\r
2904      */\r
2905     function is(value) {\r
2906         var candidate = value;\r
2907         return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message);\r
2908     }\r
2909     DiagnosticRelatedInformation.is = is;\r
2910 })(DiagnosticRelatedInformation || (DiagnosticRelatedInformation = {}));\r
2911 /**\r
2912  * The diagnostic's severity.\r
2913  */\r
2914 var DiagnosticSeverity;\r
2915 (function (DiagnosticSeverity) {\r
2916     /**\r
2917      * Reports an error.\r
2918      */\r
2919     DiagnosticSeverity.Error = 1;\r
2920     /**\r
2921      * Reports a warning.\r
2922      */\r
2923     DiagnosticSeverity.Warning = 2;\r
2924     /**\r
2925      * Reports an information.\r
2926      */\r
2927     DiagnosticSeverity.Information = 3;\r
2928     /**\r
2929      * Reports a hint.\r
2930      */\r
2931     DiagnosticSeverity.Hint = 4;\r
2932 })(DiagnosticSeverity || (DiagnosticSeverity = {}));\r
2933 /**\r
2934  * The diagnostic tags.\r
2935  *\r
2936  * @since 3.15.0\r
2937  */\r
2938 var DiagnosticTag;\r
2939 (function (DiagnosticTag) {\r
2940     /**\r
2941      * Unused or unnecessary code.\r
2942      *\r
2943      * Clients are allowed to render diagnostics with this tag faded out instead of having\r
2944      * an error squiggle.\r
2945      */\r
2946     DiagnosticTag.Unnecessary = 1;\r
2947     /**\r
2948      * Deprecated or obsolete code.\r
2949      *\r
2950      * Clients are allowed to rendered diagnostics with this tag strike through.\r
2951      */\r
2952     DiagnosticTag.Deprecated = 2;\r
2953 })(DiagnosticTag || (DiagnosticTag = {}));\r
2954 /**\r
2955  * The Diagnostic namespace provides helper functions to work with\r
2956  * [Diagnostic](#Diagnostic) literals.\r
2957  */\r
2958 var Diagnostic;\r
2959 (function (Diagnostic) {\r
2960     /**\r
2961      * Creates a new Diagnostic literal.\r
2962      */\r
2963     function create(range, message, severity, code, source, relatedInformation) {\r
2964         var result = { range: range, message: message };\r
2965         if (Is.defined(severity)) {\r
2966             result.severity = severity;\r
2967         }\r
2968         if (Is.defined(code)) {\r
2969             result.code = code;\r
2970         }\r
2971         if (Is.defined(source)) {\r
2972             result.source = source;\r
2973         }\r
2974         if (Is.defined(relatedInformation)) {\r
2975             result.relatedInformation = relatedInformation;\r
2976         }\r
2977         return result;\r
2978     }\r
2979     Diagnostic.create = create;\r
2980     /**\r
2981      * Checks whether the given literal conforms to the [Diagnostic](#Diagnostic) interface.\r
2982      */\r
2983     function is(value) {\r
2984         var candidate = value;\r
2985         return Is.defined(candidate)\r
2986             && Range.is(candidate.range)\r
2987             && Is.string(candidate.message)\r
2988             && (Is.number(candidate.severity) || Is.undefined(candidate.severity))\r
2989             && (Is.number(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code))\r
2990             && (Is.string(candidate.source) || Is.undefined(candidate.source))\r
2991             && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is));\r
2992     }\r
2993     Diagnostic.is = is;\r
2994 })(Diagnostic || (Diagnostic = {}));\r
2995 /**\r
2996  * The Command namespace provides helper functions to work with\r
2997  * [Command](#Command) literals.\r
2998  */\r
2999 var Command;\r
3000 (function (Command) {\r
3001     /**\r
3002      * Creates a new Command literal.\r
3003      */\r
3004     function create(title, command) {\r
3005         var args = [];\r
3006         for (var _i = 2; _i < arguments.length; _i++) {\r
3007             args[_i - 2] = arguments[_i];\r
3008         }\r
3009         var result = { title: title, command: command };\r
3010         if (Is.defined(args) && args.length > 0) {\r
3011             result.arguments = args;\r
3012         }\r
3013         return result;\r
3014     }\r
3015     Command.create = create;\r
3016     /**\r
3017      * Checks whether the given literal conforms to the [Command](#Command) interface.\r
3018      */\r
3019     function is(value) {\r
3020         var candidate = value;\r
3021         return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command);\r
3022     }\r
3023     Command.is = is;\r
3024 })(Command || (Command = {}));\r
3025 /**\r
3026  * The TextEdit namespace provides helper function to create replace,\r
3027  * insert and delete edits more easily.\r
3028  */\r
3029 var TextEdit;\r
3030 (function (TextEdit) {\r
3031     /**\r
3032      * Creates a replace text edit.\r
3033      * @param range The range of text to be replaced.\r
3034      * @param newText The new text.\r
3035      */\r
3036     function replace(range, newText) {\r
3037         return { range: range, newText: newText };\r
3038     }\r
3039     TextEdit.replace = replace;\r
3040     /**\r
3041      * Creates a insert text edit.\r
3042      * @param position The position to insert the text at.\r
3043      * @param newText The text to be inserted.\r
3044      */\r
3045     function insert(position, newText) {\r
3046         return { range: { start: position, end: position }, newText: newText };\r
3047     }\r
3048     TextEdit.insert = insert;\r
3049     /**\r
3050      * Creates a delete text edit.\r
3051      * @param range The range of text to be deleted.\r
3052      */\r
3053     function del(range) {\r
3054         return { range: range, newText: '' };\r
3055     }\r
3056     TextEdit.del = del;\r
3057     function is(value) {\r
3058         var candidate = value;\r
3059         return Is.objectLiteral(candidate)\r
3060             && Is.string(candidate.newText)\r
3061             && Range.is(candidate.range);\r
3062     }\r
3063     TextEdit.is = is;\r
3064 })(TextEdit || (TextEdit = {}));\r
3065 /**\r
3066  * The TextDocumentEdit namespace provides helper function to create\r
3067  * an edit that manipulates a text document.\r
3068  */\r
3069 var TextDocumentEdit;\r
3070 (function (TextDocumentEdit) {\r
3071     /**\r
3072      * Creates a new `TextDocumentEdit`\r
3073      */\r
3074     function create(textDocument, edits) {\r
3075         return { textDocument: textDocument, edits: edits };\r
3076     }\r
3077     TextDocumentEdit.create = create;\r
3078     function is(value) {\r
3079         var candidate = value;\r
3080         return Is.defined(candidate)\r
3081             && VersionedTextDocumentIdentifier.is(candidate.textDocument)\r
3082             && Array.isArray(candidate.edits);\r
3083     }\r
3084     TextDocumentEdit.is = is;\r
3085 })(TextDocumentEdit || (TextDocumentEdit = {}));\r
3086 var CreateFile;\r
3087 (function (CreateFile) {\r
3088     function create(uri, options) {\r
3089         var result = {\r
3090             kind: 'create',\r
3091             uri: uri\r
3092         };\r
3093         if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) {\r
3094             result.options = options;\r
3095         }\r
3096         return result;\r
3097     }\r
3098     CreateFile.create = create;\r
3099     function is(value) {\r
3100         var candidate = value;\r
3101         return candidate && candidate.kind === 'create' && Is.string(candidate.uri) &&\r
3102             (candidate.options === void 0 ||\r
3103                 ((candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))));\r
3104     }\r
3105     CreateFile.is = is;\r
3106 })(CreateFile || (CreateFile = {}));\r
3107 var RenameFile;\r
3108 (function (RenameFile) {\r
3109     function create(oldUri, newUri, options) {\r
3110         var result = {\r
3111             kind: 'rename',\r
3112             oldUri: oldUri,\r
3113             newUri: newUri\r
3114         };\r
3115         if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) {\r
3116             result.options = options;\r
3117         }\r
3118         return result;\r
3119     }\r
3120     RenameFile.create = create;\r
3121     function is(value) {\r
3122         var candidate = value;\r
3123         return candidate && candidate.kind === 'rename' && Is.string(candidate.oldUri) && Is.string(candidate.newUri) &&\r
3124             (candidate.options === void 0 ||\r
3125                 ((candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))));\r
3126     }\r
3127     RenameFile.is = is;\r
3128 })(RenameFile || (RenameFile = {}));\r
3129 var DeleteFile;\r
3130 (function (DeleteFile) {\r
3131     function create(uri, options) {\r
3132         var result = {\r
3133             kind: 'delete',\r
3134             uri: uri\r
3135         };\r
3136         if (options !== void 0 && (options.recursive !== void 0 || options.ignoreIfNotExists !== void 0)) {\r
3137             result.options = options;\r
3138         }\r
3139         return result;\r
3140     }\r
3141     DeleteFile.create = create;\r
3142     function is(value) {\r
3143         var candidate = value;\r
3144         return candidate && candidate.kind === 'delete' && Is.string(candidate.uri) &&\r
3145             (candidate.options === void 0 ||\r
3146                 ((candidate.options.recursive === void 0 || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === void 0 || Is.boolean(candidate.options.ignoreIfNotExists))));\r
3147     }\r
3148     DeleteFile.is = is;\r
3149 })(DeleteFile || (DeleteFile = {}));\r
3150 var WorkspaceEdit;\r
3151 (function (WorkspaceEdit) {\r
3152     function is(value) {\r
3153         var candidate = value;\r
3154         return candidate &&\r
3155             (candidate.changes !== void 0 || candidate.documentChanges !== void 0) &&\r
3156             (candidate.documentChanges === void 0 || candidate.documentChanges.every(function (change) {\r
3157                 if (Is.string(change.kind)) {\r
3158                     return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change);\r
3159                 }\r
3160                 else {\r
3161                     return TextDocumentEdit.is(change);\r
3162                 }\r
3163             }));\r
3164     }\r
3165     WorkspaceEdit.is = is;\r
3166 })(WorkspaceEdit || (WorkspaceEdit = {}));\r
3167 var TextEditChangeImpl = /** @class */ (function () {\r
3168     function TextEditChangeImpl(edits) {\r
3169         this.edits = edits;\r
3170     }\r
3171     TextEditChangeImpl.prototype.insert = function (position, newText) {\r
3172         this.edits.push(TextEdit.insert(position, newText));\r
3173     };\r
3174     TextEditChangeImpl.prototype.replace = function (range, newText) {\r
3175         this.edits.push(TextEdit.replace(range, newText));\r
3176     };\r
3177     TextEditChangeImpl.prototype.delete = function (range) {\r
3178         this.edits.push(TextEdit.del(range));\r
3179     };\r
3180     TextEditChangeImpl.prototype.add = function (edit) {\r
3181         this.edits.push(edit);\r
3182     };\r
3183     TextEditChangeImpl.prototype.all = function () {\r
3184         return this.edits;\r
3185     };\r
3186     TextEditChangeImpl.prototype.clear = function () {\r
3187         this.edits.splice(0, this.edits.length);\r
3188     };\r
3189     return TextEditChangeImpl;\r
3190 }());\r
3191 /**\r
3192  * A workspace change helps constructing changes to a workspace.\r
3193  */\r
3194 var WorkspaceChange = /** @class */ (function () {\r
3195     function WorkspaceChange(workspaceEdit) {\r
3196         var _this = this;\r
3197         this._textEditChanges = Object.create(null);\r
3198         if (workspaceEdit) {\r
3199             this._workspaceEdit = workspaceEdit;\r
3200             if (workspaceEdit.documentChanges) {\r
3201                 workspaceEdit.documentChanges.forEach(function (change) {\r
3202                     if (TextDocumentEdit.is(change)) {\r
3203                         var textEditChange = new TextEditChangeImpl(change.edits);\r
3204                         _this._textEditChanges[change.textDocument.uri] = textEditChange;\r
3205                     }\r
3206                 });\r
3207             }\r
3208             else if (workspaceEdit.changes) {\r
3209                 Object.keys(workspaceEdit.changes).forEach(function (key) {\r
3210                     var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]);\r
3211                     _this._textEditChanges[key] = textEditChange;\r
3212                 });\r
3213             }\r
3214         }\r
3215     }\r
3216     Object.defineProperty(WorkspaceChange.prototype, "edit", {\r
3217         /**\r
3218          * Returns the underlying [WorkspaceEdit](#WorkspaceEdit) literal\r
3219          * use to be returned from a workspace edit operation like rename.\r
3220          */\r
3221         get: function () {\r
3222             return this._workspaceEdit;\r
3223         },\r
3224         enumerable: true,\r
3225         configurable: true\r
3226     });\r
3227     WorkspaceChange.prototype.getTextEditChange = function (key) {\r
3228         if (VersionedTextDocumentIdentifier.is(key)) {\r
3229             if (!this._workspaceEdit) {\r
3230                 this._workspaceEdit = {\r
3231                     documentChanges: []\r
3232                 };\r
3233             }\r
3234             if (!this._workspaceEdit.documentChanges) {\r
3235                 throw new Error('Workspace edit is not configured for document changes.');\r
3236             }\r
3237             var textDocument = key;\r
3238             var result = this._textEditChanges[textDocument.uri];\r
3239             if (!result) {\r
3240                 var edits = [];\r
3241                 var textDocumentEdit = {\r
3242                     textDocument: textDocument,\r
3243                     edits: edits\r
3244                 };\r
3245                 this._workspaceEdit.documentChanges.push(textDocumentEdit);\r
3246                 result = new TextEditChangeImpl(edits);\r
3247                 this._textEditChanges[textDocument.uri] = result;\r
3248             }\r
3249             return result;\r
3250         }\r
3251         else {\r
3252             if (!this._workspaceEdit) {\r
3253                 this._workspaceEdit = {\r
3254                     changes: Object.create(null)\r
3255                 };\r
3256             }\r
3257             if (!this._workspaceEdit.changes) {\r
3258                 throw new Error('Workspace edit is not configured for normal text edit changes.');\r
3259             }\r
3260             var result = this._textEditChanges[key];\r
3261             if (!result) {\r
3262                 var edits = [];\r
3263                 this._workspaceEdit.changes[key] = edits;\r
3264                 result = new TextEditChangeImpl(edits);\r
3265                 this._textEditChanges[key] = result;\r
3266             }\r
3267             return result;\r
3268         }\r
3269     };\r
3270     WorkspaceChange.prototype.createFile = function (uri, options) {\r
3271         this.checkDocumentChanges();\r
3272         this._workspaceEdit.documentChanges.push(CreateFile.create(uri, options));\r
3273     };\r
3274     WorkspaceChange.prototype.renameFile = function (oldUri, newUri, options) {\r
3275         this.checkDocumentChanges();\r
3276         this._workspaceEdit.documentChanges.push(RenameFile.create(oldUri, newUri, options));\r
3277     };\r
3278     WorkspaceChange.prototype.deleteFile = function (uri, options) {\r
3279         this.checkDocumentChanges();\r
3280         this._workspaceEdit.documentChanges.push(DeleteFile.create(uri, options));\r
3281     };\r
3282     WorkspaceChange.prototype.checkDocumentChanges = function () {\r
3283         if (!this._workspaceEdit || !this._workspaceEdit.documentChanges) {\r
3284             throw new Error('Workspace edit is not configured for document changes.');\r
3285         }\r
3286     };\r
3287     return WorkspaceChange;\r
3288 }());\r
3289 \r
3290 /**\r
3291  * The TextDocumentIdentifier namespace provides helper functions to work with\r
3292  * [TextDocumentIdentifier](#TextDocumentIdentifier) literals.\r
3293  */\r
3294 var TextDocumentIdentifier;\r
3295 (function (TextDocumentIdentifier) {\r
3296     /**\r
3297      * Creates a new TextDocumentIdentifier literal.\r
3298      * @param uri The document's uri.\r
3299      */\r
3300     function create(uri) {\r
3301         return { uri: uri };\r
3302     }\r
3303     TextDocumentIdentifier.create = create;\r
3304     /**\r
3305      * Checks whether the given literal conforms to the [TextDocumentIdentifier](#TextDocumentIdentifier) interface.\r
3306      */\r
3307     function is(value) {\r
3308         var candidate = value;\r
3309         return Is.defined(candidate) && Is.string(candidate.uri);\r
3310     }\r
3311     TextDocumentIdentifier.is = is;\r
3312 })(TextDocumentIdentifier || (TextDocumentIdentifier = {}));\r
3313 /**\r
3314  * The VersionedTextDocumentIdentifier namespace provides helper functions to work with\r
3315  * [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) literals.\r
3316  */\r
3317 var VersionedTextDocumentIdentifier;\r
3318 (function (VersionedTextDocumentIdentifier) {\r
3319     /**\r
3320      * Creates a new VersionedTextDocumentIdentifier literal.\r
3321      * @param uri The document's uri.\r
3322      * @param uri The document's text.\r
3323      */\r
3324     function create(uri, version) {\r
3325         return { uri: uri, version: version };\r
3326     }\r
3327     VersionedTextDocumentIdentifier.create = create;\r
3328     /**\r
3329      * Checks whether the given literal conforms to the [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) interface.\r
3330      */\r
3331     function is(value) {\r
3332         var candidate = value;\r
3333         return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.number(candidate.version));\r
3334     }\r
3335     VersionedTextDocumentIdentifier.is = is;\r
3336 })(VersionedTextDocumentIdentifier || (VersionedTextDocumentIdentifier = {}));\r
3337 /**\r
3338  * The TextDocumentItem namespace provides helper functions to work with\r
3339  * [TextDocumentItem](#TextDocumentItem) literals.\r
3340  */\r
3341 var TextDocumentItem;\r
3342 (function (TextDocumentItem) {\r
3343     /**\r
3344      * Creates a new TextDocumentItem literal.\r
3345      * @param uri The document's uri.\r
3346      * @param languageId The document's language identifier.\r
3347      * @param version The document's version number.\r
3348      * @param text The document's text.\r
3349      */\r
3350     function create(uri, languageId, version, text) {\r
3351         return { uri: uri, languageId: languageId, version: version, text: text };\r
3352     }\r
3353     TextDocumentItem.create = create;\r
3354     /**\r
3355      * Checks whether the given literal conforms to the [TextDocumentItem](#TextDocumentItem) interface.\r
3356      */\r
3357     function is(value) {\r
3358         var candidate = value;\r
3359         return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.number(candidate.version) && Is.string(candidate.text);\r
3360     }\r
3361     TextDocumentItem.is = is;\r
3362 })(TextDocumentItem || (TextDocumentItem = {}));\r
3363 /**\r
3364  * Describes the content type that a client supports in various\r
3365  * result literals like `Hover`, `ParameterInfo` or `CompletionItem`.\r
3366  *\r
3367  * Please note that `MarkupKinds` must not start with a `$`. This kinds\r
3368  * are reserved for internal usage.\r
3369  */\r
3370 var MarkupKind;\r
3371 (function (MarkupKind) {\r
3372     /**\r
3373      * Plain text is supported as a content format\r
3374      */\r
3375     MarkupKind.PlainText = 'plaintext';\r
3376     /**\r
3377      * Markdown is supported as a content format\r
3378      */\r
3379     MarkupKind.Markdown = 'markdown';\r
3380 })(MarkupKind || (MarkupKind = {}));\r
3381 (function (MarkupKind) {\r
3382     /**\r
3383      * Checks whether the given value is a value of the [MarkupKind](#MarkupKind) type.\r
3384      */\r
3385     function is(value) {\r
3386         var candidate = value;\r
3387         return candidate === MarkupKind.PlainText || candidate === MarkupKind.Markdown;\r
3388     }\r
3389     MarkupKind.is = is;\r
3390 })(MarkupKind || (MarkupKind = {}));\r
3391 var MarkupContent;\r
3392 (function (MarkupContent) {\r
3393     /**\r
3394      * Checks whether the given value conforms to the [MarkupContent](#MarkupContent) interface.\r
3395      */\r
3396     function is(value) {\r
3397         var candidate = value;\r
3398         return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);\r
3399     }\r
3400     MarkupContent.is = is;\r
3401 })(MarkupContent || (MarkupContent = {}));\r
3402 /**\r
3403  * The kind of a completion entry.\r
3404  */\r
3405 var CompletionItemKind;\r
3406 (function (CompletionItemKind) {\r
3407     CompletionItemKind.Text = 1;\r
3408     CompletionItemKind.Method = 2;\r
3409     CompletionItemKind.Function = 3;\r
3410     CompletionItemKind.Constructor = 4;\r
3411     CompletionItemKind.Field = 5;\r
3412     CompletionItemKind.Variable = 6;\r
3413     CompletionItemKind.Class = 7;\r
3414     CompletionItemKind.Interface = 8;\r
3415     CompletionItemKind.Module = 9;\r
3416     CompletionItemKind.Property = 10;\r
3417     CompletionItemKind.Unit = 11;\r
3418     CompletionItemKind.Value = 12;\r
3419     CompletionItemKind.Enum = 13;\r
3420     CompletionItemKind.Keyword = 14;\r
3421     CompletionItemKind.Snippet = 15;\r
3422     CompletionItemKind.Color = 16;\r
3423     CompletionItemKind.File = 17;\r
3424     CompletionItemKind.Reference = 18;\r
3425     CompletionItemKind.Folder = 19;\r
3426     CompletionItemKind.EnumMember = 20;\r
3427     CompletionItemKind.Constant = 21;\r
3428     CompletionItemKind.Struct = 22;\r
3429     CompletionItemKind.Event = 23;\r
3430     CompletionItemKind.Operator = 24;\r
3431     CompletionItemKind.TypeParameter = 25;\r
3432 })(CompletionItemKind || (CompletionItemKind = {}));\r
3433 /**\r
3434  * Defines whether the insert text in a completion item should be interpreted as\r
3435  * plain text or a snippet.\r
3436  */\r
3437 var InsertTextFormat;\r
3438 (function (InsertTextFormat) {\r
3439     /**\r
3440      * The primary text to be inserted is treated as a plain string.\r
3441      */\r
3442     InsertTextFormat.PlainText = 1;\r
3443     /**\r
3444      * The primary text to be inserted is treated as a snippet.\r
3445      *\r
3446      * A snippet can define tab stops and placeholders with `$1`, `$2`\r
3447      * and `${3:foo}`. `$0` defines the final tab stop, it defaults to\r
3448      * the end of the snippet. Placeholders with equal identifiers are linked,\r
3449      * that is typing in one will update others too.\r
3450      *\r
3451      * See also: https://github.com/Microsoft/vscode/blob/master/src/vs/editor/contrib/snippet/common/snippet.md\r
3452      */\r
3453     InsertTextFormat.Snippet = 2;\r
3454 })(InsertTextFormat || (InsertTextFormat = {}));\r
3455 /**\r
3456  * Completion item tags are extra annotations that tweak the rendering of a completion\r
3457  * item.\r
3458  *\r
3459  * @since 3.15.0\r
3460  */\r
3461 var CompletionItemTag;\r
3462 (function (CompletionItemTag) {\r
3463     /**\r
3464      * Render a completion as obsolete, usually using a strike-out.\r
3465      */\r
3466     CompletionItemTag.Deprecated = 1;\r
3467 })(CompletionItemTag || (CompletionItemTag = {}));\r
3468 /**\r
3469  * The CompletionItem namespace provides functions to deal with\r
3470  * completion items.\r
3471  */\r
3472 var CompletionItem;\r
3473 (function (CompletionItem) {\r
3474     /**\r
3475      * Create a completion item and seed it with a label.\r
3476      * @param label The completion item's label\r
3477      */\r
3478     function create(label) {\r
3479         return { label: label };\r
3480     }\r
3481     CompletionItem.create = create;\r
3482 })(CompletionItem || (CompletionItem = {}));\r
3483 /**\r
3484  * The CompletionList namespace provides functions to deal with\r
3485  * completion lists.\r
3486  */\r
3487 var CompletionList;\r
3488 (function (CompletionList) {\r
3489     /**\r
3490      * Creates a new completion list.\r
3491      *\r
3492      * @param items The completion items.\r
3493      * @param isIncomplete The list is not complete.\r
3494      */\r
3495     function create(items, isIncomplete) {\r
3496         return { items: items ? items : [], isIncomplete: !!isIncomplete };\r
3497     }\r
3498     CompletionList.create = create;\r
3499 })(CompletionList || (CompletionList = {}));\r
3500 var MarkedString;\r
3501 (function (MarkedString) {\r
3502     /**\r
3503      * Creates a marked string from plain text.\r
3504      *\r
3505      * @param plainText The plain text.\r
3506      */\r
3507     function fromPlainText(plainText) {\r
3508         return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, '\\$&'); // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash\r
3509     }\r
3510     MarkedString.fromPlainText = fromPlainText;\r
3511     /**\r
3512      * Checks whether the given value conforms to the [MarkedString](#MarkedString) type.\r
3513      */\r
3514     function is(value) {\r
3515         var candidate = value;\r
3516         return Is.string(candidate) || (Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value));\r
3517     }\r
3518     MarkedString.is = is;\r
3519 })(MarkedString || (MarkedString = {}));\r
3520 var Hover;\r
3521 (function (Hover) {\r
3522     /**\r
3523      * Checks whether the given value conforms to the [Hover](#Hover) interface.\r
3524      */\r
3525     function is(value) {\r
3526         var candidate = value;\r
3527         return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) ||\r
3528             MarkedString.is(candidate.contents) ||\r
3529             Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === void 0 || Range.is(value.range));\r
3530     }\r
3531     Hover.is = is;\r
3532 })(Hover || (Hover = {}));\r
3533 /**\r
3534  * The ParameterInformation namespace provides helper functions to work with\r
3535  * [ParameterInformation](#ParameterInformation) literals.\r
3536  */\r
3537 var ParameterInformation;\r
3538 (function (ParameterInformation) {\r
3539     /**\r
3540      * Creates a new parameter information literal.\r
3541      *\r
3542      * @param label A label string.\r
3543      * @param documentation A doc string.\r
3544      */\r
3545     function create(label, documentation) {\r
3546         return documentation ? { label: label, documentation: documentation } : { label: label };\r
3547     }\r
3548     ParameterInformation.create = create;\r
3549 })(ParameterInformation || (ParameterInformation = {}));\r
3550 /**\r
3551  * The SignatureInformation namespace provides helper functions to work with\r
3552  * [SignatureInformation](#SignatureInformation) literals.\r
3553  */\r
3554 var SignatureInformation;\r
3555 (function (SignatureInformation) {\r
3556     function create(label, documentation) {\r
3557         var parameters = [];\r
3558         for (var _i = 2; _i < arguments.length; _i++) {\r
3559             parameters[_i - 2] = arguments[_i];\r
3560         }\r
3561         var result = { label: label };\r
3562         if (Is.defined(documentation)) {\r
3563             result.documentation = documentation;\r
3564         }\r
3565         if (Is.defined(parameters)) {\r
3566             result.parameters = parameters;\r
3567         }\r
3568         else {\r
3569             result.parameters = [];\r
3570         }\r
3571         return result;\r
3572     }\r
3573     SignatureInformation.create = create;\r
3574 })(SignatureInformation || (SignatureInformation = {}));\r
3575 /**\r
3576  * A document highlight kind.\r
3577  */\r
3578 var DocumentHighlightKind;\r
3579 (function (DocumentHighlightKind) {\r
3580     /**\r
3581      * A textual occurrence.\r
3582      */\r
3583     DocumentHighlightKind.Text = 1;\r
3584     /**\r
3585      * Read-access of a symbol, like reading a variable.\r
3586      */\r
3587     DocumentHighlightKind.Read = 2;\r
3588     /**\r
3589      * Write-access of a symbol, like writing to a variable.\r
3590      */\r
3591     DocumentHighlightKind.Write = 3;\r
3592 })(DocumentHighlightKind || (DocumentHighlightKind = {}));\r
3593 /**\r
3594  * DocumentHighlight namespace to provide helper functions to work with\r
3595  * [DocumentHighlight](#DocumentHighlight) literals.\r
3596  */\r
3597 var DocumentHighlight;\r
3598 (function (DocumentHighlight) {\r
3599     /**\r
3600      * Create a DocumentHighlight object.\r
3601      * @param range The range the highlight applies to.\r
3602      */\r
3603     function create(range, kind) {\r
3604         var result = { range: range };\r
3605         if (Is.number(kind)) {\r
3606             result.kind = kind;\r
3607         }\r
3608         return result;\r
3609     }\r
3610     DocumentHighlight.create = create;\r
3611 })(DocumentHighlight || (DocumentHighlight = {}));\r
3612 /**\r
3613  * A symbol kind.\r
3614  */\r
3615 var SymbolKind;\r
3616 (function (SymbolKind) {\r
3617     SymbolKind.File = 1;\r
3618     SymbolKind.Module = 2;\r
3619     SymbolKind.Namespace = 3;\r
3620     SymbolKind.Package = 4;\r
3621     SymbolKind.Class = 5;\r
3622     SymbolKind.Method = 6;\r
3623     SymbolKind.Property = 7;\r
3624     SymbolKind.Field = 8;\r
3625     SymbolKind.Constructor = 9;\r
3626     SymbolKind.Enum = 10;\r
3627     SymbolKind.Interface = 11;\r
3628     SymbolKind.Function = 12;\r
3629     SymbolKind.Variable = 13;\r
3630     SymbolKind.Constant = 14;\r
3631     SymbolKind.String = 15;\r
3632     SymbolKind.Number = 16;\r
3633     SymbolKind.Boolean = 17;\r
3634     SymbolKind.Array = 18;\r
3635     SymbolKind.Object = 19;\r
3636     SymbolKind.Key = 20;\r
3637     SymbolKind.Null = 21;\r
3638     SymbolKind.EnumMember = 22;\r
3639     SymbolKind.Struct = 23;\r
3640     SymbolKind.Event = 24;\r
3641     SymbolKind.Operator = 25;\r
3642     SymbolKind.TypeParameter = 26;\r
3643 })(SymbolKind || (SymbolKind = {}));\r
3644 /**\r
3645  * Symbol tags are extra annotations that tweak the rendering of a symbol.\r
3646  * @since 3.15\r
3647  */\r
3648 var SymbolTag;\r
3649 (function (SymbolTag) {\r
3650     /**\r
3651      * Render a symbol as obsolete, usually using a strike-out.\r
3652      */\r
3653     SymbolTag.Deprecated = 1;\r
3654 })(SymbolTag || (SymbolTag = {}));\r
3655 var SymbolInformation;\r
3656 (function (SymbolInformation) {\r
3657     /**\r
3658      * Creates a new symbol information literal.\r
3659      *\r
3660      * @param name The name of the symbol.\r
3661      * @param kind The kind of the symbol.\r
3662      * @param range The range of the location of the symbol.\r
3663      * @param uri The resource of the location of symbol, defaults to the current document.\r
3664      * @param containerName The name of the symbol containing the symbol.\r
3665      */\r
3666     function create(name, kind, range, uri, containerName) {\r
3667         var result = {\r
3668             name: name,\r
3669             kind: kind,\r
3670             location: { uri: uri, range: range }\r
3671         };\r
3672         if (containerName) {\r
3673             result.containerName = containerName;\r
3674         }\r
3675         return result;\r
3676     }\r
3677     SymbolInformation.create = create;\r
3678 })(SymbolInformation || (SymbolInformation = {}));\r
3679 var DocumentSymbol;\r
3680 (function (DocumentSymbol) {\r
3681     /**\r
3682      * Creates a new symbol information literal.\r
3683      *\r
3684      * @param name The name of the symbol.\r
3685      * @param detail The detail of the symbol.\r
3686      * @param kind The kind of the symbol.\r
3687      * @param range The range of the symbol.\r
3688      * @param selectionRange The selectionRange of the symbol.\r
3689      * @param children Children of the symbol.\r
3690      */\r
3691     function create(name, detail, kind, range, selectionRange, children) {\r
3692         var result = {\r
3693             name: name,\r
3694             detail: detail,\r
3695             kind: kind,\r
3696             range: range,\r
3697             selectionRange: selectionRange\r
3698         };\r
3699         if (children !== void 0) {\r
3700             result.children = children;\r
3701         }\r
3702         return result;\r
3703     }\r
3704     DocumentSymbol.create = create;\r
3705     /**\r
3706      * Checks whether the given literal conforms to the [DocumentSymbol](#DocumentSymbol) interface.\r
3707      */\r
3708     function is(value) {\r
3709         var candidate = value;\r
3710         return candidate &&\r
3711             Is.string(candidate.name) && Is.number(candidate.kind) &&\r
3712             Range.is(candidate.range) && Range.is(candidate.selectionRange) &&\r
3713             (candidate.detail === void 0 || Is.string(candidate.detail)) &&\r
3714             (candidate.deprecated === void 0 || Is.boolean(candidate.deprecated)) &&\r
3715             (candidate.children === void 0 || Array.isArray(candidate.children));\r
3716     }\r
3717     DocumentSymbol.is = is;\r
3718 })(DocumentSymbol || (DocumentSymbol = {}));\r
3719 /**\r
3720  * A set of predefined code action kinds\r
3721  */\r
3722 var CodeActionKind;\r
3723 (function (CodeActionKind) {\r
3724     /**\r
3725      * Empty kind.\r
3726      */\r
3727     CodeActionKind.Empty = '';\r
3728     /**\r
3729      * Base kind for quickfix actions: 'quickfix'\r
3730      */\r
3731     CodeActionKind.QuickFix = 'quickfix';\r
3732     /**\r
3733      * Base kind for refactoring actions: 'refactor'\r
3734      */\r
3735     CodeActionKind.Refactor = 'refactor';\r
3736     /**\r
3737      * Base kind for refactoring extraction actions: 'refactor.extract'\r
3738      *\r
3739      * Example extract actions:\r
3740      *\r
3741      * - Extract method\r
3742      * - Extract function\r
3743      * - Extract variable\r
3744      * - Extract interface from class\r
3745      * - ...\r
3746      */\r
3747     CodeActionKind.RefactorExtract = 'refactor.extract';\r
3748     /**\r
3749      * Base kind for refactoring inline actions: 'refactor.inline'\r
3750      *\r
3751      * Example inline actions:\r
3752      *\r
3753      * - Inline function\r
3754      * - Inline variable\r
3755      * - Inline constant\r
3756      * - ...\r
3757      */\r
3758     CodeActionKind.RefactorInline = 'refactor.inline';\r
3759     /**\r
3760      * Base kind for refactoring rewrite actions: 'refactor.rewrite'\r
3761      *\r
3762      * Example rewrite actions:\r
3763      *\r
3764      * - Convert JavaScript function to class\r
3765      * - Add or remove parameter\r
3766      * - Encapsulate field\r
3767      * - Make method static\r
3768      * - Move method to base class\r
3769      * - ...\r
3770      */\r
3771     CodeActionKind.RefactorRewrite = 'refactor.rewrite';\r
3772     /**\r
3773      * Base kind for source actions: `source`\r
3774      *\r
3775      * Source code actions apply to the entire file.\r
3776      */\r
3777     CodeActionKind.Source = 'source';\r
3778     /**\r
3779      * Base kind for an organize imports source action: `source.organizeImports`\r
3780      */\r
3781     CodeActionKind.SourceOrganizeImports = 'source.organizeImports';\r
3782     /**\r
3783      * Base kind for auto-fix source actions: `source.fixAll`.\r
3784      *\r
3785      * Fix all actions automatically fix errors that have a clear fix that do not require user input.\r
3786      * They should not suppress errors or perform unsafe fixes such as generating new types or classes.\r
3787      *\r
3788      * @since 3.15.0\r
3789      */\r
3790     CodeActionKind.SourceFixAll = 'source.fixAll';\r
3791 })(CodeActionKind || (CodeActionKind = {}));\r
3792 /**\r
3793  * The CodeActionContext namespace provides helper functions to work with\r
3794  * [CodeActionContext](#CodeActionContext) literals.\r
3795  */\r
3796 var CodeActionContext;\r
3797 (function (CodeActionContext) {\r
3798     /**\r
3799      * Creates a new CodeActionContext literal.\r
3800      */\r
3801     function create(diagnostics, only) {\r
3802         var result = { diagnostics: diagnostics };\r
3803         if (only !== void 0 && only !== null) {\r
3804             result.only = only;\r
3805         }\r
3806         return result;\r
3807     }\r
3808     CodeActionContext.create = create;\r
3809     /**\r
3810      * Checks whether the given literal conforms to the [CodeActionContext](#CodeActionContext) interface.\r
3811      */\r
3812     function is(value) {\r
3813         var candidate = value;\r
3814         return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string));\r
3815     }\r
3816     CodeActionContext.is = is;\r
3817 })(CodeActionContext || (CodeActionContext = {}));\r
3818 var CodeAction;\r
3819 (function (CodeAction) {\r
3820     function create(title, commandOrEdit, kind) {\r
3821         var result = { title: title };\r
3822         if (Command.is(commandOrEdit)) {\r
3823             result.command = commandOrEdit;\r
3824         }\r
3825         else {\r
3826             result.edit = commandOrEdit;\r
3827         }\r
3828         if (kind !== void 0) {\r
3829             result.kind = kind;\r
3830         }\r
3831         return result;\r
3832     }\r
3833     CodeAction.create = create;\r
3834     function is(value) {\r
3835         var candidate = value;\r
3836         return candidate && Is.string(candidate.title) &&\r
3837             (candidate.diagnostics === void 0 || Is.typedArray(candidate.diagnostics, Diagnostic.is)) &&\r
3838             (candidate.kind === void 0 || Is.string(candidate.kind)) &&\r
3839             (candidate.edit !== void 0 || candidate.command !== void 0) &&\r
3840             (candidate.command === void 0 || Command.is(candidate.command)) &&\r
3841             (candidate.isPreferred === void 0 || Is.boolean(candidate.isPreferred)) &&\r
3842             (candidate.edit === void 0 || WorkspaceEdit.is(candidate.edit));\r
3843     }\r
3844     CodeAction.is = is;\r
3845 })(CodeAction || (CodeAction = {}));\r
3846 /**\r
3847  * The CodeLens namespace provides helper functions to work with\r
3848  * [CodeLens](#CodeLens) literals.\r
3849  */\r
3850 var CodeLens;\r
3851 (function (CodeLens) {\r
3852     /**\r
3853      * Creates a new CodeLens literal.\r
3854      */\r
3855     function create(range, data) {\r
3856         var result = { range: range };\r
3857         if (Is.defined(data)) {\r
3858             result.data = data;\r
3859         }\r
3860         return result;\r
3861     }\r
3862     CodeLens.create = create;\r
3863     /**\r
3864      * Checks whether the given literal conforms to the [CodeLens](#CodeLens) interface.\r
3865      */\r
3866     function is(value) {\r
3867         var candidate = value;\r
3868         return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command));\r
3869     }\r
3870     CodeLens.is = is;\r
3871 })(CodeLens || (CodeLens = {}));\r
3872 /**\r
3873  * The FormattingOptions namespace provides helper functions to work with\r
3874  * [FormattingOptions](#FormattingOptions) literals.\r
3875  */\r
3876 var FormattingOptions;\r
3877 (function (FormattingOptions) {\r
3878     /**\r
3879      * Creates a new FormattingOptions literal.\r
3880      */\r
3881     function create(tabSize, insertSpaces) {\r
3882         return { tabSize: tabSize, insertSpaces: insertSpaces };\r
3883     }\r
3884     FormattingOptions.create = create;\r
3885     /**\r
3886      * Checks whether the given literal conforms to the [FormattingOptions](#FormattingOptions) interface.\r
3887      */\r
3888     function is(value) {\r
3889         var candidate = value;\r
3890         return Is.defined(candidate) && Is.number(candidate.tabSize) && Is.boolean(candidate.insertSpaces);\r
3891     }\r
3892     FormattingOptions.is = is;\r
3893 })(FormattingOptions || (FormattingOptions = {}));\r
3894 /**\r
3895  * The DocumentLink namespace provides helper functions to work with\r
3896  * [DocumentLink](#DocumentLink) literals.\r
3897  */\r
3898 var DocumentLink;\r
3899 (function (DocumentLink) {\r
3900     /**\r
3901      * Creates a new DocumentLink literal.\r
3902      */\r
3903     function create(range, target, data) {\r
3904         return { range: range, target: target, data: data };\r
3905     }\r
3906     DocumentLink.create = create;\r
3907     /**\r
3908      * Checks whether the given literal conforms to the [DocumentLink](#DocumentLink) interface.\r
3909      */\r
3910     function is(value) {\r
3911         var candidate = value;\r
3912         return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target));\r
3913     }\r
3914     DocumentLink.is = is;\r
3915 })(DocumentLink || (DocumentLink = {}));\r
3916 /**\r
3917  * The SelectionRange namespace provides helper function to work with\r
3918  * SelectionRange literals.\r
3919  */\r
3920 var SelectionRange;\r
3921 (function (SelectionRange) {\r
3922     /**\r
3923      * Creates a new SelectionRange\r
3924      * @param range the range.\r
3925      * @param parent an optional parent.\r
3926      */\r
3927     function create(range, parent) {\r
3928         return { range: range, parent: parent };\r
3929     }\r
3930     SelectionRange.create = create;\r
3931     function is(value) {\r
3932         var candidate = value;\r
3933         return candidate !== undefined && Range.is(candidate.range) && (candidate.parent === undefined || SelectionRange.is(candidate.parent));\r
3934     }\r
3935     SelectionRange.is = is;\r
3936 })(SelectionRange || (SelectionRange = {}));\r
3937 var EOL = ['\n', '\r\n', '\r'];\r
3938 /**\r
3939  * @deprecated Use the text document from the new vscode-languageserver-textdocument package.\r
3940  */\r
3941 var TextDocument;\r
3942 (function (TextDocument) {\r
3943     /**\r
3944      * Creates a new ITextDocument literal from the given uri and content.\r
3945      * @param uri The document's uri.\r
3946      * @param languageId  The document's language Id.\r
3947      * @param content The document's content.\r
3948      */\r
3949     function create(uri, languageId, version, content) {\r
3950         return new FullTextDocument(uri, languageId, version, content);\r
3951     }\r
3952     TextDocument.create = create;\r
3953     /**\r
3954      * Checks whether the given literal conforms to the [ITextDocument](#ITextDocument) interface.\r
3955      */\r
3956     function is(value) {\r
3957         var candidate = value;\r
3958         return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.number(candidate.lineCount)\r
3959             && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;\r
3960     }\r
3961     TextDocument.is = is;\r
3962     function applyEdits(document, edits) {\r
3963         var text = document.getText();\r
3964         var sortedEdits = mergeSort(edits, function (a, b) {\r
3965             var diff = a.range.start.line - b.range.start.line;\r
3966             if (diff === 0) {\r
3967                 return a.range.start.character - b.range.start.character;\r
3968             }\r
3969             return diff;\r
3970         });\r
3971         var lastModifiedOffset = text.length;\r
3972         for (var i = sortedEdits.length - 1; i >= 0; i--) {\r
3973             var e = sortedEdits[i];\r
3974             var startOffset = document.offsetAt(e.range.start);\r
3975             var endOffset = document.offsetAt(e.range.end);\r
3976             if (endOffset <= lastModifiedOffset) {\r
3977                 text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length);\r
3978             }\r
3979             else {\r
3980                 throw new Error('Overlapping edit');\r
3981             }\r
3982             lastModifiedOffset = startOffset;\r
3983         }\r
3984         return text;\r
3985     }\r
3986     TextDocument.applyEdits = applyEdits;\r
3987     function mergeSort(data, compare) {\r
3988         if (data.length <= 1) {\r
3989             // sorted\r
3990             return data;\r
3991         }\r
3992         var p = (data.length / 2) | 0;\r
3993         var left = data.slice(0, p);\r
3994         var right = data.slice(p);\r
3995         mergeSort(left, compare);\r
3996         mergeSort(right, compare);\r
3997         var leftIdx = 0;\r
3998         var rightIdx = 0;\r
3999         var i = 0;\r
4000         while (leftIdx < left.length && rightIdx < right.length) {\r
4001             var ret = compare(left[leftIdx], right[rightIdx]);\r
4002             if (ret <= 0) {\r
4003                 // smaller_equal -> take left to preserve order\r
4004                 data[i++] = left[leftIdx++];\r
4005             }\r
4006             else {\r
4007                 // greater -> take right\r
4008                 data[i++] = right[rightIdx++];\r
4009             }\r
4010         }\r
4011         while (leftIdx < left.length) {\r
4012             data[i++] = left[leftIdx++];\r
4013         }\r
4014         while (rightIdx < right.length) {\r
4015             data[i++] = right[rightIdx++];\r
4016         }\r
4017         return data;\r
4018     }\r
4019 })(TextDocument || (TextDocument = {}));\r
4020 var FullTextDocument = /** @class */ (function () {\r
4021     function FullTextDocument(uri, languageId, version, content) {\r
4022         this._uri = uri;\r
4023         this._languageId = languageId;\r
4024         this._version = version;\r
4025         this._content = content;\r
4026         this._lineOffsets = undefined;\r
4027     }\r
4028     Object.defineProperty(FullTextDocument.prototype, "uri", {\r
4029         get: function () {\r
4030             return this._uri;\r
4031         },\r
4032         enumerable: true,\r
4033         configurable: true\r
4034     });\r
4035     Object.defineProperty(FullTextDocument.prototype, "languageId", {\r
4036         get: function () {\r
4037             return this._languageId;\r
4038         },\r
4039         enumerable: true,\r
4040         configurable: true\r
4041     });\r
4042     Object.defineProperty(FullTextDocument.prototype, "version", {\r
4043         get: function () {\r
4044             return this._version;\r
4045         },\r
4046         enumerable: true,\r
4047         configurable: true\r
4048     });\r
4049     FullTextDocument.prototype.getText = function (range) {\r
4050         if (range) {\r
4051             var start = this.offsetAt(range.start);\r
4052             var end = this.offsetAt(range.end);\r
4053             return this._content.substring(start, end);\r
4054         }\r
4055         return this._content;\r
4056     };\r
4057     FullTextDocument.prototype.update = function (event, version) {\r
4058         this._content = event.text;\r
4059         this._version = version;\r
4060         this._lineOffsets = undefined;\r
4061     };\r
4062     FullTextDocument.prototype.getLineOffsets = function () {\r
4063         if (this._lineOffsets === undefined) {\r
4064             var lineOffsets = [];\r
4065             var text = this._content;\r
4066             var isLineStart = true;\r
4067             for (var i = 0; i < text.length; i++) {\r
4068                 if (isLineStart) {\r
4069                     lineOffsets.push(i);\r
4070                     isLineStart = false;\r
4071                 }\r
4072                 var ch = text.charAt(i);\r
4073                 isLineStart = (ch === '\r' || ch === '\n');\r
4074                 if (ch === '\r' && i + 1 < text.length && text.charAt(i + 1) === '\n') {\r
4075                     i++;\r
4076                 }\r
4077             }\r
4078             if (isLineStart && text.length > 0) {\r
4079                 lineOffsets.push(text.length);\r
4080             }\r
4081             this._lineOffsets = lineOffsets;\r
4082         }\r
4083         return this._lineOffsets;\r
4084     };\r
4085     FullTextDocument.prototype.positionAt = function (offset) {\r
4086         offset = Math.max(Math.min(offset, this._content.length), 0);\r
4087         var lineOffsets = this.getLineOffsets();\r
4088         var low = 0, high = lineOffsets.length;\r
4089         if (high === 0) {\r
4090             return Position.create(0, offset);\r
4091         }\r
4092         while (low < high) {\r
4093             var mid = Math.floor((low + high) / 2);\r
4094             if (lineOffsets[mid] > offset) {\r
4095                 high = mid;\r
4096             }\r
4097             else {\r
4098                 low = mid + 1;\r
4099             }\r
4100         }\r
4101         // low is the least x for which the line offset is larger than the current offset\r
4102         // or array.length if no line offset is larger than the current offset\r
4103         var line = low - 1;\r
4104         return Position.create(line, offset - lineOffsets[line]);\r
4105     };\r
4106     FullTextDocument.prototype.offsetAt = function (position) {\r
4107         var lineOffsets = this.getLineOffsets();\r
4108         if (position.line >= lineOffsets.length) {\r
4109             return this._content.length;\r
4110         }\r
4111         else if (position.line < 0) {\r
4112             return 0;\r
4113         }\r
4114         var lineOffset = lineOffsets[position.line];\r
4115         var nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length;\r
4116         return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset);\r
4117     };\r
4118     Object.defineProperty(FullTextDocument.prototype, "lineCount", {\r
4119         get: function () {\r
4120             return this.getLineOffsets().length;\r
4121         },\r
4122         enumerable: true,\r
4123         configurable: true\r
4124     });\r
4125     return FullTextDocument;\r
4126 }());\r
4127 var Is;\r
4128 (function (Is) {\r
4129     var toString = Object.prototype.toString;\r
4130     function defined(value) {\r
4131         return typeof value !== 'undefined';\r
4132     }\r
4133     Is.defined = defined;\r
4134     function undefined(value) {\r
4135         return typeof value === 'undefined';\r
4136     }\r
4137     Is.undefined = undefined;\r
4138     function boolean(value) {\r
4139         return value === true || value === false;\r
4140     }\r
4141     Is.boolean = boolean;\r
4142     function string(value) {\r
4143         return toString.call(value) === '[object String]';\r
4144     }\r
4145     Is.string = string;\r
4146     function number(value) {\r
4147         return toString.call(value) === '[object Number]';\r
4148     }\r
4149     Is.number = number;\r
4150     function func(value) {\r
4151         return toString.call(value) === '[object Function]';\r
4152     }\r
4153     Is.func = func;\r
4154     function objectLiteral(value) {\r
4155         // Strictly speaking class instances pass this check as well. Since the LSP\r
4156         // doesn't use classes we ignore this for now. If we do we need to add something\r
4157         // like this: `Object.getPrototypeOf(Object.getPrototypeOf(x)) === null`\r
4158         return value !== null && typeof value === 'object';\r
4159     }\r
4160     Is.objectLiteral = objectLiteral;\r
4161     function typedArray(value, check) {\r
4162         return Array.isArray(value) && value.every(check);\r
4163     }\r
4164     Is.typedArray = typedArray;\r
4165 })(Is || (Is = {}));\r
4166
4167
4168 /***/ }),
4169 /* 19 */
4170 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4171
4172 /* --------------------------------------------------------------------------------------------\r
4173  * Copyright (c) Microsoft Corporation. All rights reserved.\r
4174  * Licensed under the MIT License. See License.txt in the project root for license information.\r
4175  * ------------------------------------------------------------------------------------------ */\r
4176 \r
4177 Object.defineProperty(exports, "__esModule", ({ value: true }));\r
4178 const Is = __webpack_require__(20);\r
4179 const vscode_jsonrpc_1 = __webpack_require__(5);\r
4180 const messages_1 = __webpack_require__(21);\r
4181 const protocol_implementation_1 = __webpack_require__(22);\r
4182 exports.ImplementationRequest = protocol_implementation_1.ImplementationRequest;\r
4183 const protocol_typeDefinition_1 = __webpack_require__(23);\r
4184 exports.TypeDefinitionRequest = protocol_typeDefinition_1.TypeDefinitionRequest;\r
4185 const protocol_workspaceFolders_1 = __webpack_require__(24);\r
4186 exports.WorkspaceFoldersRequest = protocol_workspaceFolders_1.WorkspaceFoldersRequest;\r
4187 exports.DidChangeWorkspaceFoldersNotification = protocol_workspaceFolders_1.DidChangeWorkspaceFoldersNotification;\r
4188 const protocol_configuration_1 = __webpack_require__(25);\r
4189 exports.ConfigurationRequest = protocol_configuration_1.ConfigurationRequest;\r
4190 const protocol_colorProvider_1 = __webpack_require__(26);\r
4191 exports.DocumentColorRequest = protocol_colorProvider_1.DocumentColorRequest;\r
4192 exports.ColorPresentationRequest = protocol_colorProvider_1.ColorPresentationRequest;\r
4193 const protocol_foldingRange_1 = __webpack_require__(27);\r
4194 exports.FoldingRangeRequest = protocol_foldingRange_1.FoldingRangeRequest;\r
4195 const protocol_declaration_1 = __webpack_require__(28);\r
4196 exports.DeclarationRequest = protocol_declaration_1.DeclarationRequest;\r
4197 const protocol_selectionRange_1 = __webpack_require__(29);\r
4198 exports.SelectionRangeRequest = protocol_selectionRange_1.SelectionRangeRequest;\r
4199 const protocol_progress_1 = __webpack_require__(30);\r
4200 exports.WorkDoneProgress = protocol_progress_1.WorkDoneProgress;\r
4201 exports.WorkDoneProgressCreateRequest = protocol_progress_1.WorkDoneProgressCreateRequest;\r
4202 exports.WorkDoneProgressCancelNotification = protocol_progress_1.WorkDoneProgressCancelNotification;\r
4203 // @ts-ignore: to avoid inlining LocatioLink as dynamic import\r
4204 let __noDynamicImport;\r
4205 /**\r
4206  * The DocumentFilter namespace provides helper functions to work with\r
4207  * [DocumentFilter](#DocumentFilter) literals.\r
4208  */\r
4209 var DocumentFilter;\r
4210 (function (DocumentFilter) {\r
4211     function is(value) {\r
4212         const candidate = value;\r
4213         return Is.string(candidate.language) || Is.string(candidate.scheme) || Is.string(candidate.pattern);\r
4214     }\r
4215     DocumentFilter.is = is;\r
4216 })(DocumentFilter = exports.DocumentFilter || (exports.DocumentFilter = {}));\r
4217 /**\r
4218  * The DocumentSelector namespace provides helper functions to work with\r
4219  * [DocumentSelector](#DocumentSelector)s.\r
4220  */\r
4221 var DocumentSelector;\r
4222 (function (DocumentSelector) {\r
4223     function is(value) {\r
4224         if (!Array.isArray(value)) {\r
4225             return false;\r
4226         }\r
4227         for (let elem of value) {\r
4228             if (!Is.string(elem) && !DocumentFilter.is(elem)) {\r
4229                 return false;\r
4230             }\r
4231         }\r
4232         return true;\r
4233     }\r
4234     DocumentSelector.is = is;\r
4235 })(DocumentSelector = exports.DocumentSelector || (exports.DocumentSelector = {}));\r
4236 /**\r
4237  * The `client/registerCapability` request is sent from the server to the client to register a new capability\r
4238  * handler on the client side.\r
4239  */\r
4240 var RegistrationRequest;\r
4241 (function (RegistrationRequest) {\r
4242     RegistrationRequest.type = new messages_1.ProtocolRequestType('client/registerCapability');\r
4243 })(RegistrationRequest = exports.RegistrationRequest || (exports.RegistrationRequest = {}));\r
4244 /**\r
4245  * The `client/unregisterCapability` request is sent from the server to the client to unregister a previously registered capability\r
4246  * handler on the client side.\r
4247  */\r
4248 var UnregistrationRequest;\r
4249 (function (UnregistrationRequest) {\r
4250     UnregistrationRequest.type = new messages_1.ProtocolRequestType('client/unregisterCapability');\r
4251 })(UnregistrationRequest = exports.UnregistrationRequest || (exports.UnregistrationRequest = {}));\r
4252 var ResourceOperationKind;\r
4253 (function (ResourceOperationKind) {\r
4254     /**\r
4255      * Supports creating new files and folders.\r
4256      */\r
4257     ResourceOperationKind.Create = 'create';\r
4258     /**\r
4259      * Supports renaming existing files and folders.\r
4260      */\r
4261     ResourceOperationKind.Rename = 'rename';\r
4262     /**\r
4263      * Supports deleting existing files and folders.\r
4264      */\r
4265     ResourceOperationKind.Delete = 'delete';\r
4266 })(ResourceOperationKind = exports.ResourceOperationKind || (exports.ResourceOperationKind = {}));\r
4267 var FailureHandlingKind;\r
4268 (function (FailureHandlingKind) {\r
4269     /**\r
4270      * Applying the workspace change is simply aborted if one of the changes provided\r
4271      * fails. All operations executed before the failing operation stay executed.\r
4272      */\r
4273     FailureHandlingKind.Abort = 'abort';\r
4274     /**\r
4275      * All operations are executed transactional. That means they either all\r
4276      * succeed or no changes at all are applied to the workspace.\r
4277      */\r
4278     FailureHandlingKind.Transactional = 'transactional';\r
4279     /**\r
4280      * If the workspace edit contains only textual file changes they are executed transactional.\r
4281      * If resource changes (create, rename or delete file) are part of the change the failure\r
4282      * handling startegy is abort.\r
4283      */\r
4284     FailureHandlingKind.TextOnlyTransactional = 'textOnlyTransactional';\r
4285     /**\r
4286      * The client tries to undo the operations already executed. But there is no\r
4287      * guarantee that this is succeeding.\r
4288      */\r
4289     FailureHandlingKind.Undo = 'undo';\r
4290 })(FailureHandlingKind = exports.FailureHandlingKind || (exports.FailureHandlingKind = {}));\r
4291 /**\r
4292  * The StaticRegistrationOptions namespace provides helper functions to work with\r
4293  * [StaticRegistrationOptions](#StaticRegistrationOptions) literals.\r
4294  */\r
4295 var StaticRegistrationOptions;\r
4296 (function (StaticRegistrationOptions) {\r
4297     function hasId(value) {\r
4298         const candidate = value;\r
4299         return candidate && Is.string(candidate.id) && candidate.id.length > 0;\r
4300     }\r
4301     StaticRegistrationOptions.hasId = hasId;\r
4302 })(StaticRegistrationOptions = exports.StaticRegistrationOptions || (exports.StaticRegistrationOptions = {}));\r
4303 /**\r
4304  * The TextDocumentRegistrationOptions namespace provides helper functions to work with\r
4305  * [TextDocumentRegistrationOptions](#TextDocumentRegistrationOptions) literals.\r
4306  */\r
4307 var TextDocumentRegistrationOptions;\r
4308 (function (TextDocumentRegistrationOptions) {\r
4309     function is(value) {\r
4310         const candidate = value;\r
4311         return candidate && (candidate.documentSelector === null || DocumentSelector.is(candidate.documentSelector));\r
4312     }\r
4313     TextDocumentRegistrationOptions.is = is;\r
4314 })(TextDocumentRegistrationOptions = exports.TextDocumentRegistrationOptions || (exports.TextDocumentRegistrationOptions = {}));\r
4315 /**\r
4316  * The WorkDoneProgressOptions namespace provides helper functions to work with\r
4317  * [WorkDoneProgressOptions](#WorkDoneProgressOptions) literals.\r
4318  */\r
4319 var WorkDoneProgressOptions;\r
4320 (function (WorkDoneProgressOptions) {\r
4321     function is(value) {\r
4322         const candidate = value;\r
4323         return Is.objectLiteral(candidate) && (candidate.workDoneProgress === undefined || Is.boolean(candidate.workDoneProgress));\r
4324     }\r
4325     WorkDoneProgressOptions.is = is;\r
4326     function hasWorkDoneProgress(value) {\r
4327         const candidate = value;\r
4328         return candidate && Is.boolean(candidate.workDoneProgress);\r
4329     }\r
4330     WorkDoneProgressOptions.hasWorkDoneProgress = hasWorkDoneProgress;\r
4331 })(WorkDoneProgressOptions = exports.WorkDoneProgressOptions || (exports.WorkDoneProgressOptions = {}));\r
4332 /**\r
4333  * The initialize request is sent from the client to the server.\r
4334  * It is sent once as the request after starting up the server.\r
4335  * The requests parameter is of type [InitializeParams](#InitializeParams)\r
4336  * the response if of type [InitializeResult](#InitializeResult) of a Thenable that\r
4337  * resolves to such.\r
4338  */\r
4339 var InitializeRequest;\r
4340 (function (InitializeRequest) {\r
4341     InitializeRequest.type = new messages_1.ProtocolRequestType('initialize');\r
4342 })(InitializeRequest = exports.InitializeRequest || (exports.InitializeRequest = {}));\r
4343 /**\r
4344  * Known error codes for an `InitializeError`;\r
4345  */\r
4346 var InitializeError;\r
4347 (function (InitializeError) {\r
4348     /**\r
4349      * If the protocol version provided by the client can't be handled by the server.\r
4350      * @deprecated This initialize error got replaced by client capabilities. There is\r
4351      * no version handshake in version 3.0x\r
4352      */\r
4353     InitializeError.unknownProtocolVersion = 1;\r
4354 })(InitializeError = exports.InitializeError || (exports.InitializeError = {}));\r
4355 /**\r
4356  * The intialized notification is sent from the client to the\r
4357  * server after the client is fully initialized and the server\r
4358  * is allowed to send requests from the server to the client.\r
4359  */\r
4360 var InitializedNotification;\r
4361 (function (InitializedNotification) {\r
4362     InitializedNotification.type = new messages_1.ProtocolNotificationType('initialized');\r
4363 })(InitializedNotification = exports.InitializedNotification || (exports.InitializedNotification = {}));\r
4364 //---- Shutdown Method ----\r
4365 /**\r
4366  * A shutdown request is sent from the client to the server.\r
4367  * It is sent once when the client decides to shutdown the\r
4368  * server. The only notification that is sent after a shutdown request\r
4369  * is the exit event.\r
4370  */\r
4371 var ShutdownRequest;\r
4372 (function (ShutdownRequest) {\r
4373     ShutdownRequest.type = new messages_1.ProtocolRequestType0('shutdown');\r
4374 })(ShutdownRequest = exports.ShutdownRequest || (exports.ShutdownRequest = {}));\r
4375 //---- Exit Notification ----\r
4376 /**\r
4377  * The exit event is sent from the client to the server to\r
4378  * ask the server to exit its process.\r
4379  */\r
4380 var ExitNotification;\r
4381 (function (ExitNotification) {\r
4382     ExitNotification.type = new messages_1.ProtocolNotificationType0('exit');\r
4383 })(ExitNotification = exports.ExitNotification || (exports.ExitNotification = {}));\r
4384 /**\r
4385  * The configuration change notification is sent from the client to the server\r
4386  * when the client's configuration has changed. The notification contains\r
4387  * the changed configuration as defined by the language client.\r
4388  */\r
4389 var DidChangeConfigurationNotification;\r
4390 (function (DidChangeConfigurationNotification) {\r
4391     DidChangeConfigurationNotification.type = new messages_1.ProtocolNotificationType('workspace/didChangeConfiguration');\r
4392 })(DidChangeConfigurationNotification = exports.DidChangeConfigurationNotification || (exports.DidChangeConfigurationNotification = {}));\r
4393 //---- Message show and log notifications ----\r
4394 /**\r
4395  * The message type\r
4396  */\r
4397 var MessageType;\r
4398 (function (MessageType) {\r
4399     /**\r
4400      * An error message.\r
4401      */\r
4402     MessageType.Error = 1;\r
4403     /**\r
4404      * A warning message.\r
4405      */\r
4406     MessageType.Warning = 2;\r
4407     /**\r
4408      * An information message.\r
4409      */\r
4410     MessageType.Info = 3;\r
4411     /**\r
4412      * A log message.\r
4413      */\r
4414     MessageType.Log = 4;\r
4415 })(MessageType = exports.MessageType || (exports.MessageType = {}));\r
4416 /**\r
4417  * The show message notification is sent from a server to a client to ask\r
4418  * the client to display a particular message in the user interface.\r
4419  */\r
4420 var ShowMessageNotification;\r
4421 (function (ShowMessageNotification) {\r
4422     ShowMessageNotification.type = new messages_1.ProtocolNotificationType('window/showMessage');\r
4423 })(ShowMessageNotification = exports.ShowMessageNotification || (exports.ShowMessageNotification = {}));\r
4424 /**\r
4425  * The show message request is sent from the server to the client to show a message\r
4426  * and a set of options actions to the user.\r
4427  */\r
4428 var ShowMessageRequest;\r
4429 (function (ShowMessageRequest) {\r
4430     ShowMessageRequest.type = new messages_1.ProtocolRequestType('window/showMessageRequest');\r
4431 })(ShowMessageRequest = exports.ShowMessageRequest || (exports.ShowMessageRequest = {}));\r
4432 /**\r
4433  * The log message notification is sent from the server to the client to ask\r
4434  * the client to log a particular message.\r
4435  */\r
4436 var LogMessageNotification;\r
4437 (function (LogMessageNotification) {\r
4438     LogMessageNotification.type = new messages_1.ProtocolNotificationType('window/logMessage');\r
4439 })(LogMessageNotification = exports.LogMessageNotification || (exports.LogMessageNotification = {}));\r
4440 //---- Telemetry notification\r
4441 /**\r
4442  * The telemetry event notification is sent from the server to the client to ask\r
4443  * the client to log telemetry data.\r
4444  */\r
4445 var TelemetryEventNotification;\r
4446 (function (TelemetryEventNotification) {\r
4447     TelemetryEventNotification.type = new messages_1.ProtocolNotificationType('telemetry/event');\r
4448 })(TelemetryEventNotification = exports.TelemetryEventNotification || (exports.TelemetryEventNotification = {}));\r
4449 /**\r
4450  * Defines how the host (editor) should sync\r
4451  * document changes to the language server.\r
4452  */\r
4453 var TextDocumentSyncKind;\r
4454 (function (TextDocumentSyncKind) {\r
4455     /**\r
4456      * Documents should not be synced at all.\r
4457      */\r
4458     TextDocumentSyncKind.None = 0;\r
4459     /**\r
4460      * Documents are synced by always sending the full content\r
4461      * of the document.\r
4462      */\r
4463     TextDocumentSyncKind.Full = 1;\r
4464     /**\r
4465      * Documents are synced by sending the full content on open.\r
4466      * After that only incremental updates to the document are\r
4467      * send.\r
4468      */\r
4469     TextDocumentSyncKind.Incremental = 2;\r
4470 })(TextDocumentSyncKind = exports.TextDocumentSyncKind || (exports.TextDocumentSyncKind = {}));\r
4471 /**\r
4472  * The document open notification is sent from the client to the server to signal\r
4473  * newly opened text documents. The document's truth is now managed by the client\r
4474  * and the server must not try to read the document's truth using the document's\r
4475  * uri. Open in this sense means it is managed by the client. It doesn't necessarily\r
4476  * mean that its content is presented in an editor. An open notification must not\r
4477  * be sent more than once without a corresponding close notification send before.\r
4478  * This means open and close notification must be balanced and the max open count\r
4479  * is one.\r
4480  */\r
4481 var DidOpenTextDocumentNotification;\r
4482 (function (DidOpenTextDocumentNotification) {\r
4483     DidOpenTextDocumentNotification.method = 'textDocument/didOpen';\r
4484     DidOpenTextDocumentNotification.type = new messages_1.ProtocolNotificationType(DidOpenTextDocumentNotification.method);\r
4485 })(DidOpenTextDocumentNotification = exports.DidOpenTextDocumentNotification || (exports.DidOpenTextDocumentNotification = {}));\r
4486 /**\r
4487  * The document change notification is sent from the client to the server to signal\r
4488  * changes to a text document.\r
4489  */\r
4490 var DidChangeTextDocumentNotification;\r
4491 (function (DidChangeTextDocumentNotification) {\r
4492     DidChangeTextDocumentNotification.method = 'textDocument/didChange';\r
4493     DidChangeTextDocumentNotification.type = new messages_1.ProtocolNotificationType(DidChangeTextDocumentNotification.method);\r
4494 })(DidChangeTextDocumentNotification = exports.DidChangeTextDocumentNotification || (exports.DidChangeTextDocumentNotification = {}));\r
4495 /**\r
4496  * The document close notification is sent from the client to the server when\r
4497  * the document got closed in the client. The document's truth now exists where\r
4498  * the document's uri points to (e.g. if the document's uri is a file uri the\r
4499  * truth now exists on disk). As with the open notification the close notification\r
4500  * is about managing the document's content. Receiving a close notification\r
4501  * doesn't mean that the document was open in an editor before. A close\r
4502  * notification requires a previous open notification to be sent.\r
4503  */\r
4504 var DidCloseTextDocumentNotification;\r
4505 (function (DidCloseTextDocumentNotification) {\r
4506     DidCloseTextDocumentNotification.method = 'textDocument/didClose';\r
4507     DidCloseTextDocumentNotification.type = new messages_1.ProtocolNotificationType(DidCloseTextDocumentNotification.method);\r
4508 })(DidCloseTextDocumentNotification = exports.DidCloseTextDocumentNotification || (exports.DidCloseTextDocumentNotification = {}));\r
4509 /**\r
4510  * The document save notification is sent from the client to the server when\r
4511  * the document got saved in the client.\r
4512  */\r
4513 var DidSaveTextDocumentNotification;\r
4514 (function (DidSaveTextDocumentNotification) {\r
4515     DidSaveTextDocumentNotification.method = 'textDocument/didSave';\r
4516     DidSaveTextDocumentNotification.type = new messages_1.ProtocolNotificationType(DidSaveTextDocumentNotification.method);\r
4517 })(DidSaveTextDocumentNotification = exports.DidSaveTextDocumentNotification || (exports.DidSaveTextDocumentNotification = {}));\r
4518 /**\r
4519  * Represents reasons why a text document is saved.\r
4520  */\r
4521 var TextDocumentSaveReason;\r
4522 (function (TextDocumentSaveReason) {\r
4523     /**\r
4524      * Manually triggered, e.g. by the user pressing save, by starting debugging,\r
4525      * or by an API call.\r
4526      */\r
4527     TextDocumentSaveReason.Manual = 1;\r
4528     /**\r
4529      * Automatic after a delay.\r
4530      */\r
4531     TextDocumentSaveReason.AfterDelay = 2;\r
4532     /**\r
4533      * When the editor lost focus.\r
4534      */\r
4535     TextDocumentSaveReason.FocusOut = 3;\r
4536 })(TextDocumentSaveReason = exports.TextDocumentSaveReason || (exports.TextDocumentSaveReason = {}));\r
4537 /**\r
4538  * A document will save notification is sent from the client to the server before\r
4539  * the document is actually saved.\r
4540  */\r
4541 var WillSaveTextDocumentNotification;\r
4542 (function (WillSaveTextDocumentNotification) {\r
4543     WillSaveTextDocumentNotification.method = 'textDocument/willSave';\r
4544     WillSaveTextDocumentNotification.type = new messages_1.ProtocolNotificationType(WillSaveTextDocumentNotification.method);\r
4545 })(WillSaveTextDocumentNotification = exports.WillSaveTextDocumentNotification || (exports.WillSaveTextDocumentNotification = {}));\r
4546 /**\r
4547  * A document will save request is sent from the client to the server before\r
4548  * the document is actually saved. The request can return an array of TextEdits\r
4549  * which will be applied to the text document before it is saved. Please note that\r
4550  * clients might drop results if computing the text edits took too long or if a\r
4551  * server constantly fails on this request. This is done to keep the save fast and\r
4552  * reliable.\r
4553  */\r
4554 var WillSaveTextDocumentWaitUntilRequest;\r
4555 (function (WillSaveTextDocumentWaitUntilRequest) {\r
4556     WillSaveTextDocumentWaitUntilRequest.method = 'textDocument/willSaveWaitUntil';\r
4557     WillSaveTextDocumentWaitUntilRequest.type = new messages_1.ProtocolRequestType(WillSaveTextDocumentWaitUntilRequest.method);\r
4558 })(WillSaveTextDocumentWaitUntilRequest = exports.WillSaveTextDocumentWaitUntilRequest || (exports.WillSaveTextDocumentWaitUntilRequest = {}));\r
4559 /**\r
4560  * The watched files notification is sent from the client to the server when\r
4561  * the client detects changes to file watched by the language client.\r
4562  */\r
4563 var DidChangeWatchedFilesNotification;\r
4564 (function (DidChangeWatchedFilesNotification) {\r
4565     DidChangeWatchedFilesNotification.type = new messages_1.ProtocolNotificationType('workspace/didChangeWatchedFiles');\r
4566 })(DidChangeWatchedFilesNotification = exports.DidChangeWatchedFilesNotification || (exports.DidChangeWatchedFilesNotification = {}));\r
4567 /**\r
4568  * The file event type\r
4569  */\r
4570 var FileChangeType;\r
4571 (function (FileChangeType) {\r
4572     /**\r
4573      * The file got created.\r
4574      */\r
4575     FileChangeType.Created = 1;\r
4576     /**\r
4577      * The file got changed.\r
4578      */\r
4579     FileChangeType.Changed = 2;\r
4580     /**\r
4581      * The file got deleted.\r
4582      */\r
4583     FileChangeType.Deleted = 3;\r
4584 })(FileChangeType = exports.FileChangeType || (exports.FileChangeType = {}));\r
4585 var WatchKind;\r
4586 (function (WatchKind) {\r
4587     /**\r
4588      * Interested in create events.\r
4589      */\r
4590     WatchKind.Create = 1;\r
4591     /**\r
4592      * Interested in change events\r
4593      */\r
4594     WatchKind.Change = 2;\r
4595     /**\r
4596      * Interested in delete events\r
4597      */\r
4598     WatchKind.Delete = 4;\r
4599 })(WatchKind = exports.WatchKind || (exports.WatchKind = {}));\r
4600 /**\r
4601  * Diagnostics notification are sent from the server to the client to signal\r
4602  * results of validation runs.\r
4603  */\r
4604 var PublishDiagnosticsNotification;\r
4605 (function (PublishDiagnosticsNotification) {\r
4606     PublishDiagnosticsNotification.type = new messages_1.ProtocolNotificationType('textDocument/publishDiagnostics');\r
4607 })(PublishDiagnosticsNotification = exports.PublishDiagnosticsNotification || (exports.PublishDiagnosticsNotification = {}));\r
4608 /**\r
4609  * How a completion was triggered\r
4610  */\r
4611 var CompletionTriggerKind;\r
4612 (function (CompletionTriggerKind) {\r
4613     /**\r
4614      * Completion was triggered by typing an identifier (24x7 code\r
4615      * complete), manual invocation (e.g Ctrl+Space) or via API.\r
4616      */\r
4617     CompletionTriggerKind.Invoked = 1;\r
4618     /**\r
4619      * Completion was triggered by a trigger character specified by\r
4620      * the `triggerCharacters` properties of the `CompletionRegistrationOptions`.\r
4621      */\r
4622     CompletionTriggerKind.TriggerCharacter = 2;\r
4623     /**\r
4624      * Completion was re-triggered as current completion list is incomplete\r
4625      */\r
4626     CompletionTriggerKind.TriggerForIncompleteCompletions = 3;\r
4627 })(CompletionTriggerKind = exports.CompletionTriggerKind || (exports.CompletionTriggerKind = {}));\r
4628 /**\r
4629  * Request to request completion at a given text document position. The request's\r
4630  * parameter is of type [TextDocumentPosition](#TextDocumentPosition) the response\r
4631  * is of type [CompletionItem[]](#CompletionItem) or [CompletionList](#CompletionList)\r
4632  * or a Thenable that resolves to such.\r
4633  *\r
4634  * The request can delay the computation of the [`detail`](#CompletionItem.detail)\r
4635  * and [`documentation`](#CompletionItem.documentation) properties to the `completionItem/resolve`\r
4636  * request. However, properties that are needed for the initial sorting and filtering, like `sortText`,\r
4637  * `filterText`, `insertText`, and `textEdit`, must not be changed during resolve.\r
4638  */\r
4639 var CompletionRequest;\r
4640 (function (CompletionRequest) {\r
4641     CompletionRequest.method = 'textDocument/completion';\r
4642     CompletionRequest.type = new messages_1.ProtocolRequestType(CompletionRequest.method);\r
4643     /** @deprecated Use CompletionRequest.type */\r
4644     CompletionRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
4645 })(CompletionRequest = exports.CompletionRequest || (exports.CompletionRequest = {}));\r
4646 /**\r
4647  * Request to resolve additional information for a given completion item.The request's\r
4648  * parameter is of type [CompletionItem](#CompletionItem) the response\r
4649  * is of type [CompletionItem](#CompletionItem) or a Thenable that resolves to such.\r
4650  */\r
4651 var CompletionResolveRequest;\r
4652 (function (CompletionResolveRequest) {\r
4653     CompletionResolveRequest.method = 'completionItem/resolve';\r
4654     CompletionResolveRequest.type = new messages_1.ProtocolRequestType(CompletionResolveRequest.method);\r
4655 })(CompletionResolveRequest = exports.CompletionResolveRequest || (exports.CompletionResolveRequest = {}));\r
4656 /**\r
4657  * Request to request hover information at a given text document position. The request's\r
4658  * parameter is of type [TextDocumentPosition](#TextDocumentPosition) the response is of\r
4659  * type [Hover](#Hover) or a Thenable that resolves to such.\r
4660  */\r
4661 var HoverRequest;\r
4662 (function (HoverRequest) {\r
4663     HoverRequest.method = 'textDocument/hover';\r
4664     HoverRequest.type = new messages_1.ProtocolRequestType(HoverRequest.method);\r
4665 })(HoverRequest = exports.HoverRequest || (exports.HoverRequest = {}));\r
4666 /**\r
4667  * How a signature help was triggered.\r
4668  *\r
4669  * @since 3.15.0\r
4670  */\r
4671 var SignatureHelpTriggerKind;\r
4672 (function (SignatureHelpTriggerKind) {\r
4673     /**\r
4674      * Signature help was invoked manually by the user or by a command.\r
4675      */\r
4676     SignatureHelpTriggerKind.Invoked = 1;\r
4677     /**\r
4678      * Signature help was triggered by a trigger character.\r
4679      */\r
4680     SignatureHelpTriggerKind.TriggerCharacter = 2;\r
4681     /**\r
4682      * Signature help was triggered by the cursor moving or by the document content changing.\r
4683      */\r
4684     SignatureHelpTriggerKind.ContentChange = 3;\r
4685 })(SignatureHelpTriggerKind = exports.SignatureHelpTriggerKind || (exports.SignatureHelpTriggerKind = {}));\r
4686 var SignatureHelpRequest;\r
4687 (function (SignatureHelpRequest) {\r
4688     SignatureHelpRequest.method = 'textDocument/signatureHelp';\r
4689     SignatureHelpRequest.type = new messages_1.ProtocolRequestType(SignatureHelpRequest.method);\r
4690 })(SignatureHelpRequest = exports.SignatureHelpRequest || (exports.SignatureHelpRequest = {}));\r
4691 /**\r
4692  * A request to resolve the definition location of a symbol at a given text\r
4693  * document position. The request's parameter is of type [TextDocumentPosition]\r
4694  * (#TextDocumentPosition) the response is of either type [Definition](#Definition)\r
4695  * or a typed array of [DefinitionLink](#DefinitionLink) or a Thenable that resolves\r
4696  * to such.\r
4697  */\r
4698 var DefinitionRequest;\r
4699 (function (DefinitionRequest) {\r
4700     DefinitionRequest.method = 'textDocument/definition';\r
4701     DefinitionRequest.type = new messages_1.ProtocolRequestType(DefinitionRequest.method);\r
4702     /** @deprecated Use DefinitionRequest.type */\r
4703     DefinitionRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
4704 })(DefinitionRequest = exports.DefinitionRequest || (exports.DefinitionRequest = {}));\r
4705 /**\r
4706  * A request to resolve project-wide references for the symbol denoted\r
4707  * by the given text document position. The request's parameter is of\r
4708  * type [ReferenceParams](#ReferenceParams) the response is of type\r
4709  * [Location[]](#Location) or a Thenable that resolves to such.\r
4710  */\r
4711 var ReferencesRequest;\r
4712 (function (ReferencesRequest) {\r
4713     ReferencesRequest.method = 'textDocument/references';\r
4714     ReferencesRequest.type = new messages_1.ProtocolRequestType(ReferencesRequest.method);\r
4715     /** @deprecated Use ReferencesRequest.type */\r
4716     ReferencesRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
4717 })(ReferencesRequest = exports.ReferencesRequest || (exports.ReferencesRequest = {}));\r
4718 /**\r
4719  * Request to resolve a [DocumentHighlight](#DocumentHighlight) for a given\r
4720  * text document position. The request's parameter is of type [TextDocumentPosition]\r
4721  * (#TextDocumentPosition) the request response is of type [DocumentHighlight[]]\r
4722  * (#DocumentHighlight) or a Thenable that resolves to such.\r
4723  */\r
4724 var DocumentHighlightRequest;\r
4725 (function (DocumentHighlightRequest) {\r
4726     DocumentHighlightRequest.method = 'textDocument/documentHighlight';\r
4727     DocumentHighlightRequest.type = new messages_1.ProtocolRequestType(DocumentHighlightRequest.method);\r
4728     /** @deprecated Use DocumentHighlightRequest.type */\r
4729     DocumentHighlightRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
4730 })(DocumentHighlightRequest = exports.DocumentHighlightRequest || (exports.DocumentHighlightRequest = {}));\r
4731 /**\r
4732  * A request to list all symbols found in a given text document. The request's\r
4733  * parameter is of type [TextDocumentIdentifier](#TextDocumentIdentifier) the\r
4734  * response is of type [SymbolInformation[]](#SymbolInformation) or a Thenable\r
4735  * that resolves to such.\r
4736  */\r
4737 var DocumentSymbolRequest;\r
4738 (function (DocumentSymbolRequest) {\r
4739     DocumentSymbolRequest.method = 'textDocument/documentSymbol';\r
4740     DocumentSymbolRequest.type = new messages_1.ProtocolRequestType(DocumentSymbolRequest.method);\r
4741     /** @deprecated Use DocumentSymbolRequest.type */\r
4742     DocumentSymbolRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
4743 })(DocumentSymbolRequest = exports.DocumentSymbolRequest || (exports.DocumentSymbolRequest = {}));\r
4744 /**\r
4745  * A request to provide commands for the given text document and range.\r
4746  */\r
4747 var CodeActionRequest;\r
4748 (function (CodeActionRequest) {\r
4749     CodeActionRequest.method = 'textDocument/codeAction';\r
4750     CodeActionRequest.type = new messages_1.ProtocolRequestType(CodeActionRequest.method);\r
4751     /** @deprecated Use CodeActionRequest.type */\r
4752     CodeActionRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
4753 })(CodeActionRequest = exports.CodeActionRequest || (exports.CodeActionRequest = {}));\r
4754 /**\r
4755  * A request to list project-wide symbols matching the query string given\r
4756  * by the [WorkspaceSymbolParams](#WorkspaceSymbolParams). The response is\r
4757  * of type [SymbolInformation[]](#SymbolInformation) or a Thenable that\r
4758  * resolves to such.\r
4759  */\r
4760 var WorkspaceSymbolRequest;\r
4761 (function (WorkspaceSymbolRequest) {\r
4762     WorkspaceSymbolRequest.method = 'workspace/symbol';\r
4763     WorkspaceSymbolRequest.type = new messages_1.ProtocolRequestType(WorkspaceSymbolRequest.method);\r
4764     /** @deprecated Use WorkspaceSymbolRequest.type */\r
4765     WorkspaceSymbolRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
4766 })(WorkspaceSymbolRequest = exports.WorkspaceSymbolRequest || (exports.WorkspaceSymbolRequest = {}));\r
4767 /**\r
4768  * A request to provide code lens for the given text document.\r
4769  */\r
4770 var CodeLensRequest;\r
4771 (function (CodeLensRequest) {\r
4772     CodeLensRequest.type = new messages_1.ProtocolRequestType('textDocument/codeLens');\r
4773     /** @deprecated Use CodeLensRequest.type */\r
4774     CodeLensRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
4775 })(CodeLensRequest = exports.CodeLensRequest || (exports.CodeLensRequest = {}));\r
4776 /**\r
4777  * A request to resolve a command for a given code lens.\r
4778  */\r
4779 var CodeLensResolveRequest;\r
4780 (function (CodeLensResolveRequest) {\r
4781     CodeLensResolveRequest.type = new messages_1.ProtocolRequestType('codeLens/resolve');\r
4782 })(CodeLensResolveRequest = exports.CodeLensResolveRequest || (exports.CodeLensResolveRequest = {}));\r
4783 /**\r
4784  * A request to provide document links\r
4785  */\r
4786 var DocumentLinkRequest;\r
4787 (function (DocumentLinkRequest) {\r
4788     DocumentLinkRequest.method = 'textDocument/documentLink';\r
4789     DocumentLinkRequest.type = new messages_1.ProtocolRequestType(DocumentLinkRequest.method);\r
4790     /** @deprecated Use DocumentLinkRequest.type */\r
4791     DocumentLinkRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
4792 })(DocumentLinkRequest = exports.DocumentLinkRequest || (exports.DocumentLinkRequest = {}));\r
4793 /**\r
4794  * Request to resolve additional information for a given document link. The request's\r
4795  * parameter is of type [DocumentLink](#DocumentLink) the response\r
4796  * is of type [DocumentLink](#DocumentLink) or a Thenable that resolves to such.\r
4797  */\r
4798 var DocumentLinkResolveRequest;\r
4799 (function (DocumentLinkResolveRequest) {\r
4800     DocumentLinkResolveRequest.type = new messages_1.ProtocolRequestType('documentLink/resolve');\r
4801 })(DocumentLinkResolveRequest = exports.DocumentLinkResolveRequest || (exports.DocumentLinkResolveRequest = {}));\r
4802 /**\r
4803  * A request to to format a whole document.\r
4804  */\r
4805 var DocumentFormattingRequest;\r
4806 (function (DocumentFormattingRequest) {\r
4807     DocumentFormattingRequest.method = 'textDocument/formatting';\r
4808     DocumentFormattingRequest.type = new messages_1.ProtocolRequestType(DocumentFormattingRequest.method);\r
4809 })(DocumentFormattingRequest = exports.DocumentFormattingRequest || (exports.DocumentFormattingRequest = {}));\r
4810 /**\r
4811  * A request to to format a range in a document.\r
4812  */\r
4813 var DocumentRangeFormattingRequest;\r
4814 (function (DocumentRangeFormattingRequest) {\r
4815     DocumentRangeFormattingRequest.method = 'textDocument/rangeFormatting';\r
4816     DocumentRangeFormattingRequest.type = new messages_1.ProtocolRequestType(DocumentRangeFormattingRequest.method);\r
4817 })(DocumentRangeFormattingRequest = exports.DocumentRangeFormattingRequest || (exports.DocumentRangeFormattingRequest = {}));\r
4818 /**\r
4819  * A request to format a document on type.\r
4820  */\r
4821 var DocumentOnTypeFormattingRequest;\r
4822 (function (DocumentOnTypeFormattingRequest) {\r
4823     DocumentOnTypeFormattingRequest.method = 'textDocument/onTypeFormatting';\r
4824     DocumentOnTypeFormattingRequest.type = new messages_1.ProtocolRequestType(DocumentOnTypeFormattingRequest.method);\r
4825 })(DocumentOnTypeFormattingRequest = exports.DocumentOnTypeFormattingRequest || (exports.DocumentOnTypeFormattingRequest = {}));\r
4826 /**\r
4827  * A request to rename a symbol.\r
4828  */\r
4829 var RenameRequest;\r
4830 (function (RenameRequest) {\r
4831     RenameRequest.method = 'textDocument/rename';\r
4832     RenameRequest.type = new messages_1.ProtocolRequestType(RenameRequest.method);\r
4833 })(RenameRequest = exports.RenameRequest || (exports.RenameRequest = {}));\r
4834 /**\r
4835  * A request to test and perform the setup necessary for a rename.\r
4836  */\r
4837 var PrepareRenameRequest;\r
4838 (function (PrepareRenameRequest) {\r
4839     PrepareRenameRequest.method = 'textDocument/prepareRename';\r
4840     PrepareRenameRequest.type = new messages_1.ProtocolRequestType(PrepareRenameRequest.method);\r
4841 })(PrepareRenameRequest = exports.PrepareRenameRequest || (exports.PrepareRenameRequest = {}));\r
4842 /**\r
4843  * A request send from the client to the server to execute a command. The request might return\r
4844  * a workspace edit which the client will apply to the workspace.\r
4845  */\r
4846 var ExecuteCommandRequest;\r
4847 (function (ExecuteCommandRequest) {\r
4848     ExecuteCommandRequest.type = new messages_1.ProtocolRequestType('workspace/executeCommand');\r
4849 })(ExecuteCommandRequest = exports.ExecuteCommandRequest || (exports.ExecuteCommandRequest = {}));\r
4850 /**\r
4851  * A request sent from the server to the client to modified certain resources.\r
4852  */\r
4853 var ApplyWorkspaceEditRequest;\r
4854 (function (ApplyWorkspaceEditRequest) {\r
4855     ApplyWorkspaceEditRequest.type = new messages_1.ProtocolRequestType('workspace/applyEdit');\r
4856 })(ApplyWorkspaceEditRequest = exports.ApplyWorkspaceEditRequest || (exports.ApplyWorkspaceEditRequest = {}));\r
4857
4858
4859 /***/ }),
4860 /* 20 */
4861 /***/ ((__unused_webpack_module, exports) => {
4862
4863 /* --------------------------------------------------------------------------------------------\r
4864  * Copyright (c) Microsoft Corporation. All rights reserved.\r
4865  * Licensed under the MIT License. See License.txt in the project root for license information.\r
4866  * ------------------------------------------------------------------------------------------ */\r
4867 \r
4868 Object.defineProperty(exports, "__esModule", ({ value: true }));\r
4869 function boolean(value) {\r
4870     return value === true || value === false;\r
4871 }\r
4872 exports.boolean = boolean;\r
4873 function string(value) {\r
4874     return typeof value === 'string' || value instanceof String;\r
4875 }\r
4876 exports.string = string;\r
4877 function number(value) {\r
4878     return typeof value === 'number' || value instanceof Number;\r
4879 }\r
4880 exports.number = number;\r
4881 function error(value) {\r
4882     return value instanceof Error;\r
4883 }\r
4884 exports.error = error;\r
4885 function func(value) {\r
4886     return typeof value === 'function';\r
4887 }\r
4888 exports.func = func;\r
4889 function array(value) {\r
4890     return Array.isArray(value);\r
4891 }\r
4892 exports.array = array;\r
4893 function stringArray(value) {\r
4894     return array(value) && value.every(elem => string(elem));\r
4895 }\r
4896 exports.stringArray = stringArray;\r
4897 function typedArray(value, check) {\r
4898     return Array.isArray(value) && value.every(check);\r
4899 }\r
4900 exports.typedArray = typedArray;\r
4901 function objectLiteral(value) {\r
4902     // Strictly speaking class instances pass this check as well. Since the LSP\r
4903     // doesn't use classes we ignore this for now. If we do we need to add something\r
4904     // like this: `Object.getPrototypeOf(Object.getPrototypeOf(x)) === null`\r
4905     return value !== null && typeof value === 'object';\r
4906 }\r
4907 exports.objectLiteral = objectLiteral;\r
4908
4909
4910 /***/ }),
4911 /* 21 */
4912 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4913
4914 /* --------------------------------------------------------------------------------------------\r
4915  * Copyright (c) Microsoft Corporation. All rights reserved.\r
4916  * Licensed under the MIT License. See License.txt in the project root for license information.\r
4917  * ------------------------------------------------------------------------------------------ */\r
4918 \r
4919 Object.defineProperty(exports, "__esModule", ({ value: true }));\r
4920 const vscode_jsonrpc_1 = __webpack_require__(5);\r
4921 class ProtocolRequestType0 extends vscode_jsonrpc_1.RequestType0 {\r
4922     constructor(method) {\r
4923         super(method);\r
4924     }\r
4925 }\r
4926 exports.ProtocolRequestType0 = ProtocolRequestType0;\r
4927 class ProtocolRequestType extends vscode_jsonrpc_1.RequestType {\r
4928     constructor(method) {\r
4929         super(method);\r
4930     }\r
4931 }\r
4932 exports.ProtocolRequestType = ProtocolRequestType;\r
4933 class ProtocolNotificationType extends vscode_jsonrpc_1.NotificationType {\r
4934     constructor(method) {\r
4935         super(method);\r
4936     }\r
4937 }\r
4938 exports.ProtocolNotificationType = ProtocolNotificationType;\r
4939 class ProtocolNotificationType0 extends vscode_jsonrpc_1.NotificationType0 {\r
4940     constructor(method) {\r
4941         super(method);\r
4942     }\r
4943 }\r
4944 exports.ProtocolNotificationType0 = ProtocolNotificationType0;\r
4945
4946
4947 /***/ }),
4948 /* 22 */
4949 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4950
4951 /* --------------------------------------------------------------------------------------------\r
4952  * Copyright (c) Microsoft Corporation. All rights reserved.\r
4953  * Licensed under the MIT License. See License.txt in the project root for license information.\r
4954  * ------------------------------------------------------------------------------------------ */\r
4955 \r
4956 Object.defineProperty(exports, "__esModule", ({ value: true }));\r
4957 const vscode_jsonrpc_1 = __webpack_require__(5);\r
4958 const messages_1 = __webpack_require__(21);\r
4959 // @ts-ignore: to avoid inlining LocatioLink as dynamic import\r
4960 let __noDynamicImport;\r
4961 /**\r
4962  * A request to resolve the implementation locations of a symbol at a given text\r
4963  * document position. The request's parameter is of type [TextDocumentPositioParams]\r
4964  * (#TextDocumentPositionParams) the response is of type [Definition](#Definition) or a\r
4965  * Thenable that resolves to such.\r
4966  */\r
4967 var ImplementationRequest;\r
4968 (function (ImplementationRequest) {\r
4969     ImplementationRequest.method = 'textDocument/implementation';\r
4970     ImplementationRequest.type = new messages_1.ProtocolRequestType(ImplementationRequest.method);\r
4971     /** @deprecated Use ImplementationRequest.type */\r
4972     ImplementationRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
4973 })(ImplementationRequest = exports.ImplementationRequest || (exports.ImplementationRequest = {}));\r
4974
4975
4976 /***/ }),
4977 /* 23 */
4978 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4979
4980 /* --------------------------------------------------------------------------------------------\r
4981  * Copyright (c) Microsoft Corporation. All rights reserved.\r
4982  * Licensed under the MIT License. See License.txt in the project root for license information.\r
4983  * ------------------------------------------------------------------------------------------ */\r
4984 \r
4985 Object.defineProperty(exports, "__esModule", ({ value: true }));\r
4986 const vscode_jsonrpc_1 = __webpack_require__(5);\r
4987 const messages_1 = __webpack_require__(21);\r
4988 // @ts-ignore: to avoid inlining LocatioLink as dynamic import\r
4989 let __noDynamicImport;\r
4990 /**\r
4991  * A request to resolve the type definition locations of a symbol at a given text\r
4992  * document position. The request's parameter is of type [TextDocumentPositioParams]\r
4993  * (#TextDocumentPositionParams) the response is of type [Definition](#Definition) or a\r
4994  * Thenable that resolves to such.\r
4995  */\r
4996 var TypeDefinitionRequest;\r
4997 (function (TypeDefinitionRequest) {\r
4998     TypeDefinitionRequest.method = 'textDocument/typeDefinition';\r
4999     TypeDefinitionRequest.type = new messages_1.ProtocolRequestType(TypeDefinitionRequest.method);\r
5000     /** @deprecated Use TypeDefinitionRequest.type */\r
5001     TypeDefinitionRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
5002 })(TypeDefinitionRequest = exports.TypeDefinitionRequest || (exports.TypeDefinitionRequest = {}));\r
5003
5004
5005 /***/ }),
5006 /* 24 */
5007 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5008
5009 /* --------------------------------------------------------------------------------------------\r
5010  * Copyright (c) Microsoft Corporation. All rights reserved.\r
5011  * Licensed under the MIT License. See License.txt in the project root for license information.\r
5012  * ------------------------------------------------------------------------------------------ */\r
5013 \r
5014 Object.defineProperty(exports, "__esModule", ({ value: true }));\r
5015 const messages_1 = __webpack_require__(21);\r
5016 /**\r
5017  * The `workspace/workspaceFolders` is sent from the server to the client to fetch the open workspace folders.\r
5018  */\r
5019 var WorkspaceFoldersRequest;\r
5020 (function (WorkspaceFoldersRequest) {\r
5021     WorkspaceFoldersRequest.type = new messages_1.ProtocolRequestType0('workspace/workspaceFolders');\r
5022 })(WorkspaceFoldersRequest = exports.WorkspaceFoldersRequest || (exports.WorkspaceFoldersRequest = {}));\r
5023 /**\r
5024  * The `workspace/didChangeWorkspaceFolders` notification is sent from the client to the server when the workspace\r
5025  * folder configuration changes.\r
5026  */\r
5027 var DidChangeWorkspaceFoldersNotification;\r
5028 (function (DidChangeWorkspaceFoldersNotification) {\r
5029     DidChangeWorkspaceFoldersNotification.type = new messages_1.ProtocolNotificationType('workspace/didChangeWorkspaceFolders');\r
5030 })(DidChangeWorkspaceFoldersNotification = exports.DidChangeWorkspaceFoldersNotification || (exports.DidChangeWorkspaceFoldersNotification = {}));\r
5031
5032
5033 /***/ }),
5034 /* 25 */
5035 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5036
5037 /* --------------------------------------------------------------------------------------------\r
5038  * Copyright (c) Microsoft Corporation. All rights reserved.\r
5039  * Licensed under the MIT License. See License.txt in the project root for license information.\r
5040  * ------------------------------------------------------------------------------------------ */\r
5041 \r
5042 Object.defineProperty(exports, "__esModule", ({ value: true }));\r
5043 const messages_1 = __webpack_require__(21);\r
5044 /**\r
5045  * The 'workspace/configuration' request is sent from the server to the client to fetch a certain\r
5046  * configuration setting.\r
5047  *\r
5048  * This pull model replaces the old push model were the client signaled configuration change via an\r
5049  * event. If the server still needs to react to configuration changes (since the server caches the\r
5050  * result of `workspace/configuration` requests) the server should register for an empty configuration\r
5051  * change event and empty the cache if such an event is received.\r
5052  */\r
5053 var ConfigurationRequest;\r
5054 (function (ConfigurationRequest) {\r
5055     ConfigurationRequest.type = new messages_1.ProtocolRequestType('workspace/configuration');\r
5056 })(ConfigurationRequest = exports.ConfigurationRequest || (exports.ConfigurationRequest = {}));\r
5057
5058
5059 /***/ }),
5060 /* 26 */
5061 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5062
5063 /* --------------------------------------------------------------------------------------------\r
5064  * Copyright (c) Microsoft Corporation. All rights reserved.\r
5065  * Licensed under the MIT License. See License.txt in the project root for license information.\r
5066  * ------------------------------------------------------------------------------------------ */\r
5067 \r
5068 Object.defineProperty(exports, "__esModule", ({ value: true }));\r
5069 const vscode_jsonrpc_1 = __webpack_require__(5);\r
5070 const messages_1 = __webpack_require__(21);\r
5071 /**\r
5072  * A request to list all color symbols found in a given text document. The request's\r
5073  * parameter is of type [DocumentColorParams](#DocumentColorParams) the\r
5074  * response is of type [ColorInformation[]](#ColorInformation) or a Thenable\r
5075  * that resolves to such.\r
5076  */\r
5077 var DocumentColorRequest;\r
5078 (function (DocumentColorRequest) {\r
5079     DocumentColorRequest.method = 'textDocument/documentColor';\r
5080     DocumentColorRequest.type = new messages_1.ProtocolRequestType(DocumentColorRequest.method);\r
5081     /** @deprecated Use DocumentColorRequest.type */\r
5082     DocumentColorRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
5083 })(DocumentColorRequest = exports.DocumentColorRequest || (exports.DocumentColorRequest = {}));\r
5084 /**\r
5085  * A request to list all presentation for a color. The request's\r
5086  * parameter is of type [ColorPresentationParams](#ColorPresentationParams) the\r
5087  * response is of type [ColorInformation[]](#ColorInformation) or a Thenable\r
5088  * that resolves to such.\r
5089  */\r
5090 var ColorPresentationRequest;\r
5091 (function (ColorPresentationRequest) {\r
5092     ColorPresentationRequest.type = new messages_1.ProtocolRequestType('textDocument/colorPresentation');\r
5093 })(ColorPresentationRequest = exports.ColorPresentationRequest || (exports.ColorPresentationRequest = {}));\r
5094
5095
5096 /***/ }),
5097 /* 27 */
5098 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5099
5100 \r
5101 /*---------------------------------------------------------------------------------------------\r
5102  *  Copyright (c) Microsoft Corporation. All rights reserved.\r
5103  *  Licensed under the MIT License. See License.txt in the project root for license information.\r
5104  *--------------------------------------------------------------------------------------------*/\r
5105 Object.defineProperty(exports, "__esModule", ({ value: true }));\r
5106 const vscode_jsonrpc_1 = __webpack_require__(5);\r
5107 const messages_1 = __webpack_require__(21);\r
5108 /**\r
5109  * Enum of known range kinds\r
5110  */\r
5111 var FoldingRangeKind;\r
5112 (function (FoldingRangeKind) {\r
5113     /**\r
5114      * Folding range for a comment\r
5115      */\r
5116     FoldingRangeKind["Comment"] = "comment";\r
5117     /**\r
5118      * Folding range for a imports or includes\r
5119      */\r
5120     FoldingRangeKind["Imports"] = "imports";\r
5121     /**\r
5122      * Folding range for a region (e.g. `#region`)\r
5123      */\r
5124     FoldingRangeKind["Region"] = "region";\r
5125 })(FoldingRangeKind = exports.FoldingRangeKind || (exports.FoldingRangeKind = {}));\r
5126 /**\r
5127  * A request to provide folding ranges in a document. The request's\r
5128  * parameter is of type [FoldingRangeParams](#FoldingRangeParams), the\r
5129  * response is of type [FoldingRangeList](#FoldingRangeList) or a Thenable\r
5130  * that resolves to such.\r
5131  */\r
5132 var FoldingRangeRequest;\r
5133 (function (FoldingRangeRequest) {\r
5134     FoldingRangeRequest.method = 'textDocument/foldingRange';\r
5135     FoldingRangeRequest.type = new messages_1.ProtocolRequestType(FoldingRangeRequest.method);\r
5136     /** @deprecated Use FoldingRangeRequest.type */\r
5137     FoldingRangeRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
5138 })(FoldingRangeRequest = exports.FoldingRangeRequest || (exports.FoldingRangeRequest = {}));\r
5139
5140
5141 /***/ }),
5142 /* 28 */
5143 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5144
5145 /* --------------------------------------------------------------------------------------------\r
5146  * Copyright (c) Microsoft Corporation. All rights reserved.\r
5147  * Licensed under the MIT License. See License.txt in the project root for license information.\r
5148  * ------------------------------------------------------------------------------------------ */\r
5149 \r
5150 Object.defineProperty(exports, "__esModule", ({ value: true }));\r
5151 const vscode_jsonrpc_1 = __webpack_require__(5);\r
5152 const messages_1 = __webpack_require__(21);\r
5153 // @ts-ignore: to avoid inlining LocatioLink as dynamic import\r
5154 let __noDynamicImport;\r
5155 /**\r
5156  * A request to resolve the type definition locations of a symbol at a given text\r
5157  * document position. The request's parameter is of type [TextDocumentPositioParams]\r
5158  * (#TextDocumentPositionParams) the response is of type [Declaration](#Declaration)\r
5159  * or a typed array of [DeclarationLink](#DeclarationLink) or a Thenable that resolves\r
5160  * to such.\r
5161  */\r
5162 var DeclarationRequest;\r
5163 (function (DeclarationRequest) {\r
5164     DeclarationRequest.method = 'textDocument/declaration';\r
5165     DeclarationRequest.type = new messages_1.ProtocolRequestType(DeclarationRequest.method);\r
5166     /** @deprecated Use DeclarationRequest.type */\r
5167     DeclarationRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
5168 })(DeclarationRequest = exports.DeclarationRequest || (exports.DeclarationRequest = {}));\r
5169
5170
5171 /***/ }),
5172 /* 29 */
5173 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5174
5175 \r
5176 /*---------------------------------------------------------------------------------------------\r
5177  *  Copyright (c) Microsoft Corporation. All rights reserved.\r
5178  *  Licensed under the MIT License. See License.txt in the project root for license information.\r
5179  *--------------------------------------------------------------------------------------------*/\r
5180 Object.defineProperty(exports, "__esModule", ({ value: true }));\r
5181 const vscode_jsonrpc_1 = __webpack_require__(5);\r
5182 const messages_1 = __webpack_require__(21);\r
5183 /**\r
5184  * A request to provide selection ranges in a document. The request's\r
5185  * parameter is of type [SelectionRangeParams](#SelectionRangeParams), the\r
5186  * response is of type [SelectionRange[]](#SelectionRange[]) or a Thenable\r
5187  * that resolves to such.\r
5188  */\r
5189 var SelectionRangeRequest;\r
5190 (function (SelectionRangeRequest) {\r
5191     SelectionRangeRequest.method = 'textDocument/selectionRange';\r
5192     SelectionRangeRequest.type = new messages_1.ProtocolRequestType(SelectionRangeRequest.method);\r
5193     /** @deprecated  Use SelectionRangeRequest.type */\r
5194     SelectionRangeRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
5195 })(SelectionRangeRequest = exports.SelectionRangeRequest || (exports.SelectionRangeRequest = {}));\r
5196
5197
5198 /***/ }),
5199 /* 30 */
5200 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5201
5202 /* --------------------------------------------------------------------------------------------\r
5203  * Copyright (c) Microsoft Corporation. All rights reserved.\r
5204  * Licensed under the MIT License. See License.txt in the project root for license information.\r
5205  * ------------------------------------------------------------------------------------------ */\r
5206 \r
5207 Object.defineProperty(exports, "__esModule", ({ value: true }));\r
5208 const vscode_jsonrpc_1 = __webpack_require__(5);\r
5209 const messages_1 = __webpack_require__(21);\r
5210 var WorkDoneProgress;\r
5211 (function (WorkDoneProgress) {\r
5212     WorkDoneProgress.type = new vscode_jsonrpc_1.ProgressType();\r
5213 })(WorkDoneProgress = exports.WorkDoneProgress || (exports.WorkDoneProgress = {}));\r
5214 /**\r
5215  * The `window/workDoneProgress/create` request is sent from the server to the client to initiate progress\r
5216  * reporting from the server.\r
5217  */\r
5218 var WorkDoneProgressCreateRequest;\r
5219 (function (WorkDoneProgressCreateRequest) {\r
5220     WorkDoneProgressCreateRequest.type = new messages_1.ProtocolRequestType('window/workDoneProgress/create');\r
5221 })(WorkDoneProgressCreateRequest = exports.WorkDoneProgressCreateRequest || (exports.WorkDoneProgressCreateRequest = {}));\r
5222 /**\r
5223  * The `window/workDoneProgress/cancel` notification is sent from  the client to the server to cancel a progress\r
5224  * initiated on the server side.\r
5225  */\r
5226 var WorkDoneProgressCancelNotification;\r
5227 (function (WorkDoneProgressCancelNotification) {\r
5228     WorkDoneProgressCancelNotification.type = new messages_1.ProtocolNotificationType('window/workDoneProgress/cancel');\r
5229 })(WorkDoneProgressCancelNotification = exports.WorkDoneProgressCancelNotification || (exports.WorkDoneProgressCancelNotification = {}));\r
5230
5231
5232 /***/ }),
5233 /* 31 */
5234 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5235
5236 /* --------------------------------------------------------------------------------------------\r
5237  * Copyright (c) TypeFox and others. All rights reserved.\r
5238  * Licensed under the MIT License. See License.txt in the project root for license information.\r
5239  * ------------------------------------------------------------------------------------------ */\r
5240 \r
5241 Object.defineProperty(exports, "__esModule", ({ value: true }));\r
5242 const messages_1 = __webpack_require__(21);\r
5243 /**\r
5244  * A request to result a `CallHierarchyItem` in a document at a given position.\r
5245  * Can be used as an input to a incoming or outgoing call hierarchy.\r
5246  *\r
5247  * @since 3.16.0 - Proposed state\r
5248  */\r
5249 var CallHierarchyPrepareRequest;\r
5250 (function (CallHierarchyPrepareRequest) {\r
5251     CallHierarchyPrepareRequest.method = 'textDocument/prepareCallHierarchy';\r
5252     CallHierarchyPrepareRequest.type = new messages_1.ProtocolRequestType(CallHierarchyPrepareRequest.method);\r
5253 })(CallHierarchyPrepareRequest = exports.CallHierarchyPrepareRequest || (exports.CallHierarchyPrepareRequest = {}));\r
5254 /**\r
5255  * A request to resolve the incoming calls for a given `CallHierarchyItem`.\r
5256  *\r
5257  * @since 3.16.0 - Proposed state\r
5258  */\r
5259 var CallHierarchyIncomingCallsRequest;\r
5260 (function (CallHierarchyIncomingCallsRequest) {\r
5261     CallHierarchyIncomingCallsRequest.method = 'callHierarchy/incomingCalls';\r
5262     CallHierarchyIncomingCallsRequest.type = new messages_1.ProtocolRequestType(CallHierarchyIncomingCallsRequest.method);\r
5263 })(CallHierarchyIncomingCallsRequest = exports.CallHierarchyIncomingCallsRequest || (exports.CallHierarchyIncomingCallsRequest = {}));\r
5264 /**\r
5265  * A request to resolve the outgoing calls for a given `CallHierarchyItem`.\r
5266  *\r
5267  * @since 3.16.0 - Proposed state\r
5268  */\r
5269 var CallHierarchyOutgoingCallsRequest;\r
5270 (function (CallHierarchyOutgoingCallsRequest) {\r
5271     CallHierarchyOutgoingCallsRequest.method = 'callHierarchy/outgoingCalls';\r
5272     CallHierarchyOutgoingCallsRequest.type = new messages_1.ProtocolRequestType(CallHierarchyOutgoingCallsRequest.method);\r
5273 })(CallHierarchyOutgoingCallsRequest = exports.CallHierarchyOutgoingCallsRequest || (exports.CallHierarchyOutgoingCallsRequest = {}));\r
5274
5275
5276 /***/ }),
5277 /* 32 */
5278 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5279
5280 /* --------------------------------------------------------------------------------------------\r
5281  * Copyright (c) Microsoft Corporation. All rights reserved.\r
5282  * Licensed under the MIT License. See License.txt in the project root for license information.\r
5283  * ------------------------------------------------------------------------------------------ */\r
5284 \r
5285 Object.defineProperty(exports, "__esModule", ({ value: true }));\r
5286 const messages_1 = __webpack_require__(21);\r
5287 /**\r
5288  * A set of predefined token types. This set is not fixed\r
5289  * an clients can specify additional token types via the\r
5290  * corresponding client capabilities.\r
5291  *\r
5292  * @since 3.16.0 - Proposed state\r
5293  */\r
5294 var SemanticTokenTypes;\r
5295 (function (SemanticTokenTypes) {\r
5296     SemanticTokenTypes["comment"] = "comment";\r
5297     SemanticTokenTypes["keyword"] = "keyword";\r
5298     SemanticTokenTypes["string"] = "string";\r
5299     SemanticTokenTypes["number"] = "number";\r
5300     SemanticTokenTypes["regexp"] = "regexp";\r
5301     SemanticTokenTypes["operator"] = "operator";\r
5302     SemanticTokenTypes["namespace"] = "namespace";\r
5303     SemanticTokenTypes["type"] = "type";\r
5304     SemanticTokenTypes["struct"] = "struct";\r
5305     SemanticTokenTypes["class"] = "class";\r
5306     SemanticTokenTypes["interface"] = "interface";\r
5307     SemanticTokenTypes["enum"] = "enum";\r
5308     SemanticTokenTypes["typeParameter"] = "typeParameter";\r
5309     SemanticTokenTypes["function"] = "function";\r
5310     SemanticTokenTypes["member"] = "member";\r
5311     SemanticTokenTypes["property"] = "property";\r
5312     SemanticTokenTypes["macro"] = "macro";\r
5313     SemanticTokenTypes["variable"] = "variable";\r
5314     SemanticTokenTypes["parameter"] = "parameter";\r
5315     SemanticTokenTypes["label"] = "label";\r
5316 })(SemanticTokenTypes = exports.SemanticTokenTypes || (exports.SemanticTokenTypes = {}));\r
5317 /**\r
5318  * A set of predefined token modifiers. This set is not fixed\r
5319  * an clients can specify additional token types via the\r
5320  * corresponding client capabilities.\r
5321  *\r
5322  * @since 3.16.0 - Proposed state\r
5323  */\r
5324 var SemanticTokenModifiers;\r
5325 (function (SemanticTokenModifiers) {\r
5326     SemanticTokenModifiers["documentation"] = "documentation";\r
5327     SemanticTokenModifiers["declaration"] = "declaration";\r
5328     SemanticTokenModifiers["definition"] = "definition";\r
5329     SemanticTokenModifiers["reference"] = "reference";\r
5330     SemanticTokenModifiers["static"] = "static";\r
5331     SemanticTokenModifiers["abstract"] = "abstract";\r
5332     SemanticTokenModifiers["deprecated"] = "deprecated";\r
5333     SemanticTokenModifiers["async"] = "async";\r
5334     SemanticTokenModifiers["volatile"] = "volatile";\r
5335     SemanticTokenModifiers["readonly"] = "readonly";\r
5336 })(SemanticTokenModifiers = exports.SemanticTokenModifiers || (exports.SemanticTokenModifiers = {}));\r
5337 /**\r
5338  * @since 3.16.0 - Proposed state\r
5339  */\r
5340 var SemanticTokens;\r
5341 (function (SemanticTokens) {\r
5342     function is(value) {\r
5343         const candidate = value;\r
5344         return candidate !== undefined && (candidate.resultId === undefined || typeof candidate.resultId === 'string') &&\r
5345             Array.isArray(candidate.data) && (candidate.data.length === 0 || typeof candidate.data[0] === 'number');\r
5346     }\r
5347     SemanticTokens.is = is;\r
5348 })(SemanticTokens = exports.SemanticTokens || (exports.SemanticTokens = {}));\r
5349 /**\r
5350  * @since 3.16.0 - Proposed state\r
5351  */\r
5352 var SemanticTokensRequest;\r
5353 (function (SemanticTokensRequest) {\r
5354     SemanticTokensRequest.method = 'textDocument/semanticTokens';\r
5355     SemanticTokensRequest.type = new messages_1.ProtocolRequestType(SemanticTokensRequest.method);\r
5356 })(SemanticTokensRequest = exports.SemanticTokensRequest || (exports.SemanticTokensRequest = {}));\r
5357 /**\r
5358  * @since 3.16.0 - Proposed state\r
5359  */\r
5360 var SemanticTokensEditsRequest;\r
5361 (function (SemanticTokensEditsRequest) {\r
5362     SemanticTokensEditsRequest.method = 'textDocument/semanticTokens/edits';\r
5363     SemanticTokensEditsRequest.type = new messages_1.ProtocolRequestType(SemanticTokensEditsRequest.method);\r
5364 })(SemanticTokensEditsRequest = exports.SemanticTokensEditsRequest || (exports.SemanticTokensEditsRequest = {}));\r
5365 /**\r
5366  * @since 3.16.0 - Proposed state\r
5367  */\r
5368 var SemanticTokensRangeRequest;\r
5369 (function (SemanticTokensRangeRequest) {\r
5370     SemanticTokensRangeRequest.method = 'textDocument/semanticTokens/range';\r
5371     SemanticTokensRangeRequest.type = new messages_1.ProtocolRequestType(SemanticTokensRangeRequest.method);\r
5372 })(SemanticTokensRangeRequest = exports.SemanticTokensRangeRequest || (exports.SemanticTokensRangeRequest = {}));\r
5373
5374
5375 /***/ }),
5376 /* 33 */
5377 /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
5378
5379
5380 /*---------------------------------------------------------------------------------------------
5381  *  Copyright (c) Microsoft Corporation. All rights reserved.
5382  *  Licensed under the MIT License. See License.txt in the project root for license information.
5383  *--------------------------------------------------------------------------------------------*/
5384 var __importDefault = (this && this.__importDefault) || function (mod) {
5385     return (mod && mod.__esModule) ? mod : { "default": mod };
5386 };
5387 Object.defineProperty(exports, "__esModule", ({ value: true }));
5388 exports.joinPath = exports.normalizePath = exports.resolvePath = exports.FileType = void 0;
5389 const path_1 = __importDefault(__webpack_require__(3));
5390 var FileType;
5391 (function (FileType) {
5392     /**
5393      * The file type is unknown.
5394      */
5395     FileType[FileType["Unknown"] = 0] = "Unknown";
5396     /**
5397      * A regular file.
5398      */
5399     FileType[FileType["File"] = 1] = "File";
5400     /**
5401      * A directory.
5402      */
5403     FileType[FileType["Directory"] = 2] = "Directory";
5404     /**
5405      * A symbolic link to a file.
5406      */
5407     FileType[FileType["SymbolicLink"] = 64] = "SymbolicLink";
5408 })(FileType = exports.FileType || (exports.FileType = {}));
5409 const Dot = '.'.charCodeAt(0);
5410 function resolvePath(uri, p) {
5411     if (path_1.default.isAbsolute(p)) {
5412         return uri.with({ path: normalizePath(p.split('/')) });
5413     }
5414     return joinPath(uri, p);
5415 }
5416 exports.resolvePath = resolvePath;
5417 function normalizePath(parts) {
5418     const newParts = [];
5419     for (const part of parts) {
5420         if (part.length === 0 || part.length === 1 && part.charCodeAt(0) === Dot) {
5421             // ignore
5422         }
5423         else if (part.length === 2 && part.charCodeAt(0) === Dot && part.charCodeAt(1) === Dot) {
5424             newParts.pop();
5425         }
5426         else {
5427             newParts.push(part);
5428         }
5429     }
5430     if (parts.length > 1 && parts[parts.length - 1].length === 0) {
5431         newParts.push('');
5432     }
5433     let res = newParts.join('/');
5434     if (parts[0].length === 0) {
5435         res = '/' + res;
5436     }
5437     return res;
5438 }
5439 exports.normalizePath = normalizePath;
5440 function joinPath(uri, ...paths) {
5441     const parts = uri.path.split('/');
5442     for (let path of paths) {
5443         parts.push(...path.split('/'));
5444     }
5445     return uri.with({ path: normalizePath(parts) });
5446 }
5447 exports.joinPath = joinPath;
5448
5449
5450 /***/ })
5451 /******/        ]);
5452 /************************************************************************/
5453 /******/        // The module cache
5454 /******/        var __webpack_module_cache__ = {};
5455 /******/        
5456 /******/        // The require function
5457 /******/        function __webpack_require__(moduleId) {
5458 /******/                // Check if module is in cache
5459 /******/                if(__webpack_module_cache__[moduleId]) {
5460 /******/                        return __webpack_module_cache__[moduleId].exports;
5461 /******/                }
5462 /******/                // Create a new module (and put it into the cache)
5463 /******/                var module = __webpack_module_cache__[moduleId] = {
5464 /******/                        // no module.id needed
5465 /******/                        // no module.loaded needed
5466 /******/                        exports: {}
5467 /******/                };
5468 /******/        
5469 /******/                // Execute the module function
5470 /******/                __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
5471 /******/        
5472 /******/                // Return the exports of the module
5473 /******/                return module.exports;
5474 /******/        }
5475 /******/        
5476 /************************************************************************/
5477 /******/        /* webpack/runtime/define property getters */
5478 /******/        (() => {
5479 /******/                // define getter functions for harmony exports
5480 /******/                __webpack_require__.d = (exports, definition) => {
5481 /******/                        for(var key in definition) {
5482 /******/                                if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
5483 /******/                                        Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
5484 /******/                                }
5485 /******/                        }
5486 /******/                };
5487 /******/        })();
5488 /******/        
5489 /******/        /* webpack/runtime/hasOwnProperty shorthand */
5490 /******/        (() => {
5491 /******/                __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop)
5492 /******/        })();
5493 /******/        
5494 /******/        /* webpack/runtime/make namespace object */
5495 /******/        (() => {
5496 /******/                // define __esModule on exports
5497 /******/                __webpack_require__.r = (exports) => {
5498 /******/                        if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
5499 /******/                                Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5500 /******/                        }
5501 /******/                        Object.defineProperty(exports, '__esModule', { value: true });
5502 /******/                };
5503 /******/        })();
5504 /******/        
5505 /************************************************************************/
5506 /******/        // module exports must be returned from runtime so entry inlining is disabled
5507 /******/        // startup
5508 /******/        // Load entry module and return exports
5509 /******/        return __webpack_require__(0);
5510 /******/ })()
5511
5512 ));