Actualizacion maquina principal
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-eslint / lib / server.js
diff --git a/.config/coc/extensions/node_modules/coc-eslint/lib/server.js b/.config/coc/extensions/node_modules/coc-eslint/lib/server.js
new file mode 100644 (file)
index 0000000..7894d46
--- /dev/null
@@ -0,0 +1,9710 @@
+(function(e, a) { for(var i in a) e[i] = a[i]; }(exports, /******/ (function(modules) { // webpackBootstrap
+/******/       // The module cache
+/******/       var installedModules = {};
+/******/
+/******/       // The require function
+/******/       function __webpack_require__(moduleId) {
+/******/
+/******/               // Check if module is in cache
+/******/               if(installedModules[moduleId]) {
+/******/                       return installedModules[moduleId].exports;
+/******/               }
+/******/               // Create a new module (and put it into the cache)
+/******/               var module = installedModules[moduleId] = {
+/******/                       i: moduleId,
+/******/                       l: false,
+/******/                       exports: {}
+/******/               };
+/******/
+/******/               // Execute the module function
+/******/               modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+/******/
+/******/               // Flag the module as loaded
+/******/               module.l = true;
+/******/
+/******/               // Return the exports of the module
+/******/               return module.exports;
+/******/       }
+/******/
+/******/
+/******/       // expose the modules object (__webpack_modules__)
+/******/       __webpack_require__.m = modules;
+/******/
+/******/       // expose the module cache
+/******/       __webpack_require__.c = installedModules;
+/******/
+/******/       // define getter function for harmony exports
+/******/       __webpack_require__.d = function(exports, name, getter) {
+/******/               if(!__webpack_require__.o(exports, name)) {
+/******/                       Object.defineProperty(exports, name, { enumerable: true, get: getter });
+/******/               }
+/******/       };
+/******/
+/******/       // define __esModule on exports
+/******/       __webpack_require__.r = function(exports) {
+/******/               if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
+/******/                       Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
+/******/               }
+/******/               Object.defineProperty(exports, '__esModule', { value: true });
+/******/       };
+/******/
+/******/       // create a fake namespace object
+/******/       // mode & 1: value is a module id, require it
+/******/       // mode & 2: merge all properties of value into the ns
+/******/       // mode & 4: return value when already ns object
+/******/       // mode & 8|1: behave like require
+/******/       __webpack_require__.t = function(value, mode) {
+/******/               if(mode & 1) value = __webpack_require__(value);
+/******/               if(mode & 8) return value;
+/******/               if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
+/******/               var ns = Object.create(null);
+/******/               __webpack_require__.r(ns);
+/******/               Object.defineProperty(ns, 'default', { enumerable: true, value: value });
+/******/               if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
+/******/               return ns;
+/******/       };
+/******/
+/******/       // getDefaultExport function for compatibility with non-harmony modules
+/******/       __webpack_require__.n = function(module) {
+/******/               var getter = module && module.__esModule ?
+/******/                       function getDefault() { return module['default']; } :
+/******/                       function getModuleExports() { return module; };
+/******/               __webpack_require__.d(getter, 'a', getter);
+/******/               return getter;
+/******/       };
+/******/
+/******/       // Object.prototype.hasOwnProperty.call
+/******/       __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
+/******/
+/******/       // __webpack_public_path__
+/******/       __webpack_require__.p = "";
+/******/
+/******/
+/******/       // Load entry module and return exports
+/******/       return __webpack_require__(__webpack_require__.s = 36);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */,
+/* 1 */,
+/* 2 */
+/***/ (function(module, exports) {
+
+module.exports = require("fs");
+
+/***/ }),
+/* 3 */
+/***/ (function(module, exports) {
+
+module.exports = require("path");
+
+/***/ }),
+/* 4 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/* --------------------------------------------------------------------------------------------\r
+ * Copyright (c) Microsoft Corporation. All rights reserved.\r
+ * Licensed under the MIT License. See License.txt in the project root for license information.\r
+ * ------------------------------------------------------------------------------------------ */\r
+\r
+function __export(m) {\r
+    for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r
+}\r
+Object.defineProperty(exports, "__esModule", { value: true });\r
+const vscode_jsonrpc_1 = __webpack_require__(5);\r
+exports.ErrorCodes = vscode_jsonrpc_1.ErrorCodes;\r
+exports.ResponseError = vscode_jsonrpc_1.ResponseError;\r
+exports.CancellationToken = vscode_jsonrpc_1.CancellationToken;\r
+exports.CancellationTokenSource = vscode_jsonrpc_1.CancellationTokenSource;\r
+exports.Disposable = vscode_jsonrpc_1.Disposable;\r
+exports.Event = vscode_jsonrpc_1.Event;\r
+exports.Emitter = vscode_jsonrpc_1.Emitter;\r
+exports.Trace = vscode_jsonrpc_1.Trace;\r
+exports.TraceFormat = vscode_jsonrpc_1.TraceFormat;\r
+exports.SetTraceNotification = vscode_jsonrpc_1.SetTraceNotification;\r
+exports.LogTraceNotification = vscode_jsonrpc_1.LogTraceNotification;\r
+exports.RequestType = vscode_jsonrpc_1.RequestType;\r
+exports.RequestType0 = vscode_jsonrpc_1.RequestType0;\r
+exports.NotificationType = vscode_jsonrpc_1.NotificationType;\r
+exports.NotificationType0 = vscode_jsonrpc_1.NotificationType0;\r
+exports.MessageReader = vscode_jsonrpc_1.MessageReader;\r
+exports.MessageWriter = vscode_jsonrpc_1.MessageWriter;\r
+exports.ConnectionStrategy = vscode_jsonrpc_1.ConnectionStrategy;\r
+exports.StreamMessageReader = vscode_jsonrpc_1.StreamMessageReader;\r
+exports.StreamMessageWriter = vscode_jsonrpc_1.StreamMessageWriter;\r
+exports.IPCMessageReader = vscode_jsonrpc_1.IPCMessageReader;\r
+exports.IPCMessageWriter = vscode_jsonrpc_1.IPCMessageWriter;\r
+exports.createClientPipeTransport = vscode_jsonrpc_1.createClientPipeTransport;\r
+exports.createServerPipeTransport = vscode_jsonrpc_1.createServerPipeTransport;\r
+exports.generateRandomPipeName = vscode_jsonrpc_1.generateRandomPipeName;\r
+exports.createClientSocketTransport = vscode_jsonrpc_1.createClientSocketTransport;\r
+exports.createServerSocketTransport = vscode_jsonrpc_1.createServerSocketTransport;\r
+exports.ProgressType = vscode_jsonrpc_1.ProgressType;\r
+__export(__webpack_require__(18));\r
+__export(__webpack_require__(19));\r
+const callHierarchy = __webpack_require__(30);\r
+var Proposed;\r
+(function (Proposed) {\r
+    let CallHierarchyPrepareRequest;\r
+    (function (CallHierarchyPrepareRequest) {\r
+        CallHierarchyPrepareRequest.method = callHierarchy.CallHierarchyPrepareRequest.method;\r
+        CallHierarchyPrepareRequest.type = callHierarchy.CallHierarchyPrepareRequest.type;\r
+    })(CallHierarchyPrepareRequest = Proposed.CallHierarchyPrepareRequest || (Proposed.CallHierarchyPrepareRequest = {}));\r
+    let CallHierarchyIncomingCallsRequest;\r
+    (function (CallHierarchyIncomingCallsRequest) {\r
+        CallHierarchyIncomingCallsRequest.method = callHierarchy.CallHierarchyIncomingCallsRequest.method;\r
+        CallHierarchyIncomingCallsRequest.type = callHierarchy.CallHierarchyIncomingCallsRequest;\r
+        CallHierarchyIncomingCallsRequest.resultType = callHierarchy.CallHierarchyIncomingCallsRequest.resultType;\r
+    })(CallHierarchyIncomingCallsRequest = Proposed.CallHierarchyIncomingCallsRequest || (Proposed.CallHierarchyIncomingCallsRequest = {}));\r
+    let CallHierarchyOutgoingCallsRequest;\r
+    (function (CallHierarchyOutgoingCallsRequest) {\r
+        CallHierarchyOutgoingCallsRequest.method = callHierarchy.CallHierarchyOutgoingCallsRequest.method;\r
+        CallHierarchyOutgoingCallsRequest.type = callHierarchy.CallHierarchyOutgoingCallsRequest;\r
+        CallHierarchyOutgoingCallsRequest.resultType = callHierarchy.CallHierarchyOutgoingCallsRequest.resultType;\r
+    })(CallHierarchyOutgoingCallsRequest = Proposed.CallHierarchyOutgoingCallsRequest || (Proposed.CallHierarchyOutgoingCallsRequest = {}));\r
+})(Proposed = exports.Proposed || (exports.Proposed = {}));\r
+function createProtocolConnection(reader, writer, logger, strategy) {\r
+    return vscode_jsonrpc_1.createMessageConnection(reader, writer, logger, strategy);\r
+}\r
+exports.createProtocolConnection = createProtocolConnection;\r
+
+
+/***/ }),
+/* 5 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/* --------------------------------------------------------------------------------------------\r
+ * Copyright (c) Microsoft Corporation. All rights reserved.\r
+ * Licensed under the MIT License. See License.txt in the project root for license information.\r
+ * ------------------------------------------------------------------------------------------ */\r
+/// <reference path="../typings/thenable.d.ts" />\r
+\r
+function __export(m) {\r
+    for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r
+}\r
+Object.defineProperty(exports, "__esModule", { value: true });\r
+const Is = __webpack_require__(6);\r
+const messages_1 = __webpack_require__(7);\r
+exports.RequestType = messages_1.RequestType;\r
+exports.RequestType0 = messages_1.RequestType0;\r
+exports.RequestType1 = messages_1.RequestType1;\r
+exports.RequestType2 = messages_1.RequestType2;\r
+exports.RequestType3 = messages_1.RequestType3;\r
+exports.RequestType4 = messages_1.RequestType4;\r
+exports.RequestType5 = messages_1.RequestType5;\r
+exports.RequestType6 = messages_1.RequestType6;\r
+exports.RequestType7 = messages_1.RequestType7;\r
+exports.RequestType8 = messages_1.RequestType8;\r
+exports.RequestType9 = messages_1.RequestType9;\r
+exports.ResponseError = messages_1.ResponseError;\r
+exports.ErrorCodes = messages_1.ErrorCodes;\r
+exports.NotificationType = messages_1.NotificationType;\r
+exports.NotificationType0 = messages_1.NotificationType0;\r
+exports.NotificationType1 = messages_1.NotificationType1;\r
+exports.NotificationType2 = messages_1.NotificationType2;\r
+exports.NotificationType3 = messages_1.NotificationType3;\r
+exports.NotificationType4 = messages_1.NotificationType4;\r
+exports.NotificationType5 = messages_1.NotificationType5;\r
+exports.NotificationType6 = messages_1.NotificationType6;\r
+exports.NotificationType7 = messages_1.NotificationType7;\r
+exports.NotificationType8 = messages_1.NotificationType8;\r
+exports.NotificationType9 = messages_1.NotificationType9;\r
+const messageReader_1 = __webpack_require__(8);\r
+exports.MessageReader = messageReader_1.MessageReader;\r
+exports.StreamMessageReader = messageReader_1.StreamMessageReader;\r
+exports.IPCMessageReader = messageReader_1.IPCMessageReader;\r
+exports.SocketMessageReader = messageReader_1.SocketMessageReader;\r
+const messageWriter_1 = __webpack_require__(10);\r
+exports.MessageWriter = messageWriter_1.MessageWriter;\r
+exports.StreamMessageWriter = messageWriter_1.StreamMessageWriter;\r
+exports.IPCMessageWriter = messageWriter_1.IPCMessageWriter;\r
+exports.SocketMessageWriter = messageWriter_1.SocketMessageWriter;\r
+const events_1 = __webpack_require__(9);\r
+exports.Disposable = events_1.Disposable;\r
+exports.Event = events_1.Event;\r
+exports.Emitter = events_1.Emitter;\r
+const cancellation_1 = __webpack_require__(11);\r
+exports.CancellationTokenSource = cancellation_1.CancellationTokenSource;\r
+exports.CancellationToken = cancellation_1.CancellationToken;\r
+const linkedMap_1 = __webpack_require__(12);\r
+__export(__webpack_require__(13));\r
+__export(__webpack_require__(17));\r
+var CancelNotification;\r
+(function (CancelNotification) {\r
+    CancelNotification.type = new messages_1.NotificationType('$/cancelRequest');\r
+})(CancelNotification || (CancelNotification = {}));\r
+var ProgressNotification;\r
+(function (ProgressNotification) {\r
+    ProgressNotification.type = new messages_1.NotificationType('$/progress');\r
+})(ProgressNotification || (ProgressNotification = {}));\r
+class ProgressType {\r
+    constructor() {\r
+        this._ = undefined;\r
+    }\r
+}\r
+exports.ProgressType = ProgressType;\r
+exports.NullLogger = Object.freeze({\r
+    error: () => { },\r
+    warn: () => { },\r
+    info: () => { },\r
+    log: () => { }\r
+});\r
+var Trace;\r
+(function (Trace) {\r
+    Trace[Trace["Off"] = 0] = "Off";\r
+    Trace[Trace["Messages"] = 1] = "Messages";\r
+    Trace[Trace["Verbose"] = 2] = "Verbose";\r
+})(Trace = exports.Trace || (exports.Trace = {}));\r
+(function (Trace) {\r
+    function fromString(value) {\r
+        if (!Is.string(value)) {\r
+            return Trace.Off;\r
+        }\r
+        value = value.toLowerCase();\r
+        switch (value) {\r
+            case 'off':\r
+                return Trace.Off;\r
+            case 'messages':\r
+                return Trace.Messages;\r
+            case 'verbose':\r
+                return Trace.Verbose;\r
+            default:\r
+                return Trace.Off;\r
+        }\r
+    }\r
+    Trace.fromString = fromString;\r
+    function toString(value) {\r
+        switch (value) {\r
+            case Trace.Off:\r
+                return 'off';\r
+            case Trace.Messages:\r
+                return 'messages';\r
+            case Trace.Verbose:\r
+                return 'verbose';\r
+            default:\r
+                return 'off';\r
+        }\r
+    }\r
+    Trace.toString = toString;\r
+})(Trace = exports.Trace || (exports.Trace = {}));\r
+var TraceFormat;\r
+(function (TraceFormat) {\r
+    TraceFormat["Text"] = "text";\r
+    TraceFormat["JSON"] = "json";\r
+})(TraceFormat = exports.TraceFormat || (exports.TraceFormat = {}));\r
+(function (TraceFormat) {\r
+    function fromString(value) {\r
+        value = value.toLowerCase();\r
+        if (value === 'json') {\r
+            return TraceFormat.JSON;\r
+        }\r
+        else {\r
+            return TraceFormat.Text;\r
+        }\r
+    }\r
+    TraceFormat.fromString = fromString;\r
+})(TraceFormat = exports.TraceFormat || (exports.TraceFormat = {}));\r
+var SetTraceNotification;\r
+(function (SetTraceNotification) {\r
+    SetTraceNotification.type = new messages_1.NotificationType('$/setTraceNotification');\r
+})(SetTraceNotification = exports.SetTraceNotification || (exports.SetTraceNotification = {}));\r
+var LogTraceNotification;\r
+(function (LogTraceNotification) {\r
+    LogTraceNotification.type = new messages_1.NotificationType('$/logTraceNotification');\r
+})(LogTraceNotification = exports.LogTraceNotification || (exports.LogTraceNotification = {}));\r
+var ConnectionErrors;\r
+(function (ConnectionErrors) {\r
+    /**\r
+     * The connection is closed.\r
+     */\r
+    ConnectionErrors[ConnectionErrors["Closed"] = 1] = "Closed";\r
+    /**\r
+     * The connection got disposed.\r
+     */\r
+    ConnectionErrors[ConnectionErrors["Disposed"] = 2] = "Disposed";\r
+    /**\r
+     * The connection is already in listening mode.\r
+     */\r
+    ConnectionErrors[ConnectionErrors["AlreadyListening"] = 3] = "AlreadyListening";\r
+})(ConnectionErrors = exports.ConnectionErrors || (exports.ConnectionErrors = {}));\r
+class ConnectionError extends Error {\r
+    constructor(code, message) {\r
+        super(message);\r
+        this.code = code;\r
+        Object.setPrototypeOf(this, ConnectionError.prototype);\r
+    }\r
+}\r
+exports.ConnectionError = ConnectionError;\r
+var ConnectionStrategy;\r
+(function (ConnectionStrategy) {\r
+    function is(value) {\r
+        let candidate = value;\r
+        return candidate && Is.func(candidate.cancelUndispatched);\r
+    }\r
+    ConnectionStrategy.is = is;\r
+})(ConnectionStrategy = exports.ConnectionStrategy || (exports.ConnectionStrategy = {}));\r
+var ConnectionState;\r
+(function (ConnectionState) {\r
+    ConnectionState[ConnectionState["New"] = 1] = "New";\r
+    ConnectionState[ConnectionState["Listening"] = 2] = "Listening";\r
+    ConnectionState[ConnectionState["Closed"] = 3] = "Closed";\r
+    ConnectionState[ConnectionState["Disposed"] = 4] = "Disposed";\r
+})(ConnectionState || (ConnectionState = {}));\r
+function _createMessageConnection(messageReader, messageWriter, logger, strategy) {\r
+    let sequenceNumber = 0;\r
+    let notificationSquenceNumber = 0;\r
+    let unknownResponseSquenceNumber = 0;\r
+    const version = '2.0';\r
+    let starRequestHandler = undefined;\r
+    let requestHandlers = Object.create(null);\r
+    let starNotificationHandler = undefined;\r
+    let notificationHandlers = Object.create(null);\r
+    let progressHandlers = new Map();\r
+    let timer;\r
+    let messageQueue = new linkedMap_1.LinkedMap();\r
+    let responsePromises = Object.create(null);\r
+    let requestTokens = Object.create(null);\r
+    let trace = Trace.Off;\r
+    let traceFormat = TraceFormat.Text;\r
+    let tracer;\r
+    let state = ConnectionState.New;\r
+    let errorEmitter = new events_1.Emitter();\r
+    let closeEmitter = new events_1.Emitter();\r
+    let unhandledNotificationEmitter = new events_1.Emitter();\r
+    let unhandledProgressEmitter = new events_1.Emitter();\r
+    let disposeEmitter = new events_1.Emitter();\r
+    function createRequestQueueKey(id) {\r
+        return 'req-' + id.toString();\r
+    }\r
+    function createResponseQueueKey(id) {\r
+        if (id === null) {\r
+            return 'res-unknown-' + (++unknownResponseSquenceNumber).toString();\r
+        }\r
+        else {\r
+            return 'res-' + id.toString();\r
+        }\r
+    }\r
+    function createNotificationQueueKey() {\r
+        return 'not-' + (++notificationSquenceNumber).toString();\r
+    }\r
+    function addMessageToQueue(queue, message) {\r
+        if (messages_1.isRequestMessage(message)) {\r
+            queue.set(createRequestQueueKey(message.id), message);\r
+        }\r
+        else if (messages_1.isResponseMessage(message)) {\r
+            queue.set(createResponseQueueKey(message.id), message);\r
+        }\r
+        else {\r
+            queue.set(createNotificationQueueKey(), message);\r
+        }\r
+    }\r
+    function cancelUndispatched(_message) {\r
+        return undefined;\r
+    }\r
+    function isListening() {\r
+        return state === ConnectionState.Listening;\r
+    }\r
+    function isClosed() {\r
+        return state === ConnectionState.Closed;\r
+    }\r
+    function isDisposed() {\r
+        return state === ConnectionState.Disposed;\r
+    }\r
+    function closeHandler() {\r
+        if (state === ConnectionState.New || state === ConnectionState.Listening) {\r
+            state = ConnectionState.Closed;\r
+            closeEmitter.fire(undefined);\r
+        }\r
+        // If the connection is disposed don't sent close events.\r
+    }\r
+    function readErrorHandler(error) {\r
+        errorEmitter.fire([error, undefined, undefined]);\r
+    }\r
+    function writeErrorHandler(data) {\r
+        errorEmitter.fire(data);\r
+    }\r
+    messageReader.onClose(closeHandler);\r
+    messageReader.onError(readErrorHandler);\r
+    messageWriter.onClose(closeHandler);\r
+    messageWriter.onError(writeErrorHandler);\r
+    function triggerMessageQueue() {\r
+        if (timer || messageQueue.size === 0) {\r
+            return;\r
+        }\r
+        timer = setImmediate(() => {\r
+            timer = undefined;\r
+            processMessageQueue();\r
+        });\r
+    }\r
+    function processMessageQueue() {\r
+        if (messageQueue.size === 0) {\r
+            return;\r
+        }\r
+        let message = messageQueue.shift();\r
+        try {\r
+            if (messages_1.isRequestMessage(message)) {\r
+                handleRequest(message);\r
+            }\r
+            else if (messages_1.isNotificationMessage(message)) {\r
+                handleNotification(message);\r
+            }\r
+            else if (messages_1.isResponseMessage(message)) {\r
+                handleResponse(message);\r
+            }\r
+            else {\r
+                handleInvalidMessage(message);\r
+            }\r
+        }\r
+        finally {\r
+            triggerMessageQueue();\r
+        }\r
+    }\r
+    let callback = (message) => {\r
+        try {\r
+            // We have received a cancellation message. Check if the message is still in the queue\r
+            // and cancel it if allowed to do so.\r
+            if (messages_1.isNotificationMessage(message) && message.method === CancelNotification.type.method) {\r
+                let key = createRequestQueueKey(message.params.id);\r
+                let toCancel = messageQueue.get(key);\r
+                if (messages_1.isRequestMessage(toCancel)) {\r
+                    let response = strategy && strategy.cancelUndispatched ? strategy.cancelUndispatched(toCancel, cancelUndispatched) : cancelUndispatched(toCancel);\r
+                    if (response && (response.error !== void 0 || response.result !== void 0)) {\r
+                        messageQueue.delete(key);\r
+                        response.id = toCancel.id;\r
+                        traceSendingResponse(response, message.method, Date.now());\r
+                        messageWriter.write(response);\r
+                        return;\r
+                    }\r
+                }\r
+            }\r
+            addMessageToQueue(messageQueue, message);\r
+        }\r
+        finally {\r
+            triggerMessageQueue();\r
+        }\r
+    };\r
+    function handleRequest(requestMessage) {\r
+        if (isDisposed()) {\r
+            // we return here silently since we fired an event when the\r
+            // connection got disposed.\r
+            return;\r
+        }\r
+        function reply(resultOrError, method, startTime) {\r
+            let message = {\r
+                jsonrpc: version,\r
+                id: requestMessage.id\r
+            };\r
+            if (resultOrError instanceof messages_1.ResponseError) {\r
+                message.error = resultOrError.toJson();\r
+            }\r
+            else {\r
+                message.result = resultOrError === void 0 ? null : resultOrError;\r
+            }\r
+            traceSendingResponse(message, method, startTime);\r
+            messageWriter.write(message);\r
+        }\r
+        function replyError(error, method, startTime) {\r
+            let message = {\r
+                jsonrpc: version,\r
+                id: requestMessage.id,\r
+                error: error.toJson()\r
+            };\r
+            traceSendingResponse(message, method, startTime);\r
+            messageWriter.write(message);\r
+        }\r
+        function replySuccess(result, method, startTime) {\r
+            // The JSON RPC defines that a response must either have a result or an error\r
+            // So we can't treat undefined as a valid response result.\r
+            if (result === void 0) {\r
+                result = null;\r
+            }\r
+            let message = {\r
+                jsonrpc: version,\r
+                id: requestMessage.id,\r
+                result: result\r
+            };\r
+            traceSendingResponse(message, method, startTime);\r
+            messageWriter.write(message);\r
+        }\r
+        traceReceivedRequest(requestMessage);\r
+        let element = requestHandlers[requestMessage.method];\r
+        let type;\r
+        let requestHandler;\r
+        if (element) {\r
+            type = element.type;\r
+            requestHandler = element.handler;\r
+        }\r
+        let startTime = Date.now();\r
+        if (requestHandler || starRequestHandler) {\r
+            let cancellationSource = new cancellation_1.CancellationTokenSource();\r
+            let tokenKey = String(requestMessage.id);\r
+            requestTokens[tokenKey] = cancellationSource;\r
+            try {\r
+                let handlerResult;\r
+                if (requestMessage.params === void 0 || (type !== void 0 && type.numberOfParams === 0)) {\r
+                    handlerResult = requestHandler\r
+                        ? requestHandler(cancellationSource.token)\r
+                        : starRequestHandler(requestMessage.method, cancellationSource.token);\r
+                }\r
+                else if (Is.array(requestMessage.params) && (type === void 0 || type.numberOfParams > 1)) {\r
+                    handlerResult = requestHandler\r
+                        ? requestHandler(...requestMessage.params, cancellationSource.token)\r
+                        : starRequestHandler(requestMessage.method, ...requestMessage.params, cancellationSource.token);\r
+                }\r
+                else {\r
+                    handlerResult = requestHandler\r
+                        ? requestHandler(requestMessage.params, cancellationSource.token)\r
+                        : starRequestHandler(requestMessage.method, requestMessage.params, cancellationSource.token);\r
+                }\r
+                let promise = handlerResult;\r
+                if (!handlerResult) {\r
+                    delete requestTokens[tokenKey];\r
+                    replySuccess(handlerResult, requestMessage.method, startTime);\r
+                }\r
+                else if (promise.then) {\r
+                    promise.then((resultOrError) => {\r
+                        delete requestTokens[tokenKey];\r
+                        reply(resultOrError, requestMessage.method, startTime);\r
+                    }, error => {\r
+                        delete requestTokens[tokenKey];\r
+                        if (error instanceof messages_1.ResponseError) {\r
+                            replyError(error, requestMessage.method, startTime);\r
+                        }\r
+                        else if (error && Is.string(error.message)) {\r
+                            replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed with message: ${error.message}`), requestMessage.method, startTime);\r
+                        }\r
+                        else {\r
+                            replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed unexpectedly without providing any details.`), requestMessage.method, startTime);\r
+                        }\r
+                    });\r
+                }\r
+                else {\r
+                    delete requestTokens[tokenKey];\r
+                    reply(handlerResult, requestMessage.method, startTime);\r
+                }\r
+            }\r
+            catch (error) {\r
+                delete requestTokens[tokenKey];\r
+                if (error instanceof messages_1.ResponseError) {\r
+                    reply(error, requestMessage.method, startTime);\r
+                }\r
+                else if (error && Is.string(error.message)) {\r
+                    replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed with message: ${error.message}`), requestMessage.method, startTime);\r
+                }\r
+                else {\r
+                    replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed unexpectedly without providing any details.`), requestMessage.method, startTime);\r
+                }\r
+            }\r
+        }\r
+        else {\r
+            replyError(new messages_1.ResponseError(messages_1.ErrorCodes.MethodNotFound, `Unhandled method ${requestMessage.method}`), requestMessage.method, startTime);\r
+        }\r
+    }\r
+    function handleResponse(responseMessage) {\r
+        if (isDisposed()) {\r
+            // See handle request.\r
+            return;\r
+        }\r
+        if (responseMessage.id === null) {\r
+            if (responseMessage.error) {\r
+                logger.error(`Received response message without id: Error is: \n${JSON.stringify(responseMessage.error, undefined, 4)}`);\r
+            }\r
+            else {\r
+                logger.error(`Received response message without id. No further error information provided.`);\r
+            }\r
+        }\r
+        else {\r
+            let key = String(responseMessage.id);\r
+            let responsePromise = responsePromises[key];\r
+            traceReceivedResponse(responseMessage, responsePromise);\r
+            if (responsePromise) {\r
+                delete responsePromises[key];\r
+                try {\r
+                    if (responseMessage.error) {\r
+                        let error = responseMessage.error;\r
+                        responsePromise.reject(new messages_1.ResponseError(error.code, error.message, error.data));\r
+                    }\r
+                    else if (responseMessage.result !== void 0) {\r
+                        responsePromise.resolve(responseMessage.result);\r
+                    }\r
+                    else {\r
+                        throw new Error('Should never happen.');\r
+                    }\r
+                }\r
+                catch (error) {\r
+                    if (error.message) {\r
+                        logger.error(`Response handler '${responsePromise.method}' failed with message: ${error.message}`);\r
+                    }\r
+                    else {\r
+                        logger.error(`Response handler '${responsePromise.method}' failed unexpectedly.`);\r
+                    }\r
+                }\r
+            }\r
+        }\r
+    }\r
+    function handleNotification(message) {\r
+        if (isDisposed()) {\r
+            // See handle request.\r
+            return;\r
+        }\r
+        let type = undefined;\r
+        let notificationHandler;\r
+        if (message.method === CancelNotification.type.method) {\r
+            notificationHandler = (params) => {\r
+                let id = params.id;\r
+                let source = requestTokens[String(id)];\r
+                if (source) {\r
+                    source.cancel();\r
+                }\r
+            };\r
+        }\r
+        else {\r
+            let element = notificationHandlers[message.method];\r
+            if (element) {\r
+                notificationHandler = element.handler;\r
+                type = element.type;\r
+            }\r
+        }\r
+        if (notificationHandler || starNotificationHandler) {\r
+            try {\r
+                traceReceivedNotification(message);\r
+                if (message.params === void 0 || (type !== void 0 && type.numberOfParams === 0)) {\r
+                    notificationHandler ? notificationHandler() : starNotificationHandler(message.method);\r
+                }\r
+                else if (Is.array(message.params) && (type === void 0 || type.numberOfParams > 1)) {\r
+                    notificationHandler ? notificationHandler(...message.params) : starNotificationHandler(message.method, ...message.params);\r
+                }\r
+                else {\r
+                    notificationHandler ? notificationHandler(message.params) : starNotificationHandler(message.method, message.params);\r
+                }\r
+            }\r
+            catch (error) {\r
+                if (error.message) {\r
+                    logger.error(`Notification handler '${message.method}' failed with message: ${error.message}`);\r
+                }\r
+                else {\r
+                    logger.error(`Notification handler '${message.method}' failed unexpectedly.`);\r
+                }\r
+            }\r
+        }\r
+        else {\r
+            unhandledNotificationEmitter.fire(message);\r
+        }\r
+    }\r
+    function handleInvalidMessage(message) {\r
+        if (!message) {\r
+            logger.error('Received empty message.');\r
+            return;\r
+        }\r
+        logger.error(`Received message which is neither a response nor a notification message:\n${JSON.stringify(message, null, 4)}`);\r
+        // Test whether we find an id to reject the promise\r
+        let responseMessage = message;\r
+        if (Is.string(responseMessage.id) || Is.number(responseMessage.id)) {\r
+            let key = String(responseMessage.id);\r
+            let responseHandler = responsePromises[key];\r
+            if (responseHandler) {\r
+                responseHandler.reject(new Error('The received response has neither a result nor an error property.'));\r
+            }\r
+        }\r
+    }\r
+    function traceSendingRequest(message) {\r
+        if (trace === Trace.Off || !tracer) {\r
+            return;\r
+        }\r
+        if (traceFormat === TraceFormat.Text) {\r
+            let data = undefined;\r
+            if (trace === Trace.Verbose && message.params) {\r
+                data = `Params: ${JSON.stringify(message.params, null, 4)}\n\n`;\r
+            }\r
+            tracer.log(`Sending request '${message.method} - (${message.id})'.`, data);\r
+        }\r
+        else {\r
+            logLSPMessage('send-request', message);\r
+        }\r
+    }\r
+    function traceSendingNotification(message) {\r
+        if (trace === Trace.Off || !tracer) {\r
+            return;\r
+        }\r
+        if (traceFormat === TraceFormat.Text) {\r
+            let data = undefined;\r
+            if (trace === Trace.Verbose) {\r
+                if (message.params) {\r
+                    data = `Params: ${JSON.stringify(message.params, null, 4)}\n\n`;\r
+                }\r
+                else {\r
+                    data = 'No parameters provided.\n\n';\r
+                }\r
+            }\r
+            tracer.log(`Sending notification '${message.method}'.`, data);\r
+        }\r
+        else {\r
+            logLSPMessage('send-notification', message);\r
+        }\r
+    }\r
+    function traceSendingResponse(message, method, startTime) {\r
+        if (trace === Trace.Off || !tracer) {\r
+            return;\r
+        }\r
+        if (traceFormat === TraceFormat.Text) {\r
+            let data = undefined;\r
+            if (trace === Trace.Verbose) {\r
+                if (message.error && message.error.data) {\r
+                    data = `Error data: ${JSON.stringify(message.error.data, null, 4)}\n\n`;\r
+                }\r
+                else {\r
+                    if (message.result) {\r
+                        data = `Result: ${JSON.stringify(message.result, null, 4)}\n\n`;\r
+                    }\r
+                    else if (message.error === void 0) {\r
+                        data = 'No result returned.\n\n';\r
+                    }\r
+                }\r
+            }\r
+            tracer.log(`Sending response '${method} - (${message.id})'. Processing request took ${Date.now() - startTime}ms`, data);\r
+        }\r
+        else {\r
+            logLSPMessage('send-response', message);\r
+        }\r
+    }\r
+    function traceReceivedRequest(message) {\r
+        if (trace === Trace.Off || !tracer) {\r
+            return;\r
+        }\r
+        if (traceFormat === TraceFormat.Text) {\r
+            let data = undefined;\r
+            if (trace === Trace.Verbose && message.params) {\r
+                data = `Params: ${JSON.stringify(message.params, null, 4)}\n\n`;\r
+            }\r
+            tracer.log(`Received request '${message.method} - (${message.id})'.`, data);\r
+        }\r
+        else {\r
+            logLSPMessage('receive-request', message);\r
+        }\r
+    }\r
+    function traceReceivedNotification(message) {\r
+        if (trace === Trace.Off || !tracer || message.method === LogTraceNotification.type.method) {\r
+            return;\r
+        }\r
+        if (traceFormat === TraceFormat.Text) {\r
+            let data = undefined;\r
+            if (trace === Trace.Verbose) {\r
+                if (message.params) {\r
+                    data = `Params: ${JSON.stringify(message.params, null, 4)}\n\n`;\r
+                }\r
+                else {\r
+                    data = 'No parameters provided.\n\n';\r
+                }\r
+            }\r
+            tracer.log(`Received notification '${message.method}'.`, data);\r
+        }\r
+        else {\r
+            logLSPMessage('receive-notification', message);\r
+        }\r
+    }\r
+    function traceReceivedResponse(message, responsePromise) {\r
+        if (trace === Trace.Off || !tracer) {\r
+            return;\r
+        }\r
+        if (traceFormat === TraceFormat.Text) {\r
+            let data = undefined;\r
+            if (trace === Trace.Verbose) {\r
+                if (message.error && message.error.data) {\r
+                    data = `Error data: ${JSON.stringify(message.error.data, null, 4)}\n\n`;\r
+                }\r
+                else {\r
+                    if (message.result) {\r
+                        data = `Result: ${JSON.stringify(message.result, null, 4)}\n\n`;\r
+                    }\r
+                    else if (message.error === void 0) {\r
+                        data = 'No result returned.\n\n';\r
+                    }\r
+                }\r
+            }\r
+            if (responsePromise) {\r
+                let error = message.error ? ` Request failed: ${message.error.message} (${message.error.code}).` : '';\r
+                tracer.log(`Received response '${responsePromise.method} - (${message.id})' in ${Date.now() - responsePromise.timerStart}ms.${error}`, data);\r
+            }\r
+            else {\r
+                tracer.log(`Received response ${message.id} without active response promise.`, data);\r
+            }\r
+        }\r
+        else {\r
+            logLSPMessage('receive-response', message);\r
+        }\r
+    }\r
+    function logLSPMessage(type, message) {\r
+        if (!tracer || trace === Trace.Off) {\r
+            return;\r
+        }\r
+        const lspMessage = {\r
+            isLSPMessage: true,\r
+            type,\r
+            message,\r
+            timestamp: Date.now()\r
+        };\r
+        tracer.log(lspMessage);\r
+    }\r
+    function throwIfClosedOrDisposed() {\r
+        if (isClosed()) {\r
+            throw new ConnectionError(ConnectionErrors.Closed, 'Connection is closed.');\r
+        }\r
+        if (isDisposed()) {\r
+            throw new ConnectionError(ConnectionErrors.Disposed, 'Connection is disposed.');\r
+        }\r
+    }\r
+    function throwIfListening() {\r
+        if (isListening()) {\r
+            throw new ConnectionError(ConnectionErrors.AlreadyListening, 'Connection is already listening');\r
+        }\r
+    }\r
+    function throwIfNotListening() {\r
+        if (!isListening()) {\r
+            throw new Error('Call listen() first.');\r
+        }\r
+    }\r
+    function undefinedToNull(param) {\r
+        if (param === void 0) {\r
+            return null;\r
+        }\r
+        else {\r
+            return param;\r
+        }\r
+    }\r
+    function computeMessageParams(type, params) {\r
+        let result;\r
+        let numberOfParams = type.numberOfParams;\r
+        switch (numberOfParams) {\r
+            case 0:\r
+                result = null;\r
+                break;\r
+            case 1:\r
+                result = undefinedToNull(params[0]);\r
+                break;\r
+            default:\r
+                result = [];\r
+                for (let i = 0; i < params.length && i < numberOfParams; i++) {\r
+                    result.push(undefinedToNull(params[i]));\r
+                }\r
+                if (params.length < numberOfParams) {\r
+                    for (let i = params.length; i < numberOfParams; i++) {\r
+                        result.push(null);\r
+                    }\r
+                }\r
+                break;\r
+        }\r
+        return result;\r
+    }\r
+    let connection = {\r
+        sendNotification: (type, ...params) => {\r
+            throwIfClosedOrDisposed();\r
+            let method;\r
+            let messageParams;\r
+            if (Is.string(type)) {\r
+                method = type;\r
+                switch (params.length) {\r
+                    case 0:\r
+                        messageParams = null;\r
+                        break;\r
+                    case 1:\r
+                        messageParams = params[0];\r
+                        break;\r
+                    default:\r
+                        messageParams = params;\r
+                        break;\r
+                }\r
+            }\r
+            else {\r
+                method = type.method;\r
+                messageParams = computeMessageParams(type, params);\r
+            }\r
+            let notificationMessage = {\r
+                jsonrpc: version,\r
+                method: method,\r
+                params: messageParams\r
+            };\r
+            traceSendingNotification(notificationMessage);\r
+            messageWriter.write(notificationMessage);\r
+        },\r
+        onNotification: (type, handler) => {\r
+            throwIfClosedOrDisposed();\r
+            if (Is.func(type)) {\r
+                starNotificationHandler = type;\r
+            }\r
+            else if (handler) {\r
+                if (Is.string(type)) {\r
+                    notificationHandlers[type] = { type: undefined, handler };\r
+                }\r
+                else {\r
+                    notificationHandlers[type.method] = { type, handler };\r
+                }\r
+            }\r
+        },\r
+        onProgress: (_type, token, handler) => {\r
+            if (progressHandlers.has(token)) {\r
+                throw new Error(`Progress handler for token ${token} already registered`);\r
+            }\r
+            progressHandlers.set(token, handler);\r
+            return {\r
+                dispose: () => {\r
+                    progressHandlers.delete(token);\r
+                }\r
+            };\r
+        },\r
+        sendProgress: (_type, token, value) => {\r
+            connection.sendNotification(ProgressNotification.type, { token, value });\r
+        },\r
+        onUnhandledProgress: unhandledProgressEmitter.event,\r
+        sendRequest: (type, ...params) => {\r
+            throwIfClosedOrDisposed();\r
+            throwIfNotListening();\r
+            let method;\r
+            let messageParams;\r
+            let token = undefined;\r
+            if (Is.string(type)) {\r
+                method = type;\r
+                switch (params.length) {\r
+                    case 0:\r
+                        messageParams = null;\r
+                        break;\r
+                    case 1:\r
+                        // The cancellation token is optional so it can also be undefined.\r
+                        if (cancellation_1.CancellationToken.is(params[0])) {\r
+                            messageParams = null;\r
+                            token = params[0];\r
+                        }\r
+                        else {\r
+                            messageParams = undefinedToNull(params[0]);\r
+                        }\r
+                        break;\r
+                    default:\r
+                        const last = params.length - 1;\r
+                        if (cancellation_1.CancellationToken.is(params[last])) {\r
+                            token = params[last];\r
+                            if (params.length === 2) {\r
+                                messageParams = undefinedToNull(params[0]);\r
+                            }\r
+                            else {\r
+                                messageParams = params.slice(0, last).map(value => undefinedToNull(value));\r
+                            }\r
+                        }\r
+                        else {\r
+                            messageParams = params.map(value => undefinedToNull(value));\r
+                        }\r
+                        break;\r
+                }\r
+            }\r
+            else {\r
+                method = type.method;\r
+                messageParams = computeMessageParams(type, params);\r
+                let numberOfParams = type.numberOfParams;\r
+                token = cancellation_1.CancellationToken.is(params[numberOfParams]) ? params[numberOfParams] : undefined;\r
+            }\r
+            let id = sequenceNumber++;\r
+            let result = new Promise((resolve, reject) => {\r
+                let requestMessage = {\r
+                    jsonrpc: version,\r
+                    id: id,\r
+                    method: method,\r
+                    params: messageParams\r
+                };\r
+                let responsePromise = { method: method, timerStart: Date.now(), resolve, reject };\r
+                traceSendingRequest(requestMessage);\r
+                try {\r
+                    messageWriter.write(requestMessage);\r
+                }\r
+                catch (e) {\r
+                    // Writing the message failed. So we need to reject the promise.\r
+                    responsePromise.reject(new messages_1.ResponseError(messages_1.ErrorCodes.MessageWriteError, e.message ? e.message : 'Unknown reason'));\r
+                    responsePromise = null;\r
+                }\r
+                if (responsePromise) {\r
+                    responsePromises[String(id)] = responsePromise;\r
+                }\r
+            });\r
+            if (token) {\r
+                token.onCancellationRequested(() => {\r
+                    connection.sendNotification(CancelNotification.type, { id });\r
+                });\r
+            }\r
+            return result;\r
+        },\r
+        onRequest: (type, handler) => {\r
+            throwIfClosedOrDisposed();\r
+            if (Is.func(type)) {\r
+                starRequestHandler = type;\r
+            }\r
+            else if (handler) {\r
+                if (Is.string(type)) {\r
+                    requestHandlers[type] = { type: undefined, handler };\r
+                }\r
+                else {\r
+                    requestHandlers[type.method] = { type, handler };\r
+                }\r
+            }\r
+        },\r
+        trace: (_value, _tracer, sendNotificationOrTraceOptions) => {\r
+            let _sendNotification = false;\r
+            let _traceFormat = TraceFormat.Text;\r
+            if (sendNotificationOrTraceOptions !== void 0) {\r
+                if (Is.boolean(sendNotificationOrTraceOptions)) {\r
+                    _sendNotification = sendNotificationOrTraceOptions;\r
+                }\r
+                else {\r
+                    _sendNotification = sendNotificationOrTraceOptions.sendNotification || false;\r
+                    _traceFormat = sendNotificationOrTraceOptions.traceFormat || TraceFormat.Text;\r
+                }\r
+            }\r
+            trace = _value;\r
+            traceFormat = _traceFormat;\r
+            if (trace === Trace.Off) {\r
+                tracer = undefined;\r
+            }\r
+            else {\r
+                tracer = _tracer;\r
+            }\r
+            if (_sendNotification && !isClosed() && !isDisposed()) {\r
+                connection.sendNotification(SetTraceNotification.type, { value: Trace.toString(_value) });\r
+            }\r
+        },\r
+        onError: errorEmitter.event,\r
+        onClose: closeEmitter.event,\r
+        onUnhandledNotification: unhandledNotificationEmitter.event,\r
+        onDispose: disposeEmitter.event,\r
+        dispose: () => {\r
+            if (isDisposed()) {\r
+                return;\r
+            }\r
+            state = ConnectionState.Disposed;\r
+            disposeEmitter.fire(undefined);\r
+            let error = new Error('Connection got disposed.');\r
+            Object.keys(responsePromises).forEach((key) => {\r
+                responsePromises[key].reject(error);\r
+            });\r
+            responsePromises = Object.create(null);\r
+            requestTokens = Object.create(null);\r
+            messageQueue = new linkedMap_1.LinkedMap();\r
+            // Test for backwards compatibility\r
+            if (Is.func(messageWriter.dispose)) {\r
+                messageWriter.dispose();\r
+            }\r
+            if (Is.func(messageReader.dispose)) {\r
+                messageReader.dispose();\r
+            }\r
+        },\r
+        listen: () => {\r
+            throwIfClosedOrDisposed();\r
+            throwIfListening();\r
+            state = ConnectionState.Listening;\r
+            messageReader.listen(callback);\r
+        },\r
+        inspect: () => {\r
+            // eslint-disable-next-line no-console\r
+            console.log('inspect');\r
+        }\r
+    };\r
+    connection.onNotification(LogTraceNotification.type, (params) => {\r
+        if (trace === Trace.Off || !tracer) {\r
+            return;\r
+        }\r
+        tracer.log(params.message, trace === Trace.Verbose ? params.verbose : undefined);\r
+    });\r
+    connection.onNotification(ProgressNotification.type, (params) => {\r
+        const handler = progressHandlers.get(params.token);\r
+        if (handler) {\r
+            handler(params.value);\r
+        }\r
+        else {\r
+            unhandledProgressEmitter.fire(params);\r
+        }\r
+    });\r
+    return connection;\r
+}\r
+function isMessageReader(value) {\r
+    return value.listen !== void 0 && value.read === void 0;\r
+}\r
+function isMessageWriter(value) {\r
+    return value.write !== void 0 && value.end === void 0;\r
+}\r
+function createMessageConnection(input, output, logger, strategy) {\r
+    if (!logger) {\r
+        logger = exports.NullLogger;\r
+    }\r
+    let reader = isMessageReader(input) ? input : new messageReader_1.StreamMessageReader(input);\r
+    let writer = isMessageWriter(output) ? output : new messageWriter_1.StreamMessageWriter(output);\r
+    return _createMessageConnection(reader, writer, logger, strategy);\r
+}\r
+exports.createMessageConnection = createMessageConnection;\r
+
+
+/***/ }),
+/* 6 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/* --------------------------------------------------------------------------------------------\r
+ * Copyright (c) Microsoft Corporation. All rights reserved.\r
+ * Licensed under the MIT License. See License.txt in the project root for license information.\r
+ * ------------------------------------------------------------------------------------------ */\r
+\r
+Object.defineProperty(exports, "__esModule", { value: true });\r
+function boolean(value) {\r
+    return value === true || value === false;\r
+}\r
+exports.boolean = boolean;\r
+function string(value) {\r
+    return typeof value === 'string' || value instanceof String;\r
+}\r
+exports.string = string;\r
+function number(value) {\r
+    return typeof value === 'number' || value instanceof Number;\r
+}\r
+exports.number = number;\r
+function error(value) {\r
+    return value instanceof Error;\r
+}\r
+exports.error = error;\r
+function func(value) {\r
+    return typeof value === 'function';\r
+}\r
+exports.func = func;\r
+function array(value) {\r
+    return Array.isArray(value);\r
+}\r
+exports.array = array;\r
+function stringArray(value) {\r
+    return array(value) && value.every(elem => string(elem));\r
+}\r
+exports.stringArray = stringArray;\r
+
+
+/***/ }),
+/* 7 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/* --------------------------------------------------------------------------------------------\r
+ * Copyright (c) Microsoft Corporation. All rights reserved.\r
+ * Licensed under the MIT License. See License.txt in the project root for license information.\r
+ * ------------------------------------------------------------------------------------------ */\r
+\r
+Object.defineProperty(exports, "__esModule", { value: true });\r
+const is = __webpack_require__(6);\r
+/**\r
+ * Predefined error codes.\r
+ */\r
+var ErrorCodes;\r
+(function (ErrorCodes) {\r
+    // Defined by JSON RPC\r
+    ErrorCodes.ParseError = -32700;\r
+    ErrorCodes.InvalidRequest = -32600;\r
+    ErrorCodes.MethodNotFound = -32601;\r
+    ErrorCodes.InvalidParams = -32602;\r
+    ErrorCodes.InternalError = -32603;\r
+    ErrorCodes.serverErrorStart = -32099;\r
+    ErrorCodes.serverErrorEnd = -32000;\r
+    ErrorCodes.ServerNotInitialized = -32002;\r
+    ErrorCodes.UnknownErrorCode = -32001;\r
+    // Defined by the protocol.\r
+    ErrorCodes.RequestCancelled = -32800;\r
+    ErrorCodes.ContentModified = -32801;\r
+    // Defined by VSCode library.\r
+    ErrorCodes.MessageWriteError = 1;\r
+    ErrorCodes.MessageReadError = 2;\r
+})(ErrorCodes = exports.ErrorCodes || (exports.ErrorCodes = {}));\r
+/**\r
+ * An error object return in a response in case a request\r
+ * has failed.\r
+ */\r
+class ResponseError extends Error {\r
+    constructor(code, message, data) {\r
+        super(message);\r
+        this.code = is.number(code) ? code : ErrorCodes.UnknownErrorCode;\r
+        this.data = data;\r
+        Object.setPrototypeOf(this, ResponseError.prototype);\r
+    }\r
+    toJson() {\r
+        return {\r
+            code: this.code,\r
+            message: this.message,\r
+            data: this.data,\r
+        };\r
+    }\r
+}\r
+exports.ResponseError = ResponseError;\r
+/**\r
+ * An abstract implementation of a MessageType.\r
+ */\r
+class AbstractMessageType {\r
+    constructor(_method, _numberOfParams) {\r
+        this._method = _method;\r
+        this._numberOfParams = _numberOfParams;\r
+    }\r
+    get method() {\r
+        return this._method;\r
+    }\r
+    get numberOfParams() {\r
+        return this._numberOfParams;\r
+    }\r
+}\r
+exports.AbstractMessageType = AbstractMessageType;\r
+/**\r
+ * Classes to type request response pairs\r
+ */\r
+class RequestType0 extends AbstractMessageType {\r
+    constructor(method) {\r
+        super(method, 0);\r
+        this._ = undefined;\r
+    }\r
+}\r
+exports.RequestType0 = RequestType0;\r
+class RequestType extends AbstractMessageType {\r
+    constructor(method) {\r
+        super(method, 1);\r
+        this._ = undefined;\r
+    }\r
+}\r
+exports.RequestType = RequestType;\r
+class RequestType1 extends AbstractMessageType {\r
+    constructor(method) {\r
+        super(method, 1);\r
+        this._ = undefined;\r
+    }\r
+}\r
+exports.RequestType1 = RequestType1;\r
+class RequestType2 extends AbstractMessageType {\r
+    constructor(method) {\r
+        super(method, 2);\r
+        this._ = undefined;\r
+    }\r
+}\r
+exports.RequestType2 = RequestType2;\r
+class RequestType3 extends AbstractMessageType {\r
+    constructor(method) {\r
+        super(method, 3);\r
+        this._ = undefined;\r
+    }\r
+}\r
+exports.RequestType3 = RequestType3;\r
+class RequestType4 extends AbstractMessageType {\r
+    constructor(method) {\r
+        super(method, 4);\r
+        this._ = undefined;\r
+    }\r
+}\r
+exports.RequestType4 = RequestType4;\r
+class RequestType5 extends AbstractMessageType {\r
+    constructor(method) {\r
+        super(method, 5);\r
+        this._ = undefined;\r
+    }\r
+}\r
+exports.RequestType5 = RequestType5;\r
+class RequestType6 extends AbstractMessageType {\r
+    constructor(method) {\r
+        super(method, 6);\r
+        this._ = undefined;\r
+    }\r
+}\r
+exports.RequestType6 = RequestType6;\r
+class RequestType7 extends AbstractMessageType {\r
+    constructor(method) {\r
+        super(method, 7);\r
+        this._ = undefined;\r
+    }\r
+}\r
+exports.RequestType7 = RequestType7;\r
+class RequestType8 extends AbstractMessageType {\r
+    constructor(method) {\r
+        super(method, 8);\r
+        this._ = undefined;\r
+    }\r
+}\r
+exports.RequestType8 = RequestType8;\r
+class RequestType9 extends AbstractMessageType {\r
+    constructor(method) {\r
+        super(method, 9);\r
+        this._ = undefined;\r
+    }\r
+}\r
+exports.RequestType9 = RequestType9;\r
+class NotificationType extends AbstractMessageType {\r
+    constructor(method) {\r
+        super(method, 1);\r
+        this._ = undefined;\r
+    }\r
+}\r
+exports.NotificationType = NotificationType;\r
+class NotificationType0 extends AbstractMessageType {\r
+    constructor(method) {\r
+        super(method, 0);\r
+        this._ = undefined;\r
+    }\r
+}\r
+exports.NotificationType0 = NotificationType0;\r
+class NotificationType1 extends AbstractMessageType {\r
+    constructor(method) {\r
+        super(method, 1);\r
+        this._ = undefined;\r
+    }\r
+}\r
+exports.NotificationType1 = NotificationType1;\r
+class NotificationType2 extends AbstractMessageType {\r
+    constructor(method) {\r
+        super(method, 2);\r
+        this._ = undefined;\r
+    }\r
+}\r
+exports.NotificationType2 = NotificationType2;\r
+class NotificationType3 extends AbstractMessageType {\r
+    constructor(method) {\r
+        super(method, 3);\r
+        this._ = undefined;\r
+    }\r
+}\r
+exports.NotificationType3 = NotificationType3;\r
+class NotificationType4 extends AbstractMessageType {\r
+    constructor(method) {\r
+        super(method, 4);\r
+        this._ = undefined;\r
+    }\r
+}\r
+exports.NotificationType4 = NotificationType4;\r
+class NotificationType5 extends AbstractMessageType {\r
+    constructor(method) {\r
+        super(method, 5);\r
+        this._ = undefined;\r
+    }\r
+}\r
+exports.NotificationType5 = NotificationType5;\r
+class NotificationType6 extends AbstractMessageType {\r
+    constructor(method) {\r
+        super(method, 6);\r
+        this._ = undefined;\r
+    }\r
+}\r
+exports.NotificationType6 = NotificationType6;\r
+class NotificationType7 extends AbstractMessageType {\r
+    constructor(method) {\r
+        super(method, 7);\r
+        this._ = undefined;\r
+    }\r
+}\r
+exports.NotificationType7 = NotificationType7;\r
+class NotificationType8 extends AbstractMessageType {\r
+    constructor(method) {\r
+        super(method, 8);\r
+        this._ = undefined;\r
+    }\r
+}\r
+exports.NotificationType8 = NotificationType8;\r
+class NotificationType9 extends AbstractMessageType {\r
+    constructor(method) {\r
+        super(method, 9);\r
+        this._ = undefined;\r
+    }\r
+}\r
+exports.NotificationType9 = NotificationType9;\r
+/**\r
+ * Tests if the given message is a request message\r
+ */\r
+function isRequestMessage(message) {\r
+    let candidate = message;\r
+    return candidate && is.string(candidate.method) && (is.string(candidate.id) || is.number(candidate.id));\r
+}\r
+exports.isRequestMessage = isRequestMessage;\r
+/**\r
+ * Tests if the given message is a notification message\r
+ */\r
+function isNotificationMessage(message) {\r
+    let candidate = message;\r
+    return candidate && is.string(candidate.method) && message.id === void 0;\r
+}\r
+exports.isNotificationMessage = isNotificationMessage;\r
+/**\r
+ * Tests if the given message is a response message\r
+ */\r
+function isResponseMessage(message) {\r
+    let candidate = message;\r
+    return candidate && (candidate.result !== void 0 || !!candidate.error) && (is.string(candidate.id) || is.number(candidate.id) || candidate.id === null);\r
+}\r
+exports.isResponseMessage = isResponseMessage;\r
+
+
+/***/ }),
+/* 8 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/* --------------------------------------------------------------------------------------------\r
+ * Copyright (c) Microsoft Corporation. All rights reserved.\r
+ * Licensed under the MIT License. See License.txt in the project root for license information.\r
+ * ------------------------------------------------------------------------------------------ */\r
+\r
+Object.defineProperty(exports, "__esModule", { value: true });\r
+const events_1 = __webpack_require__(9);\r
+const Is = __webpack_require__(6);\r
+let DefaultSize = 8192;\r
+let CR = Buffer.from('\r', 'ascii')[0];\r
+let LF = Buffer.from('\n', 'ascii')[0];\r
+let CRLF = '\r\n';\r
+class MessageBuffer {\r
+    constructor(encoding = 'utf8') {\r
+        this.encoding = encoding;\r
+        this.index = 0;\r
+        this.buffer = Buffer.allocUnsafe(DefaultSize);\r
+    }\r
+    append(chunk) {\r
+        var toAppend = chunk;\r
+        if (typeof (chunk) === 'string') {\r
+            var str = chunk;\r
+            var bufferLen = Buffer.byteLength(str, this.encoding);\r
+            toAppend = Buffer.allocUnsafe(bufferLen);\r
+            toAppend.write(str, 0, bufferLen, this.encoding);\r
+        }\r
+        if (this.buffer.length - this.index >= toAppend.length) {\r
+            toAppend.copy(this.buffer, this.index, 0, toAppend.length);\r
+        }\r
+        else {\r
+            var newSize = (Math.ceil((this.index + toAppend.length) / DefaultSize) + 1) * DefaultSize;\r
+            if (this.index === 0) {\r
+                this.buffer = Buffer.allocUnsafe(newSize);\r
+                toAppend.copy(this.buffer, 0, 0, toAppend.length);\r
+            }\r
+            else {\r
+                this.buffer = Buffer.concat([this.buffer.slice(0, this.index), toAppend], newSize);\r
+            }\r
+        }\r
+        this.index += toAppend.length;\r
+    }\r
+    tryReadHeaders() {\r
+        let result = undefined;\r
+        let current = 0;\r
+        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
+            current++;\r
+        }\r
+        // No header / body separator found (e.g CRLFCRLF)\r
+        if (current + 3 >= this.index) {\r
+            return result;\r
+        }\r
+        result = Object.create(null);\r
+        let headers = this.buffer.toString('ascii', 0, current).split(CRLF);\r
+        headers.forEach((header) => {\r
+            let index = header.indexOf(':');\r
+            if (index === -1) {\r
+                throw new Error('Message header must separate key and value using :');\r
+            }\r
+            let key = header.substr(0, index);\r
+            let value = header.substr(index + 1).trim();\r
+            result[key] = value;\r
+        });\r
+        let nextStart = current + 4;\r
+        this.buffer = this.buffer.slice(nextStart);\r
+        this.index = this.index - nextStart;\r
+        return result;\r
+    }\r
+    tryReadContent(length) {\r
+        if (this.index < length) {\r
+            return null;\r
+        }\r
+        let result = this.buffer.toString(this.encoding, 0, length);\r
+        let nextStart = length;\r
+        this.buffer.copy(this.buffer, 0, nextStart);\r
+        this.index = this.index - nextStart;\r
+        return result;\r
+    }\r
+    get numberOfBytes() {\r
+        return this.index;\r
+    }\r
+}\r
+var MessageReader;\r
+(function (MessageReader) {\r
+    function is(value) {\r
+        let candidate = value;\r
+        return candidate && Is.func(candidate.listen) && Is.func(candidate.dispose) &&\r
+            Is.func(candidate.onError) && Is.func(candidate.onClose) && Is.func(candidate.onPartialMessage);\r
+    }\r
+    MessageReader.is = is;\r
+})(MessageReader = exports.MessageReader || (exports.MessageReader = {}));\r
+class AbstractMessageReader {\r
+    constructor() {\r
+        this.errorEmitter = new events_1.Emitter();\r
+        this.closeEmitter = new events_1.Emitter();\r
+        this.partialMessageEmitter = new events_1.Emitter();\r
+    }\r
+    dispose() {\r
+        this.errorEmitter.dispose();\r
+        this.closeEmitter.dispose();\r
+    }\r
+    get onError() {\r
+        return this.errorEmitter.event;\r
+    }\r
+    fireError(error) {\r
+        this.errorEmitter.fire(this.asError(error));\r
+    }\r
+    get onClose() {\r
+        return this.closeEmitter.event;\r
+    }\r
+    fireClose() {\r
+        this.closeEmitter.fire(undefined);\r
+    }\r
+    get onPartialMessage() {\r
+        return this.partialMessageEmitter.event;\r
+    }\r
+    firePartialMessage(info) {\r
+        this.partialMessageEmitter.fire(info);\r
+    }\r
+    asError(error) {\r
+        if (error instanceof Error) {\r
+            return error;\r
+        }\r
+        else {\r
+            return new Error(`Reader received error. Reason: ${Is.string(error.message) ? error.message : 'unknown'}`);\r
+        }\r
+    }\r
+}\r
+exports.AbstractMessageReader = AbstractMessageReader;\r
+class StreamMessageReader extends AbstractMessageReader {\r
+    constructor(readable, encoding = 'utf8') {\r
+        super();\r
+        this.readable = readable;\r
+        this.buffer = new MessageBuffer(encoding);\r
+        this._partialMessageTimeout = 10000;\r
+    }\r
+    set partialMessageTimeout(timeout) {\r
+        this._partialMessageTimeout = timeout;\r
+    }\r
+    get partialMessageTimeout() {\r
+        return this._partialMessageTimeout;\r
+    }\r
+    listen(callback) {\r
+        this.nextMessageLength = -1;\r
+        this.messageToken = 0;\r
+        this.partialMessageTimer = undefined;\r
+        this.callback = callback;\r
+        this.readable.on('data', (data) => {\r
+            this.onData(data);\r
+        });\r
+        this.readable.on('error', (error) => this.fireError(error));\r
+        this.readable.on('close', () => this.fireClose());\r
+    }\r
+    onData(data) {\r
+        this.buffer.append(data);\r
+        while (true) {\r
+            if (this.nextMessageLength === -1) {\r
+                let headers = this.buffer.tryReadHeaders();\r
+                if (!headers) {\r
+                    return;\r
+                }\r
+                let contentLength = headers['Content-Length'];\r
+                if (!contentLength) {\r
+                    throw new Error('Header must provide a Content-Length property.');\r
+                }\r
+                let length = parseInt(contentLength);\r
+                if (isNaN(length)) {\r
+                    throw new Error('Content-Length value must be a number.');\r
+                }\r
+                this.nextMessageLength = length;\r
+                // Take the encoding form the header. For compatibility\r
+                // treat both utf-8 and utf8 as node utf8\r
+            }\r
+            var msg = this.buffer.tryReadContent(this.nextMessageLength);\r
+            if (msg === null) {\r
+                /** We haven't received the full message yet. */\r
+                this.setPartialMessageTimer();\r
+                return;\r
+            }\r
+            this.clearPartialMessageTimer();\r
+            this.nextMessageLength = -1;\r
+            this.messageToken++;\r
+            var json = JSON.parse(msg);\r
+            this.callback(json);\r
+        }\r
+    }\r
+    clearPartialMessageTimer() {\r
+        if (this.partialMessageTimer) {\r
+            clearTimeout(this.partialMessageTimer);\r
+            this.partialMessageTimer = undefined;\r
+        }\r
+    }\r
+    setPartialMessageTimer() {\r
+        this.clearPartialMessageTimer();\r
+        if (this._partialMessageTimeout <= 0) {\r
+            return;\r
+        }\r
+        this.partialMessageTimer = setTimeout((token, timeout) => {\r
+            this.partialMessageTimer = undefined;\r
+            if (token === this.messageToken) {\r
+                this.firePartialMessage({ messageToken: token, waitingTime: timeout });\r
+                this.setPartialMessageTimer();\r
+            }\r
+        }, this._partialMessageTimeout, this.messageToken, this._partialMessageTimeout);\r
+    }\r
+}\r
+exports.StreamMessageReader = StreamMessageReader;\r
+class IPCMessageReader extends AbstractMessageReader {\r
+    constructor(process) {\r
+        super();\r
+        this.process = process;\r
+        let eventEmitter = this.process;\r
+        eventEmitter.on('error', (error) => this.fireError(error));\r
+        eventEmitter.on('close', () => this.fireClose());\r
+    }\r
+    listen(callback) {\r
+        this.process.on('message', callback);\r
+    }\r
+}\r
+exports.IPCMessageReader = IPCMessageReader;\r
+class SocketMessageReader extends StreamMessageReader {\r
+    constructor(socket, encoding = 'utf-8') {\r
+        super(socket, encoding);\r
+    }\r
+}\r
+exports.SocketMessageReader = SocketMessageReader;\r
+
+
+/***/ }),
+/* 9 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/* --------------------------------------------------------------------------------------------\r
+ * Copyright (c) Microsoft Corporation. All rights reserved.\r
+ * Licensed under the MIT License. See License.txt in the project root for license information.\r
+ * ------------------------------------------------------------------------------------------ */\r
+\r
+Object.defineProperty(exports, "__esModule", { value: true });\r
+var Disposable;\r
+(function (Disposable) {\r
+    function create(func) {\r
+        return {\r
+            dispose: func\r
+        };\r
+    }\r
+    Disposable.create = create;\r
+})(Disposable = exports.Disposable || (exports.Disposable = {}));\r
+var Event;\r
+(function (Event) {\r
+    const _disposable = { dispose() { } };\r
+    Event.None = function () { return _disposable; };\r
+})(Event = exports.Event || (exports.Event = {}));\r
+class CallbackList {\r
+    add(callback, context = null, bucket) {\r
+        if (!this._callbacks) {\r
+            this._callbacks = [];\r
+            this._contexts = [];\r
+        }\r
+        this._callbacks.push(callback);\r
+        this._contexts.push(context);\r
+        if (Array.isArray(bucket)) {\r
+            bucket.push({ dispose: () => this.remove(callback, context) });\r
+        }\r
+    }\r
+    remove(callback, context = null) {\r
+        if (!this._callbacks) {\r
+            return;\r
+        }\r
+        var foundCallbackWithDifferentContext = false;\r
+        for (var i = 0, len = this._callbacks.length; i < len; i++) {\r
+            if (this._callbacks[i] === callback) {\r
+                if (this._contexts[i] === context) {\r
+                    // callback & context match => remove it\r
+                    this._callbacks.splice(i, 1);\r
+                    this._contexts.splice(i, 1);\r
+                    return;\r
+                }\r
+                else {\r
+                    foundCallbackWithDifferentContext = true;\r
+                }\r
+            }\r
+        }\r
+        if (foundCallbackWithDifferentContext) {\r
+            throw new Error('When adding a listener with a context, you should remove it with the same context');\r
+        }\r
+    }\r
+    invoke(...args) {\r
+        if (!this._callbacks) {\r
+            return [];\r
+        }\r
+        var ret = [], callbacks = this._callbacks.slice(0), contexts = this._contexts.slice(0);\r
+        for (var i = 0, len = callbacks.length; i < len; i++) {\r
+            try {\r
+                ret.push(callbacks[i].apply(contexts[i], args));\r
+            }\r
+            catch (e) {\r
+                // eslint-disable-next-line no-console\r
+                console.error(e);\r
+            }\r
+        }\r
+        return ret;\r
+    }\r
+    isEmpty() {\r
+        return !this._callbacks || this._callbacks.length === 0;\r
+    }\r
+    dispose() {\r
+        this._callbacks = undefined;\r
+        this._contexts = undefined;\r
+    }\r
+}\r
+class Emitter {\r
+    constructor(_options) {\r
+        this._options = _options;\r
+    }\r
+    /**\r
+     * For the public to allow to subscribe\r
+     * to events from this Emitter\r
+     */\r
+    get event() {\r
+        if (!this._event) {\r
+            this._event = (listener, thisArgs, disposables) => {\r
+                if (!this._callbacks) {\r
+                    this._callbacks = new CallbackList();\r
+                }\r
+                if (this._options && this._options.onFirstListenerAdd && this._callbacks.isEmpty()) {\r
+                    this._options.onFirstListenerAdd(this);\r
+                }\r
+                this._callbacks.add(listener, thisArgs);\r
+                let result;\r
+                result = {\r
+                    dispose: () => {\r
+                        this._callbacks.remove(listener, thisArgs);\r
+                        result.dispose = Emitter._noop;\r
+                        if (this._options && this._options.onLastListenerRemove && this._callbacks.isEmpty()) {\r
+                            this._options.onLastListenerRemove(this);\r
+                        }\r
+                    }\r
+                };\r
+                if (Array.isArray(disposables)) {\r
+                    disposables.push(result);\r
+                }\r
+                return result;\r
+            };\r
+        }\r
+        return this._event;\r
+    }\r
+    /**\r
+     * To be kept private to fire an event to\r
+     * subscribers\r
+     */\r
+    fire(event) {\r
+        if (this._callbacks) {\r
+            this._callbacks.invoke.call(this._callbacks, event);\r
+        }\r
+    }\r
+    dispose() {\r
+        if (this._callbacks) {\r
+            this._callbacks.dispose();\r
+            this._callbacks = undefined;\r
+        }\r
+    }\r
+}\r
+exports.Emitter = Emitter;\r
+Emitter._noop = function () { };\r
+
+
+/***/ }),
+/* 10 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/* --------------------------------------------------------------------------------------------\r
+ * Copyright (c) Microsoft Corporation. All rights reserved.\r
+ * Licensed under the MIT License. See License.txt in the project root for license information.\r
+ * ------------------------------------------------------------------------------------------ */\r
+\r
+Object.defineProperty(exports, "__esModule", { value: true });\r
+const events_1 = __webpack_require__(9);\r
+const Is = __webpack_require__(6);\r
+let ContentLength = 'Content-Length: ';\r
+let CRLF = '\r\n';\r
+var MessageWriter;\r
+(function (MessageWriter) {\r
+    function is(value) {\r
+        let candidate = value;\r
+        return candidate && Is.func(candidate.dispose) && Is.func(candidate.onClose) &&\r
+            Is.func(candidate.onError) && Is.func(candidate.write);\r
+    }\r
+    MessageWriter.is = is;\r
+})(MessageWriter = exports.MessageWriter || (exports.MessageWriter = {}));\r
+class AbstractMessageWriter {\r
+    constructor() {\r
+        this.errorEmitter = new events_1.Emitter();\r
+        this.closeEmitter = new events_1.Emitter();\r
+    }\r
+    dispose() {\r
+        this.errorEmitter.dispose();\r
+        this.closeEmitter.dispose();\r
+    }\r
+    get onError() {\r
+        return this.errorEmitter.event;\r
+    }\r
+    fireError(error, message, count) {\r
+        this.errorEmitter.fire([this.asError(error), message, count]);\r
+    }\r
+    get onClose() {\r
+        return this.closeEmitter.event;\r
+    }\r
+    fireClose() {\r
+        this.closeEmitter.fire(undefined);\r
+    }\r
+    asError(error) {\r
+        if (error instanceof Error) {\r
+            return error;\r
+        }\r
+        else {\r
+            return new Error(`Writer received error. Reason: ${Is.string(error.message) ? error.message : 'unknown'}`);\r
+        }\r
+    }\r
+}\r
+exports.AbstractMessageWriter = AbstractMessageWriter;\r
+class StreamMessageWriter extends AbstractMessageWriter {\r
+    constructor(writable, encoding = 'utf8') {\r
+        super();\r
+        this.writable = writable;\r
+        this.encoding = encoding;\r
+        this.errorCount = 0;\r
+        this.writable.on('error', (error) => this.fireError(error));\r
+        this.writable.on('close', () => this.fireClose());\r
+    }\r
+    write(msg) {\r
+        let json = JSON.stringify(msg);\r
+        let contentLength = Buffer.byteLength(json, this.encoding);\r
+        let headers = [\r
+            ContentLength, contentLength.toString(), CRLF,\r
+            CRLF\r
+        ];\r
+        try {\r
+            // Header must be written in ASCII encoding\r
+            this.writable.write(headers.join(''), 'ascii');\r
+            // Now write the content. This can be written in any encoding\r
+            this.writable.write(json, this.encoding);\r
+            this.errorCount = 0;\r
+        }\r
+        catch (error) {\r
+            this.errorCount++;\r
+            this.fireError(error, msg, this.errorCount);\r
+        }\r
+    }\r
+}\r
+exports.StreamMessageWriter = StreamMessageWriter;\r
+class IPCMessageWriter extends AbstractMessageWriter {\r
+    constructor(process) {\r
+        super();\r
+        this.process = process;\r
+        this.errorCount = 0;\r
+        this.queue = [];\r
+        this.sending = false;\r
+        let eventEmitter = this.process;\r
+        eventEmitter.on('error', (error) => this.fireError(error));\r
+        eventEmitter.on('close', () => this.fireClose);\r
+    }\r
+    write(msg) {\r
+        if (!this.sending && this.queue.length === 0) {\r
+            // See https://github.com/nodejs/node/issues/7657\r
+            this.doWriteMessage(msg);\r
+        }\r
+        else {\r
+            this.queue.push(msg);\r
+        }\r
+    }\r
+    doWriteMessage(msg) {\r
+        try {\r
+            if (this.process.send) {\r
+                this.sending = true;\r
+                this.process.send(msg, undefined, undefined, (error) => {\r
+                    this.sending = false;\r
+                    if (error) {\r
+                        this.errorCount++;\r
+                        this.fireError(error, msg, this.errorCount);\r
+                    }\r
+                    else {\r
+                        this.errorCount = 0;\r
+                    }\r
+                    if (this.queue.length > 0) {\r
+                        this.doWriteMessage(this.queue.shift());\r
+                    }\r
+                });\r
+            }\r
+        }\r
+        catch (error) {\r
+            this.errorCount++;\r
+            this.fireError(error, msg, this.errorCount);\r
+        }\r
+    }\r
+}\r
+exports.IPCMessageWriter = IPCMessageWriter;\r
+class SocketMessageWriter extends AbstractMessageWriter {\r
+    constructor(socket, encoding = 'utf8') {\r
+        super();\r
+        this.socket = socket;\r
+        this.queue = [];\r
+        this.sending = false;\r
+        this.encoding = encoding;\r
+        this.errorCount = 0;\r
+        this.socket.on('error', (error) => this.fireError(error));\r
+        this.socket.on('close', () => this.fireClose());\r
+    }\r
+    dispose() {\r
+        super.dispose();\r
+        this.socket.destroy();\r
+    }\r
+    write(msg) {\r
+        if (!this.sending && this.queue.length === 0) {\r
+            // See https://github.com/nodejs/node/issues/7657\r
+            this.doWriteMessage(msg);\r
+        }\r
+        else {\r
+            this.queue.push(msg);\r
+        }\r
+    }\r
+    doWriteMessage(msg) {\r
+        let json = JSON.stringify(msg);\r
+        let contentLength = Buffer.byteLength(json, this.encoding);\r
+        let headers = [\r
+            ContentLength, contentLength.toString(), CRLF,\r
+            CRLF\r
+        ];\r
+        try {\r
+            // Header must be written in ASCII encoding\r
+            this.sending = true;\r
+            this.socket.write(headers.join(''), 'ascii', (error) => {\r
+                if (error) {\r
+                    this.handleError(error, msg);\r
+                }\r
+                try {\r
+                    // Now write the content. This can be written in any encoding\r
+                    this.socket.write(json, this.encoding, (error) => {\r
+                        this.sending = false;\r
+                        if (error) {\r
+                            this.handleError(error, msg);\r
+                        }\r
+                        else {\r
+                            this.errorCount = 0;\r
+                        }\r
+                        if (this.queue.length > 0) {\r
+                            this.doWriteMessage(this.queue.shift());\r
+                        }\r
+                    });\r
+                }\r
+                catch (error) {\r
+                    this.handleError(error, msg);\r
+                }\r
+            });\r
+        }\r
+        catch (error) {\r
+            this.handleError(error, msg);\r
+        }\r
+    }\r
+    handleError(error, msg) {\r
+        this.errorCount++;\r
+        this.fireError(error, msg, this.errorCount);\r
+    }\r
+}\r
+exports.SocketMessageWriter = SocketMessageWriter;\r
+
+
+/***/ }),
+/* 11 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/*---------------------------------------------------------------------------------------------\r
+ *  Copyright (c) Microsoft Corporation. All rights reserved.\r
+ *  Licensed under the MIT License. See License.txt in the project root for license information.\r
+ *--------------------------------------------------------------------------------------------*/\r
+\r
+Object.defineProperty(exports, "__esModule", { value: true });\r
+const events_1 = __webpack_require__(9);\r
+const Is = __webpack_require__(6);\r
+var CancellationToken;\r
+(function (CancellationToken) {\r
+    CancellationToken.None = Object.freeze({\r
+        isCancellationRequested: false,\r
+        onCancellationRequested: events_1.Event.None\r
+    });\r
+    CancellationToken.Cancelled = Object.freeze({\r
+        isCancellationRequested: true,\r
+        onCancellationRequested: events_1.Event.None\r
+    });\r
+    function is(value) {\r
+        let candidate = value;\r
+        return candidate && (candidate === CancellationToken.None\r
+            || candidate === CancellationToken.Cancelled\r
+            || (Is.boolean(candidate.isCancellationRequested) && !!candidate.onCancellationRequested));\r
+    }\r
+    CancellationToken.is = is;\r
+})(CancellationToken = exports.CancellationToken || (exports.CancellationToken = {}));\r
+const shortcutEvent = Object.freeze(function (callback, context) {\r
+    let handle = setTimeout(callback.bind(context), 0);\r
+    return { dispose() { clearTimeout(handle); } };\r
+});\r
+class MutableToken {\r
+    constructor() {\r
+        this._isCancelled = false;\r
+    }\r
+    cancel() {\r
+        if (!this._isCancelled) {\r
+            this._isCancelled = true;\r
+            if (this._emitter) {\r
+                this._emitter.fire(undefined);\r
+                this.dispose();\r
+            }\r
+        }\r
+    }\r
+    get isCancellationRequested() {\r
+        return this._isCancelled;\r
+    }\r
+    get onCancellationRequested() {\r
+        if (this._isCancelled) {\r
+            return shortcutEvent;\r
+        }\r
+        if (!this._emitter) {\r
+            this._emitter = new events_1.Emitter();\r
+        }\r
+        return this._emitter.event;\r
+    }\r
+    dispose() {\r
+        if (this._emitter) {\r
+            this._emitter.dispose();\r
+            this._emitter = undefined;\r
+        }\r
+    }\r
+}\r
+class CancellationTokenSource {\r
+    get token() {\r
+        if (!this._token) {\r
+            // be lazy and create the token only when\r
+            // actually needed\r
+            this._token = new MutableToken();\r
+        }\r
+        return this._token;\r
+    }\r
+    cancel() {\r
+        if (!this._token) {\r
+            // save an object by returning the default\r
+            // cancelled token when cancellation happens\r
+            // before someone asks for the token\r
+            this._token = CancellationToken.Cancelled;\r
+        }\r
+        else {\r
+            this._token.cancel();\r
+        }\r
+    }\r
+    dispose() {\r
+        if (!this._token) {\r
+            // ensure to initialize with an empty token if we had none\r
+            this._token = CancellationToken.None;\r
+        }\r
+        else if (this._token instanceof MutableToken) {\r
+            // actually dispose\r
+            this._token.dispose();\r
+        }\r
+    }\r
+}\r
+exports.CancellationTokenSource = CancellationTokenSource;\r
+
+
+/***/ }),
+/* 12 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+\r
+/*---------------------------------------------------------------------------------------------\r
+ *  Copyright (c) Microsoft Corporation. All rights reserved.\r
+ *  Licensed under the MIT License. See License.txt in the project root for license information.\r
+ *--------------------------------------------------------------------------------------------*/\r
+Object.defineProperty(exports, "__esModule", { value: true });\r
+var Touch;\r
+(function (Touch) {\r
+    Touch.None = 0;\r
+    Touch.First = 1;\r
+    Touch.Last = 2;\r
+})(Touch = exports.Touch || (exports.Touch = {}));\r
+class LinkedMap {\r
+    constructor() {\r
+        this._map = new Map();\r
+        this._head = undefined;\r
+        this._tail = undefined;\r
+        this._size = 0;\r
+    }\r
+    clear() {\r
+        this._map.clear();\r
+        this._head = undefined;\r
+        this._tail = undefined;\r
+        this._size = 0;\r
+    }\r
+    isEmpty() {\r
+        return !this._head && !this._tail;\r
+    }\r
+    get size() {\r
+        return this._size;\r
+    }\r
+    has(key) {\r
+        return this._map.has(key);\r
+    }\r
+    get(key) {\r
+        const item = this._map.get(key);\r
+        if (!item) {\r
+            return undefined;\r
+        }\r
+        return item.value;\r
+    }\r
+    set(key, value, touch = Touch.None) {\r
+        let item = this._map.get(key);\r
+        if (item) {\r
+            item.value = value;\r
+            if (touch !== Touch.None) {\r
+                this.touch(item, touch);\r
+            }\r
+        }\r
+        else {\r
+            item = { key, value, next: undefined, previous: undefined };\r
+            switch (touch) {\r
+                case Touch.None:\r
+                    this.addItemLast(item);\r
+                    break;\r
+                case Touch.First:\r
+                    this.addItemFirst(item);\r
+                    break;\r
+                case Touch.Last:\r
+                    this.addItemLast(item);\r
+                    break;\r
+                default:\r
+                    this.addItemLast(item);\r
+                    break;\r
+            }\r
+            this._map.set(key, item);\r
+            this._size++;\r
+        }\r
+    }\r
+    delete(key) {\r
+        const item = this._map.get(key);\r
+        if (!item) {\r
+            return false;\r
+        }\r
+        this._map.delete(key);\r
+        this.removeItem(item);\r
+        this._size--;\r
+        return true;\r
+    }\r
+    shift() {\r
+        if (!this._head && !this._tail) {\r
+            return undefined;\r
+        }\r
+        if (!this._head || !this._tail) {\r
+            throw new Error('Invalid list');\r
+        }\r
+        const item = this._head;\r
+        this._map.delete(item.key);\r
+        this.removeItem(item);\r
+        this._size--;\r
+        return item.value;\r
+    }\r
+    forEach(callbackfn, thisArg) {\r
+        let current = this._head;\r
+        while (current) {\r
+            if (thisArg) {\r
+                callbackfn.bind(thisArg)(current.value, current.key, this);\r
+            }\r
+            else {\r
+                callbackfn(current.value, current.key, this);\r
+            }\r
+            current = current.next;\r
+        }\r
+    }\r
+    forEachReverse(callbackfn, thisArg) {\r
+        let current = this._tail;\r
+        while (current) {\r
+            if (thisArg) {\r
+                callbackfn.bind(thisArg)(current.value, current.key, this);\r
+            }\r
+            else {\r
+                callbackfn(current.value, current.key, this);\r
+            }\r
+            current = current.previous;\r
+        }\r
+    }\r
+    values() {\r
+        let result = [];\r
+        let current = this._head;\r
+        while (current) {\r
+            result.push(current.value);\r
+            current = current.next;\r
+        }\r
+        return result;\r
+    }\r
+    keys() {\r
+        let result = [];\r
+        let current = this._head;\r
+        while (current) {\r
+            result.push(current.key);\r
+            current = current.next;\r
+        }\r
+        return result;\r
+    }\r
+    /* JSON RPC run on es5 which has no Symbol.iterator\r
+    public keys(): IterableIterator<K> {\r
+        let current = this._head;\r
+        let iterator: IterableIterator<K> = {\r
+            [Symbol.iterator]() {\r
+                return iterator;\r
+            },\r
+            next():IteratorResult<K> {\r
+                if (current) {\r
+                    let result = { value: current.key, done: false };\r
+                    current = current.next;\r
+                    return result;\r
+                } else {\r
+                    return { value: undefined, done: true };\r
+                }\r
+            }\r
+        };\r
+        return iterator;\r
+    }\r
+\r
+    public values(): IterableIterator<V> {\r
+        let current = this._head;\r
+        let iterator: IterableIterator<V> = {\r
+            [Symbol.iterator]() {\r
+                return iterator;\r
+            },\r
+            next():IteratorResult<V> {\r
+                if (current) {\r
+                    let result = { value: current.value, done: false };\r
+                    current = current.next;\r
+                    return result;\r
+                } else {\r
+                    return { value: undefined, done: true };\r
+                }\r
+            }\r
+        };\r
+        return iterator;\r
+    }\r
+    */\r
+    addItemFirst(item) {\r
+        // First time Insert\r
+        if (!this._head && !this._tail) {\r
+            this._tail = item;\r
+        }\r
+        else if (!this._head) {\r
+            throw new Error('Invalid list');\r
+        }\r
+        else {\r
+            item.next = this._head;\r
+            this._head.previous = item;\r
+        }\r
+        this._head = item;\r
+    }\r
+    addItemLast(item) {\r
+        // First time Insert\r
+        if (!this._head && !this._tail) {\r
+            this._head = item;\r
+        }\r
+        else if (!this._tail) {\r
+            throw new Error('Invalid list');\r
+        }\r
+        else {\r
+            item.previous = this._tail;\r
+            this._tail.next = item;\r
+        }\r
+        this._tail = item;\r
+    }\r
+    removeItem(item) {\r
+        if (item === this._head && item === this._tail) {\r
+            this._head = undefined;\r
+            this._tail = undefined;\r
+        }\r
+        else if (item === this._head) {\r
+            this._head = item.next;\r
+        }\r
+        else if (item === this._tail) {\r
+            this._tail = item.previous;\r
+        }\r
+        else {\r
+            const next = item.next;\r
+            const previous = item.previous;\r
+            if (!next || !previous) {\r
+                throw new Error('Invalid list');\r
+            }\r
+            next.previous = previous;\r
+            previous.next = next;\r
+        }\r
+    }\r
+    touch(item, touch) {\r
+        if (!this._head || !this._tail) {\r
+            throw new Error('Invalid list');\r
+        }\r
+        if ((touch !== Touch.First && touch !== Touch.Last)) {\r
+            return;\r
+        }\r
+        if (touch === Touch.First) {\r
+            if (item === this._head) {\r
+                return;\r
+            }\r
+            const next = item.next;\r
+            const previous = item.previous;\r
+            // Unlink the item\r
+            if (item === this._tail) {\r
+                // previous must be defined since item was not head but is tail\r
+                // So there are more than on item in the map\r
+                previous.next = undefined;\r
+                this._tail = previous;\r
+            }\r
+            else {\r
+                // Both next and previous are not undefined since item was neither head nor tail.\r
+                next.previous = previous;\r
+                previous.next = next;\r
+            }\r
+            // Insert the node at head\r
+            item.previous = undefined;\r
+            item.next = this._head;\r
+            this._head.previous = item;\r
+            this._head = item;\r
+        }\r
+        else if (touch === Touch.Last) {\r
+            if (item === this._tail) {\r
+                return;\r
+            }\r
+            const next = item.next;\r
+            const previous = item.previous;\r
+            // Unlink the item.\r
+            if (item === this._head) {\r
+                // next must be defined since item was not tail but is head\r
+                // So there are more than on item in the map\r
+                next.previous = undefined;\r
+                this._head = next;\r
+            }\r
+            else {\r
+                // Both next and previous are not undefined since item was neither head nor tail.\r
+                next.previous = previous;\r
+                previous.next = next;\r
+            }\r
+            item.next = undefined;\r
+            item.previous = this._tail;\r
+            this._tail.next = item;\r
+            this._tail = item;\r
+        }\r
+    }\r
+}\r
+exports.LinkedMap = LinkedMap;\r
+
+
+/***/ }),
+/* 13 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/* --------------------------------------------------------------------------------------------\r
+ * Copyright (c) Microsoft Corporation. All rights reserved.\r
+ * Licensed under the MIT License. See License.txt in the project root for license information.\r
+ * ------------------------------------------------------------------------------------------ */\r
+\r
+Object.defineProperty(exports, "__esModule", { value: true });\r
+const path_1 = __webpack_require__(3);\r
+const os_1 = __webpack_require__(14);\r
+const crypto_1 = __webpack_require__(15);\r
+const net_1 = __webpack_require__(16);\r
+const messageReader_1 = __webpack_require__(8);\r
+const messageWriter_1 = __webpack_require__(10);\r
+function generateRandomPipeName() {\r
+    const randomSuffix = crypto_1.randomBytes(21).toString('hex');\r
+    if (process.platform === 'win32') {\r
+        return `\\\\.\\pipe\\vscode-jsonrpc-${randomSuffix}-sock`;\r
+    }\r
+    else {\r
+        // Mac/Unix: use socket file\r
+        return path_1.join(os_1.tmpdir(), `vscode-${randomSuffix}.sock`);\r
+    }\r
+}\r
+exports.generateRandomPipeName = generateRandomPipeName;\r
+function createClientPipeTransport(pipeName, encoding = 'utf-8') {\r
+    let connectResolve;\r
+    let connected = new Promise((resolve, _reject) => {\r
+        connectResolve = resolve;\r
+    });\r
+    return new Promise((resolve, reject) => {\r
+        let server = net_1.createServer((socket) => {\r
+            server.close();\r
+            connectResolve([\r
+                new messageReader_1.SocketMessageReader(socket, encoding),\r
+                new messageWriter_1.SocketMessageWriter(socket, encoding)\r
+            ]);\r
+        });\r
+        server.on('error', reject);\r
+        server.listen(pipeName, () => {\r
+            server.removeListener('error', reject);\r
+            resolve({\r
+                onConnected: () => { return connected; }\r
+            });\r
+        });\r
+    });\r
+}\r
+exports.createClientPipeTransport = createClientPipeTransport;\r
+function createServerPipeTransport(pipeName, encoding = 'utf-8') {\r
+    const socket = net_1.createConnection(pipeName);\r
+    return [\r
+        new messageReader_1.SocketMessageReader(socket, encoding),\r
+        new messageWriter_1.SocketMessageWriter(socket, encoding)\r
+    ];\r
+}\r
+exports.createServerPipeTransport = createServerPipeTransport;\r
+
+
+/***/ }),
+/* 14 */
+/***/ (function(module, exports) {
+
+module.exports = require("os");
+
+/***/ }),
+/* 15 */
+/***/ (function(module, exports) {
+
+module.exports = require("crypto");
+
+/***/ }),
+/* 16 */
+/***/ (function(module, exports) {
+
+module.exports = require("net");
+
+/***/ }),
+/* 17 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/* --------------------------------------------------------------------------------------------\r
+ * Copyright (c) Microsoft Corporation. All rights reserved.\r
+ * Licensed under the MIT License. See License.txt in the project root for license information.\r
+ * ------------------------------------------------------------------------------------------ */\r
+\r
+Object.defineProperty(exports, "__esModule", { value: true });\r
+const net_1 = __webpack_require__(16);\r
+const messageReader_1 = __webpack_require__(8);\r
+const messageWriter_1 = __webpack_require__(10);\r
+function createClientSocketTransport(port, encoding = 'utf-8') {\r
+    let connectResolve;\r
+    let connected = new Promise((resolve, _reject) => {\r
+        connectResolve = resolve;\r
+    });\r
+    return new Promise((resolve, reject) => {\r
+        let server = net_1.createServer((socket) => {\r
+            server.close();\r
+            connectResolve([\r
+                new messageReader_1.SocketMessageReader(socket, encoding),\r
+                new messageWriter_1.SocketMessageWriter(socket, encoding)\r
+            ]);\r
+        });\r
+        server.on('error', reject);\r
+        server.listen(port, '127.0.0.1', () => {\r
+            server.removeListener('error', reject);\r
+            resolve({\r
+                onConnected: () => { return connected; }\r
+            });\r
+        });\r
+    });\r
+}\r
+exports.createClientSocketTransport = createClientSocketTransport;\r
+function createServerSocketTransport(port, encoding = 'utf-8') {\r
+    const socket = net_1.createConnection(port, '127.0.0.1');\r
+    return [\r
+        new messageReader_1.SocketMessageReader(socket, encoding),\r
+        new messageWriter_1.SocketMessageWriter(socket, encoding)\r
+    ];\r
+}\r
+exports.createServerSocketTransport = createServerSocketTransport;\r
+
+
+/***/ }),
+/* 18 */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Position", function() { return Position; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Range", function() { return Range; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Location", function() { return Location; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LocationLink", function() { return LocationLink; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Color", function() { return Color; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColorInformation", function() { return ColorInformation; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColorPresentation", function() { return ColorPresentation; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FoldingRangeKind", function() { return FoldingRangeKind; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FoldingRange", function() { return FoldingRange; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiagnosticRelatedInformation", function() { return DiagnosticRelatedInformation; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiagnosticSeverity", function() { return DiagnosticSeverity; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiagnosticTag", function() { return DiagnosticTag; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Diagnostic", function() { return Diagnostic; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Command", function() { return Command; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextEdit", function() { return TextEdit; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextDocumentEdit", function() { return TextDocumentEdit; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CreateFile", function() { return CreateFile; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RenameFile", function() { return RenameFile; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DeleteFile", function() { return DeleteFile; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WorkspaceEdit", function() { return WorkspaceEdit; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WorkspaceChange", function() { return WorkspaceChange; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextDocumentIdentifier", function() { return TextDocumentIdentifier; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VersionedTextDocumentIdentifier", function() { return VersionedTextDocumentIdentifier; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextDocumentItem", function() { return TextDocumentItem; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkupKind", function() { return MarkupKind; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkupContent", function() { return MarkupContent; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItemKind", function() { return CompletionItemKind; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InsertTextFormat", function() { return InsertTextFormat; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItemTag", function() { return CompletionItemTag; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItem", function() { return CompletionItem; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionList", function() { return CompletionList; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkedString", function() { return MarkedString; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Hover", function() { return Hover; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ParameterInformation", function() { return ParameterInformation; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SignatureInformation", function() { return SignatureInformation; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentHighlightKind", function() { return DocumentHighlightKind; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentHighlight", function() { return DocumentHighlight; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SymbolKind", function() { return SymbolKind; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SymbolTag", function() { return SymbolTag; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SymbolInformation", function() { return SymbolInformation; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentSymbol", function() { return DocumentSymbol; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeActionKind", function() { return CodeActionKind; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeActionContext", function() { return CodeActionContext; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeAction", function() { return CodeAction; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeLens", function() { return CodeLens; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormattingOptions", function() { return FormattingOptions; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentLink", function() { return DocumentLink; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectionRange", function() { return SelectionRange; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EOL", function() { return EOL; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextDocument", function() { return TextDocument; });
+/* --------------------------------------------------------------------------------------------\r
+ * Copyright (c) Microsoft Corporation. All rights reserved.\r
+ * Licensed under the MIT License. See License.txt in the project root for license information.\r
+ * ------------------------------------------------------------------------------------------ */\r
+\r
+/**\r
+ * The Position namespace provides helper functions to work with\r
+ * [Position](#Position) literals.\r
+ */\r
+var Position;\r
+(function (Position) {\r
+    /**\r
+     * Creates a new Position literal from the given line and character.\r
+     * @param line The position's line.\r
+     * @param character The position's character.\r
+     */\r
+    function create(line, character) {\r
+        return { line: line, character: character };\r
+    }\r
+    Position.create = create;\r
+    /**\r
+     * Checks whether the given liternal conforms to the [Position](#Position) interface.\r
+     */\r
+    function is(value) {\r
+        var candidate = value;\r
+        return Is.objectLiteral(candidate) && Is.number(candidate.line) && Is.number(candidate.character);\r
+    }\r
+    Position.is = is;\r
+})(Position || (Position = {}));\r
+/**\r
+ * The Range namespace provides helper functions to work with\r
+ * [Range](#Range) literals.\r
+ */\r
+var Range;\r
+(function (Range) {\r
+    function create(one, two, three, four) {\r
+        if (Is.number(one) && Is.number(two) && Is.number(three) && Is.number(four)) {\r
+            return { start: Position.create(one, two), end: Position.create(three, four) };\r
+        }\r
+        else if (Position.is(one) && Position.is(two)) {\r
+            return { start: one, end: two };\r
+        }\r
+        else {\r
+            throw new Error("Range#create called with invalid arguments[" + one + ", " + two + ", " + three + ", " + four + "]");\r
+        }\r
+    }\r
+    Range.create = create;\r
+    /**\r
+     * Checks whether the given literal conforms to the [Range](#Range) interface.\r
+     */\r
+    function is(value) {\r
+        var candidate = value;\r
+        return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);\r
+    }\r
+    Range.is = is;\r
+})(Range || (Range = {}));\r
+/**\r
+ * The Location namespace provides helper functions to work with\r
+ * [Location](#Location) literals.\r
+ */\r
+var Location;\r
+(function (Location) {\r
+    /**\r
+     * Creates a Location literal.\r
+     * @param uri The location's uri.\r
+     * @param range The location's range.\r
+     */\r
+    function create(uri, range) {\r
+        return { uri: uri, range: range };\r
+    }\r
+    Location.create = create;\r
+    /**\r
+     * Checks whether the given literal conforms to the [Location](#Location) interface.\r
+     */\r
+    function is(value) {\r
+        var candidate = value;\r
+        return Is.defined(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri));\r
+    }\r
+    Location.is = is;\r
+})(Location || (Location = {}));\r
+/**\r
+ * The LocationLink namespace provides helper functions to work with\r
+ * [LocationLink](#LocationLink) literals.\r
+ */\r
+var LocationLink;\r
+(function (LocationLink) {\r
+    /**\r
+     * Creates a LocationLink literal.\r
+     * @param targetUri The definition's uri.\r
+     * @param targetRange The full range of the definition.\r
+     * @param targetSelectionRange The span of the symbol definition at the target.\r
+     * @param originSelectionRange The span of the symbol being defined in the originating source file.\r
+     */\r
+    function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) {\r
+        return { targetUri: targetUri, targetRange: targetRange, targetSelectionRange: targetSelectionRange, originSelectionRange: originSelectionRange };\r
+    }\r
+    LocationLink.create = create;\r
+    /**\r
+     * Checks whether the given literal conforms to the [LocationLink](#LocationLink) interface.\r
+     */\r
+    function is(value) {\r
+        var candidate = value;\r
+        return Is.defined(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri)\r
+            && (Range.is(candidate.targetSelectionRange) || Is.undefined(candidate.targetSelectionRange))\r
+            && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange));\r
+    }\r
+    LocationLink.is = is;\r
+})(LocationLink || (LocationLink = {}));\r
+/**\r
+ * The Color namespace provides helper functions to work with\r
+ * [Color](#Color) literals.\r
+ */\r
+var Color;\r
+(function (Color) {\r
+    /**\r
+     * Creates a new Color literal.\r
+     */\r
+    function create(red, green, blue, alpha) {\r
+        return {\r
+            red: red,\r
+            green: green,\r
+            blue: blue,\r
+            alpha: alpha,\r
+        };\r
+    }\r
+    Color.create = create;\r
+    /**\r
+     * Checks whether the given literal conforms to the [Color](#Color) interface.\r
+     */\r
+    function is(value) {\r
+        var candidate = value;\r
+        return Is.number(candidate.red)\r
+            && Is.number(candidate.green)\r
+            && Is.number(candidate.blue)\r
+            && Is.number(candidate.alpha);\r
+    }\r
+    Color.is = is;\r
+})(Color || (Color = {}));\r
+/**\r
+ * The ColorInformation namespace provides helper functions to work with\r
+ * [ColorInformation](#ColorInformation) literals.\r
+ */\r
+var ColorInformation;\r
+(function (ColorInformation) {\r
+    /**\r
+     * Creates a new ColorInformation literal.\r
+     */\r
+    function create(range, color) {\r
+        return {\r
+            range: range,\r
+            color: color,\r
+        };\r
+    }\r
+    ColorInformation.create = create;\r
+    /**\r
+     * Checks whether the given literal conforms to the [ColorInformation](#ColorInformation) interface.\r
+     */\r
+    function is(value) {\r
+        var candidate = value;\r
+        return Range.is(candidate.range) && Color.is(candidate.color);\r
+    }\r
+    ColorInformation.is = is;\r
+})(ColorInformation || (ColorInformation = {}));\r
+/**\r
+ * The Color namespace provides helper functions to work with\r
+ * [ColorPresentation](#ColorPresentation) literals.\r
+ */\r
+var ColorPresentation;\r
+(function (ColorPresentation) {\r
+    /**\r
+     * Creates a new ColorInformation literal.\r
+     */\r
+    function create(label, textEdit, additionalTextEdits) {\r
+        return {\r
+            label: label,\r
+            textEdit: textEdit,\r
+            additionalTextEdits: additionalTextEdits,\r
+        };\r
+    }\r
+    ColorPresentation.create = create;\r
+    /**\r
+     * Checks whether the given literal conforms to the [ColorInformation](#ColorInformation) interface.\r
+     */\r
+    function is(value) {\r
+        var candidate = value;\r
+        return Is.string(candidate.label)\r
+            && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate))\r
+            && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is));\r
+    }\r
+    ColorPresentation.is = is;\r
+})(ColorPresentation || (ColorPresentation = {}));\r
+/**\r
+ * Enum of known range kinds\r
+ */\r
+var FoldingRangeKind;\r
+(function (FoldingRangeKind) {\r
+    /**\r
+     * Folding range for a comment\r
+     */\r
+    FoldingRangeKind["Comment"] = "comment";\r
+    /**\r
+     * Folding range for a imports or includes\r
+     */\r
+    FoldingRangeKind["Imports"] = "imports";\r
+    /**\r
+     * Folding range for a region (e.g. `#region`)\r
+     */\r
+    FoldingRangeKind["Region"] = "region";\r
+})(FoldingRangeKind || (FoldingRangeKind = {}));\r
+/**\r
+ * The folding range namespace provides helper functions to work with\r
+ * [FoldingRange](#FoldingRange) literals.\r
+ */\r
+var FoldingRange;\r
+(function (FoldingRange) {\r
+    /**\r
+     * Creates a new FoldingRange literal.\r
+     */\r
+    function create(startLine, endLine, startCharacter, endCharacter, kind) {\r
+        var result = {\r
+            startLine: startLine,\r
+            endLine: endLine\r
+        };\r
+        if (Is.defined(startCharacter)) {\r
+            result.startCharacter = startCharacter;\r
+        }\r
+        if (Is.defined(endCharacter)) {\r
+            result.endCharacter = endCharacter;\r
+        }\r
+        if (Is.defined(kind)) {\r
+            result.kind = kind;\r
+        }\r
+        return result;\r
+    }\r
+    FoldingRange.create = create;\r
+    /**\r
+     * Checks whether the given literal conforms to the [FoldingRange](#FoldingRange) interface.\r
+     */\r
+    function is(value) {\r
+        var candidate = value;\r
+        return Is.number(candidate.startLine) && Is.number(candidate.startLine)\r
+            && (Is.undefined(candidate.startCharacter) || Is.number(candidate.startCharacter))\r
+            && (Is.undefined(candidate.endCharacter) || Is.number(candidate.endCharacter))\r
+            && (Is.undefined(candidate.kind) || Is.string(candidate.kind));\r
+    }\r
+    FoldingRange.is = is;\r
+})(FoldingRange || (FoldingRange = {}));\r
+/**\r
+ * The DiagnosticRelatedInformation namespace provides helper functions to work with\r
+ * [DiagnosticRelatedInformation](#DiagnosticRelatedInformation) literals.\r
+ */\r
+var DiagnosticRelatedInformation;\r
+(function (DiagnosticRelatedInformation) {\r
+    /**\r
+     * Creates a new DiagnosticRelatedInformation literal.\r
+     */\r
+    function create(location, message) {\r
+        return {\r
+            location: location,\r
+            message: message\r
+        };\r
+    }\r
+    DiagnosticRelatedInformation.create = create;\r
+    /**\r
+     * Checks whether the given literal conforms to the [DiagnosticRelatedInformation](#DiagnosticRelatedInformation) interface.\r
+     */\r
+    function is(value) {\r
+        var candidate = value;\r
+        return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message);\r
+    }\r
+    DiagnosticRelatedInformation.is = is;\r
+})(DiagnosticRelatedInformation || (DiagnosticRelatedInformation = {}));\r
+/**\r
+ * The diagnostic's severity.\r
+ */\r
+var DiagnosticSeverity;\r
+(function (DiagnosticSeverity) {\r
+    /**\r
+     * Reports an error.\r
+     */\r
+    DiagnosticSeverity.Error = 1;\r
+    /**\r
+     * Reports a warning.\r
+     */\r
+    DiagnosticSeverity.Warning = 2;\r
+    /**\r
+     * Reports an information.\r
+     */\r
+    DiagnosticSeverity.Information = 3;\r
+    /**\r
+     * Reports a hint.\r
+     */\r
+    DiagnosticSeverity.Hint = 4;\r
+})(DiagnosticSeverity || (DiagnosticSeverity = {}));\r
+/**\r
+ * The diagnostic tags.\r
+ *\r
+ * @since 3.15.0\r
+ */\r
+var DiagnosticTag;\r
+(function (DiagnosticTag) {\r
+    /**\r
+     * Unused or unnecessary code.\r
+     *\r
+     * Clients are allowed to render diagnostics with this tag faded out instead of having\r
+     * an error squiggle.\r
+     */\r
+    DiagnosticTag.Unnecessary = 1;\r
+    /**\r
+     * Deprecated or obsolete code.\r
+     *\r
+     * Clients are allowed to rendered diagnostics with this tag strike through.\r
+     */\r
+    DiagnosticTag.Deprecated = 2;\r
+})(DiagnosticTag || (DiagnosticTag = {}));\r
+/**\r
+ * The Diagnostic namespace provides helper functions to work with\r
+ * [Diagnostic](#Diagnostic) literals.\r
+ */\r
+var Diagnostic;\r
+(function (Diagnostic) {\r
+    /**\r
+     * Creates a new Diagnostic literal.\r
+     */\r
+    function create(range, message, severity, code, source, relatedInformation) {\r
+        var result = { range: range, message: message };\r
+        if (Is.defined(severity)) {\r
+            result.severity = severity;\r
+        }\r
+        if (Is.defined(code)) {\r
+            result.code = code;\r
+        }\r
+        if (Is.defined(source)) {\r
+            result.source = source;\r
+        }\r
+        if (Is.defined(relatedInformation)) {\r
+            result.relatedInformation = relatedInformation;\r
+        }\r
+        return result;\r
+    }\r
+    Diagnostic.create = create;\r
+    /**\r
+     * Checks whether the given literal conforms to the [Diagnostic](#Diagnostic) interface.\r
+     */\r
+    function is(value) {\r
+        var candidate = value;\r
+        return Is.defined(candidate)\r
+            && Range.is(candidate.range)\r
+            && Is.string(candidate.message)\r
+            && (Is.number(candidate.severity) || Is.undefined(candidate.severity))\r
+            && (Is.number(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code))\r
+            && (Is.string(candidate.source) || Is.undefined(candidate.source))\r
+            && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is));\r
+    }\r
+    Diagnostic.is = is;\r
+})(Diagnostic || (Diagnostic = {}));\r
+/**\r
+ * The Command namespace provides helper functions to work with\r
+ * [Command](#Command) literals.\r
+ */\r
+var Command;\r
+(function (Command) {\r
+    /**\r
+     * Creates a new Command literal.\r
+     */\r
+    function create(title, command) {\r
+        var args = [];\r
+        for (var _i = 2; _i < arguments.length; _i++) {\r
+            args[_i - 2] = arguments[_i];\r
+        }\r
+        var result = { title: title, command: command };\r
+        if (Is.defined(args) && args.length > 0) {\r
+            result.arguments = args;\r
+        }\r
+        return result;\r
+    }\r
+    Command.create = create;\r
+    /**\r
+     * Checks whether the given literal conforms to the [Command](#Command) interface.\r
+     */\r
+    function is(value) {\r
+        var candidate = value;\r
+        return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command);\r
+    }\r
+    Command.is = is;\r
+})(Command || (Command = {}));\r
+/**\r
+ * The TextEdit namespace provides helper function to create replace,\r
+ * insert and delete edits more easily.\r
+ */\r
+var TextEdit;\r
+(function (TextEdit) {\r
+    /**\r
+     * Creates a replace text edit.\r
+     * @param range The range of text to be replaced.\r
+     * @param newText The new text.\r
+     */\r
+    function replace(range, newText) {\r
+        return { range: range, newText: newText };\r
+    }\r
+    TextEdit.replace = replace;\r
+    /**\r
+     * Creates a insert text edit.\r
+     * @param position The position to insert the text at.\r
+     * @param newText The text to be inserted.\r
+     */\r
+    function insert(position, newText) {\r
+        return { range: { start: position, end: position }, newText: newText };\r
+    }\r
+    TextEdit.insert = insert;\r
+    /**\r
+     * Creates a delete text edit.\r
+     * @param range The range of text to be deleted.\r
+     */\r
+    function del(range) {\r
+        return { range: range, newText: '' };\r
+    }\r
+    TextEdit.del = del;\r
+    function is(value) {\r
+        var candidate = value;\r
+        return Is.objectLiteral(candidate)\r
+            && Is.string(candidate.newText)\r
+            && Range.is(candidate.range);\r
+    }\r
+    TextEdit.is = is;\r
+})(TextEdit || (TextEdit = {}));\r
+/**\r
+ * The TextDocumentEdit namespace provides helper function to create\r
+ * an edit that manipulates a text document.\r
+ */\r
+var TextDocumentEdit;\r
+(function (TextDocumentEdit) {\r
+    /**\r
+     * Creates a new `TextDocumentEdit`\r
+     */\r
+    function create(textDocument, edits) {\r
+        return { textDocument: textDocument, edits: edits };\r
+    }\r
+    TextDocumentEdit.create = create;\r
+    function is(value) {\r
+        var candidate = value;\r
+        return Is.defined(candidate)\r
+            && VersionedTextDocumentIdentifier.is(candidate.textDocument)\r
+            && Array.isArray(candidate.edits);\r
+    }\r
+    TextDocumentEdit.is = is;\r
+})(TextDocumentEdit || (TextDocumentEdit = {}));\r
+var CreateFile;\r
+(function (CreateFile) {\r
+    function create(uri, options) {\r
+        var result = {\r
+            kind: 'create',\r
+            uri: uri\r
+        };\r
+        if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) {\r
+            result.options = options;\r
+        }\r
+        return result;\r
+    }\r
+    CreateFile.create = create;\r
+    function is(value) {\r
+        var candidate = value;\r
+        return candidate && candidate.kind === 'create' && Is.string(candidate.uri) &&\r
+            (candidate.options === void 0 ||\r
+                ((candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))));\r
+    }\r
+    CreateFile.is = is;\r
+})(CreateFile || (CreateFile = {}));\r
+var RenameFile;\r
+(function (RenameFile) {\r
+    function create(oldUri, newUri, options) {\r
+        var result = {\r
+            kind: 'rename',\r
+            oldUri: oldUri,\r
+            newUri: newUri\r
+        };\r
+        if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) {\r
+            result.options = options;\r
+        }\r
+        return result;\r
+    }\r
+    RenameFile.create = create;\r
+    function is(value) {\r
+        var candidate = value;\r
+        return candidate && candidate.kind === 'rename' && Is.string(candidate.oldUri) && Is.string(candidate.newUri) &&\r
+            (candidate.options === void 0 ||\r
+                ((candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))));\r
+    }\r
+    RenameFile.is = is;\r
+})(RenameFile || (RenameFile = {}));\r
+var DeleteFile;\r
+(function (DeleteFile) {\r
+    function create(uri, options) {\r
+        var result = {\r
+            kind: 'delete',\r
+            uri: uri\r
+        };\r
+        if (options !== void 0 && (options.recursive !== void 0 || options.ignoreIfNotExists !== void 0)) {\r
+            result.options = options;\r
+        }\r
+        return result;\r
+    }\r
+    DeleteFile.create = create;\r
+    function is(value) {\r
+        var candidate = value;\r
+        return candidate && candidate.kind === 'delete' && Is.string(candidate.uri) &&\r
+            (candidate.options === void 0 ||\r
+                ((candidate.options.recursive === void 0 || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === void 0 || Is.boolean(candidate.options.ignoreIfNotExists))));\r
+    }\r
+    DeleteFile.is = is;\r
+})(DeleteFile || (DeleteFile = {}));\r
+var WorkspaceEdit;\r
+(function (WorkspaceEdit) {\r
+    function is(value) {\r
+        var candidate = value;\r
+        return candidate &&\r
+            (candidate.changes !== void 0 || candidate.documentChanges !== void 0) &&\r
+            (candidate.documentChanges === void 0 || candidate.documentChanges.every(function (change) {\r
+                if (Is.string(change.kind)) {\r
+                    return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change);\r
+                }\r
+                else {\r
+                    return TextDocumentEdit.is(change);\r
+                }\r
+            }));\r
+    }\r
+    WorkspaceEdit.is = is;\r
+})(WorkspaceEdit || (WorkspaceEdit = {}));\r
+var TextEditChangeImpl = /** @class */ (function () {\r
+    function TextEditChangeImpl(edits) {\r
+        this.edits = edits;\r
+    }\r
+    TextEditChangeImpl.prototype.insert = function (position, newText) {\r
+        this.edits.push(TextEdit.insert(position, newText));\r
+    };\r
+    TextEditChangeImpl.prototype.replace = function (range, newText) {\r
+        this.edits.push(TextEdit.replace(range, newText));\r
+    };\r
+    TextEditChangeImpl.prototype.delete = function (range) {\r
+        this.edits.push(TextEdit.del(range));\r
+    };\r
+    TextEditChangeImpl.prototype.add = function (edit) {\r
+        this.edits.push(edit);\r
+    };\r
+    TextEditChangeImpl.prototype.all = function () {\r
+        return this.edits;\r
+    };\r
+    TextEditChangeImpl.prototype.clear = function () {\r
+        this.edits.splice(0, this.edits.length);\r
+    };\r
+    return TextEditChangeImpl;\r
+}());\r
+/**\r
+ * A workspace change helps constructing changes to a workspace.\r
+ */\r
+var WorkspaceChange = /** @class */ (function () {\r
+    function WorkspaceChange(workspaceEdit) {\r
+        var _this = this;\r
+        this._textEditChanges = Object.create(null);\r
+        if (workspaceEdit) {\r
+            this._workspaceEdit = workspaceEdit;\r
+            if (workspaceEdit.documentChanges) {\r
+                workspaceEdit.documentChanges.forEach(function (change) {\r
+                    if (TextDocumentEdit.is(change)) {\r
+                        var textEditChange = new TextEditChangeImpl(change.edits);\r
+                        _this._textEditChanges[change.textDocument.uri] = textEditChange;\r
+                    }\r
+                });\r
+            }\r
+            else if (workspaceEdit.changes) {\r
+                Object.keys(workspaceEdit.changes).forEach(function (key) {\r
+                    var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]);\r
+                    _this._textEditChanges[key] = textEditChange;\r
+                });\r
+            }\r
+        }\r
+    }\r
+    Object.defineProperty(WorkspaceChange.prototype, "edit", {\r
+        /**\r
+         * Returns the underlying [WorkspaceEdit](#WorkspaceEdit) literal\r
+         * use to be returned from a workspace edit operation like rename.\r
+         */\r
+        get: function () {\r
+            return this._workspaceEdit;\r
+        },\r
+        enumerable: true,\r
+        configurable: true\r
+    });\r
+    WorkspaceChange.prototype.getTextEditChange = function (key) {\r
+        if (VersionedTextDocumentIdentifier.is(key)) {\r
+            if (!this._workspaceEdit) {\r
+                this._workspaceEdit = {\r
+                    documentChanges: []\r
+                };\r
+            }\r
+            if (!this._workspaceEdit.documentChanges) {\r
+                throw new Error('Workspace edit is not configured for document changes.');\r
+            }\r
+            var textDocument = key;\r
+            var result = this._textEditChanges[textDocument.uri];\r
+            if (!result) {\r
+                var edits = [];\r
+                var textDocumentEdit = {\r
+                    textDocument: textDocument,\r
+                    edits: edits\r
+                };\r
+                this._workspaceEdit.documentChanges.push(textDocumentEdit);\r
+                result = new TextEditChangeImpl(edits);\r
+                this._textEditChanges[textDocument.uri] = result;\r
+            }\r
+            return result;\r
+        }\r
+        else {\r
+            if (!this._workspaceEdit) {\r
+                this._workspaceEdit = {\r
+                    changes: Object.create(null)\r
+                };\r
+            }\r
+            if (!this._workspaceEdit.changes) {\r
+                throw new Error('Workspace edit is not configured for normal text edit changes.');\r
+            }\r
+            var result = this._textEditChanges[key];\r
+            if (!result) {\r
+                var edits = [];\r
+                this._workspaceEdit.changes[key] = edits;\r
+                result = new TextEditChangeImpl(edits);\r
+                this._textEditChanges[key] = result;\r
+            }\r
+            return result;\r
+        }\r
+    };\r
+    WorkspaceChange.prototype.createFile = function (uri, options) {\r
+        this.checkDocumentChanges();\r
+        this._workspaceEdit.documentChanges.push(CreateFile.create(uri, options));\r
+    };\r
+    WorkspaceChange.prototype.renameFile = function (oldUri, newUri, options) {\r
+        this.checkDocumentChanges();\r
+        this._workspaceEdit.documentChanges.push(RenameFile.create(oldUri, newUri, options));\r
+    };\r
+    WorkspaceChange.prototype.deleteFile = function (uri, options) {\r
+        this.checkDocumentChanges();\r
+        this._workspaceEdit.documentChanges.push(DeleteFile.create(uri, options));\r
+    };\r
+    WorkspaceChange.prototype.checkDocumentChanges = function () {\r
+        if (!this._workspaceEdit || !this._workspaceEdit.documentChanges) {\r
+            throw new Error('Workspace edit is not configured for document changes.');\r
+        }\r
+    };\r
+    return WorkspaceChange;\r
+}());\r
+\r
+/**\r
+ * The TextDocumentIdentifier namespace provides helper functions to work with\r
+ * [TextDocumentIdentifier](#TextDocumentIdentifier) literals.\r
+ */\r
+var TextDocumentIdentifier;\r
+(function (TextDocumentIdentifier) {\r
+    /**\r
+     * Creates a new TextDocumentIdentifier literal.\r
+     * @param uri The document's uri.\r
+     */\r
+    function create(uri) {\r
+        return { uri: uri };\r
+    }\r
+    TextDocumentIdentifier.create = create;\r
+    /**\r
+     * Checks whether the given literal conforms to the [TextDocumentIdentifier](#TextDocumentIdentifier) interface.\r
+     */\r
+    function is(value) {\r
+        var candidate = value;\r
+        return Is.defined(candidate) && Is.string(candidate.uri);\r
+    }\r
+    TextDocumentIdentifier.is = is;\r
+})(TextDocumentIdentifier || (TextDocumentIdentifier = {}));\r
+/**\r
+ * The VersionedTextDocumentIdentifier namespace provides helper functions to work with\r
+ * [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) literals.\r
+ */\r
+var VersionedTextDocumentIdentifier;\r
+(function (VersionedTextDocumentIdentifier) {\r
+    /**\r
+     * Creates a new VersionedTextDocumentIdentifier literal.\r
+     * @param uri The document's uri.\r
+     * @param uri The document's text.\r
+     */\r
+    function create(uri, version) {\r
+        return { uri: uri, version: version };\r
+    }\r
+    VersionedTextDocumentIdentifier.create = create;\r
+    /**\r
+     * Checks whether the given literal conforms to the [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) interface.\r
+     */\r
+    function is(value) {\r
+        var candidate = value;\r
+        return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.number(candidate.version));\r
+    }\r
+    VersionedTextDocumentIdentifier.is = is;\r
+})(VersionedTextDocumentIdentifier || (VersionedTextDocumentIdentifier = {}));\r
+/**\r
+ * The TextDocumentItem namespace provides helper functions to work with\r
+ * [TextDocumentItem](#TextDocumentItem) literals.\r
+ */\r
+var TextDocumentItem;\r
+(function (TextDocumentItem) {\r
+    /**\r
+     * Creates a new TextDocumentItem literal.\r
+     * @param uri The document's uri.\r
+     * @param languageId The document's language identifier.\r
+     * @param version The document's version number.\r
+     * @param text The document's text.\r
+     */\r
+    function create(uri, languageId, version, text) {\r
+        return { uri: uri, languageId: languageId, version: version, text: text };\r
+    }\r
+    TextDocumentItem.create = create;\r
+    /**\r
+     * Checks whether the given literal conforms to the [TextDocumentItem](#TextDocumentItem) interface.\r
+     */\r
+    function is(value) {\r
+        var candidate = value;\r
+        return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.number(candidate.version) && Is.string(candidate.text);\r
+    }\r
+    TextDocumentItem.is = is;\r
+})(TextDocumentItem || (TextDocumentItem = {}));\r
+/**\r
+ * Describes the content type that a client supports in various\r
+ * result literals like `Hover`, `ParameterInfo` or `CompletionItem`.\r
+ *\r
+ * Please note that `MarkupKinds` must not start with a `$`. This kinds\r
+ * are reserved for internal usage.\r
+ */\r
+var MarkupKind;\r
+(function (MarkupKind) {\r
+    /**\r
+     * Plain text is supported as a content format\r
+     */\r
+    MarkupKind.PlainText = 'plaintext';\r
+    /**\r
+     * Markdown is supported as a content format\r
+     */\r
+    MarkupKind.Markdown = 'markdown';\r
+})(MarkupKind || (MarkupKind = {}));\r
+(function (MarkupKind) {\r
+    /**\r
+     * Checks whether the given value is a value of the [MarkupKind](#MarkupKind) type.\r
+     */\r
+    function is(value) {\r
+        var candidate = value;\r
+        return candidate === MarkupKind.PlainText || candidate === MarkupKind.Markdown;\r
+    }\r
+    MarkupKind.is = is;\r
+})(MarkupKind || (MarkupKind = {}));\r
+var MarkupContent;\r
+(function (MarkupContent) {\r
+    /**\r
+     * Checks whether the given value conforms to the [MarkupContent](#MarkupContent) interface.\r
+     */\r
+    function is(value) {\r
+        var candidate = value;\r
+        return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);\r
+    }\r
+    MarkupContent.is = is;\r
+})(MarkupContent || (MarkupContent = {}));\r
+/**\r
+ * The kind of a completion entry.\r
+ */\r
+var CompletionItemKind;\r
+(function (CompletionItemKind) {\r
+    CompletionItemKind.Text = 1;\r
+    CompletionItemKind.Method = 2;\r
+    CompletionItemKind.Function = 3;\r
+    CompletionItemKind.Constructor = 4;\r
+    CompletionItemKind.Field = 5;\r
+    CompletionItemKind.Variable = 6;\r
+    CompletionItemKind.Class = 7;\r
+    CompletionItemKind.Interface = 8;\r
+    CompletionItemKind.Module = 9;\r
+    CompletionItemKind.Property = 10;\r
+    CompletionItemKind.Unit = 11;\r
+    CompletionItemKind.Value = 12;\r
+    CompletionItemKind.Enum = 13;\r
+    CompletionItemKind.Keyword = 14;\r
+    CompletionItemKind.Snippet = 15;\r
+    CompletionItemKind.Color = 16;\r
+    CompletionItemKind.File = 17;\r
+    CompletionItemKind.Reference = 18;\r
+    CompletionItemKind.Folder = 19;\r
+    CompletionItemKind.EnumMember = 20;\r
+    CompletionItemKind.Constant = 21;\r
+    CompletionItemKind.Struct = 22;\r
+    CompletionItemKind.Event = 23;\r
+    CompletionItemKind.Operator = 24;\r
+    CompletionItemKind.TypeParameter = 25;\r
+})(CompletionItemKind || (CompletionItemKind = {}));\r
+/**\r
+ * Defines whether the insert text in a completion item should be interpreted as\r
+ * plain text or a snippet.\r
+ */\r
+var InsertTextFormat;\r
+(function (InsertTextFormat) {\r
+    /**\r
+     * The primary text to be inserted is treated as a plain string.\r
+     */\r
+    InsertTextFormat.PlainText = 1;\r
+    /**\r
+     * The primary text to be inserted is treated as a snippet.\r
+     *\r
+     * A snippet can define tab stops and placeholders with `$1`, `$2`\r
+     * and `${3:foo}`. `$0` defines the final tab stop, it defaults to\r
+     * the end of the snippet. Placeholders with equal identifiers are linked,\r
+     * that is typing in one will update others too.\r
+     *\r
+     * See also: https://github.com/Microsoft/vscode/blob/master/src/vs/editor/contrib/snippet/common/snippet.md\r
+     */\r
+    InsertTextFormat.Snippet = 2;\r
+})(InsertTextFormat || (InsertTextFormat = {}));\r
+/**\r
+ * Completion item tags are extra annotations that tweak the rendering of a completion\r
+ * item.\r
+ *\r
+ * @since 3.15.0\r
+ */\r
+var CompletionItemTag;\r
+(function (CompletionItemTag) {\r
+    /**\r
+     * Render a completion as obsolete, usually using a strike-out.\r
+     */\r
+    CompletionItemTag.Deprecated = 1;\r
+})(CompletionItemTag || (CompletionItemTag = {}));\r
+/**\r
+ * The CompletionItem namespace provides functions to deal with\r
+ * completion items.\r
+ */\r
+var CompletionItem;\r
+(function (CompletionItem) {\r
+    /**\r
+     * Create a completion item and seed it with a label.\r
+     * @param label The completion item's label\r
+     */\r
+    function create(label) {\r
+        return { label: label };\r
+    }\r
+    CompletionItem.create = create;\r
+})(CompletionItem || (CompletionItem = {}));\r
+/**\r
+ * The CompletionList namespace provides functions to deal with\r
+ * completion lists.\r
+ */\r
+var CompletionList;\r
+(function (CompletionList) {\r
+    /**\r
+     * Creates a new completion list.\r
+     *\r
+     * @param items The completion items.\r
+     * @param isIncomplete The list is not complete.\r
+     */\r
+    function create(items, isIncomplete) {\r
+        return { items: items ? items : [], isIncomplete: !!isIncomplete };\r
+    }\r
+    CompletionList.create = create;\r
+})(CompletionList || (CompletionList = {}));\r
+var MarkedString;\r
+(function (MarkedString) {\r
+    /**\r
+     * Creates a marked string from plain text.\r
+     *\r
+     * @param plainText The plain text.\r
+     */\r
+    function fromPlainText(plainText) {\r
+        return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, '\\$&'); // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash\r
+    }\r
+    MarkedString.fromPlainText = fromPlainText;\r
+    /**\r
+     * Checks whether the given value conforms to the [MarkedString](#MarkedString) type.\r
+     */\r
+    function is(value) {\r
+        var candidate = value;\r
+        return Is.string(candidate) || (Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value));\r
+    }\r
+    MarkedString.is = is;\r
+})(MarkedString || (MarkedString = {}));\r
+var Hover;\r
+(function (Hover) {\r
+    /**\r
+     * Checks whether the given value conforms to the [Hover](#Hover) interface.\r
+     */\r
+    function is(value) {\r
+        var candidate = value;\r
+        return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) ||\r
+            MarkedString.is(candidate.contents) ||\r
+            Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === void 0 || Range.is(value.range));\r
+    }\r
+    Hover.is = is;\r
+})(Hover || (Hover = {}));\r
+/**\r
+ * The ParameterInformation namespace provides helper functions to work with\r
+ * [ParameterInformation](#ParameterInformation) literals.\r
+ */\r
+var ParameterInformation;\r
+(function (ParameterInformation) {\r
+    /**\r
+     * Creates a new parameter information literal.\r
+     *\r
+     * @param label A label string.\r
+     * @param documentation A doc string.\r
+     */\r
+    function create(label, documentation) {\r
+        return documentation ? { label: label, documentation: documentation } : { label: label };\r
+    }\r
+    ParameterInformation.create = create;\r
+})(ParameterInformation || (ParameterInformation = {}));\r
+/**\r
+ * The SignatureInformation namespace provides helper functions to work with\r
+ * [SignatureInformation](#SignatureInformation) literals.\r
+ */\r
+var SignatureInformation;\r
+(function (SignatureInformation) {\r
+    function create(label, documentation) {\r
+        var parameters = [];\r
+        for (var _i = 2; _i < arguments.length; _i++) {\r
+            parameters[_i - 2] = arguments[_i];\r
+        }\r
+        var result = { label: label };\r
+        if (Is.defined(documentation)) {\r
+            result.documentation = documentation;\r
+        }\r
+        if (Is.defined(parameters)) {\r
+            result.parameters = parameters;\r
+        }\r
+        else {\r
+            result.parameters = [];\r
+        }\r
+        return result;\r
+    }\r
+    SignatureInformation.create = create;\r
+})(SignatureInformation || (SignatureInformation = {}));\r
+/**\r
+ * A document highlight kind.\r
+ */\r
+var DocumentHighlightKind;\r
+(function (DocumentHighlightKind) {\r
+    /**\r
+     * A textual occurrence.\r
+     */\r
+    DocumentHighlightKind.Text = 1;\r
+    /**\r
+     * Read-access of a symbol, like reading a variable.\r
+     */\r
+    DocumentHighlightKind.Read = 2;\r
+    /**\r
+     * Write-access of a symbol, like writing to a variable.\r
+     */\r
+    DocumentHighlightKind.Write = 3;\r
+})(DocumentHighlightKind || (DocumentHighlightKind = {}));\r
+/**\r
+ * DocumentHighlight namespace to provide helper functions to work with\r
+ * [DocumentHighlight](#DocumentHighlight) literals.\r
+ */\r
+var DocumentHighlight;\r
+(function (DocumentHighlight) {\r
+    /**\r
+     * Create a DocumentHighlight object.\r
+     * @param range The range the highlight applies to.\r
+     */\r
+    function create(range, kind) {\r
+        var result = { range: range };\r
+        if (Is.number(kind)) {\r
+            result.kind = kind;\r
+        }\r
+        return result;\r
+    }\r
+    DocumentHighlight.create = create;\r
+})(DocumentHighlight || (DocumentHighlight = {}));\r
+/**\r
+ * A symbol kind.\r
+ */\r
+var SymbolKind;\r
+(function (SymbolKind) {\r
+    SymbolKind.File = 1;\r
+    SymbolKind.Module = 2;\r
+    SymbolKind.Namespace = 3;\r
+    SymbolKind.Package = 4;\r
+    SymbolKind.Class = 5;\r
+    SymbolKind.Method = 6;\r
+    SymbolKind.Property = 7;\r
+    SymbolKind.Field = 8;\r
+    SymbolKind.Constructor = 9;\r
+    SymbolKind.Enum = 10;\r
+    SymbolKind.Interface = 11;\r
+    SymbolKind.Function = 12;\r
+    SymbolKind.Variable = 13;\r
+    SymbolKind.Constant = 14;\r
+    SymbolKind.String = 15;\r
+    SymbolKind.Number = 16;\r
+    SymbolKind.Boolean = 17;\r
+    SymbolKind.Array = 18;\r
+    SymbolKind.Object = 19;\r
+    SymbolKind.Key = 20;\r
+    SymbolKind.Null = 21;\r
+    SymbolKind.EnumMember = 22;\r
+    SymbolKind.Struct = 23;\r
+    SymbolKind.Event = 24;\r
+    SymbolKind.Operator = 25;\r
+    SymbolKind.TypeParameter = 26;\r
+})(SymbolKind || (SymbolKind = {}));\r
+/**\r
+ * Symbol tags are extra annotations that tweak the rendering of a symbol.\r
+ * @since 3.15\r
+ */\r
+var SymbolTag;\r
+(function (SymbolTag) {\r
+    /**\r
+     * Render a symbol as obsolete, usually using a strike-out.\r
+     */\r
+    SymbolTag.Deprecated = 1;\r
+})(SymbolTag || (SymbolTag = {}));\r
+var SymbolInformation;\r
+(function (SymbolInformation) {\r
+    /**\r
+     * Creates a new symbol information literal.\r
+     *\r
+     * @param name The name of the symbol.\r
+     * @param kind The kind of the symbol.\r
+     * @param range The range of the location of the symbol.\r
+     * @param uri The resource of the location of symbol, defaults to the current document.\r
+     * @param containerName The name of the symbol containing the symbol.\r
+     */\r
+    function create(name, kind, range, uri, containerName) {\r
+        var result = {\r
+            name: name,\r
+            kind: kind,\r
+            location: { uri: uri, range: range }\r
+        };\r
+        if (containerName) {\r
+            result.containerName = containerName;\r
+        }\r
+        return result;\r
+    }\r
+    SymbolInformation.create = create;\r
+})(SymbolInformation || (SymbolInformation = {}));\r
+var DocumentSymbol;\r
+(function (DocumentSymbol) {\r
+    /**\r
+     * Creates a new symbol information literal.\r
+     *\r
+     * @param name The name of the symbol.\r
+     * @param detail The detail of the symbol.\r
+     * @param kind The kind of the symbol.\r
+     * @param range The range of the symbol.\r
+     * @param selectionRange The selectionRange of the symbol.\r
+     * @param children Children of the symbol.\r
+     */\r
+    function create(name, detail, kind, range, selectionRange, children) {\r
+        var result = {\r
+            name: name,\r
+            detail: detail,\r
+            kind: kind,\r
+            range: range,\r
+            selectionRange: selectionRange\r
+        };\r
+        if (children !== void 0) {\r
+            result.children = children;\r
+        }\r
+        return result;\r
+    }\r
+    DocumentSymbol.create = create;\r
+    /**\r
+     * Checks whether the given literal conforms to the [DocumentSymbol](#DocumentSymbol) interface.\r
+     */\r
+    function is(value) {\r
+        var candidate = value;\r
+        return candidate &&\r
+            Is.string(candidate.name) && Is.number(candidate.kind) &&\r
+            Range.is(candidate.range) && Range.is(candidate.selectionRange) &&\r
+            (candidate.detail === void 0 || Is.string(candidate.detail)) &&\r
+            (candidate.deprecated === void 0 || Is.boolean(candidate.deprecated)) &&\r
+            (candidate.children === void 0 || Array.isArray(candidate.children));\r
+    }\r
+    DocumentSymbol.is = is;\r
+})(DocumentSymbol || (DocumentSymbol = {}));\r
+/**\r
+ * A set of predefined code action kinds\r
+ */\r
+var CodeActionKind;\r
+(function (CodeActionKind) {\r
+    /**\r
+     * Empty kind.\r
+     */\r
+    CodeActionKind.Empty = '';\r
+    /**\r
+     * Base kind for quickfix actions: 'quickfix'\r
+     */\r
+    CodeActionKind.QuickFix = 'quickfix';\r
+    /**\r
+     * Base kind for refactoring actions: 'refactor'\r
+     */\r
+    CodeActionKind.Refactor = 'refactor';\r
+    /**\r
+     * Base kind for refactoring extraction actions: 'refactor.extract'\r
+     *\r
+     * Example extract actions:\r
+     *\r
+     * - Extract method\r
+     * - Extract function\r
+     * - Extract variable\r
+     * - Extract interface from class\r
+     * - ...\r
+     */\r
+    CodeActionKind.RefactorExtract = 'refactor.extract';\r
+    /**\r
+     * Base kind for refactoring inline actions: 'refactor.inline'\r
+     *\r
+     * Example inline actions:\r
+     *\r
+     * - Inline function\r
+     * - Inline variable\r
+     * - Inline constant\r
+     * - ...\r
+     */\r
+    CodeActionKind.RefactorInline = 'refactor.inline';\r
+    /**\r
+     * Base kind for refactoring rewrite actions: 'refactor.rewrite'\r
+     *\r
+     * Example rewrite actions:\r
+     *\r
+     * - Convert JavaScript function to class\r
+     * - Add or remove parameter\r
+     * - Encapsulate field\r
+     * - Make method static\r
+     * - Move method to base class\r
+     * - ...\r
+     */\r
+    CodeActionKind.RefactorRewrite = 'refactor.rewrite';\r
+    /**\r
+     * Base kind for source actions: `source`\r
+     *\r
+     * Source code actions apply to the entire file.\r
+     */\r
+    CodeActionKind.Source = 'source';\r
+    /**\r
+     * Base kind for an organize imports source action: `source.organizeImports`\r
+     */\r
+    CodeActionKind.SourceOrganizeImports = 'source.organizeImports';\r
+    /**\r
+     * Base kind for auto-fix source actions: `source.fixAll`.\r
+     *\r
+     * Fix all actions automatically fix errors that have a clear fix that do not require user input.\r
+     * They should not suppress errors or perform unsafe fixes such as generating new types or classes.\r
+     *\r
+     * @since 3.15.0\r
+     */\r
+    CodeActionKind.SourceFixAll = 'source.fixAll';\r
+})(CodeActionKind || (CodeActionKind = {}));\r
+/**\r
+ * The CodeActionContext namespace provides helper functions to work with\r
+ * [CodeActionContext](#CodeActionContext) literals.\r
+ */\r
+var CodeActionContext;\r
+(function (CodeActionContext) {\r
+    /**\r
+     * Creates a new CodeActionContext literal.\r
+     */\r
+    function create(diagnostics, only) {\r
+        var result = { diagnostics: diagnostics };\r
+        if (only !== void 0 && only !== null) {\r
+            result.only = only;\r
+        }\r
+        return result;\r
+    }\r
+    CodeActionContext.create = create;\r
+    /**\r
+     * Checks whether the given literal conforms to the [CodeActionContext](#CodeActionContext) interface.\r
+     */\r
+    function is(value) {\r
+        var candidate = value;\r
+        return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string));\r
+    }\r
+    CodeActionContext.is = is;\r
+})(CodeActionContext || (CodeActionContext = {}));\r
+var CodeAction;\r
+(function (CodeAction) {\r
+    function create(title, commandOrEdit, kind) {\r
+        var result = { title: title };\r
+        if (Command.is(commandOrEdit)) {\r
+            result.command = commandOrEdit;\r
+        }\r
+        else {\r
+            result.edit = commandOrEdit;\r
+        }\r
+        if (kind !== void 0) {\r
+            result.kind = kind;\r
+        }\r
+        return result;\r
+    }\r
+    CodeAction.create = create;\r
+    function is(value) {\r
+        var candidate = value;\r
+        return candidate && Is.string(candidate.title) &&\r
+            (candidate.diagnostics === void 0 || Is.typedArray(candidate.diagnostics, Diagnostic.is)) &&\r
+            (candidate.kind === void 0 || Is.string(candidate.kind)) &&\r
+            (candidate.edit !== void 0 || candidate.command !== void 0) &&\r
+            (candidate.command === void 0 || Command.is(candidate.command)) &&\r
+            (candidate.isPreferred === void 0 || Is.boolean(candidate.isPreferred)) &&\r
+            (candidate.edit === void 0 || WorkspaceEdit.is(candidate.edit));\r
+    }\r
+    CodeAction.is = is;\r
+})(CodeAction || (CodeAction = {}));\r
+/**\r
+ * The CodeLens namespace provides helper functions to work with\r
+ * [CodeLens](#CodeLens) literals.\r
+ */\r
+var CodeLens;\r
+(function (CodeLens) {\r
+    /**\r
+     * Creates a new CodeLens literal.\r
+     */\r
+    function create(range, data) {\r
+        var result = { range: range };\r
+        if (Is.defined(data)) {\r
+            result.data = data;\r
+        }\r
+        return result;\r
+    }\r
+    CodeLens.create = create;\r
+    /**\r
+     * Checks whether the given literal conforms to the [CodeLens](#CodeLens) interface.\r
+     */\r
+    function is(value) {\r
+        var candidate = value;\r
+        return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command));\r
+    }\r
+    CodeLens.is = is;\r
+})(CodeLens || (CodeLens = {}));\r
+/**\r
+ * The FormattingOptions namespace provides helper functions to work with\r
+ * [FormattingOptions](#FormattingOptions) literals.\r
+ */\r
+var FormattingOptions;\r
+(function (FormattingOptions) {\r
+    /**\r
+     * Creates a new FormattingOptions literal.\r
+     */\r
+    function create(tabSize, insertSpaces) {\r
+        return { tabSize: tabSize, insertSpaces: insertSpaces };\r
+    }\r
+    FormattingOptions.create = create;\r
+    /**\r
+     * Checks whether the given literal conforms to the [FormattingOptions](#FormattingOptions) interface.\r
+     */\r
+    function is(value) {\r
+        var candidate = value;\r
+        return Is.defined(candidate) && Is.number(candidate.tabSize) && Is.boolean(candidate.insertSpaces);\r
+    }\r
+    FormattingOptions.is = is;\r
+})(FormattingOptions || (FormattingOptions = {}));\r
+/**\r
+ * The DocumentLink namespace provides helper functions to work with\r
+ * [DocumentLink](#DocumentLink) literals.\r
+ */\r
+var DocumentLink;\r
+(function (DocumentLink) {\r
+    /**\r
+     * Creates a new DocumentLink literal.\r
+     */\r
+    function create(range, target, data) {\r
+        return { range: range, target: target, data: data };\r
+    }\r
+    DocumentLink.create = create;\r
+    /**\r
+     * Checks whether the given literal conforms to the [DocumentLink](#DocumentLink) interface.\r
+     */\r
+    function is(value) {\r
+        var candidate = value;\r
+        return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target));\r
+    }\r
+    DocumentLink.is = is;\r
+})(DocumentLink || (DocumentLink = {}));\r
+/**\r
+ * The SelectionRange namespace provides helper function to work with\r
+ * SelectionRange literals.\r
+ */\r
+var SelectionRange;\r
+(function (SelectionRange) {\r
+    /**\r
+     * Creates a new SelectionRange\r
+     * @param range the range.\r
+     * @param parent an optional parent.\r
+     */\r
+    function create(range, parent) {\r
+        return { range: range, parent: parent };\r
+    }\r
+    SelectionRange.create = create;\r
+    function is(value) {\r
+        var candidate = value;\r
+        return candidate !== undefined && Range.is(candidate.range) && (candidate.parent === undefined || SelectionRange.is(candidate.parent));\r
+    }\r
+    SelectionRange.is = is;\r
+})(SelectionRange || (SelectionRange = {}));\r
+var EOL = ['\n', '\r\n', '\r'];\r
+/**\r
+ * @deprecated Use the text document from the new vscode-languageserver-textdocument package.\r
+ */\r
+var TextDocument;\r
+(function (TextDocument) {\r
+    /**\r
+     * Creates a new ITextDocument literal from the given uri and content.\r
+     * @param uri The document's uri.\r
+     * @param languageId  The document's language Id.\r
+     * @param content The document's content.\r
+     */\r
+    function create(uri, languageId, version, content) {\r
+        return new FullTextDocument(uri, languageId, version, content);\r
+    }\r
+    TextDocument.create = create;\r
+    /**\r
+     * Checks whether the given literal conforms to the [ITextDocument](#ITextDocument) interface.\r
+     */\r
+    function is(value) {\r
+        var candidate = value;\r
+        return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.number(candidate.lineCount)\r
+            && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;\r
+    }\r
+    TextDocument.is = is;\r
+    function applyEdits(document, edits) {\r
+        var text = document.getText();\r
+        var sortedEdits = mergeSort(edits, function (a, b) {\r
+            var diff = a.range.start.line - b.range.start.line;\r
+            if (diff === 0) {\r
+                return a.range.start.character - b.range.start.character;\r
+            }\r
+            return diff;\r
+        });\r
+        var lastModifiedOffset = text.length;\r
+        for (var i = sortedEdits.length - 1; i >= 0; i--) {\r
+            var e = sortedEdits[i];\r
+            var startOffset = document.offsetAt(e.range.start);\r
+            var endOffset = document.offsetAt(e.range.end);\r
+            if (endOffset <= lastModifiedOffset) {\r
+                text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length);\r
+            }\r
+            else {\r
+                throw new Error('Overlapping edit');\r
+            }\r
+            lastModifiedOffset = startOffset;\r
+        }\r
+        return text;\r
+    }\r
+    TextDocument.applyEdits = applyEdits;\r
+    function mergeSort(data, compare) {\r
+        if (data.length <= 1) {\r
+            // sorted\r
+            return data;\r
+        }\r
+        var p = (data.length / 2) | 0;\r
+        var left = data.slice(0, p);\r
+        var right = data.slice(p);\r
+        mergeSort(left, compare);\r
+        mergeSort(right, compare);\r
+        var leftIdx = 0;\r
+        var rightIdx = 0;\r
+        var i = 0;\r
+        while (leftIdx < left.length && rightIdx < right.length) {\r
+            var ret = compare(left[leftIdx], right[rightIdx]);\r
+            if (ret <= 0) {\r
+                // smaller_equal -> take left to preserve order\r
+                data[i++] = left[leftIdx++];\r
+            }\r
+            else {\r
+                // greater -> take right\r
+                data[i++] = right[rightIdx++];\r
+            }\r
+        }\r
+        while (leftIdx < left.length) {\r
+            data[i++] = left[leftIdx++];\r
+        }\r
+        while (rightIdx < right.length) {\r
+            data[i++] = right[rightIdx++];\r
+        }\r
+        return data;\r
+    }\r
+})(TextDocument || (TextDocument = {}));\r
+var FullTextDocument = /** @class */ (function () {\r
+    function FullTextDocument(uri, languageId, version, content) {\r
+        this._uri = uri;\r
+        this._languageId = languageId;\r
+        this._version = version;\r
+        this._content = content;\r
+        this._lineOffsets = undefined;\r
+    }\r
+    Object.defineProperty(FullTextDocument.prototype, "uri", {\r
+        get: function () {\r
+            return this._uri;\r
+        },\r
+        enumerable: true,\r
+        configurable: true\r
+    });\r
+    Object.defineProperty(FullTextDocument.prototype, "languageId", {\r
+        get: function () {\r
+            return this._languageId;\r
+        },\r
+        enumerable: true,\r
+        configurable: true\r
+    });\r
+    Object.defineProperty(FullTextDocument.prototype, "version", {\r
+        get: function () {\r
+            return this._version;\r
+        },\r
+        enumerable: true,\r
+        configurable: true\r
+    });\r
+    FullTextDocument.prototype.getText = function (range) {\r
+        if (range) {\r
+            var start = this.offsetAt(range.start);\r
+            var end = this.offsetAt(range.end);\r
+            return this._content.substring(start, end);\r
+        }\r
+        return this._content;\r
+    };\r
+    FullTextDocument.prototype.update = function (event, version) {\r
+        this._content = event.text;\r
+        this._version = version;\r
+        this._lineOffsets = undefined;\r
+    };\r
+    FullTextDocument.prototype.getLineOffsets = function () {\r
+        if (this._lineOffsets === undefined) {\r
+            var lineOffsets = [];\r
+            var text = this._content;\r
+            var isLineStart = true;\r
+            for (var i = 0; i < text.length; i++) {\r
+                if (isLineStart) {\r
+                    lineOffsets.push(i);\r
+                    isLineStart = false;\r
+                }\r
+                var ch = text.charAt(i);\r
+                isLineStart = (ch === '\r' || ch === '\n');\r
+                if (ch === '\r' && i + 1 < text.length && text.charAt(i + 1) === '\n') {\r
+                    i++;\r
+                }\r
+            }\r
+            if (isLineStart && text.length > 0) {\r
+                lineOffsets.push(text.length);\r
+            }\r
+            this._lineOffsets = lineOffsets;\r
+        }\r
+        return this._lineOffsets;\r
+    };\r
+    FullTextDocument.prototype.positionAt = function (offset) {\r
+        offset = Math.max(Math.min(offset, this._content.length), 0);\r
+        var lineOffsets = this.getLineOffsets();\r
+        var low = 0, high = lineOffsets.length;\r
+        if (high === 0) {\r
+            return Position.create(0, offset);\r
+        }\r
+        while (low < high) {\r
+            var mid = Math.floor((low + high) / 2);\r
+            if (lineOffsets[mid] > offset) {\r
+                high = mid;\r
+            }\r
+            else {\r
+                low = mid + 1;\r
+            }\r
+        }\r
+        // low is the least x for which the line offset is larger than the current offset\r
+        // or array.length if no line offset is larger than the current offset\r
+        var line = low - 1;\r
+        return Position.create(line, offset - lineOffsets[line]);\r
+    };\r
+    FullTextDocument.prototype.offsetAt = function (position) {\r
+        var lineOffsets = this.getLineOffsets();\r
+        if (position.line >= lineOffsets.length) {\r
+            return this._content.length;\r
+        }\r
+        else if (position.line < 0) {\r
+            return 0;\r
+        }\r
+        var lineOffset = lineOffsets[position.line];\r
+        var nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length;\r
+        return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset);\r
+    };\r
+    Object.defineProperty(FullTextDocument.prototype, "lineCount", {\r
+        get: function () {\r
+            return this.getLineOffsets().length;\r
+        },\r
+        enumerable: true,\r
+        configurable: true\r
+    });\r
+    return FullTextDocument;\r
+}());\r
+var Is;\r
+(function (Is) {\r
+    var toString = Object.prototype.toString;\r
+    function defined(value) {\r
+        return typeof value !== 'undefined';\r
+    }\r
+    Is.defined = defined;\r
+    function undefined(value) {\r
+        return typeof value === 'undefined';\r
+    }\r
+    Is.undefined = undefined;\r
+    function boolean(value) {\r
+        return value === true || value === false;\r
+    }\r
+    Is.boolean = boolean;\r
+    function string(value) {\r
+        return toString.call(value) === '[object String]';\r
+    }\r
+    Is.string = string;\r
+    function number(value) {\r
+        return toString.call(value) === '[object Number]';\r
+    }\r
+    Is.number = number;\r
+    function func(value) {\r
+        return toString.call(value) === '[object Function]';\r
+    }\r
+    Is.func = func;\r
+    function objectLiteral(value) {\r
+        // Strictly speaking class instances pass this check as well. Since the LSP\r
+        // doesn't use classes we ignore this for now. If we do we need to add something\r
+        // like this: `Object.getPrototypeOf(Object.getPrototypeOf(x)) === null`\r
+        return value !== null && typeof value === 'object';\r
+    }\r
+    Is.objectLiteral = objectLiteral;\r
+    function typedArray(value, check) {\r
+        return Array.isArray(value) && value.every(check);\r
+    }\r
+    Is.typedArray = typedArray;\r
+})(Is || (Is = {}));\r
+
+
+/***/ }),
+/* 19 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/* --------------------------------------------------------------------------------------------\r
+ * Copyright (c) Microsoft Corporation. All rights reserved.\r
+ * Licensed under the MIT License. See License.txt in the project root for license information.\r
+ * ------------------------------------------------------------------------------------------ */\r
+\r
+Object.defineProperty(exports, "__esModule", { value: true });\r
+const Is = __webpack_require__(20);\r
+const vscode_jsonrpc_1 = __webpack_require__(5);\r
+const protocol_implementation_1 = __webpack_require__(21);\r
+exports.ImplementationRequest = protocol_implementation_1.ImplementationRequest;\r
+const protocol_typeDefinition_1 = __webpack_require__(22);\r
+exports.TypeDefinitionRequest = protocol_typeDefinition_1.TypeDefinitionRequest;\r
+const protocol_workspaceFolders_1 = __webpack_require__(23);\r
+exports.WorkspaceFoldersRequest = protocol_workspaceFolders_1.WorkspaceFoldersRequest;\r
+exports.DidChangeWorkspaceFoldersNotification = protocol_workspaceFolders_1.DidChangeWorkspaceFoldersNotification;\r
+const protocol_configuration_1 = __webpack_require__(24);\r
+exports.ConfigurationRequest = protocol_configuration_1.ConfigurationRequest;\r
+const protocol_colorProvider_1 = __webpack_require__(25);\r
+exports.DocumentColorRequest = protocol_colorProvider_1.DocumentColorRequest;\r
+exports.ColorPresentationRequest = protocol_colorProvider_1.ColorPresentationRequest;\r
+const protocol_foldingRange_1 = __webpack_require__(26);\r
+exports.FoldingRangeRequest = protocol_foldingRange_1.FoldingRangeRequest;\r
+const protocol_declaration_1 = __webpack_require__(27);\r
+exports.DeclarationRequest = protocol_declaration_1.DeclarationRequest;\r
+const protocol_selectionRange_1 = __webpack_require__(28);\r
+exports.SelectionRangeRequest = protocol_selectionRange_1.SelectionRangeRequest;\r
+const protocol_progress_1 = __webpack_require__(29);\r
+exports.WorkDoneProgress = protocol_progress_1.WorkDoneProgress;\r
+exports.WorkDoneProgressCreateRequest = protocol_progress_1.WorkDoneProgressCreateRequest;\r
+exports.WorkDoneProgressCancelNotification = protocol_progress_1.WorkDoneProgressCancelNotification;\r
+// @ts-ignore: to avoid inlining LocatioLink as dynamic import\r
+let __noDynamicImport;\r
+/**\r
+ * The DocumentFilter namespace provides helper functions to work with\r
+ * [DocumentFilter](#DocumentFilter) literals.\r
+ */\r
+var DocumentFilter;\r
+(function (DocumentFilter) {\r
+    function is(value) {\r
+        const candidate = value;\r
+        return Is.string(candidate.language) || Is.string(candidate.scheme) || Is.string(candidate.pattern);\r
+    }\r
+    DocumentFilter.is = is;\r
+})(DocumentFilter = exports.DocumentFilter || (exports.DocumentFilter = {}));\r
+/**\r
+ * The DocumentSelector namespace provides helper functions to work with\r
+ * [DocumentSelector](#DocumentSelector)s.\r
+ */\r
+var DocumentSelector;\r
+(function (DocumentSelector) {\r
+    function is(value) {\r
+        if (!Array.isArray(value)) {\r
+            return false;\r
+        }\r
+        for (let elem of value) {\r
+            if (!Is.string(elem) && !DocumentFilter.is(elem)) {\r
+                return false;\r
+            }\r
+        }\r
+        return true;\r
+    }\r
+    DocumentSelector.is = is;\r
+})(DocumentSelector = exports.DocumentSelector || (exports.DocumentSelector = {}));\r
+/**\r
+ * The `client/registerCapability` request is sent from the server to the client to register a new capability\r
+ * handler on the client side.\r
+ */\r
+var RegistrationRequest;\r
+(function (RegistrationRequest) {\r
+    RegistrationRequest.type = new vscode_jsonrpc_1.RequestType('client/registerCapability');\r
+})(RegistrationRequest = exports.RegistrationRequest || (exports.RegistrationRequest = {}));\r
+/**\r
+ * The `client/unregisterCapability` request is sent from the server to the client to unregister a previously registered capability\r
+ * handler on the client side.\r
+ */\r
+var UnregistrationRequest;\r
+(function (UnregistrationRequest) {\r
+    UnregistrationRequest.type = new vscode_jsonrpc_1.RequestType('client/unregisterCapability');\r
+})(UnregistrationRequest = exports.UnregistrationRequest || (exports.UnregistrationRequest = {}));\r
+var ResourceOperationKind;\r
+(function (ResourceOperationKind) {\r
+    /**\r
+     * Supports creating new files and folders.\r
+     */\r
+    ResourceOperationKind.Create = 'create';\r
+    /**\r
+     * Supports renaming existing files and folders.\r
+     */\r
+    ResourceOperationKind.Rename = 'rename';\r
+    /**\r
+     * Supports deleting existing files and folders.\r
+     */\r
+    ResourceOperationKind.Delete = 'delete';\r
+})(ResourceOperationKind = exports.ResourceOperationKind || (exports.ResourceOperationKind = {}));\r
+var FailureHandlingKind;\r
+(function (FailureHandlingKind) {\r
+    /**\r
+     * Applying the workspace change is simply aborted if one of the changes provided\r
+     * fails. All operations executed before the failing operation stay executed.\r
+     */\r
+    FailureHandlingKind.Abort = 'abort';\r
+    /**\r
+     * All operations are executed transactional. That means they either all\r
+     * succeed or no changes at all are applied to the workspace.\r
+     */\r
+    FailureHandlingKind.Transactional = 'transactional';\r
+    /**\r
+     * If the workspace edit contains only textual file changes they are executed transactional.\r
+     * If resource changes (create, rename or delete file) are part of the change the failure\r
+     * handling startegy is abort.\r
+     */\r
+    FailureHandlingKind.TextOnlyTransactional = 'textOnlyTransactional';\r
+    /**\r
+     * The client tries to undo the operations already executed. But there is no\r
+     * guaruntee that this is succeeding.\r
+     */\r
+    FailureHandlingKind.Undo = 'undo';\r
+})(FailureHandlingKind = exports.FailureHandlingKind || (exports.FailureHandlingKind = {}));\r
+/**\r
+ * The StaticRegistrationOptions namespace provides helper functions to work with\r
+ * [StaticRegistrationOptions](#StaticRegistrationOptions) literals.\r
+ */\r
+var StaticRegistrationOptions;\r
+(function (StaticRegistrationOptions) {\r
+    function hasId(value) {\r
+        const candidate = value;\r
+        return candidate && Is.string(candidate.id) && candidate.id.length > 0;\r
+    }\r
+    StaticRegistrationOptions.hasId = hasId;\r
+})(StaticRegistrationOptions = exports.StaticRegistrationOptions || (exports.StaticRegistrationOptions = {}));\r
+/**\r
+ * The TextDocumentRegistrationOptions namespace provides helper functions to work with\r
+ * [TextDocumentRegistrationOptions](#TextDocumentRegistrationOptions) literals.\r
+ */\r
+var TextDocumentRegistrationOptions;\r
+(function (TextDocumentRegistrationOptions) {\r
+    function is(value) {\r
+        const candidate = value;\r
+        return candidate && (candidate.documentSelector === null || DocumentSelector.is(candidate.documentSelector));\r
+    }\r
+    TextDocumentRegistrationOptions.is = is;\r
+})(TextDocumentRegistrationOptions = exports.TextDocumentRegistrationOptions || (exports.TextDocumentRegistrationOptions = {}));\r
+/**\r
+ * The WorkDoneProgressOptions namespace provides helper functions to work with\r
+ * [WorkDoneProgressOptions](#WorkDoneProgressOptions) literals.\r
+ */\r
+var WorkDoneProgressOptions;\r
+(function (WorkDoneProgressOptions) {\r
+    function is(value) {\r
+        const candidate = value;\r
+        return Is.objectLiteral(candidate) && (candidate.workDoneProgress === undefined || Is.boolean(candidate.workDoneProgress));\r
+    }\r
+    WorkDoneProgressOptions.is = is;\r
+    function hasWorkDoneProgress(value) {\r
+        const candidate = value;\r
+        return candidate && Is.boolean(candidate.workDoneProgress);\r
+    }\r
+    WorkDoneProgressOptions.hasWorkDoneProgress = hasWorkDoneProgress;\r
+})(WorkDoneProgressOptions = exports.WorkDoneProgressOptions || (exports.WorkDoneProgressOptions = {}));\r
+/**\r
+ * The initialize request is sent from the client to the server.\r
+ * It is sent once as the request after starting up the server.\r
+ * The requests parameter is of type [InitializeParams](#InitializeParams)\r
+ * the response if of type [InitializeResult](#InitializeResult) of a Thenable that\r
+ * resolves to such.\r
+ */\r
+var InitializeRequest;\r
+(function (InitializeRequest) {\r
+    InitializeRequest.type = new vscode_jsonrpc_1.RequestType('initialize');\r
+})(InitializeRequest = exports.InitializeRequest || (exports.InitializeRequest = {}));\r
+/**\r
+ * Known error codes for an `InitializeError`;\r
+ */\r
+var InitializeError;\r
+(function (InitializeError) {\r
+    /**\r
+     * If the protocol version provided by the client can't be handled by the server.\r
+     * @deprecated This initialize error got replaced by client capabilities. There is\r
+     * no version handshake in version 3.0x\r
+     */\r
+    InitializeError.unknownProtocolVersion = 1;\r
+})(InitializeError = exports.InitializeError || (exports.InitializeError = {}));\r
+/**\r
+ * The intialized notification is sent from the client to the\r
+ * server after the client is fully initialized and the server\r
+ * is allowed to send requests from the server to the client.\r
+ */\r
+var InitializedNotification;\r
+(function (InitializedNotification) {\r
+    InitializedNotification.type = new vscode_jsonrpc_1.NotificationType('initialized');\r
+})(InitializedNotification = exports.InitializedNotification || (exports.InitializedNotification = {}));\r
+//---- Shutdown Method ----\r
+/**\r
+ * A shutdown request is sent from the client to the server.\r
+ * It is sent once when the client decides to shutdown the\r
+ * server. The only notification that is sent after a shutdown request\r
+ * is the exit event.\r
+ */\r
+var ShutdownRequest;\r
+(function (ShutdownRequest) {\r
+    ShutdownRequest.type = new vscode_jsonrpc_1.RequestType0('shutdown');\r
+})(ShutdownRequest = exports.ShutdownRequest || (exports.ShutdownRequest = {}));\r
+//---- Exit Notification ----\r
+/**\r
+ * The exit event is sent from the client to the server to\r
+ * ask the server to exit its process.\r
+ */\r
+var ExitNotification;\r
+(function (ExitNotification) {\r
+    ExitNotification.type = new vscode_jsonrpc_1.NotificationType0('exit');\r
+})(ExitNotification = exports.ExitNotification || (exports.ExitNotification = {}));\r
+/**\r
+ * The configuration change notification is sent from the client to the server\r
+ * when the client's configuration has changed. The notification contains\r
+ * the changed configuration as defined by the language client.\r
+ */\r
+var DidChangeConfigurationNotification;\r
+(function (DidChangeConfigurationNotification) {\r
+    DidChangeConfigurationNotification.type = new vscode_jsonrpc_1.NotificationType('workspace/didChangeConfiguration');\r
+})(DidChangeConfigurationNotification = exports.DidChangeConfigurationNotification || (exports.DidChangeConfigurationNotification = {}));\r
+//---- Message show and log notifications ----\r
+/**\r
+ * The message type\r
+ */\r
+var MessageType;\r
+(function (MessageType) {\r
+    /**\r
+     * An error message.\r
+     */\r
+    MessageType.Error = 1;\r
+    /**\r
+     * A warning message.\r
+     */\r
+    MessageType.Warning = 2;\r
+    /**\r
+     * An information message.\r
+     */\r
+    MessageType.Info = 3;\r
+    /**\r
+     * A log message.\r
+     */\r
+    MessageType.Log = 4;\r
+})(MessageType = exports.MessageType || (exports.MessageType = {}));\r
+/**\r
+ * The show message notification is sent from a server to a client to ask\r
+ * the client to display a particular message in the user interface.\r
+ */\r
+var ShowMessageNotification;\r
+(function (ShowMessageNotification) {\r
+    ShowMessageNotification.type = new vscode_jsonrpc_1.NotificationType('window/showMessage');\r
+})(ShowMessageNotification = exports.ShowMessageNotification || (exports.ShowMessageNotification = {}));\r
+/**\r
+ * The show message request is sent from the server to the client to show a message\r
+ * and a set of options actions to the user.\r
+ */\r
+var ShowMessageRequest;\r
+(function (ShowMessageRequest) {\r
+    ShowMessageRequest.type = new vscode_jsonrpc_1.RequestType('window/showMessageRequest');\r
+})(ShowMessageRequest = exports.ShowMessageRequest || (exports.ShowMessageRequest = {}));\r
+/**\r
+ * The log message notification is sent from the server to the client to ask\r
+ * the client to log a particular message.\r
+ */\r
+var LogMessageNotification;\r
+(function (LogMessageNotification) {\r
+    LogMessageNotification.type = new vscode_jsonrpc_1.NotificationType('window/logMessage');\r
+})(LogMessageNotification = exports.LogMessageNotification || (exports.LogMessageNotification = {}));\r
+//---- Telemetry notification\r
+/**\r
+ * The telemetry event notification is sent from the server to the client to ask\r
+ * the client to log telemetry data.\r
+ */\r
+var TelemetryEventNotification;\r
+(function (TelemetryEventNotification) {\r
+    TelemetryEventNotification.type = new vscode_jsonrpc_1.NotificationType('telemetry/event');\r
+})(TelemetryEventNotification = exports.TelemetryEventNotification || (exports.TelemetryEventNotification = {}));\r
+/**\r
+ * Defines how the host (editor) should sync\r
+ * document changes to the language server.\r
+ */\r
+var TextDocumentSyncKind;\r
+(function (TextDocumentSyncKind) {\r
+    /**\r
+     * Documents should not be synced at all.\r
+     */\r
+    TextDocumentSyncKind.None = 0;\r
+    /**\r
+     * Documents are synced by always sending the full content\r
+     * of the document.\r
+     */\r
+    TextDocumentSyncKind.Full = 1;\r
+    /**\r
+     * Documents are synced by sending the full content on open.\r
+     * After that only incremental updates to the document are\r
+     * send.\r
+     */\r
+    TextDocumentSyncKind.Incremental = 2;\r
+})(TextDocumentSyncKind = exports.TextDocumentSyncKind || (exports.TextDocumentSyncKind = {}));\r
+/**\r
+ * The document open notification is sent from the client to the server to signal\r
+ * newly opened text documents. The document's truth is now managed by the client\r
+ * and the server must not try to read the document's truth using the document's\r
+ * uri. Open in this sense means it is managed by the client. It doesn't necessarily\r
+ * mean that its content is presented in an editor. An open notification must not\r
+ * be sent more than once without a corresponding close notification send before.\r
+ * This means open and close notification must be balanced and the max open count\r
+ * is one.\r
+ */\r
+var DidOpenTextDocumentNotification;\r
+(function (DidOpenTextDocumentNotification) {\r
+    DidOpenTextDocumentNotification.method = 'textDocument/didOpen';\r
+    DidOpenTextDocumentNotification.type = new vscode_jsonrpc_1.NotificationType(DidOpenTextDocumentNotification.method);\r
+})(DidOpenTextDocumentNotification = exports.DidOpenTextDocumentNotification || (exports.DidOpenTextDocumentNotification = {}));\r
+/**\r
+ * The document change notification is sent from the client to the server to signal\r
+ * changes to a text document.\r
+ */\r
+var DidChangeTextDocumentNotification;\r
+(function (DidChangeTextDocumentNotification) {\r
+    DidChangeTextDocumentNotification.method = 'textDocument/didChange';\r
+    DidChangeTextDocumentNotification.type = new vscode_jsonrpc_1.NotificationType(DidChangeTextDocumentNotification.method);\r
+})(DidChangeTextDocumentNotification = exports.DidChangeTextDocumentNotification || (exports.DidChangeTextDocumentNotification = {}));\r
+/**\r
+ * The document close notification is sent from the client to the server when\r
+ * the document got closed in the client. The document's truth now exists where\r
+ * the document's uri points to (e.g. if the document's uri is a file uri the\r
+ * truth now exists on disk). As with the open notification the close notification\r
+ * is about managing the document's content. Receiving a close notification\r
+ * doesn't mean that the document was open in an editor before. A close\r
+ * notification requires a previous open notification to be sent.\r
+ */\r
+var DidCloseTextDocumentNotification;\r
+(function (DidCloseTextDocumentNotification) {\r
+    DidCloseTextDocumentNotification.method = 'textDocument/didClose';\r
+    DidCloseTextDocumentNotification.type = new vscode_jsonrpc_1.NotificationType(DidCloseTextDocumentNotification.method);\r
+})(DidCloseTextDocumentNotification = exports.DidCloseTextDocumentNotification || (exports.DidCloseTextDocumentNotification = {}));\r
+/**\r
+ * The document save notification is sent from the client to the server when\r
+ * the document got saved in the client.\r
+ */\r
+var DidSaveTextDocumentNotification;\r
+(function (DidSaveTextDocumentNotification) {\r
+    DidSaveTextDocumentNotification.method = 'textDocument/didSave';\r
+    DidSaveTextDocumentNotification.type = new vscode_jsonrpc_1.NotificationType(DidSaveTextDocumentNotification.method);\r
+})(DidSaveTextDocumentNotification = exports.DidSaveTextDocumentNotification || (exports.DidSaveTextDocumentNotification = {}));\r
+/**\r
+ * Represents reasons why a text document is saved.\r
+ */\r
+var TextDocumentSaveReason;\r
+(function (TextDocumentSaveReason) {\r
+    /**\r
+     * Manually triggered, e.g. by the user pressing save, by starting debugging,\r
+     * or by an API call.\r
+     */\r
+    TextDocumentSaveReason.Manual = 1;\r
+    /**\r
+     * Automatic after a delay.\r
+     */\r
+    TextDocumentSaveReason.AfterDelay = 2;\r
+    /**\r
+     * When the editor lost focus.\r
+     */\r
+    TextDocumentSaveReason.FocusOut = 3;\r
+})(TextDocumentSaveReason = exports.TextDocumentSaveReason || (exports.TextDocumentSaveReason = {}));\r
+/**\r
+ * A document will save notification is sent from the client to the server before\r
+ * the document is actually saved.\r
+ */\r
+var WillSaveTextDocumentNotification;\r
+(function (WillSaveTextDocumentNotification) {\r
+    WillSaveTextDocumentNotification.method = 'textDocument/willSave';\r
+    WillSaveTextDocumentNotification.type = new vscode_jsonrpc_1.NotificationType(WillSaveTextDocumentNotification.method);\r
+})(WillSaveTextDocumentNotification = exports.WillSaveTextDocumentNotification || (exports.WillSaveTextDocumentNotification = {}));\r
+/**\r
+ * A document will save request is sent from the client to the server before\r
+ * the document is actually saved. The request can return an array of TextEdits\r
+ * which will be applied to the text document before it is saved. Please note that\r
+ * clients might drop results if computing the text edits took too long or if a\r
+ * server constantly fails on this request. This is done to keep the save fast and\r
+ * reliable.\r
+ */\r
+var WillSaveTextDocumentWaitUntilRequest;\r
+(function (WillSaveTextDocumentWaitUntilRequest) {\r
+    WillSaveTextDocumentWaitUntilRequest.method = 'textDocument/willSaveWaitUntil';\r
+    WillSaveTextDocumentWaitUntilRequest.type = new vscode_jsonrpc_1.RequestType(WillSaveTextDocumentWaitUntilRequest.method);\r
+})(WillSaveTextDocumentWaitUntilRequest = exports.WillSaveTextDocumentWaitUntilRequest || (exports.WillSaveTextDocumentWaitUntilRequest = {}));\r
+/**\r
+ * The watched files notification is sent from the client to the server when\r
+ * the client detects changes to file watched by the language client.\r
+ */\r
+var DidChangeWatchedFilesNotification;\r
+(function (DidChangeWatchedFilesNotification) {\r
+    DidChangeWatchedFilesNotification.type = new vscode_jsonrpc_1.NotificationType('workspace/didChangeWatchedFiles');\r
+})(DidChangeWatchedFilesNotification = exports.DidChangeWatchedFilesNotification || (exports.DidChangeWatchedFilesNotification = {}));\r
+/**\r
+ * The file event type\r
+ */\r
+var FileChangeType;\r
+(function (FileChangeType) {\r
+    /**\r
+     * The file got created.\r
+     */\r
+    FileChangeType.Created = 1;\r
+    /**\r
+     * The file got changed.\r
+     */\r
+    FileChangeType.Changed = 2;\r
+    /**\r
+     * The file got deleted.\r
+     */\r
+    FileChangeType.Deleted = 3;\r
+})(FileChangeType = exports.FileChangeType || (exports.FileChangeType = {}));\r
+var WatchKind;\r
+(function (WatchKind) {\r
+    /**\r
+     * Interested in create events.\r
+     */\r
+    WatchKind.Create = 1;\r
+    /**\r
+     * Interested in change events\r
+     */\r
+    WatchKind.Change = 2;\r
+    /**\r
+     * Interested in delete events\r
+     */\r
+    WatchKind.Delete = 4;\r
+})(WatchKind = exports.WatchKind || (exports.WatchKind = {}));\r
+/**\r
+ * Diagnostics notification are sent from the server to the client to signal\r
+ * results of validation runs.\r
+ */\r
+var PublishDiagnosticsNotification;\r
+(function (PublishDiagnosticsNotification) {\r
+    PublishDiagnosticsNotification.type = new vscode_jsonrpc_1.NotificationType('textDocument/publishDiagnostics');\r
+})(PublishDiagnosticsNotification = exports.PublishDiagnosticsNotification || (exports.PublishDiagnosticsNotification = {}));\r
+/**\r
+ * How a completion was triggered\r
+ */\r
+var CompletionTriggerKind;\r
+(function (CompletionTriggerKind) {\r
+    /**\r
+     * Completion was triggered by typing an identifier (24x7 code\r
+     * complete), manual invocation (e.g Ctrl+Space) or via API.\r
+     */\r
+    CompletionTriggerKind.Invoked = 1;\r
+    /**\r
+     * Completion was triggered by a trigger character specified by\r
+     * the `triggerCharacters` properties of the `CompletionRegistrationOptions`.\r
+     */\r
+    CompletionTriggerKind.TriggerCharacter = 2;\r
+    /**\r
+     * Completion was re-triggered as current completion list is incomplete\r
+     */\r
+    CompletionTriggerKind.TriggerForIncompleteCompletions = 3;\r
+})(CompletionTriggerKind = exports.CompletionTriggerKind || (exports.CompletionTriggerKind = {}));\r
+/**\r
+ * Request to request completion at a given text document position. The request's\r
+ * parameter is of type [TextDocumentPosition](#TextDocumentPosition) the response\r
+ * is of type [CompletionItem[]](#CompletionItem) or [CompletionList](#CompletionList)\r
+ * or a Thenable that resolves to such.\r
+ *\r
+ * The request can delay the computation of the [`detail`](#CompletionItem.detail)\r
+ * and [`documentation`](#CompletionItem.documentation) properties to the `completionItem/resolve`\r
+ * request. However, properties that are needed for the initial sorting and filtering, like `sortText`,\r
+ * `filterText`, `insertText`, and `textEdit`, must not be changed during resolve.\r
+ */\r
+var CompletionRequest;\r
+(function (CompletionRequest) {\r
+    CompletionRequest.method = 'textDocument/completion';\r
+    CompletionRequest.type = new vscode_jsonrpc_1.RequestType(CompletionRequest.method);\r
+    CompletionRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
+})(CompletionRequest = exports.CompletionRequest || (exports.CompletionRequest = {}));\r
+/**\r
+ * Request to resolve additional information for a given completion item.The request's\r
+ * parameter is of type [CompletionItem](#CompletionItem) the response\r
+ * is of type [CompletionItem](#CompletionItem) or a Thenable that resolves to such.\r
+ */\r
+var CompletionResolveRequest;\r
+(function (CompletionResolveRequest) {\r
+    CompletionResolveRequest.method = 'completionItem/resolve';\r
+    CompletionResolveRequest.type = new vscode_jsonrpc_1.RequestType(CompletionResolveRequest.method);\r
+})(CompletionResolveRequest = exports.CompletionResolveRequest || (exports.CompletionResolveRequest = {}));\r
+/**\r
+ * Request to request hover information at a given text document position. The request's\r
+ * parameter is of type [TextDocumentPosition](#TextDocumentPosition) the response is of\r
+ * type [Hover](#Hover) or a Thenable that resolves to such.\r
+ */\r
+var HoverRequest;\r
+(function (HoverRequest) {\r
+    HoverRequest.method = 'textDocument/hover';\r
+    HoverRequest.type = new vscode_jsonrpc_1.RequestType(HoverRequest.method);\r
+})(HoverRequest = exports.HoverRequest || (exports.HoverRequest = {}));\r
+/**\r
+ * How a signature help was triggered.\r
+ *\r
+ * @since 3.15.0\r
+ */\r
+var SignatureHelpTriggerKind;\r
+(function (SignatureHelpTriggerKind) {\r
+    /**\r
+     * Signature help was invoked manually by the user or by a command.\r
+     */\r
+    SignatureHelpTriggerKind.Invoked = 1;\r
+    /**\r
+     * Signature help was triggered by a trigger character.\r
+     */\r
+    SignatureHelpTriggerKind.TriggerCharacter = 2;\r
+    /**\r
+     * Signature help was triggered by the cursor moving or by the document content changing.\r
+     */\r
+    SignatureHelpTriggerKind.ContentChange = 3;\r
+})(SignatureHelpTriggerKind = exports.SignatureHelpTriggerKind || (exports.SignatureHelpTriggerKind = {}));\r
+var SignatureHelpRequest;\r
+(function (SignatureHelpRequest) {\r
+    SignatureHelpRequest.method = 'textDocument/signatureHelp';\r
+    SignatureHelpRequest.type = new vscode_jsonrpc_1.RequestType(SignatureHelpRequest.method);\r
+})(SignatureHelpRequest = exports.SignatureHelpRequest || (exports.SignatureHelpRequest = {}));\r
+/**\r
+ * A request to resolve the definition location of a symbol at a given text\r
+ * document position. The request's parameter is of type [TextDocumentPosition]\r
+ * (#TextDocumentPosition) the response is of either type [Definition](#Definition)\r
+ * or a typed array of [DefinitionLink](#DefinitionLink) or a Thenable that resolves\r
+ * to such.\r
+ */\r
+var DefinitionRequest;\r
+(function (DefinitionRequest) {\r
+    DefinitionRequest.method = 'textDocument/definition';\r
+    DefinitionRequest.type = new vscode_jsonrpc_1.RequestType(DefinitionRequest.method);\r
+    DefinitionRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
+})(DefinitionRequest = exports.DefinitionRequest || (exports.DefinitionRequest = {}));\r
+/**\r
+ * A request to resolve project-wide references for the symbol denoted\r
+ * by the given text document position. The request's parameter is of\r
+ * type [ReferenceParams](#ReferenceParams) the response is of type\r
+ * [Location[]](#Location) or a Thenable that resolves to such.\r
+ */\r
+var ReferencesRequest;\r
+(function (ReferencesRequest) {\r
+    ReferencesRequest.method = 'textDocument/references';\r
+    ReferencesRequest.type = new vscode_jsonrpc_1.RequestType(ReferencesRequest.method);\r
+    ReferencesRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
+})(ReferencesRequest = exports.ReferencesRequest || (exports.ReferencesRequest = {}));\r
+/**\r
+ * Request to resolve a [DocumentHighlight](#DocumentHighlight) for a given\r
+ * text document position. The request's parameter is of type [TextDocumentPosition]\r
+ * (#TextDocumentPosition) the request response is of type [DocumentHighlight[]]\r
+ * (#DocumentHighlight) or a Thenable that resolves to such.\r
+ */\r
+var DocumentHighlightRequest;\r
+(function (DocumentHighlightRequest) {\r
+    DocumentHighlightRequest.method = 'textDocument/documentHighlight';\r
+    DocumentHighlightRequest.type = new vscode_jsonrpc_1.RequestType(DocumentHighlightRequest.method);\r
+    DocumentHighlightRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
+})(DocumentHighlightRequest = exports.DocumentHighlightRequest || (exports.DocumentHighlightRequest = {}));\r
+/**\r
+ * A request to list all symbols found in a given text document. The request's\r
+ * parameter is of type [TextDocumentIdentifier](#TextDocumentIdentifier) the\r
+ * response is of type [SymbolInformation[]](#SymbolInformation) or a Thenable\r
+ * that resolves to such.\r
+ */\r
+var DocumentSymbolRequest;\r
+(function (DocumentSymbolRequest) {\r
+    DocumentSymbolRequest.method = 'textDocument/documentSymbol';\r
+    DocumentSymbolRequest.type = new vscode_jsonrpc_1.RequestType(DocumentSymbolRequest.method);\r
+    DocumentSymbolRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
+})(DocumentSymbolRequest = exports.DocumentSymbolRequest || (exports.DocumentSymbolRequest = {}));\r
+/**\r
+ * A request to provide commands for the given text document and range.\r
+ */\r
+var CodeActionRequest;\r
+(function (CodeActionRequest) {\r
+    CodeActionRequest.method = 'textDocument/codeAction';\r
+    CodeActionRequest.type = new vscode_jsonrpc_1.RequestType(CodeActionRequest.method);\r
+    CodeActionRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
+})(CodeActionRequest = exports.CodeActionRequest || (exports.CodeActionRequest = {}));\r
+/**\r
+ * A request to list project-wide symbols matching the query string given\r
+ * by the [WorkspaceSymbolParams](#WorkspaceSymbolParams). The response is\r
+ * of type [SymbolInformation[]](#SymbolInformation) or a Thenable that\r
+ * resolves to such.\r
+ */\r
+var WorkspaceSymbolRequest;\r
+(function (WorkspaceSymbolRequest) {\r
+    WorkspaceSymbolRequest.method = 'workspace/symbol';\r
+    WorkspaceSymbolRequest.type = new vscode_jsonrpc_1.RequestType(WorkspaceSymbolRequest.method);\r
+    WorkspaceSymbolRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
+})(WorkspaceSymbolRequest = exports.WorkspaceSymbolRequest || (exports.WorkspaceSymbolRequest = {}));\r
+/**\r
+ * A request to provide code lens for the given text document.\r
+ */\r
+var CodeLensRequest;\r
+(function (CodeLensRequest) {\r
+    CodeLensRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/codeLens');\r
+    CodeLensRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
+})(CodeLensRequest = exports.CodeLensRequest || (exports.CodeLensRequest = {}));\r
+/**\r
+ * A request to resolve a command for a given code lens.\r
+ */\r
+var CodeLensResolveRequest;\r
+(function (CodeLensResolveRequest) {\r
+    CodeLensResolveRequest.type = new vscode_jsonrpc_1.RequestType('codeLens/resolve');\r
+})(CodeLensResolveRequest = exports.CodeLensResolveRequest || (exports.CodeLensResolveRequest = {}));\r
+/**\r
+ * A request to provide document links\r
+ */\r
+var DocumentLinkRequest;\r
+(function (DocumentLinkRequest) {\r
+    DocumentLinkRequest.method = 'textDocument/documentLink';\r
+    DocumentLinkRequest.type = new vscode_jsonrpc_1.RequestType(DocumentLinkRequest.method);\r
+    DocumentLinkRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
+})(DocumentLinkRequest = exports.DocumentLinkRequest || (exports.DocumentLinkRequest = {}));\r
+/**\r
+ * Request to resolve additional information for a given document link. The request's\r
+ * parameter is of type [DocumentLink](#DocumentLink) the response\r
+ * is of type [DocumentLink](#DocumentLink) or a Thenable that resolves to such.\r
+ */\r
+var DocumentLinkResolveRequest;\r
+(function (DocumentLinkResolveRequest) {\r
+    DocumentLinkResolveRequest.type = new vscode_jsonrpc_1.RequestType('documentLink/resolve');\r
+})(DocumentLinkResolveRequest = exports.DocumentLinkResolveRequest || (exports.DocumentLinkResolveRequest = {}));\r
+/**\r
+ * A request to to format a whole document.\r
+ */\r
+var DocumentFormattingRequest;\r
+(function (DocumentFormattingRequest) {\r
+    DocumentFormattingRequest.method = 'textDocument/formatting';\r
+    DocumentFormattingRequest.type = new vscode_jsonrpc_1.RequestType(DocumentFormattingRequest.method);\r
+})(DocumentFormattingRequest = exports.DocumentFormattingRequest || (exports.DocumentFormattingRequest = {}));\r
+/**\r
+ * A request to to format a range in a document.\r
+ */\r
+var DocumentRangeFormattingRequest;\r
+(function (DocumentRangeFormattingRequest) {\r
+    DocumentRangeFormattingRequest.method = 'textDocument/rangeFormatting';\r
+    DocumentRangeFormattingRequest.type = new vscode_jsonrpc_1.RequestType(DocumentRangeFormattingRequest.method);\r
+})(DocumentRangeFormattingRequest = exports.DocumentRangeFormattingRequest || (exports.DocumentRangeFormattingRequest = {}));\r
+/**\r
+ * A request to format a document on type.\r
+ */\r
+var DocumentOnTypeFormattingRequest;\r
+(function (DocumentOnTypeFormattingRequest) {\r
+    DocumentOnTypeFormattingRequest.method = 'textDocument/onTypeFormatting';\r
+    DocumentOnTypeFormattingRequest.type = new vscode_jsonrpc_1.RequestType(DocumentOnTypeFormattingRequest.method);\r
+})(DocumentOnTypeFormattingRequest = exports.DocumentOnTypeFormattingRequest || (exports.DocumentOnTypeFormattingRequest = {}));\r
+/**\r
+ * A request to rename a symbol.\r
+ */\r
+var RenameRequest;\r
+(function (RenameRequest) {\r
+    RenameRequest.method = 'textDocument/rename';\r
+    RenameRequest.type = new vscode_jsonrpc_1.RequestType(RenameRequest.method);\r
+})(RenameRequest = exports.RenameRequest || (exports.RenameRequest = {}));\r
+/**\r
+ * A request to test and perform the setup necessary for a rename.\r
+ */\r
+var PrepareRenameRequest;\r
+(function (PrepareRenameRequest) {\r
+    PrepareRenameRequest.method = 'textDocument/prepareRename';\r
+    PrepareRenameRequest.type = new vscode_jsonrpc_1.RequestType(PrepareRenameRequest.method);\r
+})(PrepareRenameRequest = exports.PrepareRenameRequest || (exports.PrepareRenameRequest = {}));\r
+/**\r
+ * A request send from the client to the server to execute a command. The request might return\r
+ * a workspace edit which the client will apply to the workspace.\r
+ */\r
+var ExecuteCommandRequest;\r
+(function (ExecuteCommandRequest) {\r
+    ExecuteCommandRequest.type = new vscode_jsonrpc_1.RequestType('workspace/executeCommand');\r
+})(ExecuteCommandRequest = exports.ExecuteCommandRequest || (exports.ExecuteCommandRequest = {}));\r
+/**\r
+ * A request sent from the server to the client to modified certain resources.\r
+ */\r
+var ApplyWorkspaceEditRequest;\r
+(function (ApplyWorkspaceEditRequest) {\r
+    ApplyWorkspaceEditRequest.type = new vscode_jsonrpc_1.RequestType('workspace/applyEdit');\r
+})(ApplyWorkspaceEditRequest = exports.ApplyWorkspaceEditRequest || (exports.ApplyWorkspaceEditRequest = {}));\r
+
+
+/***/ }),
+/* 20 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/* --------------------------------------------------------------------------------------------\r
+ * Copyright (c) Microsoft Corporation. All rights reserved.\r
+ * Licensed under the MIT License. See License.txt in the project root for license information.\r
+ * ------------------------------------------------------------------------------------------ */\r
+\r
+Object.defineProperty(exports, "__esModule", { value: true });\r
+function boolean(value) {\r
+    return value === true || value === false;\r
+}\r
+exports.boolean = boolean;\r
+function string(value) {\r
+    return typeof value === 'string' || value instanceof String;\r
+}\r
+exports.string = string;\r
+function number(value) {\r
+    return typeof value === 'number' || value instanceof Number;\r
+}\r
+exports.number = number;\r
+function error(value) {\r
+    return value instanceof Error;\r
+}\r
+exports.error = error;\r
+function func(value) {\r
+    return typeof value === 'function';\r
+}\r
+exports.func = func;\r
+function array(value) {\r
+    return Array.isArray(value);\r
+}\r
+exports.array = array;\r
+function stringArray(value) {\r
+    return array(value) && value.every(elem => string(elem));\r
+}\r
+exports.stringArray = stringArray;\r
+function typedArray(value, check) {\r
+    return Array.isArray(value) && value.every(check);\r
+}\r
+exports.typedArray = typedArray;\r
+function objectLiteral(value) {\r
+    // Strictly speaking class instances pass this check as well. Since the LSP\r
+    // doesn't use classes we ignore this for now. If we do we need to add something\r
+    // like this: `Object.getPrototypeOf(Object.getPrototypeOf(x)) === null`\r
+    return value !== null && typeof value === 'object';\r
+}\r
+exports.objectLiteral = objectLiteral;\r
+
+
+/***/ }),
+/* 21 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/* --------------------------------------------------------------------------------------------\r
+ * Copyright (c) Microsoft Corporation. All rights reserved.\r
+ * Licensed under the MIT License. See License.txt in the project root for license information.\r
+ * ------------------------------------------------------------------------------------------ */\r
+\r
+Object.defineProperty(exports, "__esModule", { value: true });\r
+const vscode_jsonrpc_1 = __webpack_require__(5);\r
+// @ts-ignore: to avoid inlining LocatioLink as dynamic import\r
+let __noDynamicImport;\r
+/**\r
+ * A request to resolve the implementation locations of a symbol at a given text\r
+ * document position. The request's parameter is of type [TextDocumentPositioParams]\r
+ * (#TextDocumentPositionParams) the response is of type [Definition](#Definition) or a\r
+ * Thenable that resolves to such.\r
+ */\r
+var ImplementationRequest;\r
+(function (ImplementationRequest) {\r
+    ImplementationRequest.method = 'textDocument/implementation';\r
+    ImplementationRequest.type = new vscode_jsonrpc_1.RequestType(ImplementationRequest.method);\r
+    ImplementationRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
+})(ImplementationRequest = exports.ImplementationRequest || (exports.ImplementationRequest = {}));\r
+
+
+/***/ }),
+/* 22 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/* --------------------------------------------------------------------------------------------\r
+ * Copyright (c) Microsoft Corporation. All rights reserved.\r
+ * Licensed under the MIT License. See License.txt in the project root for license information.\r
+ * ------------------------------------------------------------------------------------------ */\r
+\r
+Object.defineProperty(exports, "__esModule", { value: true });\r
+const vscode_jsonrpc_1 = __webpack_require__(5);\r
+// @ts-ignore: to avoid inlining LocatioLink as dynamic import\r
+let __noDynamicImport;\r
+/**\r
+ * A request to resolve the type definition locations of a symbol at a given text\r
+ * document position. The request's parameter is of type [TextDocumentPositioParams]\r
+ * (#TextDocumentPositionParams) the response is of type [Definition](#Definition) or a\r
+ * Thenable that resolves to such.\r
+ */\r
+var TypeDefinitionRequest;\r
+(function (TypeDefinitionRequest) {\r
+    TypeDefinitionRequest.method = 'textDocument/typeDefinition';\r
+    TypeDefinitionRequest.type = new vscode_jsonrpc_1.RequestType(TypeDefinitionRequest.method);\r
+    TypeDefinitionRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
+})(TypeDefinitionRequest = exports.TypeDefinitionRequest || (exports.TypeDefinitionRequest = {}));\r
+
+
+/***/ }),
+/* 23 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/* --------------------------------------------------------------------------------------------\r
+ * Copyright (c) Microsoft Corporation. All rights reserved.\r
+ * Licensed under the MIT License. See License.txt in the project root for license information.\r
+ * ------------------------------------------------------------------------------------------ */\r
+\r
+Object.defineProperty(exports, "__esModule", { value: true });\r
+const vscode_jsonrpc_1 = __webpack_require__(5);\r
+/**\r
+ * The `workspace/workspaceFolders` is sent from the server to the client to fetch the open workspace folders.\r
+ */\r
+var WorkspaceFoldersRequest;\r
+(function (WorkspaceFoldersRequest) {\r
+    WorkspaceFoldersRequest.type = new vscode_jsonrpc_1.RequestType0('workspace/workspaceFolders');\r
+})(WorkspaceFoldersRequest = exports.WorkspaceFoldersRequest || (exports.WorkspaceFoldersRequest = {}));\r
+/**\r
+ * The `workspace/didChangeWorkspaceFolders` notification is sent from the client to the server when the workspace\r
+ * folder configuration changes.\r
+ */\r
+var DidChangeWorkspaceFoldersNotification;\r
+(function (DidChangeWorkspaceFoldersNotification) {\r
+    DidChangeWorkspaceFoldersNotification.type = new vscode_jsonrpc_1.NotificationType('workspace/didChangeWorkspaceFolders');\r
+})(DidChangeWorkspaceFoldersNotification = exports.DidChangeWorkspaceFoldersNotification || (exports.DidChangeWorkspaceFoldersNotification = {}));\r
+
+
+/***/ }),
+/* 24 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/* --------------------------------------------------------------------------------------------\r
+ * Copyright (c) Microsoft Corporation. All rights reserved.\r
+ * Licensed under the MIT License. See License.txt in the project root for license information.\r
+ * ------------------------------------------------------------------------------------------ */\r
+\r
+Object.defineProperty(exports, "__esModule", { value: true });\r
+const vscode_jsonrpc_1 = __webpack_require__(5);\r
+/**\r
+ * The 'workspace/configuration' request is sent from the server to the client to fetch a certain\r
+ * configuration setting.\r
+ *\r
+ * This pull model replaces the old push model were the client signaled configuration change via an\r
+ * event. If the server still needs to react to configuration changes (since the server caches the\r
+ * result of `workspace/configuration` requests) the server should register for an empty configuration\r
+ * change event and empty the cache if such an event is received.\r
+ */\r
+var ConfigurationRequest;\r
+(function (ConfigurationRequest) {\r
+    ConfigurationRequest.type = new vscode_jsonrpc_1.RequestType('workspace/configuration');\r
+})(ConfigurationRequest = exports.ConfigurationRequest || (exports.ConfigurationRequest = {}));\r
+
+
+/***/ }),
+/* 25 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/* --------------------------------------------------------------------------------------------\r
+ * Copyright (c) Microsoft Corporation. All rights reserved.\r
+ * Licensed under the MIT License. See License.txt in the project root for license information.\r
+ * ------------------------------------------------------------------------------------------ */\r
+\r
+Object.defineProperty(exports, "__esModule", { value: true });\r
+const vscode_jsonrpc_1 = __webpack_require__(5);\r
+/**\r
+ * A request to list all color symbols found in a given text document. The request's\r
+ * parameter is of type [DocumentColorParams](#DocumentColorParams) the\r
+ * response is of type [ColorInformation[]](#ColorInformation) or a Thenable\r
+ * that resolves to such.\r
+ */\r
+var DocumentColorRequest;\r
+(function (DocumentColorRequest) {\r
+    DocumentColorRequest.method = 'textDocument/documentColor';\r
+    DocumentColorRequest.type = new vscode_jsonrpc_1.RequestType(DocumentColorRequest.method);\r
+    DocumentColorRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
+})(DocumentColorRequest = exports.DocumentColorRequest || (exports.DocumentColorRequest = {}));\r
+/**\r
+ * A request to list all presentation for a color. The request's\r
+ * parameter is of type [ColorPresentationParams](#ColorPresentationParams) the\r
+ * response is of type [ColorInformation[]](#ColorInformation) or a Thenable\r
+ * that resolves to such.\r
+ */\r
+var ColorPresentationRequest;\r
+(function (ColorPresentationRequest) {\r
+    ColorPresentationRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/colorPresentation');\r
+})(ColorPresentationRequest = exports.ColorPresentationRequest || (exports.ColorPresentationRequest = {}));\r
+
+
+/***/ }),
+/* 26 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+\r
+/*---------------------------------------------------------------------------------------------\r
+ *  Copyright (c) Microsoft Corporation. All rights reserved.\r
+ *  Licensed under the MIT License. See License.txt in the project root for license information.\r
+ *--------------------------------------------------------------------------------------------*/\r
+Object.defineProperty(exports, "__esModule", { value: true });\r
+const vscode_jsonrpc_1 = __webpack_require__(5);\r
+/**\r
+ * Enum of known range kinds\r
+ */\r
+var FoldingRangeKind;\r
+(function (FoldingRangeKind) {\r
+    /**\r
+     * Folding range for a comment\r
+     */\r
+    FoldingRangeKind["Comment"] = "comment";\r
+    /**\r
+     * Folding range for a imports or includes\r
+     */\r
+    FoldingRangeKind["Imports"] = "imports";\r
+    /**\r
+     * Folding range for a region (e.g. `#region`)\r
+     */\r
+    FoldingRangeKind["Region"] = "region";\r
+})(FoldingRangeKind = exports.FoldingRangeKind || (exports.FoldingRangeKind = {}));\r
+/**\r
+ * A request to provide folding ranges in a document. The request's\r
+ * parameter is of type [FoldingRangeParams](#FoldingRangeParams), the\r
+ * response is of type [FoldingRangeList](#FoldingRangeList) or a Thenable\r
+ * that resolves to such.\r
+ */\r
+var FoldingRangeRequest;\r
+(function (FoldingRangeRequest) {\r
+    FoldingRangeRequest.method = 'textDocument/foldingRange';\r
+    FoldingRangeRequest.type = new vscode_jsonrpc_1.RequestType(FoldingRangeRequest.method);\r
+    FoldingRangeRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
+})(FoldingRangeRequest = exports.FoldingRangeRequest || (exports.FoldingRangeRequest = {}));\r
+
+
+/***/ }),
+/* 27 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/* --------------------------------------------------------------------------------------------\r
+ * Copyright (c) Microsoft Corporation. All rights reserved.\r
+ * Licensed under the MIT License. See License.txt in the project root for license information.\r
+ * ------------------------------------------------------------------------------------------ */\r
+\r
+Object.defineProperty(exports, "__esModule", { value: true });\r
+const vscode_jsonrpc_1 = __webpack_require__(5);\r
+// @ts-ignore: to avoid inlining LocatioLink as dynamic import\r
+let __noDynamicImport;\r
+/**\r
+ * A request to resolve the type definition locations of a symbol at a given text\r
+ * document position. The request's parameter is of type [TextDocumentPositioParams]\r
+ * (#TextDocumentPositionParams) the response is of type [Declaration](#Declaration)\r
+ * or a typed array of [DeclarationLink](#DeclarationLink) or a Thenable that resolves\r
+ * to such.\r
+ */\r
+var DeclarationRequest;\r
+(function (DeclarationRequest) {\r
+    DeclarationRequest.method = 'textDocument/declaration';\r
+    DeclarationRequest.type = new vscode_jsonrpc_1.RequestType(DeclarationRequest.method);\r
+    DeclarationRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
+})(DeclarationRequest = exports.DeclarationRequest || (exports.DeclarationRequest = {}));\r
+
+
+/***/ }),
+/* 28 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+\r
+/*---------------------------------------------------------------------------------------------\r
+ *  Copyright (c) Microsoft Corporation. All rights reserved.\r
+ *  Licensed under the MIT License. See License.txt in the project root for license information.\r
+ *--------------------------------------------------------------------------------------------*/\r
+Object.defineProperty(exports, "__esModule", { value: true });\r
+const vscode_jsonrpc_1 = __webpack_require__(5);\r
+/**\r
+ * A request to provide selection ranges in a document. The request's\r
+ * parameter is of type [SelectionRangeParams](#SelectionRangeParams), the\r
+ * response is of type [SelectionRange[]](#SelectionRange[]) or a Thenable\r
+ * that resolves to such.\r
+ */\r
+var SelectionRangeRequest;\r
+(function (SelectionRangeRequest) {\r
+    SelectionRangeRequest.method = 'textDocument/selectionRange';\r
+    SelectionRangeRequest.type = new vscode_jsonrpc_1.RequestType(SelectionRangeRequest.method);\r
+    SelectionRangeRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
+})(SelectionRangeRequest = exports.SelectionRangeRequest || (exports.SelectionRangeRequest = {}));\r
+
+
+/***/ }),
+/* 29 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/* --------------------------------------------------------------------------------------------\r
+ * Copyright (c) Microsoft Corporation. All rights reserved.\r
+ * Licensed under the MIT License. See License.txt in the project root for license information.\r
+ * ------------------------------------------------------------------------------------------ */\r
+\r
+Object.defineProperty(exports, "__esModule", { value: true });\r
+const vscode_jsonrpc_1 = __webpack_require__(5);\r
+var WorkDoneProgress;\r
+(function (WorkDoneProgress) {\r
+    WorkDoneProgress.type = new vscode_jsonrpc_1.ProgressType();\r
+})(WorkDoneProgress = exports.WorkDoneProgress || (exports.WorkDoneProgress = {}));\r
+/**\r
+ * The `window/workDoneProgress/create` request is sent from the server to the client to initiate progress\r
+ * reporting from the server.\r
+ */\r
+var WorkDoneProgressCreateRequest;\r
+(function (WorkDoneProgressCreateRequest) {\r
+    WorkDoneProgressCreateRequest.type = new vscode_jsonrpc_1.RequestType('window/workDoneProgress/create');\r
+})(WorkDoneProgressCreateRequest = exports.WorkDoneProgressCreateRequest || (exports.WorkDoneProgressCreateRequest = {}));\r
+/**\r
+ * The `window/workDoneProgress/cancel` notification is sent from  the client to the server to cancel a progress\r
+ * initiated on the server side.\r
+ */\r
+var WorkDoneProgressCancelNotification;\r
+(function (WorkDoneProgressCancelNotification) {\r
+    WorkDoneProgressCancelNotification.type = new vscode_jsonrpc_1.NotificationType('window/workDoneProgress/cancel');\r
+})(WorkDoneProgressCancelNotification = exports.WorkDoneProgressCancelNotification || (exports.WorkDoneProgressCancelNotification = {}));\r
+
+
+/***/ }),
+/* 30 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/* --------------------------------------------------------------------------------------------\r
+ * Copyright (c) TypeFox and others. All rights reserved.\r
+ * Licensed under the MIT License. See License.txt in the project root for license information.\r
+ * ------------------------------------------------------------------------------------------ */\r
+\r
+Object.defineProperty(exports, "__esModule", { value: true });\r
+const vscode_jsonrpc_1 = __webpack_require__(5);\r
+var CallHierarchyPrepareRequest;\r
+(function (CallHierarchyPrepareRequest) {\r
+    CallHierarchyPrepareRequest.method = 'textDocument/prepareCallHierarchy';\r
+    CallHierarchyPrepareRequest.type = new vscode_jsonrpc_1.RequestType(CallHierarchyPrepareRequest.method);\r
+})(CallHierarchyPrepareRequest = exports.CallHierarchyPrepareRequest || (exports.CallHierarchyPrepareRequest = {}));\r
+var CallHierarchyIncomingCallsRequest;\r
+(function (CallHierarchyIncomingCallsRequest) {\r
+    CallHierarchyIncomingCallsRequest.method = 'callHierarchy/incomingCalls';\r
+    CallHierarchyIncomingCallsRequest.type = new vscode_jsonrpc_1.RequestType(CallHierarchyIncomingCallsRequest.method);\r
+    CallHierarchyIncomingCallsRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
+})(CallHierarchyIncomingCallsRequest = exports.CallHierarchyIncomingCallsRequest || (exports.CallHierarchyIncomingCallsRequest = {}));\r
+var CallHierarchyOutgoingCallsRequest;\r
+(function (CallHierarchyOutgoingCallsRequest) {\r
+    CallHierarchyOutgoingCallsRequest.method = 'callHierarchy/outgoingCalls';\r
+    CallHierarchyOutgoingCallsRequest.type = new vscode_jsonrpc_1.RequestType(CallHierarchyOutgoingCallsRequest.method);\r
+    CallHierarchyOutgoingCallsRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
+})(CallHierarchyOutgoingCallsRequest = exports.CallHierarchyOutgoingCallsRequest || (exports.CallHierarchyOutgoingCallsRequest = {}));\r
+
+
+/***/ }),
+/* 31 */,
+/* 32 */,
+/* 33 */,
+/* 34 */,
+/* 35 */,
+/* 36 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/* --------------------------------------------------------------------------------------------
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for license information.
+ * ------------------------------------------------------------------------------------------ */
+
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+    return new (P || (P = Promise))(function (resolve, reject) {
+        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+        step((generator = generator.apply(thisArg, _arguments || [])).next());
+    });
+};
+var __importStar = (this && this.__importStar) || function (mod) {
+    if (mod && mod.__esModule) return mod;
+    var result = {};
+    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
+    result["default"] = mod;
+    return result;
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const os = __importStar(__webpack_require__(14));
+const path = __importStar(__webpack_require__(3));
+const vscode_languageserver_1 = __webpack_require__(37);
+const vscode_uri_1 = __webpack_require__(46);
+const types_1 = __webpack_require__(47);
+const util_1 = __webpack_require__(48);
+const vscode_languageserver_textdocument_1 = __webpack_require__(52);
+const requireFunc =  true ? require : undefined;
+var CommandIds;
+(function (CommandIds) {
+    CommandIds.applySingleFix = 'eslint.applySingleFix';
+    CommandIds.applySameFixes = 'eslint.applySameFixes';
+    CommandIds.applyAllFixes = 'eslint.applyAllFixes';
+    CommandIds.applyAutoFix = 'eslint.applyAutoFix';
+    CommandIds.applyDisableLine = 'eslint.applyDisableLine';
+    CommandIds.applyDisableFile = 'eslint.applyDisableFile';
+    CommandIds.openRuleDoc = 'eslint.openRuleDoc';
+})(CommandIds || (CommandIds = {}));
+var OpenESLintDocRequest;
+(function (OpenESLintDocRequest) {
+    OpenESLintDocRequest.type = new vscode_languageserver_1.RequestType('eslint/openDoc');
+})(OpenESLintDocRequest || (OpenESLintDocRequest = {}));
+var Status;
+(function (Status) {
+    Status[Status["ok"] = 1] = "ok";
+    Status[Status["warn"] = 2] = "warn";
+    Status[Status["error"] = 3] = "error";
+})(Status || (Status = {}));
+var StatusNotification;
+(function (StatusNotification) {
+    StatusNotification.type = new vscode_languageserver_1.NotificationType('eslint/status');
+})(StatusNotification || (StatusNotification = {}));
+var NoConfigRequest;
+(function (NoConfigRequest) {
+    NoConfigRequest.type = new vscode_languageserver_1.RequestType('eslint/noConfig');
+})(NoConfigRequest || (NoConfigRequest = {}));
+var NoESLintLibraryRequest;
+(function (NoESLintLibraryRequest) {
+    NoESLintLibraryRequest.type = new vscode_languageserver_1.RequestType('eslint/noLibrary');
+})(NoESLintLibraryRequest || (NoESLintLibraryRequest = {}));
+class CodeActionResult {
+    constructor() {
+        this._actions = new Map();
+    }
+    get(ruleId) {
+        let result = this._actions.get(ruleId);
+        if (result === undefined) {
+            result = { fixes: [] };
+            this._actions.set(ruleId, result);
+        }
+        return result;
+    }
+    set fixAll(action) {
+        this._fixAll = action;
+    }
+    all() {
+        let result = [];
+        for (let actions of this._actions.values()) {
+            result.push(...actions.fixes);
+            if (actions.disable) {
+                result.push(actions.disable);
+            }
+            if (actions.fixAll) {
+                result.push(actions.fixAll);
+            }
+            if (actions.disableFile) {
+                result.push(actions.disableFile);
+            }
+            if (actions.showDocumentation) {
+                result.push(actions.showDocumentation);
+            }
+        }
+        if (this._fixAll !== undefined) {
+            result.push(this._fixAll);
+        }
+        return result;
+    }
+    get length() {
+        let result = 0;
+        for (let actions of this._actions.values()) {
+            result += actions.fixes.length;
+        }
+        return result;
+    }
+}
+function makeDiagnostic(problem) {
+    let message = problem.ruleId != null
+        ? `${problem.message} (${problem.ruleId})`
+        : `${problem.message}`;
+    let startLine = Math.max(0, problem.line - 1);
+    let startChar = Math.max(0, problem.column - 1);
+    let endLine = problem.endLine != null ? Math.max(0, problem.endLine - 1) : startLine;
+    let endChar = problem.endColumn != null ? Math.max(0, problem.endColumn - 1) : startChar;
+    return {
+        message,
+        severity: convertSeverity(problem.severity),
+        source: 'eslint',
+        range: {
+            start: { line: startLine, character: startChar },
+            end: { line: endLine, character: endChar }
+        },
+        code: problem.ruleId
+    };
+}
+function computeKey(diagnostic) {
+    let range = diagnostic.range;
+    return `[${range.start.line},${range.start.character},${range.end.line},${range.end.character}]-${diagnostic.code}`;
+}
+let codeActions = new Map();
+function recordCodeAction(document, diagnostic, problem) {
+    if (!problem.ruleId) {
+        return;
+    }
+    let uri = document.uri;
+    let edits = codeActions.get(uri);
+    if (!edits) {
+        edits = new Map();
+        codeActions.set(uri, edits);
+    }
+    edits.set(computeKey(diagnostic), { label: `Fix this ${problem.ruleId} problem`, documentVersion: document.version, ruleId: problem.ruleId, edit: problem.fix, line: problem.line });
+}
+function convertSeverity(severity) {
+    switch (severity) {
+        // Eslint 1 is warning
+        case 1:
+            return vscode_languageserver_1.DiagnosticSeverity.Warning;
+        case 2:
+            return vscode_languageserver_1.DiagnosticSeverity.Error;
+        default:
+            return vscode_languageserver_1.DiagnosticSeverity.Error;
+    }
+}
+const exitCalled = new vscode_languageserver_1.NotificationType('eslint/exitCalled');
+const nodeExit = process.exit;
+process.exit = ((code) => {
+    let stack = new Error('stack');
+    connection.sendNotification(exitCalled, [code ? code : 0, stack.stack]);
+    setTimeout(() => {
+        nodeExit(code);
+    }, 1000);
+});
+process.on('uncaughtException', (error) => {
+    let message;
+    if (error) {
+        if (typeof error.stack === 'string') {
+            message = error.stack;
+        }
+        else if (typeof error.message === 'string') {
+            message = error.message;
+        }
+        else if (typeof error === 'string') {
+            message = error;
+        }
+        if (!message) {
+            try {
+                message = JSON.stringify(error, undefined, 4);
+            }
+            catch (e) {
+                // Should not happen.
+            }
+        }
+    }
+    connection.console.error(`Uncaught exception recevied.
+  ${message || ''}`);
+});
+let connection = vscode_languageserver_1.createConnection();
+connection.console.info(`ESLint server running in node ${process.version}`);
+let documents = new vscode_languageserver_1.TextDocuments(vscode_languageserver_textdocument_1.TextDocument);
+let _globalNpmPath;
+function globalNpmPath() {
+    if (_globalNpmPath === void 0) {
+        _globalNpmPath = vscode_languageserver_1.Files.resolveGlobalNodePath(trace);
+        if (_globalNpmPath === void 0) {
+            _globalNpmPath = null;
+        }
+    }
+    if (_globalNpmPath === null) {
+        return undefined;
+    }
+    return _globalNpmPath;
+}
+let _globalYarnPath;
+function globalYarnPath() {
+    if (_globalYarnPath === void 0) {
+        _globalYarnPath = vscode_languageserver_1.Files.resolveGlobalYarnPath(trace);
+        if (_globalYarnPath === void 0) {
+            _globalYarnPath = null;
+        }
+    }
+    if (_globalYarnPath === null) {
+        return undefined;
+    }
+    return _globalYarnPath;
+}
+let path2Library = new Map();
+let document2Settings = new Map();
+let ruleDocData = {
+    handled: new Set(),
+    urls: new Map()
+};
+function resolveSettings(document) {
+    let uri = document.uri;
+    let resultPromise = document2Settings.get(uri);
+    if (resultPromise) {
+        return resultPromise;
+    }
+    resultPromise = connection.workspace
+        .getConfiguration({ scopeUri: uri, section: '' })
+        .then((settings) => {
+        let nodePath;
+        if (settings.nodePath) {
+            nodePath = settings.nodePath;
+            if (nodePath.startsWith('~')) {
+                nodePath = nodePath.replace(/^~/, os.homedir());
+            }
+            if (!path.isAbsolute(nodePath)) {
+                nodePath = path.join(vscode_uri_1.URI.parse(settings.workspaceFolder.uri).fsPath, nodePath);
+            }
+        }
+        else if (settings.packageManager === 'npm') {
+            nodePath = globalNpmPath();
+        }
+        else if (settings.packageManager === 'yarn') {
+            nodePath = globalYarnPath();
+        }
+        let uri = vscode_uri_1.URI.parse(document.uri);
+        let promise;
+        let directory;
+        if (uri.scheme === 'file') {
+            directory = path.dirname(uri.fsPath);
+        }
+        else {
+            directory = settings.workspaceFolder ? vscode_uri_1.URI.parse(settings.workspaceFolder.uri).fsPath : undefined;
+        }
+        promise = util_1.resolveModule('./eslint', directory, nodePath).catch(() => {
+            return util_1.resolveModule('eslint', directory, nodePath);
+        });
+        return promise.then(path => {
+            let library = path2Library.get(path);
+            if (!library) {
+                library = requireFunc(path);
+                if (!library.CLIEngine) {
+                    settings.validate = false;
+                    connection.console.error(`The eslint library loaded from ${path} doesn\'t export a CLIEngine. You need at least eslint@1.0.0`);
+                }
+                else {
+                    connection.console.info(`ESLint library loaded from: ${path}`);
+                    settings.library = library;
+                }
+                path2Library.set(path, library);
+            }
+            else {
+                settings.library = library;
+            }
+            return settings;
+        }, () => {
+            settings.validate = false;
+            connection.sendRequest(NoESLintLibraryRequest.type, {
+                source: { uri: document.uri }
+            });
+            return settings;
+        });
+    });
+    document2Settings.set(uri, resultPromise);
+    return resultPromise;
+}
+var Request;
+(function (Request) {
+    function is(value) {
+        let candidate = value;
+        return (candidate &&
+            !!candidate.token &&
+            !!candidate.resolve &&
+            !!candidate.reject);
+    }
+    Request.is = is;
+})(Request || (Request = {}));
+var Thenable;
+(function (Thenable) {
+    function is(value) {
+        let candidate = value;
+        return candidate && typeof candidate.then === 'function';
+    }
+    Thenable.is = is;
+})(Thenable || (Thenable = {}));
+class BufferedMessageQueue {
+    constructor(connection) {
+        this.connection = connection;
+        this.queue = [];
+        this.requestHandlers = new Map();
+        this.notificationHandlers = new Map();
+    }
+    registerRequest(type, handler, versionProvider) {
+        this.connection.onRequest(type, (params, token) => {
+            return new Promise((resolve, reject) => {
+                this.queue.push({
+                    method: type.method,
+                    params,
+                    documentVersion: versionProvider
+                        ? versionProvider(params)
+                        : undefined,
+                    resolve,
+                    reject,
+                    token
+                });
+                this.trigger();
+            });
+        });
+        this.requestHandlers.set(type.method, { handler, versionProvider });
+    }
+    registerNotification(type, handler, versionProvider) {
+        connection.onNotification(type, params => {
+            this.queue.push({
+                method: type.method,
+                params,
+                documentVersion: versionProvider ? versionProvider(params) : undefined
+            });
+            this.trigger();
+        });
+        this.notificationHandlers.set(type.method, { handler, versionProvider });
+    }
+    addNotificationMessage(type, params, version) {
+        this.queue.push({
+            method: type.method,
+            params,
+            documentVersion: version
+        });
+        this.trigger();
+    }
+    onNotification(type, handler, versionProvider) {
+        this.notificationHandlers.set(type.method, { handler, versionProvider });
+    }
+    trigger() {
+        if (this.timer || this.queue.length === 0) {
+            return;
+        }
+        this.timer = setImmediate(() => {
+            this.timer = undefined;
+            this.processQueue();
+        });
+    }
+    processQueue() {
+        let message = this.queue.shift();
+        if (!message) {
+            return;
+        }
+        if (Request.is(message)) {
+            let requestMessage = message;
+            if (requestMessage.token.isCancellationRequested) {
+                requestMessage.reject(
+                // tslint:disable-next-line: no-inferred-empty-object-type
+                new vscode_languageserver_1.ResponseError(vscode_languageserver_1.ErrorCodes.RequestCancelled, 'Request got cancelled'));
+                return;
+            }
+            let elem = this.requestHandlers.get(requestMessage.method);
+            if (elem.versionProvider &&
+                requestMessage.documentVersion !== void 0 &&
+                requestMessage.documentVersion !==
+                    elem.versionProvider(requestMessage.params)) {
+                requestMessage.reject(
+                // tslint:disable-next-line: no-inferred-empty-object-type
+                new vscode_languageserver_1.ResponseError(vscode_languageserver_1.ErrorCodes.RequestCancelled, 'Request got cancelled'));
+                return;
+            }
+            let result = elem.handler(requestMessage.params, requestMessage.token);
+            if (Thenable.is(result)) {
+                result.then(value => {
+                    requestMessage.resolve(value);
+                }, error => {
+                    requestMessage.reject(error);
+                });
+            }
+            else {
+                requestMessage.resolve(result);
+            }
+        }
+        else {
+            let notificationMessage = message;
+            let elem = this.notificationHandlers.get(notificationMessage.method);
+            if (elem.versionProvider &&
+                notificationMessage.documentVersion !== void 0 &&
+                notificationMessage.documentVersion !==
+                    elem.versionProvider(notificationMessage.params)) {
+                return;
+            }
+            elem.handler(notificationMessage.params);
+        }
+        this.trigger();
+    }
+}
+let messageQueue = new BufferedMessageQueue(connection);
+var ValidateNotification;
+(function (ValidateNotification) {
+    ValidateNotification.type = new vscode_languageserver_1.NotificationType('eslint/validate');
+})(ValidateNotification || (ValidateNotification = {}));
+messageQueue.onNotification(ValidateNotification.type, document => {
+    validateSingle(document, true);
+}, (document) => {
+    return document.version;
+});
+// The documents manager listen for text document create, change
+// and close on the connection
+documents.listen(connection);
+documents.onDidOpen(event => {
+    resolveSettings(event.document).then(settings => {
+        if (!settings.validate) {
+            return;
+        }
+        if (settings.run === 'onSave') {
+            messageQueue.addNotificationMessage(ValidateNotification.type, event.document, event.document.version);
+        }
+    });
+});
+// A text document has changed. Validate the document according the run setting.
+documents.onDidChangeContent(event => {
+    resolveSettings(event.document).then(settings => {
+        if (!settings.validate || settings.run !== 'onType') {
+            return;
+        }
+        messageQueue.addNotificationMessage(ValidateNotification.type, event.document, event.document.version);
+    });
+});
+documents.onWillSaveWaitUntil(event => {
+    if (event.reason === vscode_languageserver_1.TextDocumentSaveReason.AfterDelay) {
+        return [];
+    }
+    let document = event.document;
+    return resolveSettings(document).then(settings => {
+        if (!settings.autoFixOnSave) {
+            return [];
+        }
+        // If we validate on save and want to apply fixes on will save
+        // we need to validate the file.
+        if (settings.run === 'onSave') {
+            // Do not queue this since we want to get the fixes as fast as possible.
+            return validateSingle(document, false).then(() => util_1.getAllFixEdits(document, settings));
+        }
+        else {
+            return util_1.getAllFixEdits(document, settings);
+        }
+    });
+});
+// A text document has been saved. Validate the document according the run setting.
+documents.onDidSave(event => {
+    resolveSettings(event.document).then(settings => {
+        if (!settings.validate || settings.run !== 'onSave') {
+            return;
+        }
+        messageQueue.addNotificationMessage(ValidateNotification.type, event.document, event.document.version);
+    });
+});
+documents.onDidClose(event => {
+    resolveSettings(event.document).then(settings => {
+        let uri = event.document.uri;
+        document2Settings.delete(uri);
+        codeActions.delete(uri);
+        if (settings.validate) {
+            connection.sendDiagnostics({ uri, diagnostics: [] });
+        }
+    });
+});
+function environmentChanged() {
+    document2Settings.clear();
+    for (let document of documents.all()) {
+        messageQueue.addNotificationMessage(ValidateNotification.type, document, document.version);
+    }
+}
+function trace(message, verbose) {
+    connection.tracer.log(message, verbose);
+}
+connection.onInitialize(_params => {
+    return {
+        capabilities: {
+            textDocumentSync: {
+                openClose: true,
+                change: vscode_languageserver_1.TextDocumentSyncKind.Full,
+                willSaveWaitUntil: true,
+                save: {
+                    includeText: false
+                }
+            },
+            codeActionProvider: true,
+            executeCommandProvider: {
+                commands: [
+                    CommandIds.applySingleFix,
+                    CommandIds.applySameFixes,
+                    CommandIds.applyAllFixes,
+                    CommandIds.applyAutoFix,
+                    CommandIds.applyDisableLine,
+                    CommandIds.applyDisableFile,
+                    CommandIds.openRuleDoc,
+                ]
+            }
+        }
+    };
+});
+connection.onInitialized(() => {
+    connection.client.register(vscode_languageserver_1.DidChangeConfigurationNotification.type, undefined);
+});
+messageQueue.registerNotification(vscode_languageserver_1.DidChangeConfigurationNotification.type, _params => {
+    environmentChanged();
+});
+// messageQueue.registerNotification(
+//   DidChangeWorkspaceFoldersNotification.type,
+//   _params => {
+//     environmentChanged()
+//   }
+// )
+const singleErrorHandlers = [
+    tryHandleNoConfig,
+    tryHandleConfigError,
+    tryHandleMissingModule,
+    showErrorMessage
+];
+function validateSingle(document, publishDiagnostics = true) {
+    // We validate document in a queue but open / close documents directly. So we need to deal with the
+    // fact that a document might be gone from the server.
+    if (!documents.get(document.uri)) {
+        return Promise.resolve(undefined);
+    }
+    return resolveSettings(document).then(settings => {
+        if (!settings.validate) {
+            return;
+        }
+        try {
+            validate(document, settings, publishDiagnostics);
+            connection.sendNotification(StatusNotification.type, { state: Status.ok });
+        }
+        catch (err) {
+            let status;
+            for (let handler of singleErrorHandlers) {
+                status = handler(err, document, settings.library);
+                if (status) {
+                    break;
+                }
+            }
+            status = status || Status.error;
+            connection.sendNotification(StatusNotification.type, { state: status });
+        }
+    });
+}
+function validateMany(documents) {
+    documents.forEach(document => {
+        messageQueue.addNotificationMessage(ValidateNotification.type, document, document.version);
+    });
+}
+function getMessage(err, document) {
+    let result = null;
+    if (typeof err.message === 'string' || err.message instanceof String) {
+        result = err.message;
+        result = result.replace(/\r?\n/g, ' ');
+        if (/^CLI: /.test(result)) {
+            result = result.substr(5);
+        }
+    }
+    else {
+        result = `An unknown error occured while validating document: ${document.uri}`;
+    }
+    return result;
+}
+function validate(document, settings, publishDiagnostics = true) {
+    const uri = document.uri;
+    const content = document.getText();
+    const newOptions = Object.assign(Object.create(null), settings.options);
+    util_1.executeInWorkspaceDirectory(document, settings, newOptions, (file, options) => {
+        const cli = new settings.library.CLIEngine(options);
+        // Clean previously computed code actions.
+        codeActions.delete(uri);
+        const report = cli.executeOnText(content, file);
+        const diagnostics = [];
+        if (report && report.results && Array.isArray(report.results) && report.results.length > 0) {
+            const docReport = report.results[0];
+            if (docReport.messages && Array.isArray(docReport.messages)) {
+                docReport.messages.forEach(problem => {
+                    if (problem) {
+                        const isWarning = convertSeverity(problem.severity) === vscode_languageserver_1.DiagnosticSeverity.Warning;
+                        if (settings.quiet && isWarning) {
+                            // Filter out warnings when quiet mode is enabled
+                            return;
+                        }
+                        const diagnostic = makeDiagnostic(problem);
+                        diagnostics.push(diagnostic);
+                        if (settings.autoFix) {
+                            if (typeof cli.getRules === 'function' && problem.ruleId !== undefined && problem.fix !== undefined) {
+                                const rule = cli.getRules().get(problem.ruleId);
+                                if (rule !== undefined && rule.meta && typeof rule.meta.fixable == 'string') {
+                                    recordCodeAction(document, diagnostic, problem);
+                                }
+                            }
+                            else {
+                                recordCodeAction(document, diagnostic, problem);
+                            }
+                        }
+                    }
+                });
+            }
+        }
+        if (publishDiagnostics) {
+            connection.sendDiagnostics({ uri, diagnostics });
+        }
+        // cache documentation urls for all rules
+        if (typeof cli.getRules === 'function' && !ruleDocData.handled.has(uri)) {
+            ruleDocData.handled.add(uri);
+            cli.getRules().forEach((rule, key) => {
+                if (rule.meta && rule.meta.docs && types_1.Is.string(rule.meta.docs.url)) {
+                    ruleDocData.urls.set(key, rule.meta.docs.url);
+                }
+            });
+        }
+    });
+}
+let noConfigReported = new Map();
+function isNoConfigFoundError(error) {
+    let candidate = error;
+    return (candidate.messageTemplate === 'no-config-found' ||
+        candidate.message === 'No ESLint configuration found.');
+}
+function tryHandleNoConfig(error, document, library) {
+    if (!isNoConfigFoundError(error)) {
+        return undefined;
+    }
+    if (!noConfigReported.has(document.uri)) {
+        connection
+            .sendRequest(NoConfigRequest.type, {
+            message: getMessage(error, document),
+            document: {
+                uri: document.uri
+            }
+        })
+            .then(undefined, () => {
+            // noop
+        });
+        noConfigReported.set(document.uri, library);
+    }
+    return Status.warn;
+}
+let configErrorReported = new Map();
+function tryHandleConfigError(error, document, library) {
+    if (!error.message) {
+        return undefined;
+    }
+    function handleFileName(filename) {
+        if (!configErrorReported.has(filename)) {
+            connection.console.error(getMessage(error, document));
+            if (!documents.get(vscode_uri_1.URI.file(filename).toString())) {
+                connection.window.showInformationMessage(getMessage(error, document));
+            }
+            configErrorReported.set(filename, library);
+        }
+        return Status.warn;
+    }
+    let matches = /Cannot read config file:\s+(.*)\nError:\s+(.*)/.exec(error.message);
+    if (matches && matches.length === 3) {
+        return handleFileName(matches[1]);
+    }
+    matches = /(.*):\n\s*Configuration for rule \"(.*)\" is /.exec(error.message);
+    if (matches && matches.length === 3) {
+        return handleFileName(matches[1]);
+    }
+    matches = /Cannot find module '([^']*)'\nReferenced from:\s+(.*)/.exec(error.message);
+    if (matches && matches.length === 3) {
+        return handleFileName(matches[2]);
+    }
+    return undefined;
+}
+let missingModuleReported = new Map();
+function tryHandleMissingModule(error, document, library) {
+    if (!error.message) {
+        return undefined;
+    }
+    function handleMissingModule(plugin, module, error) {
+        if (!missingModuleReported.has(plugin)) {
+            let fsPath = util_1.getFilePath(document);
+            missingModuleReported.set(plugin, library);
+            if (error.messageTemplate === 'plugin-missing') {
+                connection.console.error([
+                    '',
+                    `${error.message.toString()}`,
+                    `Happened while validating ${fsPath ? fsPath : document.uri}`,
+                    `This can happen for a couple of reasons:`,
+                    `1. The plugin name is spelled incorrectly in an ESLint configuration file (e.g. .eslintrc).`,
+                    `2. If ESLint is installed globally, then make sure ${module} is installed globally as well.`,
+                    `3. If ESLint is installed locally, then ${module} isn't installed correctly.`,
+                    '',
+                    `Consider running eslint --debug ${fsPath ? fsPath : document.uri} from a terminal to obtain a trace about the configuration files used.`
+                ].join('\n'));
+            }
+            else {
+                connection.console.error([
+                    `${error.message.toString()}`,
+                    `Happend while validating ${fsPath ? fsPath : document.uri}`
+                ].join('\n'));
+            }
+        }
+        return Status.warn;
+    }
+    let matches = /Failed to load plugin (.*): Cannot find module (.*)/.exec(error.message);
+    if (matches && matches.length === 3) {
+        return handleMissingModule(matches[1], matches[2], error);
+    }
+    return undefined;
+}
+function showErrorMessage(error, document) {
+    connection.window.showErrorMessage(`ESLint: ${getMessage(error, document)}. Please see the 'ESLint' output channel for details.`);
+    if (types_1.Is.string(error.stack)) {
+        connection.console.error('ESLint stack trace:');
+        connection.console.error(error.stack);
+    }
+    return Status.error;
+}
+messageQueue.registerNotification(vscode_languageserver_1.DidChangeWatchedFilesNotification.type, params => {
+    // A .eslintrc has change. No smartness here.
+    // Simply revalidate all file.
+    noConfigReported = new Map();
+    missingModuleReported = new Map();
+    params.changes.forEach(change => {
+        let fsPath = util_1.getFilePath(change.uri);
+        if (!fsPath || util_1.isUNC(fsPath)) {
+            return;
+        }
+        let dirname = path.dirname(fsPath);
+        if (dirname) {
+            let library = configErrorReported.get(fsPath);
+            if (library) {
+                let cli = new library.CLIEngine({});
+                try {
+                    cli.executeOnText('', path.join(dirname, '___test___.js'));
+                    configErrorReported.delete(fsPath);
+                }
+                catch (error) {
+                    // noop
+                }
+            }
+        }
+    });
+    validateMany(documents.all());
+});
+class Fixes {
+    constructor(edits) {
+        this.edits = edits;
+    }
+    static overlaps(lastEdit, newEdit) {
+        return !!lastEdit && lastEdit.edit.range[1] > newEdit.edit.range[0];
+    }
+    isEmpty() {
+        return this.edits.size === 0;
+    }
+    getDocumentVersion() {
+        if (this.isEmpty()) {
+            throw new Error('No edits recorded.');
+        }
+        return this.edits.values().next().value.documentVersion;
+    }
+    getScoped(diagnostics) {
+        let result = [];
+        for (let diagnostic of diagnostics) {
+            let key = computeKey(diagnostic);
+            let editInfo = this.edits.get(key);
+            if (editInfo) {
+                result.push(editInfo);
+            }
+        }
+        return result;
+    }
+    getAllSorted() {
+        let result = [];
+        this.edits.forEach(value => result.push(value));
+        return result.sort((a, b) => {
+            let d = a.edit.range[0] - b.edit.range[0];
+            if (d !== 0) {
+                return d;
+            }
+            if (a.edit.range[1] === 0) {
+                return -1;
+            }
+            if (b.edit.range[1] === 0) {
+                return 1;
+            }
+            return a.edit.range[1] - b.edit.range[1];
+        });
+    }
+    getOverlapFree() {
+        let sorted = this.getAllSorted();
+        if (sorted.length <= 1) {
+            return sorted;
+        }
+        let result = [];
+        let last = sorted[0];
+        result.push(last);
+        for (let i = 1; i < sorted.length; i++) {
+            let current = sorted[i];
+            if (!Fixes.overlaps(last, current)) {
+                result.push(current);
+                last = current;
+            }
+        }
+        return result;
+    }
+}
+let commands;
+messageQueue.registerRequest(vscode_languageserver_1.CodeActionRequest.type, params => {
+    commands = new Map();
+    let result = new CodeActionResult();
+    let uri = params.textDocument.uri;
+    let edits = codeActions.get(uri);
+    if (!edits)
+        return [];
+    let fixes = new Fixes(edits);
+    if (fixes.isEmpty())
+        return [];
+    let textDocument = documents.get(uri);
+    let documentVersion = -1;
+    let allFixableRuleIds = [];
+    function createTextEdit(editInfo) {
+        return vscode_languageserver_1.TextEdit.replace(vscode_languageserver_1.Range.create(textDocument.positionAt(editInfo.edit.range[0]), textDocument.positionAt(editInfo.edit.range[1])), editInfo.edit.text || '');
+    }
+    function createDisableLineTextEdit(editInfo, indentationText) {
+        return vscode_languageserver_1.TextEdit.insert(vscode_languageserver_1.Position.create(editInfo.line - 1, 0), `${indentationText}// eslint-disable-next-line ${editInfo.ruleId}\n`);
+    }
+    function createDisableSameLineTextEdit(editInfo) {
+        return vscode_languageserver_1.TextEdit.insert(vscode_languageserver_1.Position.create(editInfo.line - 1, Number.MAX_VALUE), ` // eslint-disable-line ${editInfo.ruleId}`);
+    }
+    function createDisableFileTextEdit(editInfo) {
+        return vscode_languageserver_1.TextEdit.insert(vscode_languageserver_1.Position.create(0, 0), `/* eslint-disable ${editInfo.ruleId} */\n`);
+    }
+    function getLastEdit(array) {
+        let length = array.length;
+        if (length === 0) {
+            return undefined;
+        }
+        return array[length - 1];
+    }
+    return resolveSettings(textDocument).then(settings => {
+        for (let editInfo of fixes.getScoped(params.context.diagnostics)) {
+            documentVersion = editInfo.documentVersion;
+            let ruleId = editInfo.ruleId;
+            allFixableRuleIds.push(ruleId);
+            if (!!editInfo.edit) {
+                let workspaceChange = new vscode_languageserver_1.WorkspaceChange();
+                workspaceChange.getTextEditChange({ uri, version: documentVersion }).add(createTextEdit(editInfo));
+                commands.set(`${CommandIds.applySingleFix}:${ruleId}`, workspaceChange);
+                result.get(ruleId).fixes.push(vscode_languageserver_1.CodeAction.create(editInfo.label, vscode_languageserver_1.Command.create(editInfo.label, CommandIds.applySingleFix, ruleId), vscode_languageserver_1.CodeActionKind.QuickFix));
+            }
+            if (settings.codeAction.disableRuleComment.enable) {
+                let workspaceChange = new vscode_languageserver_1.WorkspaceChange();
+                if (settings.codeAction.disableRuleComment.location === 'sameLine') {
+                    workspaceChange.getTextEditChange({ uri, version: documentVersion }).add(createDisableSameLineTextEdit(editInfo));
+                }
+                else {
+                    let lineText = textDocument.getText(vscode_languageserver_1.Range.create(vscode_languageserver_1.Position.create(editInfo.line - 1, 0), vscode_languageserver_1.Position.create(editInfo.line - 1, Number.MAX_VALUE)));
+                    let indentationText = /^([ \t]*)/.exec(lineText)[1];
+                    workspaceChange.getTextEditChange({ uri, version: documentVersion }).add(createDisableLineTextEdit(editInfo, indentationText));
+                }
+                commands.set(`${CommandIds.applyDisableLine}:${ruleId}`, workspaceChange);
+                let title = `Disable ${ruleId} for this line`;
+                result.get(ruleId).disable = vscode_languageserver_1.CodeAction.create(title, vscode_languageserver_1.Command.create(title, CommandIds.applyDisableLine, ruleId), vscode_languageserver_1.CodeActionKind.QuickFix);
+                if (result.get(ruleId).disableFile === undefined) {
+                    workspaceChange = new vscode_languageserver_1.WorkspaceChange();
+                    workspaceChange.getTextEditChange({ uri, version: documentVersion }).add(createDisableFileTextEdit(editInfo));
+                    commands.set(`${CommandIds.applyDisableFile}:${ruleId}`, workspaceChange);
+                    title = `Disable ${ruleId} for the entire file`;
+                    result.get(ruleId).disableFile = vscode_languageserver_1.CodeAction.create(title, vscode_languageserver_1.Command.create(title, CommandIds.applyDisableFile, ruleId), vscode_languageserver_1.CodeActionKind.QuickFix);
+                }
+            }
+            if (settings.codeAction.showDocumentation.enable && result.get(ruleId).showDocumentation === undefined) {
+                if (ruleDocData.urls.has(ruleId)) {
+                    let title = `Show documentation for ${ruleId}`;
+                    result.get(ruleId).showDocumentation = vscode_languageserver_1.CodeAction.create(title, vscode_languageserver_1.Command.create(title, CommandIds.openRuleDoc, ruleId), vscode_languageserver_1.CodeActionKind.QuickFix);
+                }
+            }
+        }
+        if (result.length > 0) {
+            let sameProblems = new Map(allFixableRuleIds.map(s => [s, []]));
+            let all = [];
+            for (let editInfo of fixes.getAllSorted()) {
+                if (documentVersion === -1) {
+                    documentVersion = editInfo.documentVersion;
+                }
+                if (sameProblems.has(editInfo.ruleId)) {
+                    let same = sameProblems.get(editInfo.ruleId);
+                    if (!Fixes.overlaps(getLastEdit(same), editInfo)) {
+                        same.push(editInfo);
+                    }
+                }
+                if (!Fixes.overlaps(getLastEdit(all), editInfo)) {
+                    all.push(editInfo);
+                }
+            }
+            sameProblems.forEach((same, ruleId) => {
+                if (same.length > 1) {
+                    let sameFixes = new vscode_languageserver_1.WorkspaceChange();
+                    let sameTextChange = sameFixes.getTextEditChange({ uri, version: documentVersion });
+                    same.map(createTextEdit).forEach(edit => sameTextChange.add(edit));
+                    commands.set(CommandIds.applySameFixes, sameFixes);
+                    let title = `Fix all ${ruleId} problems`;
+                    let command = vscode_languageserver_1.Command.create(title, CommandIds.applySameFixes);
+                    result.get(ruleId).fixAll = vscode_languageserver_1.CodeAction.create(title, command, vscode_languageserver_1.CodeActionKind.QuickFix);
+                }
+            });
+            if (all.length > 1) {
+                let allFixes = new vscode_languageserver_1.WorkspaceChange();
+                let allTextChange = allFixes.getTextEditChange({ uri, version: documentVersion });
+                all.map(createTextEdit).forEach(edit => allTextChange.add(edit));
+                commands.set(CommandIds.applyAllFixes, allFixes);
+                let title = `Fix all auto-fixable problems`;
+                let command = vscode_languageserver_1.Command.create(title, CommandIds.applyAllFixes);
+                result.fixAll = vscode_languageserver_1.CodeAction.create(title, command, vscode_languageserver_1.CodeActionKind.SourceFixAll);
+            }
+        }
+        return result.all();
+    });
+}, (params) => {
+    let document = documents.get(params.textDocument.uri);
+    return document ? document.version : undefined;
+});
+messageQueue.registerRequest(vscode_languageserver_1.ExecuteCommandRequest.type, (params) => __awaiter(void 0, void 0, void 0, function* () {
+    let workspaceChange;
+    if (params.command === CommandIds.applyAutoFix) {
+        let identifier = params.arguments[0];
+        if (!identifier.uri.startsWith('file:')) {
+            return {};
+        }
+        let textDocument = documents.get(identifier.uri);
+        let settings = yield Promise.resolve(resolveSettings(textDocument));
+        let edits = util_1.getAllFixEdits(textDocument, settings);
+        if (edits && edits.length) {
+            workspaceChange = new vscode_languageserver_1.WorkspaceChange();
+            let textChange = workspaceChange.getTextEditChange(identifier);
+            edits.forEach(edit => textChange.add(edit));
+        }
+    }
+    else {
+        if ([CommandIds.applySingleFix, CommandIds.applyDisableLine, CommandIds.applyDisableFile].indexOf(params.command) !== -1) {
+            let ruleId = params.arguments[0];
+            workspaceChange = commands.get(`${params.command}:${ruleId}`);
+        }
+        else if (params.command === CommandIds.openRuleDoc) {
+            let ruleId = params.arguments[0];
+            let url = ruleDocData.urls.get(ruleId);
+            if (url) {
+                yield connection.sendRequest(OpenESLintDocRequest.type, { url });
+            }
+        }
+        else {
+            workspaceChange = commands.get(params.command);
+        }
+    }
+    if (!workspaceChange) {
+        return {};
+    }
+    try {
+        let response = yield Promise.resolve(connection.workspace.applyEdit(workspaceChange.edit));
+        if (!response.applied) {
+            connection.console.error(`Failed to apply command: ${params.command}`);
+        }
+    }
+    catch (e) {
+        connection.console.error(`Failed to apply command: ${params.command}`);
+    }
+    return {};
+}), (params) => {
+    if (params.command === CommandIds.applyAutoFix) {
+        let identifier = params.arguments[0];
+        return identifier.version;
+    }
+    else {
+        return undefined;
+    }
+});
+connection.tracer.connection.listen();
+
+
+/***/ }),
+/* 37 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/* --------------------------------------------------------------------------------------------\r
+ * Copyright (c) Microsoft Corporation. All rights reserved.\r
+ * Licensed under the MIT License. See License.txt in the project root for license information.\r
+ * ------------------------------------------------------------------------------------------ */\r
+/// <reference path="../typings/thenable.d.ts" />\r
+\r
+function __export(m) {\r
+    for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r
+}\r
+Object.defineProperty(exports, "__esModule", { value: true });\r
+const vscode_languageserver_protocol_1 = __webpack_require__(4);\r
+exports.Event = vscode_languageserver_protocol_1.Event;\r
+const configuration_1 = __webpack_require__(38);\r
+const workspaceFolders_1 = __webpack_require__(40);\r
+const progress_1 = __webpack_require__(41);\r
+const Is = __webpack_require__(39);\r
+const UUID = __webpack_require__(42);\r
+// ------------- Reexport the API surface of the language worker API ----------------------\r
+__export(__webpack_require__(4));\r
+const fm = __webpack_require__(43);\r
+var Files;\r
+(function (Files) {\r
+    Files.uriToFilePath = fm.uriToFilePath;\r
+    Files.resolveGlobalNodePath = fm.resolveGlobalNodePath;\r
+    Files.resolveGlobalYarnPath = fm.resolveGlobalYarnPath;\r
+    Files.resolve = fm.resolve;\r
+    Files.resolveModulePath = fm.resolveModulePath;\r
+})(Files = exports.Files || (exports.Files = {}));\r
+let shutdownReceived = false;\r
+let exitTimer = undefined;\r
+function setupExitTimer() {\r
+    const argName = '--clientProcessId';\r
+    function runTimer(value) {\r
+        try {\r
+            let processId = parseInt(value);\r
+            if (!isNaN(processId)) {\r
+                exitTimer = setInterval(() => {\r
+                    try {\r
+                        process.kill(processId, 0);\r
+                    }\r
+                    catch (ex) {\r
+                        // Parent process doesn't exist anymore. Exit the server.\r
+                        process.exit(shutdownReceived ? 0 : 1);\r
+                    }\r
+                }, 3000);\r
+            }\r
+        }\r
+        catch (e) {\r
+            // Ignore errors;\r
+        }\r
+    }\r
+    for (let i = 2; i < process.argv.length; i++) {\r
+        let arg = process.argv[i];\r
+        if (arg === argName && i + 1 < process.argv.length) {\r
+            runTimer(process.argv[i + 1]);\r
+            return;\r
+        }\r
+        else {\r
+            let args = arg.split('=');\r
+            if (args[0] === argName) {\r
+                runTimer(args[1]);\r
+            }\r
+        }\r
+    }\r
+}\r
+setupExitTimer();\r
+function null2Undefined(value) {\r
+    if (value === null) {\r
+        return void 0;\r
+    }\r
+    return value;\r
+}\r
+/**\r
+ * A manager for simple text documents\r
+ */\r
+class TextDocuments {\r
+    /**\r
+     * Create a new text document manager.\r
+     */\r
+    constructor(configuration) {\r
+        this._documents = Object.create(null);\r
+        this._configuration = configuration;\r
+        this._onDidChangeContent = new vscode_languageserver_protocol_1.Emitter();\r
+        this._onDidOpen = new vscode_languageserver_protocol_1.Emitter();\r
+        this._onDidClose = new vscode_languageserver_protocol_1.Emitter();\r
+        this._onDidSave = new vscode_languageserver_protocol_1.Emitter();\r
+        this._onWillSave = new vscode_languageserver_protocol_1.Emitter();\r
+    }\r
+    /**\r
+     * An event that fires when a text document managed by this manager\r
+     * has been opened or the content changes.\r
+     */\r
+    get onDidChangeContent() {\r
+        return this._onDidChangeContent.event;\r
+    }\r
+    /**\r
+     * An event that fires when a text document managed by this manager\r
+     * has been opened.\r
+     */\r
+    get onDidOpen() {\r
+        return this._onDidOpen.event;\r
+    }\r
+    /**\r
+     * An event that fires when a text document managed by this manager\r
+     * will be saved.\r
+     */\r
+    get onWillSave() {\r
+        return this._onWillSave.event;\r
+    }\r
+    /**\r
+     * Sets a handler that will be called if a participant wants to provide\r
+     * edits during a text document save.\r
+     */\r
+    onWillSaveWaitUntil(handler) {\r
+        this._willSaveWaitUntil = handler;\r
+    }\r
+    /**\r
+     * An event that fires when a text document managed by this manager\r
+     * has been saved.\r
+     */\r
+    get onDidSave() {\r
+        return this._onDidSave.event;\r
+    }\r
+    /**\r
+     * An event that fires when a text document managed by this manager\r
+     * has been closed.\r
+     */\r
+    get onDidClose() {\r
+        return this._onDidClose.event;\r
+    }\r
+    /**\r
+     * Returns the document for the given URI. Returns undefined if\r
+     * the document is not mananged by this instance.\r
+     *\r
+     * @param uri The text document's URI to retrieve.\r
+     * @return the text document or `undefined`.\r
+     */\r
+    get(uri) {\r
+        return this._documents[uri];\r
+    }\r
+    /**\r
+     * Returns all text documents managed by this instance.\r
+     *\r
+     * @return all text documents.\r
+     */\r
+    all() {\r
+        return Object.keys(this._documents).map(key => this._documents[key]);\r
+    }\r
+    /**\r
+     * Returns the URIs of all text documents managed by this instance.\r
+     *\r
+     * @return the URI's of all text documents.\r
+     */\r
+    keys() {\r
+        return Object.keys(this._documents);\r
+    }\r
+    /**\r
+     * Listens for `low level` notification on the given connection to\r
+     * update the text documents managed by this instance.\r
+     *\r
+     * @param connection The connection to listen on.\r
+     */\r
+    listen(connection) {\r
+        connection.__textDocumentSync = vscode_languageserver_protocol_1.TextDocumentSyncKind.Full;\r
+        connection.onDidOpenTextDocument((event) => {\r
+            let td = event.textDocument;\r
+            let document = this._configuration.create(td.uri, td.languageId, td.version, td.text);\r
+            this._documents[td.uri] = document;\r
+            let toFire = Object.freeze({ document });\r
+            this._onDidOpen.fire(toFire);\r
+            this._onDidChangeContent.fire(toFire);\r
+        });\r
+        connection.onDidChangeTextDocument((event) => {\r
+            let td = event.textDocument;\r
+            let changes = event.contentChanges;\r
+            if (changes.length === 0) {\r
+                return;\r
+            }\r
+            let document = this._documents[td.uri];\r
+            const { version } = td;\r
+            if (version === null || version === void 0) {\r
+                throw new Error(`Received document change event for ${td.uri} without valid version identifier`);\r
+            }\r
+            document = this._configuration.update(document, changes, version);\r
+            this._documents[td.uri] = document;\r
+            this._onDidChangeContent.fire(Object.freeze({ document }));\r
+        });\r
+        connection.onDidCloseTextDocument((event) => {\r
+            let document = this._documents[event.textDocument.uri];\r
+            if (document) {\r
+                delete this._documents[event.textDocument.uri];\r
+                this._onDidClose.fire(Object.freeze({ document }));\r
+            }\r
+        });\r
+        connection.onWillSaveTextDocument((event) => {\r
+            let document = this._documents[event.textDocument.uri];\r
+            if (document) {\r
+                this._onWillSave.fire(Object.freeze({ document, reason: event.reason }));\r
+            }\r
+        });\r
+        connection.onWillSaveTextDocumentWaitUntil((event, token) => {\r
+            let document = this._documents[event.textDocument.uri];\r
+            if (document && this._willSaveWaitUntil) {\r
+                return this._willSaveWaitUntil(Object.freeze({ document, reason: event.reason }), token);\r
+            }\r
+            else {\r
+                return [];\r
+            }\r
+        });\r
+        connection.onDidSaveTextDocument((event) => {\r
+            let document = this._documents[event.textDocument.uri];\r
+            if (document) {\r
+                this._onDidSave.fire(Object.freeze({ document }));\r
+            }\r
+        });\r
+    }\r
+}\r
+exports.TextDocuments = TextDocuments;\r
+/**\r
+ * Helps tracking error message. Equal occurences of the same\r
+ * message are only stored once. This class is for example\r
+ * useful if text documents are validated in a loop and equal\r
+ * error message should be folded into one.\r
+ */\r
+class ErrorMessageTracker {\r
+    constructor() {\r
+        this._messages = Object.create(null);\r
+    }\r
+    /**\r
+     * Add a message to the tracker.\r
+     *\r
+     * @param message The message to add.\r
+     */\r
+    add(message) {\r
+        let count = this._messages[message];\r
+        if (!count) {\r
+            count = 0;\r
+        }\r
+        count++;\r
+        this._messages[message] = count;\r
+    }\r
+    /**\r
+     * Send all tracked messages to the connection's window.\r
+     *\r
+     * @param connection The connection established between client and server.\r
+     */\r
+    sendErrors(connection) {\r
+        Object.keys(this._messages).forEach(message => {\r
+            connection.window.showErrorMessage(message);\r
+        });\r
+    }\r
+}\r
+exports.ErrorMessageTracker = ErrorMessageTracker;\r
+var BulkRegistration;\r
+(function (BulkRegistration) {\r
+    /**\r
+     * Creates a new bulk registration.\r
+     * @return an empty bulk registration.\r
+     */\r
+    function create() {\r
+        return new BulkRegistrationImpl();\r
+    }\r
+    BulkRegistration.create = create;\r
+})(BulkRegistration = exports.BulkRegistration || (exports.BulkRegistration = {}));\r
+class BulkRegistrationImpl {\r
+    constructor() {\r
+        this._registrations = [];\r
+        this._registered = new Set();\r
+    }\r
+    add(type, registerOptions) {\r
+        const method = Is.string(type) ? type : type.method;\r
+        if (this._registered.has(method)) {\r
+            throw new Error(`${method} is already added to this registration`);\r
+        }\r
+        const id = UUID.generateUuid();\r
+        this._registrations.push({\r
+            id: id,\r
+            method: method,\r
+            registerOptions: registerOptions || {}\r
+        });\r
+        this._registered.add(method);\r
+    }\r
+    asRegistrationParams() {\r
+        return {\r
+            registrations: this._registrations\r
+        };\r
+    }\r
+}\r
+var BulkUnregistration;\r
+(function (BulkUnregistration) {\r
+    function create() {\r
+        return new BulkUnregistrationImpl(undefined, []);\r
+    }\r
+    BulkUnregistration.create = create;\r
+})(BulkUnregistration = exports.BulkUnregistration || (exports.BulkUnregistration = {}));\r
+class BulkUnregistrationImpl {\r
+    constructor(_connection, unregistrations) {\r
+        this._connection = _connection;\r
+        this._unregistrations = new Map();\r
+        unregistrations.forEach(unregistration => {\r
+            this._unregistrations.set(unregistration.method, unregistration);\r
+        });\r
+    }\r
+    get isAttached() {\r
+        return !!this._connection;\r
+    }\r
+    attach(connection) {\r
+        this._connection = connection;\r
+    }\r
+    add(unregistration) {\r
+        this._unregistrations.set(unregistration.method, unregistration);\r
+    }\r
+    dispose() {\r
+        let unregistrations = [];\r
+        for (let unregistration of this._unregistrations.values()) {\r
+            unregistrations.push(unregistration);\r
+        }\r
+        let params = {\r
+            unregisterations: unregistrations\r
+        };\r
+        this._connection.sendRequest(vscode_languageserver_protocol_1.UnregistrationRequest.type, params).then(undefined, (_error) => {\r
+            this._connection.console.info(`Bulk unregistration failed.`);\r
+        });\r
+    }\r
+    disposeSingle(arg) {\r
+        const method = Is.string(arg) ? arg : arg.method;\r
+        const unregistration = this._unregistrations.get(method);\r
+        if (!unregistration) {\r
+            return false;\r
+        }\r
+        let params = {\r
+            unregisterations: [unregistration]\r
+        };\r
+        this._connection.sendRequest(vscode_languageserver_protocol_1.UnregistrationRequest.type, params).then(() => {\r
+            this._unregistrations.delete(method);\r
+        }, (_error) => {\r
+            this._connection.console.info(`Unregistering request handler for ${unregistration.id} failed.`);\r
+        });\r
+        return true;\r
+    }\r
+}\r
+class ConnectionLogger {\r
+    constructor() {\r
+    }\r
+    rawAttach(connection) {\r
+        this._rawConnection = connection;\r
+    }\r
+    attach(connection) {\r
+        this._connection = connection;\r
+    }\r
+    get connection() {\r
+        if (!this._connection) {\r
+            throw new Error('Remote is not attached to a connection yet.');\r
+        }\r
+        return this._connection;\r
+    }\r
+    fillServerCapabilities(_capabilities) {\r
+    }\r
+    initialize(_capabilities) {\r
+    }\r
+    error(message) {\r
+        this.send(vscode_languageserver_protocol_1.MessageType.Error, message);\r
+    }\r
+    warn(message) {\r
+        this.send(vscode_languageserver_protocol_1.MessageType.Warning, message);\r
+    }\r
+    info(message) {\r
+        this.send(vscode_languageserver_protocol_1.MessageType.Info, message);\r
+    }\r
+    log(message) {\r
+        this.send(vscode_languageserver_protocol_1.MessageType.Log, message);\r
+    }\r
+    send(type, message) {\r
+        if (this._rawConnection) {\r
+            this._rawConnection.sendNotification(vscode_languageserver_protocol_1.LogMessageNotification.type, { type, message });\r
+        }\r
+    }\r
+}\r
+class _RemoteWindowImpl {\r
+    constructor() {\r
+    }\r
+    attach(connection) {\r
+        this._connection = connection;\r
+    }\r
+    get connection() {\r
+        if (!this._connection) {\r
+            throw new Error('Remote is not attached to a connection yet.');\r
+        }\r
+        return this._connection;\r
+    }\r
+    initialize(_capabilities) {\r
+    }\r
+    fillServerCapabilities(_capabilities) {\r
+    }\r
+    showErrorMessage(message, ...actions) {\r
+        let params = { type: vscode_languageserver_protocol_1.MessageType.Error, message, actions };\r
+        return this._connection.sendRequest(vscode_languageserver_protocol_1.ShowMessageRequest.type, params).then(null2Undefined);\r
+    }\r
+    showWarningMessage(message, ...actions) {\r
+        let params = { type: vscode_languageserver_protocol_1.MessageType.Warning, message, actions };\r
+        return this._connection.sendRequest(vscode_languageserver_protocol_1.ShowMessageRequest.type, params).then(null2Undefined);\r
+    }\r
+    showInformationMessage(message, ...actions) {\r
+        let params = { type: vscode_languageserver_protocol_1.MessageType.Info, message, actions };\r
+        return this._connection.sendRequest(vscode_languageserver_protocol_1.ShowMessageRequest.type, params).then(null2Undefined);\r
+    }\r
+}\r
+const RemoteWindowImpl = progress_1.ProgressFeature(_RemoteWindowImpl);\r
+class RemoteClientImpl {\r
+    attach(connection) {\r
+        this._connection = connection;\r
+    }\r
+    get connection() {\r
+        if (!this._connection) {\r
+            throw new Error('Remote is not attached to a connection yet.');\r
+        }\r
+        return this._connection;\r
+    }\r
+    initialize(_capabilities) {\r
+    }\r
+    fillServerCapabilities(_capabilities) {\r
+    }\r
+    register(typeOrRegistrations, registerOptionsOrType, registerOptions) {\r
+        if (typeOrRegistrations instanceof BulkRegistrationImpl) {\r
+            return this.registerMany(typeOrRegistrations);\r
+        }\r
+        else if (typeOrRegistrations instanceof BulkUnregistrationImpl) {\r
+            return this.registerSingle1(typeOrRegistrations, registerOptionsOrType, registerOptions);\r
+        }\r
+        else {\r
+            return this.registerSingle2(typeOrRegistrations, registerOptionsOrType);\r
+        }\r
+    }\r
+    registerSingle1(unregistration, type, registerOptions) {\r
+        const method = Is.string(type) ? type : type.method;\r
+        const id = UUID.generateUuid();\r
+        let params = {\r
+            registrations: [{ id, method, registerOptions: registerOptions || {} }]\r
+        };\r
+        if (!unregistration.isAttached) {\r
+            unregistration.attach(this._connection);\r
+        }\r
+        return this._connection.sendRequest(vscode_languageserver_protocol_1.RegistrationRequest.type, params).then((_result) => {\r
+            unregistration.add({ id: id, method: method });\r
+            return unregistration;\r
+        }, (_error) => {\r
+            this.connection.console.info(`Registering request handler for ${method} failed.`);\r
+            return Promise.reject(_error);\r
+        });\r
+    }\r
+    registerSingle2(type, registerOptions) {\r
+        const method = Is.string(type) ? type : type.method;\r
+        const id = UUID.generateUuid();\r
+        let params = {\r
+            registrations: [{ id, method, registerOptions: registerOptions || {} }]\r
+        };\r
+        return this._connection.sendRequest(vscode_languageserver_protocol_1.RegistrationRequest.type, params).then((_result) => {\r
+            return vscode_languageserver_protocol_1.Disposable.create(() => {\r
+                this.unregisterSingle(id, method);\r
+            });\r
+        }, (_error) => {\r
+            this.connection.console.info(`Registering request handler for ${method} failed.`);\r
+            return Promise.reject(_error);\r
+        });\r
+    }\r
+    unregisterSingle(id, method) {\r
+        let params = {\r
+            unregisterations: [{ id, method }]\r
+        };\r
+        return this._connection.sendRequest(vscode_languageserver_protocol_1.UnregistrationRequest.type, params).then(undefined, (_error) => {\r
+            this.connection.console.info(`Unregistering request handler for ${id} failed.`);\r
+        });\r
+    }\r
+    registerMany(registrations) {\r
+        let params = registrations.asRegistrationParams();\r
+        return this._connection.sendRequest(vscode_languageserver_protocol_1.RegistrationRequest.type, params).then(() => {\r
+            return new BulkUnregistrationImpl(this._connection, params.registrations.map(registration => { return { id: registration.id, method: registration.method }; }));\r
+        }, (_error) => {\r
+            this.connection.console.info(`Bulk registration failed.`);\r
+            return Promise.reject(_error);\r
+        });\r
+    }\r
+}\r
+class _RemoteWorkspaceImpl {\r
+    constructor() {\r
+    }\r
+    attach(connection) {\r
+        this._connection = connection;\r
+    }\r
+    get connection() {\r
+        if (!this._connection) {\r
+            throw new Error('Remote is not attached to a connection yet.');\r
+        }\r
+        return this._connection;\r
+    }\r
+    initialize(_capabilities) {\r
+    }\r
+    fillServerCapabilities(_capabilities) {\r
+    }\r
+    applyEdit(paramOrEdit) {\r
+        function isApplyWorkspaceEditParams(value) {\r
+            return value && !!value.edit;\r
+        }\r
+        let params = isApplyWorkspaceEditParams(paramOrEdit) ? paramOrEdit : { edit: paramOrEdit };\r
+        return this._connection.sendRequest(vscode_languageserver_protocol_1.ApplyWorkspaceEditRequest.type, params);\r
+    }\r
+}\r
+const RemoteWorkspaceImpl = workspaceFolders_1.WorkspaceFoldersFeature(configuration_1.ConfigurationFeature(_RemoteWorkspaceImpl));\r
+class TracerImpl {\r
+    constructor() {\r
+        this._trace = vscode_languageserver_protocol_1.Trace.Off;\r
+    }\r
+    attach(connection) {\r
+        this._connection = connection;\r
+    }\r
+    get connection() {\r
+        if (!this._connection) {\r
+            throw new Error('Remote is not attached to a connection yet.');\r
+        }\r
+        return this._connection;\r
+    }\r
+    initialize(_capabilities) {\r
+    }\r
+    fillServerCapabilities(_capabilities) {\r
+    }\r
+    set trace(value) {\r
+        this._trace = value;\r
+    }\r
+    log(message, verbose) {\r
+        if (this._trace === vscode_languageserver_protocol_1.Trace.Off) {\r
+            return;\r
+        }\r
+        this._connection.sendNotification(vscode_languageserver_protocol_1.LogTraceNotification.type, {\r
+            message: message,\r
+            verbose: this._trace === vscode_languageserver_protocol_1.Trace.Verbose ? verbose : undefined\r
+        });\r
+    }\r
+}\r
+class TelemetryImpl {\r
+    constructor() {\r
+    }\r
+    attach(connection) {\r
+        this._connection = connection;\r
+    }\r
+    get connection() {\r
+        if (!this._connection) {\r
+            throw new Error('Remote is not attached to a connection yet.');\r
+        }\r
+        return this._connection;\r
+    }\r
+    initialize(_capabilities) {\r
+    }\r
+    fillServerCapabilities(_capabilities) {\r
+    }\r
+    logEvent(data) {\r
+        this._connection.sendNotification(vscode_languageserver_protocol_1.TelemetryEventNotification.type, data);\r
+    }\r
+}\r
+function combineConsoleFeatures(one, two) {\r
+    return function (Base) {\r
+        return two(one(Base));\r
+    };\r
+}\r
+exports.combineConsoleFeatures = combineConsoleFeatures;\r
+function combineTelemetryFeatures(one, two) {\r
+    return function (Base) {\r
+        return two(one(Base));\r
+    };\r
+}\r
+exports.combineTelemetryFeatures = combineTelemetryFeatures;\r
+function combineTracerFeatures(one, two) {\r
+    return function (Base) {\r
+        return two(one(Base));\r
+    };\r
+}\r
+exports.combineTracerFeatures = combineTracerFeatures;\r
+function combineClientFeatures(one, two) {\r
+    return function (Base) {\r
+        return two(one(Base));\r
+    };\r
+}\r
+exports.combineClientFeatures = combineClientFeatures;\r
+function combineWindowFeatures(one, two) {\r
+    return function (Base) {\r
+        return two(one(Base));\r
+    };\r
+}\r
+exports.combineWindowFeatures = combineWindowFeatures;\r
+function combineWorkspaceFeatures(one, two) {\r
+    return function (Base) {\r
+        return two(one(Base));\r
+    };\r
+}\r
+exports.combineWorkspaceFeatures = combineWorkspaceFeatures;\r
+function combineFeatures(one, two) {\r
+    function combine(one, two, func) {\r
+        if (one && two) {\r
+            return func(one, two);\r
+        }\r
+        else if (one) {\r
+            return one;\r
+        }\r
+        else {\r
+            return two;\r
+        }\r
+    }\r
+    let result = {\r
+        __brand: 'features',\r
+        console: combine(one.console, two.console, combineConsoleFeatures),\r
+        tracer: combine(one.tracer, two.tracer, combineTracerFeatures),\r
+        telemetry: combine(one.telemetry, two.telemetry, combineTelemetryFeatures),\r
+        client: combine(one.client, two.client, combineClientFeatures),\r
+        window: combine(one.window, two.window, combineWindowFeatures),\r
+        workspace: combine(one.workspace, two.workspace, combineWorkspaceFeatures)\r
+    };\r
+    return result;\r
+}\r
+exports.combineFeatures = combineFeatures;\r
+function createConnection(arg1, arg2, arg3, arg4) {\r
+    let factories;\r
+    let input;\r
+    let output;\r
+    let strategy;\r
+    if (arg1 !== void 0 && arg1.__brand === 'features') {\r
+        factories = arg1;\r
+        arg1 = arg2;\r
+        arg2 = arg3;\r
+        arg3 = arg4;\r
+    }\r
+    if (vscode_languageserver_protocol_1.ConnectionStrategy.is(arg1)) {\r
+        strategy = arg1;\r
+    }\r
+    else {\r
+        input = arg1;\r
+        output = arg2;\r
+        strategy = arg3;\r
+    }\r
+    return _createConnection(input, output, strategy, factories);\r
+}\r
+exports.createConnection = createConnection;\r
+function _createConnection(input, output, strategy, factories) {\r
+    if (!input && !output && process.argv.length > 2) {\r
+        let port = void 0;\r
+        let pipeName = void 0;\r
+        let argv = process.argv.slice(2);\r
+        for (let i = 0; i < argv.length; i++) {\r
+            let arg = argv[i];\r
+            if (arg === '--node-ipc') {\r
+                input = new vscode_languageserver_protocol_1.IPCMessageReader(process);\r
+                output = new vscode_languageserver_protocol_1.IPCMessageWriter(process);\r
+                break;\r
+            }\r
+            else if (arg === '--stdio') {\r
+                input = process.stdin;\r
+                output = process.stdout;\r
+                break;\r
+            }\r
+            else if (arg === '--socket') {\r
+                port = parseInt(argv[i + 1]);\r
+                break;\r
+            }\r
+            else if (arg === '--pipe') {\r
+                pipeName = argv[i + 1];\r
+                break;\r
+            }\r
+            else {\r
+                var args = arg.split('=');\r
+                if (args[0] === '--socket') {\r
+                    port = parseInt(args[1]);\r
+                    break;\r
+                }\r
+                else if (args[0] === '--pipe') {\r
+                    pipeName = args[1];\r
+                    break;\r
+                }\r
+            }\r
+        }\r
+        if (port) {\r
+            let transport = vscode_languageserver_protocol_1.createServerSocketTransport(port);\r
+            input = transport[0];\r
+            output = transport[1];\r
+        }\r
+        else if (pipeName) {\r
+            let transport = vscode_languageserver_protocol_1.createServerPipeTransport(pipeName);\r
+            input = transport[0];\r
+            output = transport[1];\r
+        }\r
+    }\r
+    var commandLineMessage = 'Use arguments of createConnection or set command line parameters: \'--node-ipc\', \'--stdio\' or \'--socket={number}\'';\r
+    if (!input) {\r
+        throw new Error('Connection input stream is not set. ' + commandLineMessage);\r
+    }\r
+    if (!output) {\r
+        throw new Error('Connection output stream is not set. ' + commandLineMessage);\r
+    }\r
+    // Backwards compatibility\r
+    if (Is.func(input.read) && Is.func(input.on)) {\r
+        let inputStream = input;\r
+        inputStream.on('end', () => {\r
+            process.exit(shutdownReceived ? 0 : 1);\r
+        });\r
+        inputStream.on('close', () => {\r
+            process.exit(shutdownReceived ? 0 : 1);\r
+        });\r
+    }\r
+    const logger = (factories && factories.console ? new (factories.console(ConnectionLogger))() : new ConnectionLogger());\r
+    const connection = vscode_languageserver_protocol_1.createProtocolConnection(input, output, logger, strategy);\r
+    logger.rawAttach(connection);\r
+    const tracer = (factories && factories.tracer ? new (factories.tracer(TracerImpl))() : new TracerImpl());\r
+    const telemetry = (factories && factories.telemetry ? new (factories.telemetry(TelemetryImpl))() : new TelemetryImpl());\r
+    const client = (factories && factories.client ? new (factories.client(RemoteClientImpl))() : new RemoteClientImpl());\r
+    const remoteWindow = (factories && factories.window ? new (factories.window(RemoteWindowImpl))() : new RemoteWindowImpl());\r
+    const workspace = (factories && factories.workspace ? new (factories.workspace(RemoteWorkspaceImpl))() : new RemoteWorkspaceImpl());\r
+    const allRemotes = [logger, tracer, telemetry, client, remoteWindow, workspace];\r
+    function asPromise(value) {\r
+        if (value instanceof Promise) {\r
+            return value;\r
+        }\r
+        else if (Is.thenable(value)) {\r
+            return new Promise((resolve, reject) => {\r
+                value.then((resolved) => resolve(resolved), (error) => reject(error));\r
+            });\r
+        }\r
+        else {\r
+            return Promise.resolve(value);\r
+        }\r
+    }\r
+    let shutdownHandler = undefined;\r
+    let initializeHandler = undefined;\r
+    let exitHandler = undefined;\r
+    let protocolConnection = {\r
+        listen: () => connection.listen(),\r
+        sendRequest: (type, ...params) => connection.sendRequest(Is.string(type) ? type : type.method, ...params),\r
+        onRequest: (type, handler) => connection.onRequest(type, handler),\r
+        sendNotification: (type, param) => {\r
+            const method = Is.string(type) ? type : type.method;\r
+            if (arguments.length === 1) {\r
+                connection.sendNotification(method);\r
+            }\r
+            else {\r
+                connection.sendNotification(method, param);\r
+            }\r
+        },\r
+        onNotification: (type, handler) => connection.onNotification(type, handler),\r
+        onProgress: connection.onProgress,\r
+        sendProgress: connection.sendProgress,\r
+        onInitialize: (handler) => initializeHandler = handler,\r
+        onInitialized: (handler) => connection.onNotification(vscode_languageserver_protocol_1.InitializedNotification.type, handler),\r
+        onShutdown: (handler) => shutdownHandler = handler,\r
+        onExit: (handler) => exitHandler = handler,\r
+        get console() { return logger; },\r
+        get telemetry() { return telemetry; },\r
+        get tracer() { return tracer; },\r
+        get client() { return client; },\r
+        get window() { return remoteWindow; },\r
+        get workspace() { return workspace; },\r
+        onDidChangeConfiguration: (handler) => connection.onNotification(vscode_languageserver_protocol_1.DidChangeConfigurationNotification.type, handler),\r
+        onDidChangeWatchedFiles: (handler) => connection.onNotification(vscode_languageserver_protocol_1.DidChangeWatchedFilesNotification.type, handler),\r
+        __textDocumentSync: undefined,\r
+        onDidOpenTextDocument: (handler) => connection.onNotification(vscode_languageserver_protocol_1.DidOpenTextDocumentNotification.type, handler),\r
+        onDidChangeTextDocument: (handler) => connection.onNotification(vscode_languageserver_protocol_1.DidChangeTextDocumentNotification.type, handler),\r
+        onDidCloseTextDocument: (handler) => connection.onNotification(vscode_languageserver_protocol_1.DidCloseTextDocumentNotification.type, handler),\r
+        onWillSaveTextDocument: (handler) => connection.onNotification(vscode_languageserver_protocol_1.WillSaveTextDocumentNotification.type, handler),\r
+        onWillSaveTextDocumentWaitUntil: (handler) => connection.onRequest(vscode_languageserver_protocol_1.WillSaveTextDocumentWaitUntilRequest.type, handler),\r
+        onDidSaveTextDocument: (handler) => connection.onNotification(vscode_languageserver_protocol_1.DidSaveTextDocumentNotification.type, handler),\r
+        sendDiagnostics: (params) => connection.sendNotification(vscode_languageserver_protocol_1.PublishDiagnosticsNotification.type, params),\r
+        onHover: (handler) => connection.onRequest(vscode_languageserver_protocol_1.HoverRequest.type, (params, cancel) => {\r
+            return handler(params, cancel, progress_1.attachWorkDone(connection, params), undefined);\r
+        }),\r
+        onCompletion: (handler) => connection.onRequest(vscode_languageserver_protocol_1.CompletionRequest.type, (params, cancel) => {\r
+            return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));\r
+        }),\r
+        onCompletionResolve: (handler) => connection.onRequest(vscode_languageserver_protocol_1.CompletionResolveRequest.type, handler),\r
+        onSignatureHelp: (handler) => connection.onRequest(vscode_languageserver_protocol_1.SignatureHelpRequest.type, (params, cancel) => {\r
+            return handler(params, cancel, progress_1.attachWorkDone(connection, params), undefined);\r
+        }),\r
+        onDeclaration: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DeclarationRequest.type, (params, cancel) => {\r
+            return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));\r
+        }),\r
+        onDefinition: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DefinitionRequest.type, (params, cancel) => {\r
+            return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));\r
+        }),\r
+        onTypeDefinition: (handler) => connection.onRequest(vscode_languageserver_protocol_1.TypeDefinitionRequest.type, (params, cancel) => {\r
+            return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));\r
+        }),\r
+        onImplementation: (handler) => connection.onRequest(vscode_languageserver_protocol_1.ImplementationRequest.type, (params, cancel) => {\r
+            return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));\r
+        }),\r
+        onReferences: (handler) => connection.onRequest(vscode_languageserver_protocol_1.ReferencesRequest.type, (params, cancel) => {\r
+            return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));\r
+        }),\r
+        onDocumentHighlight: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DocumentHighlightRequest.type, (params, cancel) => {\r
+            return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));\r
+        }),\r
+        onDocumentSymbol: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DocumentSymbolRequest.type, (params, cancel) => {\r
+            return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));\r
+        }),\r
+        onWorkspaceSymbol: (handler) => connection.onRequest(vscode_languageserver_protocol_1.WorkspaceSymbolRequest.type, (params, cancel) => {\r
+            return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));\r
+        }),\r
+        onCodeAction: (handler) => connection.onRequest(vscode_languageserver_protocol_1.CodeActionRequest.type, (params, cancel) => {\r
+            return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));\r
+        }),\r
+        onCodeLens: (handler) => connection.onRequest(vscode_languageserver_protocol_1.CodeLensRequest.type, (params, cancel) => {\r
+            return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));\r
+        }),\r
+        onCodeLensResolve: (handler) => connection.onRequest(vscode_languageserver_protocol_1.CodeLensResolveRequest.type, handler),\r
+        onDocumentFormatting: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DocumentFormattingRequest.type, (params, cancel) => {\r
+            return handler(params, cancel, progress_1.attachWorkDone(connection, params), undefined);\r
+        }),\r
+        onDocumentRangeFormatting: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DocumentRangeFormattingRequest.type, (params, cancel) => {\r
+            return handler(params, cancel, progress_1.attachWorkDone(connection, params), undefined);\r
+        }),\r
+        onDocumentOnTypeFormatting: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DocumentOnTypeFormattingRequest.type, handler),\r
+        onRenameRequest: (handler) => connection.onRequest(vscode_languageserver_protocol_1.RenameRequest.type, (params, cancel) => {\r
+            return handler(params, cancel, progress_1.attachWorkDone(connection, params), undefined);\r
+        }),\r
+        onPrepareRename: (handler) => connection.onRequest(vscode_languageserver_protocol_1.PrepareRenameRequest.type, (params, cancel) => {\r
+            return handler(params, cancel, progress_1.attachWorkDone(connection, params), undefined);\r
+        }),\r
+        onDocumentLinks: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DocumentLinkRequest.type, (params, cancel) => {\r
+            return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));\r
+        }),\r
+        onDocumentLinkResolve: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DocumentLinkResolveRequest.type, handler),\r
+        onDocumentColor: (handler) => connection.onRequest(vscode_languageserver_protocol_1.DocumentColorRequest.type, (params, cancel) => {\r
+            return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));\r
+        }),\r
+        onColorPresentation: (handler) => connection.onRequest(vscode_languageserver_protocol_1.ColorPresentationRequest.type, (params, cancel) => {\r
+            return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));\r
+        }),\r
+        onFoldingRanges: (handler) => connection.onRequest(vscode_languageserver_protocol_1.FoldingRangeRequest.type, (params, cancel) => {\r
+            return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));\r
+        }),\r
+        onSelectionRanges: (handler) => connection.onRequest(vscode_languageserver_protocol_1.SelectionRangeRequest.type, (params, cancel) => {\r
+            return handler(params, cancel, progress_1.attachWorkDone(connection, params), progress_1.attachPartialResult(connection, params));\r
+        }),\r
+        onExecuteCommand: (handler) => connection.onRequest(vscode_languageserver_protocol_1.ExecuteCommandRequest.type, (params, cancel) => {\r
+            return handler(params, cancel, progress_1.attachWorkDone(connection, params), undefined);\r
+        }),\r
+        dispose: () => connection.dispose()\r
+    };\r
+    for (let remote of allRemotes) {\r
+        remote.attach(protocolConnection);\r
+    }\r
+    connection.onRequest(vscode_languageserver_protocol_1.InitializeRequest.type, (params) => {\r
+        const processId = params.processId;\r
+        if (Is.number(processId) && exitTimer === void 0) {\r
+            // We received a parent process id. Set up a timer to periodically check\r
+            // if the parent is still alive.\r
+            setInterval(() => {\r
+                try {\r
+                    process.kill(processId, 0);\r
+                }\r
+                catch (ex) {\r
+                    // Parent process doesn't exist anymore. Exit the server.\r
+                    process.exit(shutdownReceived ? 0 : 1);\r
+                }\r
+            }, 3000);\r
+        }\r
+        if (Is.string(params.trace)) {\r
+            tracer.trace = vscode_languageserver_protocol_1.Trace.fromString(params.trace);\r
+        }\r
+        for (let remote of allRemotes) {\r
+            remote.initialize(params.capabilities);\r
+        }\r
+        if (initializeHandler) {\r
+            let result = initializeHandler(params, new vscode_languageserver_protocol_1.CancellationTokenSource().token, progress_1.attachWorkDone(connection, params), undefined);\r
+            return asPromise(result).then((value) => {\r
+                if (value instanceof vscode_languageserver_protocol_1.ResponseError) {\r
+                    return value;\r
+                }\r
+                let result = value;\r
+                if (!result) {\r
+                    result = { capabilities: {} };\r
+                }\r
+                let capabilities = result.capabilities;\r
+                if (!capabilities) {\r
+                    capabilities = {};\r
+                    result.capabilities = capabilities;\r
+                }\r
+                if (capabilities.textDocumentSync === void 0 || capabilities.textDocumentSync === null) {\r
+                    capabilities.textDocumentSync = Is.number(protocolConnection.__textDocumentSync) ? protocolConnection.__textDocumentSync : vscode_languageserver_protocol_1.TextDocumentSyncKind.None;\r
+                }\r
+                else if (!Is.number(capabilities.textDocumentSync) && !Is.number(capabilities.textDocumentSync.change)) {\r
+                    capabilities.textDocumentSync.change = Is.number(protocolConnection.__textDocumentSync) ? protocolConnection.__textDocumentSync : vscode_languageserver_protocol_1.TextDocumentSyncKind.None;\r
+                }\r
+                for (let remote of allRemotes) {\r
+                    remote.fillServerCapabilities(capabilities);\r
+                }\r
+                return result;\r
+            });\r
+        }\r
+        else {\r
+            let result = { capabilities: { textDocumentSync: vscode_languageserver_protocol_1.TextDocumentSyncKind.None } };\r
+            for (let remote of allRemotes) {\r
+                remote.fillServerCapabilities(result.capabilities);\r
+            }\r
+            return result;\r
+        }\r
+    });\r
+    connection.onRequest(vscode_languageserver_protocol_1.ShutdownRequest.type, () => {\r
+        shutdownReceived = true;\r
+        if (shutdownHandler) {\r
+            return shutdownHandler(new vscode_languageserver_protocol_1.CancellationTokenSource().token);\r
+        }\r
+        else {\r
+            return undefined;\r
+        }\r
+    });\r
+    connection.onNotification(vscode_languageserver_protocol_1.ExitNotification.type, () => {\r
+        try {\r
+            if (exitHandler) {\r
+                exitHandler();\r
+            }\r
+        }\r
+        finally {\r
+            if (shutdownReceived) {\r
+                process.exit(0);\r
+            }\r
+            else {\r
+                process.exit(1);\r
+            }\r
+        }\r
+    });\r
+    connection.onNotification(vscode_languageserver_protocol_1.SetTraceNotification.type, (params) => {\r
+        tracer.trace = vscode_languageserver_protocol_1.Trace.fromString(params.value);\r
+    });\r
+    return protocolConnection;\r
+}\r
+// Export the protocol currently in proposed state.\r
+var ProposedFeatures;\r
+(function (ProposedFeatures) {\r
+    ProposedFeatures.all = {\r
+        __brand: 'features'\r
+    };\r
+})(ProposedFeatures = exports.ProposedFeatures || (exports.ProposedFeatures = {}));\r
+//# sourceMappingURL=main.js.map
+
+/***/ }),
+/* 38 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/* --------------------------------------------------------------------------------------------\r
+ * Copyright (c) Microsoft Corporation. All rights reserved.\r
+ * Licensed under the MIT License. See License.txt in the project root for license information.\r
+ * ------------------------------------------------------------------------------------------ */\r
+\r
+Object.defineProperty(exports, "__esModule", { value: true });\r
+const vscode_languageserver_protocol_1 = __webpack_require__(4);\r
+const Is = __webpack_require__(39);\r
+exports.ConfigurationFeature = (Base) => {\r
+    return class extends Base {\r
+        getConfiguration(arg) {\r
+            if (!arg) {\r
+                return this._getConfiguration({});\r
+            }\r
+            else if (Is.string(arg)) {\r
+                return this._getConfiguration({ section: arg });\r
+            }\r
+            else {\r
+                return this._getConfiguration(arg);\r
+            }\r
+        }\r
+        _getConfiguration(arg) {\r
+            let params = {\r
+                items: Array.isArray(arg) ? arg : [arg]\r
+            };\r
+            return this.connection.sendRequest(vscode_languageserver_protocol_1.ConfigurationRequest.type, params).then((result) => {\r
+                return Array.isArray(arg) ? result : result[0];\r
+            });\r
+        }\r
+    };\r
+};\r
+//# sourceMappingURL=configuration.js.map
+
+/***/ }),
+/* 39 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/* --------------------------------------------------------------------------------------------\r
+ * Copyright (c) Microsoft Corporation. All rights reserved.\r
+ * Licensed under the MIT License. See License.txt in the project root for license information.\r
+ * ------------------------------------------------------------------------------------------ */\r
+\r
+Object.defineProperty(exports, "__esModule", { value: true });\r
+function boolean(value) {\r
+    return value === true || value === false;\r
+}\r
+exports.boolean = boolean;\r
+function string(value) {\r
+    return typeof value === 'string' || value instanceof String;\r
+}\r
+exports.string = string;\r
+function number(value) {\r
+    return typeof value === 'number' || value instanceof Number;\r
+}\r
+exports.number = number;\r
+function error(value) {\r
+    return value instanceof Error;\r
+}\r
+exports.error = error;\r
+function func(value) {\r
+    return typeof value === 'function';\r
+}\r
+exports.func = func;\r
+function array(value) {\r
+    return Array.isArray(value);\r
+}\r
+exports.array = array;\r
+function stringArray(value) {\r
+    return array(value) && value.every(elem => string(elem));\r
+}\r
+exports.stringArray = stringArray;\r
+function typedArray(value, check) {\r
+    return Array.isArray(value) && value.every(check);\r
+}\r
+exports.typedArray = typedArray;\r
+function thenable(value) {\r
+    return value && func(value.then);\r
+}\r
+exports.thenable = thenable;\r
+//# sourceMappingURL=is.js.map
+
+/***/ }),
+/* 40 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/* --------------------------------------------------------------------------------------------\r
+ * Copyright (c) Microsoft Corporation. All rights reserved.\r
+ * Licensed under the MIT License. See License.txt in the project root for license information.\r
+ * ------------------------------------------------------------------------------------------ */\r
+\r
+Object.defineProperty(exports, "__esModule", { value: true });\r
+const vscode_languageserver_protocol_1 = __webpack_require__(4);\r
+exports.WorkspaceFoldersFeature = (Base) => {\r
+    return class extends Base {\r
+        initialize(capabilities) {\r
+            let workspaceCapabilities = capabilities.workspace;\r
+            if (workspaceCapabilities && workspaceCapabilities.workspaceFolders) {\r
+                this._onDidChangeWorkspaceFolders = new vscode_languageserver_protocol_1.Emitter();\r
+                this.connection.onNotification(vscode_languageserver_protocol_1.DidChangeWorkspaceFoldersNotification.type, (params) => {\r
+                    this._onDidChangeWorkspaceFolders.fire(params.event);\r
+                });\r
+            }\r
+        }\r
+        getWorkspaceFolders() {\r
+            return this.connection.sendRequest(vscode_languageserver_protocol_1.WorkspaceFoldersRequest.type);\r
+        }\r
+        get onDidChangeWorkspaceFolders() {\r
+            if (!this._onDidChangeWorkspaceFolders) {\r
+                throw new Error('Client doesn\'t support sending workspace folder change events.');\r
+            }\r
+            if (!this._unregistration) {\r
+                this._unregistration = this.connection.client.register(vscode_languageserver_protocol_1.DidChangeWorkspaceFoldersNotification.type);\r
+            }\r
+            return this._onDidChangeWorkspaceFolders.event;\r
+        }\r
+    };\r
+};\r
+//# sourceMappingURL=workspaceFolders.js.map
+
+/***/ }),
+/* 41 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/* --------------------------------------------------------------------------------------------\r
+ * Copyright (c) Microsoft Corporation. All rights reserved.\r
+ * Licensed under the MIT License. See License.txt in the project root for license information.\r
+ * ------------------------------------------------------------------------------------------ */\r
+\r
+Object.defineProperty(exports, "__esModule", { value: true });\r
+const vscode_languageserver_protocol_1 = __webpack_require__(4);\r
+const uuid_1 = __webpack_require__(42);\r
+class WorkDoneProgressImpl {\r
+    constructor(_connection, _token) {\r
+        this._connection = _connection;\r
+        this._token = _token;\r
+        WorkDoneProgressImpl.Instances.set(this._token, this);\r
+        this._source = new vscode_languageserver_protocol_1.CancellationTokenSource();\r
+    }\r
+    get token() {\r
+        return this._source.token;\r
+    }\r
+    begin(title, percentage, message, cancellable) {\r
+        let param = {\r
+            kind: 'begin',\r
+            title,\r
+            percentage,\r
+            message,\r
+            cancellable\r
+        };\r
+        this._connection.sendProgress(vscode_languageserver_protocol_1.WorkDoneProgress.type, this._token, param);\r
+    }\r
+    report(arg0, arg1) {\r
+        let param = {\r
+            kind: 'report'\r
+        };\r
+        if (typeof arg0 === 'number') {\r
+            param.percentage = arg0;\r
+            if (arg1 !== undefined) {\r
+                param.message = arg1;\r
+            }\r
+        }\r
+        else {\r
+            param.message = arg0;\r
+        }\r
+        this._connection.sendProgress(vscode_languageserver_protocol_1.WorkDoneProgress.type, this._token, param);\r
+    }\r
+    done() {\r
+        WorkDoneProgressImpl.Instances.delete(this._token);\r
+        this._source.dispose();\r
+        this._connection.sendProgress(vscode_languageserver_protocol_1.WorkDoneProgress.type, this._token, { kind: 'end' });\r
+    }\r
+    cancel() {\r
+        this._source.cancel();\r
+    }\r
+}\r
+WorkDoneProgressImpl.Instances = new Map();\r
+class NullProgress {\r
+    constructor() {\r
+        this._source = new vscode_languageserver_protocol_1.CancellationTokenSource();\r
+    }\r
+    get token() {\r
+        return this._source.token;\r
+    }\r
+    begin() {\r
+    }\r
+    report() {\r
+    }\r
+    done() {\r
+    }\r
+}\r
+function attachWorkDone(connection, params) {\r
+    if (params === undefined || params.workDoneToken === undefined) {\r
+        return new NullProgress();\r
+    }\r
+    const token = params.workDoneToken;\r
+    delete params.workDoneToken;\r
+    return new WorkDoneProgressImpl(connection, token);\r
+}\r
+exports.attachWorkDone = attachWorkDone;\r
+exports.ProgressFeature = (Base) => {\r
+    return class extends Base {\r
+        initialize(capabilities) {\r
+            var _a, _b;\r
+            if (((_b = (_a = capabilities) === null || _a === void 0 ? void 0 : _a.window) === null || _b === void 0 ? void 0 : _b.workDoneProgress) === true) {\r
+                this._progressSupported = true;\r
+                this.connection.onNotification(vscode_languageserver_protocol_1.WorkDoneProgressCancelNotification.type, (params) => {\r
+                    let progress = WorkDoneProgressImpl.Instances.get(params.token);\r
+                    if (progress !== undefined) {\r
+                        progress.cancel();\r
+                    }\r
+                });\r
+            }\r
+        }\r
+        attachWorkDoneProgress(token) {\r
+            if (token === undefined) {\r
+                return new NullProgress();\r
+            }\r
+            else {\r
+                return new WorkDoneProgressImpl(this.connection, token);\r
+            }\r
+        }\r
+        createWorkDoneProgress() {\r
+            if (this._progressSupported) {\r
+                const token = uuid_1.generateUuid();\r
+                return this.connection.sendRequest(vscode_languageserver_protocol_1.WorkDoneProgressCreateRequest.type, { token }).then(() => {\r
+                    const result = new WorkDoneProgressImpl(this.connection, token);\r
+                    return result;\r
+                });\r
+            }\r
+            else {\r
+                return Promise.resolve(new NullProgress());\r
+            }\r
+        }\r
+    };\r
+};\r
+var ResultProgress;\r
+(function (ResultProgress) {\r
+    ResultProgress.type = new vscode_languageserver_protocol_1.ProgressType();\r
+})(ResultProgress || (ResultProgress = {}));\r
+class ResultProgressImpl {\r
+    constructor(_connection, _token) {\r
+        this._connection = _connection;\r
+        this._token = _token;\r
+    }\r
+    report(data) {\r
+        this._connection.sendProgress(ResultProgress.type, this._token, data);\r
+    }\r
+}\r
+function attachPartialResult(connection, params) {\r
+    if (params === undefined || params.partialResultToken === undefined) {\r
+        return undefined;\r
+    }\r
+    const token = params.partialResultToken;\r
+    delete params.partialResultToken;\r
+    return new ResultProgressImpl(connection, token);\r
+}\r
+exports.attachPartialResult = attachPartialResult;\r
+//# sourceMappingURL=progress.js.map
+
+/***/ }),
+/* 42 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/*---------------------------------------------------------------------------------------------\r
+ *  Copyright (c) Microsoft Corporation. All rights reserved.\r
+ *  Licensed under the MIT License. See License.txt in the project root for license information.\r
+ *--------------------------------------------------------------------------------------------*/\r
+\r
+Object.defineProperty(exports, "__esModule", { value: true });\r
+class ValueUUID {\r
+    constructor(_value) {\r
+        this._value = _value;\r
+        // empty\r
+    }\r
+    asHex() {\r
+        return this._value;\r
+    }\r
+    equals(other) {\r
+        return this.asHex() === other.asHex();\r
+    }\r
+}\r
+class V4UUID extends ValueUUID {\r
+    constructor() {\r
+        super([\r
+            V4UUID._randomHex(),\r
+            V4UUID._randomHex(),\r
+            V4UUID._randomHex(),\r
+            V4UUID._randomHex(),\r
+            V4UUID._randomHex(),\r
+            V4UUID._randomHex(),\r
+            V4UUID._randomHex(),\r
+            V4UUID._randomHex(),\r
+            '-',\r
+            V4UUID._randomHex(),\r
+            V4UUID._randomHex(),\r
+            V4UUID._randomHex(),\r
+            V4UUID._randomHex(),\r
+            '-',\r
+            '4',\r
+            V4UUID._randomHex(),\r
+            V4UUID._randomHex(),\r
+            V4UUID._randomHex(),\r
+            '-',\r
+            V4UUID._oneOf(V4UUID._timeHighBits),\r
+            V4UUID._randomHex(),\r
+            V4UUID._randomHex(),\r
+            V4UUID._randomHex(),\r
+            '-',\r
+            V4UUID._randomHex(),\r
+            V4UUID._randomHex(),\r
+            V4UUID._randomHex(),\r
+            V4UUID._randomHex(),\r
+            V4UUID._randomHex(),\r
+            V4UUID._randomHex(),\r
+            V4UUID._randomHex(),\r
+            V4UUID._randomHex(),\r
+            V4UUID._randomHex(),\r
+            V4UUID._randomHex(),\r
+            V4UUID._randomHex(),\r
+            V4UUID._randomHex(),\r
+        ].join(''));\r
+    }\r
+    static _oneOf(array) {\r
+        return array[Math.floor(array.length * Math.random())];\r
+    }\r
+    static _randomHex() {\r
+        return V4UUID._oneOf(V4UUID._chars);\r
+    }\r
+}\r
+V4UUID._chars = ['0', '1', '2', '3', '4', '5', '6', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'];\r
+V4UUID._timeHighBits = ['8', '9', 'a', 'b'];\r
+/**\r
+ * An empty UUID that contains only zeros.\r
+ */\r
+exports.empty = new ValueUUID('00000000-0000-0000-0000-000000000000');\r
+function v4() {\r
+    return new V4UUID();\r
+}\r
+exports.v4 = v4;\r
+const _UUIDPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\r
+function isUUID(value) {\r
+    return _UUIDPattern.test(value);\r
+}\r
+exports.isUUID = isUUID;\r
+/**\r
+ * Parses a UUID that is of the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.\r
+ * @param value A uuid string.\r
+ */\r
+function parse(value) {\r
+    if (!isUUID(value)) {\r
+        throw new Error('invalid uuid');\r
+    }\r
+    return new ValueUUID(value);\r
+}\r
+exports.parse = parse;\r
+function generateUuid() {\r
+    return v4().asHex();\r
+}\r
+exports.generateUuid = generateUuid;\r
+//# sourceMappingURL=uuid.js.map
+
+/***/ }),
+/* 43 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/* WEBPACK VAR INJECTION */(function(__filename) {/* --------------------------------------------------------------------------------------------\r
+ * Copyright (c) Microsoft Corporation. All rights reserved.\r
+ * Licensed under the MIT License. See License.txt in the project root for license information.\r
+ * ------------------------------------------------------------------------------------------ */\r
+\r
+Object.defineProperty(exports, "__esModule", { value: true });\r
+const url = __webpack_require__(44);\r
+const path = __webpack_require__(3);\r
+const fs = __webpack_require__(2);\r
+const child_process_1 = __webpack_require__(45);\r
+/**\r
+ * @deprecated Use the `vscode-uri` npm module which provides a more\r
+ * complete implementation of handling VS Code URIs.\r
+ */\r
+function uriToFilePath(uri) {\r
+    let parsed = url.parse(uri);\r
+    if (parsed.protocol !== 'file:' || !parsed.path) {\r
+        return undefined;\r
+    }\r
+    let segments = parsed.path.split('/');\r
+    for (var i = 0, len = segments.length; i < len; i++) {\r
+        segments[i] = decodeURIComponent(segments[i]);\r
+    }\r
+    if (process.platform === 'win32' && segments.length > 1) {\r
+        let first = segments[0];\r
+        let second = segments[1];\r
+        // Do we have a drive letter and we started with a / which is the\r
+        // case if the first segement is empty (see split above)\r
+        if (first.length === 0 && second.length > 1 && second[1] === ':') {\r
+            // Remove first slash\r
+            segments.shift();\r
+        }\r
+    }\r
+    return path.normalize(segments.join('/'));\r
+}\r
+exports.uriToFilePath = uriToFilePath;\r
+function isWindows() {\r
+    return process.platform === 'win32';\r
+}\r
+function resolve(moduleName, nodePath, cwd, tracer) {\r
+    const nodePathKey = 'NODE_PATH';\r
+    const app = [\r
+        'var p = process;',\r
+        'p.on(\'message\',function(m){',\r
+        'if(m.c===\'e\'){',\r
+        'p.exit(0);',\r
+        '}',\r
+        'else if(m.c===\'rs\'){',\r
+        'try{',\r
+        'var r=require.resolve(m.a);',\r
+        'p.send({c:\'r\',s:true,r:r});',\r
+        '}',\r
+        'catch(err){',\r
+        'p.send({c:\'r\',s:false});',\r
+        '}',\r
+        '}',\r
+        '});'\r
+    ].join('');\r
+    return new Promise((resolve, reject) => {\r
+        let env = process.env;\r
+        let newEnv = Object.create(null);\r
+        Object.keys(env).forEach(key => newEnv[key] = env[key]);\r
+        if (nodePath && fs.existsSync(nodePath) /* see issue 545 */) {\r
+            if (newEnv[nodePathKey]) {\r
+                newEnv[nodePathKey] = nodePath + path.delimiter + newEnv[nodePathKey];\r
+            }\r
+            else {\r
+                newEnv[nodePathKey] = nodePath;\r
+            }\r
+            if (tracer) {\r
+                tracer(`NODE_PATH value is: ${newEnv[nodePathKey]}`);\r
+            }\r
+        }\r
+        newEnv['ELECTRON_RUN_AS_NODE'] = '1';\r
+        try {\r
+            let cp = child_process_1.fork('', [], {\r
+                cwd: cwd,\r
+                env: newEnv,\r
+                execArgv: ['-e', app]\r
+            });\r
+            if (cp.pid === void 0) {\r
+                reject(new Error(`Starting process to resolve node module  ${moduleName} failed`));\r
+                return;\r
+            }\r
+            cp.on('error', (error) => {\r
+                reject(error);\r
+            });\r
+            cp.on('message', (message) => {\r
+                if (message.c === 'r') {\r
+                    cp.send({ c: 'e' });\r
+                    if (message.s) {\r
+                        resolve(message.r);\r
+                    }\r
+                    else {\r
+                        reject(new Error(`Failed to resolve module: ${moduleName}`));\r
+                    }\r
+                }\r
+            });\r
+            let message = {\r
+                c: 'rs',\r
+                a: moduleName\r
+            };\r
+            cp.send(message);\r
+        }\r
+        catch (error) {\r
+            reject(error);\r
+        }\r
+    });\r
+}\r
+exports.resolve = resolve;\r
+/**\r
+ * Resolve the global npm package path.\r
+ * @deprecated Since this depends on the used package manager and their version the best is that servers\r
+ * implement this themselves since they know best what kind of package managers to support.\r
+ * @param tracer the tracer to use\r
+ */\r
+function resolveGlobalNodePath(tracer) {\r
+    let npmCommand = 'npm';\r
+    const env = Object.create(null);\r
+    Object.keys(process.env).forEach(key => env[key] = process.env[key]);\r
+    env['NO_UPDATE_NOTIFIER'] = 'true';\r
+    const options = {\r
+        encoding: 'utf8',\r
+        env\r
+    };\r
+    if (isWindows()) {\r
+        npmCommand = 'npm.cmd';\r
+        options.shell = true;\r
+    }\r
+    let handler = () => { };\r
+    try {\r
+        process.on('SIGPIPE', handler);\r
+        let stdout = child_process_1.spawnSync(npmCommand, ['config', 'get', 'prefix'], options).stdout;\r
+        if (!stdout) {\r
+            if (tracer) {\r
+                tracer(`'npm config get prefix' didn't return a value.`);\r
+            }\r
+            return undefined;\r
+        }\r
+        let prefix = stdout.trim();\r
+        if (tracer) {\r
+            tracer(`'npm config get prefix' value is: ${prefix}`);\r
+        }\r
+        if (prefix.length > 0) {\r
+            if (isWindows()) {\r
+                return path.join(prefix, 'node_modules');\r
+            }\r
+            else {\r
+                return path.join(prefix, 'lib', 'node_modules');\r
+            }\r
+        }\r
+        return undefined;\r
+    }\r
+    catch (err) {\r
+        return undefined;\r
+    }\r
+    finally {\r
+        process.removeListener('SIGPIPE', handler);\r
+    }\r
+}\r
+exports.resolveGlobalNodePath = resolveGlobalNodePath;\r
+/*\r
+ * Resolve the global yarn pakage path.\r
+ * @deprecated Since this depends on the used package manager and their version the best is that servers\r
+ * implement this themselves since they know best what kind of package managers to support.\r
+ * @param tracer the tracer to use\r
+ */\r
+function resolveGlobalYarnPath(tracer) {\r
+    let yarnCommand = 'yarn';\r
+    let options = {\r
+        encoding: 'utf8'\r
+    };\r
+    if (isWindows()) {\r
+        yarnCommand = 'yarn.cmd';\r
+        options.shell = true;\r
+    }\r
+    let handler = () => { };\r
+    try {\r
+        process.on('SIGPIPE', handler);\r
+        let results = child_process_1.spawnSync(yarnCommand, ['global', 'dir', '--json'], options);\r
+        let stdout = results.stdout;\r
+        if (!stdout) {\r
+            if (tracer) {\r
+                tracer(`'yarn global dir' didn't return a value.`);\r
+                if (results.stderr) {\r
+                    tracer(results.stderr);\r
+                }\r
+            }\r
+            return undefined;\r
+        }\r
+        let lines = stdout.trim().split(/\r?\n/);\r
+        for (let line of lines) {\r
+            try {\r
+                let yarn = JSON.parse(line);\r
+                if (yarn.type === 'log') {\r
+                    return path.join(yarn.data, 'node_modules');\r
+                }\r
+            }\r
+            catch (e) {\r
+                // Do nothing. Ignore the line\r
+            }\r
+        }\r
+        return undefined;\r
+    }\r
+    catch (err) {\r
+        return undefined;\r
+    }\r
+    finally {\r
+        process.removeListener('SIGPIPE', handler);\r
+    }\r
+}\r
+exports.resolveGlobalYarnPath = resolveGlobalYarnPath;\r
+var FileSystem;\r
+(function (FileSystem) {\r
+    let _isCaseSensitive = undefined;\r
+    function isCaseSensitive() {\r
+        if (_isCaseSensitive !== void 0) {\r
+            return _isCaseSensitive;\r
+        }\r
+        if (process.platform === 'win32') {\r
+            _isCaseSensitive = false;\r
+        }\r
+        else {\r
+            // convert current file name to upper case / lower case and check if file exists\r
+            // (guards against cases when name is already all uppercase or lowercase)\r
+            _isCaseSensitive = !fs.existsSync(__filename.toUpperCase()) || !fs.existsSync(__filename.toLowerCase());\r
+        }\r
+        return _isCaseSensitive;\r
+    }\r
+    FileSystem.isCaseSensitive = isCaseSensitive;\r
+    function isParent(parent, child) {\r
+        if (isCaseSensitive()) {\r
+            return path.normalize(child).indexOf(path.normalize(parent)) === 0;\r
+        }\r
+        else {\r
+            return path.normalize(child).toLowerCase().indexOf(path.normalize(parent).toLowerCase()) === 0;\r
+        }\r
+    }\r
+    FileSystem.isParent = isParent;\r
+})(FileSystem = exports.FileSystem || (exports.FileSystem = {}));\r
+function resolveModulePath(workspaceRoot, moduleName, nodePath, tracer) {\r
+    if (nodePath) {\r
+        if (!path.isAbsolute(nodePath)) {\r
+            nodePath = path.join(workspaceRoot, nodePath);\r
+        }\r
+        return resolve(moduleName, nodePath, nodePath, tracer).then((value) => {\r
+            if (FileSystem.isParent(nodePath, value)) {\r
+                return value;\r
+            }\r
+            else {\r
+                return Promise.reject(new Error(`Failed to load ${moduleName} from node path location.`));\r
+            }\r
+        }).then(undefined, (_error) => {\r
+            return resolve(moduleName, resolveGlobalNodePath(tracer), workspaceRoot, tracer);\r
+        });\r
+    }\r
+    else {\r
+        return resolve(moduleName, resolveGlobalNodePath(tracer), workspaceRoot, tracer);\r
+    }\r
+}\r
+exports.resolveModulePath = resolveModulePath;\r
+//# sourceMappingURL=files.js.map
+/* WEBPACK VAR INJECTION */}.call(this, "/index.js"))
+
+/***/ }),
+/* 44 */
+/***/ (function(module, exports) {
+
+module.exports = require("url");
+
+/***/ }),
+/* 45 */
+/***/ (function(module, exports) {
+
+module.exports = require("child_process");
+
+/***/ }),
+/* 46 */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "URI", function() { return URI; });
+/*---------------------------------------------------------------------------------------------
+ *  Copyright (c) Microsoft Corporation. All rights reserved.
+ *  Licensed under the MIT License. See License.txt in the project root for license information.
+ *--------------------------------------------------------------------------------------------*/
+
+var __extends = (undefined && undefined.__extends) || (function () {
+    var extendStatics = function (d, b) {
+        extendStatics = Object.setPrototypeOf ||
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+        return extendStatics(d, b);
+    };
+    return function (d, b) {
+        extendStatics(d, b);
+        function __() { this.constructor = d; }
+        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+    };
+})();
+var _a;
+var isWindows;
+if (typeof process === 'object') {
+    isWindows = process.platform === 'win32';
+}
+else if (typeof navigator === 'object') {
+    var userAgent = navigator.userAgent;
+    isWindows = userAgent.indexOf('Windows') >= 0;
+}
+function isHighSurrogate(charCode) {
+    return (0xD800 <= charCode && charCode <= 0xDBFF);
+}
+function isLowSurrogate(charCode) {
+    return (0xDC00 <= charCode && charCode <= 0xDFFF);
+}
+function isLowerAsciiHex(code) {
+    return code >= 97 /* a */ && code <= 102 /* f */;
+}
+function isLowerAsciiLetter(code) {
+    return code >= 97 /* a */ && code <= 122 /* z */;
+}
+function isUpperAsciiLetter(code) {
+    return code >= 65 /* A */ && code <= 90 /* Z */;
+}
+function isAsciiLetter(code) {
+    return isLowerAsciiLetter(code) || isUpperAsciiLetter(code);
+}
+//#endregion
+var _schemePattern = /^\w[\w\d+.-]*$/;
+var _singleSlashStart = /^\//;
+var _doubleSlashStart = /^\/\//;
+function _validateUri(ret, _strict) {
+    // scheme, must be set
+    if (!ret.scheme && _strict) {
+        throw new Error("[UriError]: Scheme is missing: {scheme: \"\", authority: \"" + ret.authority + "\", path: \"" + ret.path + "\", query: \"" + ret.query + "\", fragment: \"" + ret.fragment + "\"}");
+    }
+    // scheme, https://tools.ietf.org/html/rfc3986#section-3.1
+    // ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
+    if (ret.scheme && !_schemePattern.test(ret.scheme)) {
+        throw new Error('[UriError]: Scheme contains illegal characters.');
+    }
+    // path, http://tools.ietf.org/html/rfc3986#section-3.3
+    // If a URI contains an authority component, then the path component
+    // must either be empty or begin with a slash ("/") character.  If a URI
+    // does not contain an authority component, then the path cannot begin
+    // with two slash characters ("//").
+    if (ret.path) {
+        if (ret.authority) {
+            if (!_singleSlashStart.test(ret.path)) {
+                throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character');
+            }
+        }
+        else {
+            if (_doubleSlashStart.test(ret.path)) {
+                throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")');
+            }
+        }
+    }
+}
+// for a while we allowed uris *without* schemes and this is the migration
+// for them, e.g. an uri without scheme and without strict-mode warns and falls
+// back to the file-scheme. that should cause the least carnage and still be a
+// clear warning
+function _schemeFix(scheme, _strict) {
+    if (!scheme && !_strict) {
+        return 'file';
+    }
+    return scheme;
+}
+// implements a bit of https://tools.ietf.org/html/rfc3986#section-5
+function _referenceResolution(scheme, path) {
+    // the slash-character is our 'default base' as we don't
+    // support constructing URIs relative to other URIs. This
+    // also means that we alter and potentially break paths.
+    // see https://tools.ietf.org/html/rfc3986#section-5.1.4
+    switch (scheme) {
+        case 'https':
+        case 'http':
+        case 'file':
+            if (!path) {
+                path = _slash;
+            }
+            else if (path[0] !== _slash) {
+                path = _slash + path;
+            }
+            break;
+    }
+    return path;
+}
+var _empty = '';
+var _slash = '/';
+var _regexp = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;
+/**
+ * Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986.
+ * This class is a simple parser which creates the basic component parts
+ * (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation
+ * and encoding.
+ *
+ *       foo://example.com:8042/over/there?name=ferret#nose
+ *       \_/   \______________/\_________/ \_________/ \__/
+ *        |           |            |            |        |
+ *     scheme     authority       path        query   fragment
+ *        |   _____________________|__
+ *       / \ /                        \
+ *       urn:example:animal:ferret:nose
+ */
+var URI = /** @class */ (function () {
+    /**
+     * @internal
+     */
+    function URI(schemeOrData, authority, path, query, fragment, _strict) {
+        if (_strict === void 0) { _strict = false; }
+        if (typeof schemeOrData === 'object') {
+            this.scheme = schemeOrData.scheme || _empty;
+            this.authority = schemeOrData.authority || _empty;
+            this.path = schemeOrData.path || _empty;
+            this.query = schemeOrData.query || _empty;
+            this.fragment = schemeOrData.fragment || _empty;
+            // no validation because it's this URI
+            // that creates uri components.
+            // _validateUri(this);
+        }
+        else {
+            this.scheme = _schemeFix(schemeOrData, _strict);
+            this.authority = authority || _empty;
+            this.path = _referenceResolution(this.scheme, path || _empty);
+            this.query = query || _empty;
+            this.fragment = fragment || _empty;
+            _validateUri(this, _strict);
+        }
+    }
+    URI.isUri = function (thing) {
+        if (thing instanceof URI) {
+            return true;
+        }
+        if (!thing) {
+            return false;
+        }
+        return typeof thing.authority === 'string'
+            && typeof thing.fragment === 'string'
+            && typeof thing.path === 'string'
+            && typeof thing.query === 'string'
+            && typeof thing.scheme === 'string'
+            && typeof thing.fsPath === 'function'
+            && typeof thing.with === 'function'
+            && typeof thing.toString === 'function';
+    };
+    Object.defineProperty(URI.prototype, "fsPath", {
+        // ---- filesystem path -----------------------
+        /**
+         * Returns a string representing the corresponding file system path of this URI.
+         * Will handle UNC paths, normalizes windows drive letters to lower-case, and uses the
+         * platform specific path separator.
+         *
+         * * Will *not* validate the path for invalid characters and semantics.
+         * * Will *not* look at the scheme of this URI.
+         * * The result shall *not* be used for display purposes but for accessing a file on disk.
+         *
+         *
+         * The *difference* to `URI#path` is the use of the platform specific separator and the handling
+         * of UNC paths. See the below sample of a file-uri with an authority (UNC path).
+         *
+         * ```ts
+            const u = URI.parse('file://server/c$/folder/file.txt')
+            u.authority === 'server'
+            u.path === '/shares/c$/file.txt'
+            u.fsPath === '\\server\c$\folder\file.txt'
+        ```
+         *
+         * Using `URI#path` to read a file (using fs-apis) would not be enough because parts of the path,
+         * namely the server name, would be missing. Therefore `URI#fsPath` exists - it's sugar to ease working
+         * with URIs that represent files on disk (`file` scheme).
+         */
+        get: function () {
+            // if (this.scheme !== 'file') {
+            //         console.warn(`[UriError] calling fsPath with scheme ${this.scheme}`);
+            // }
+            return _makeFsPath(this);
+        },
+        enumerable: true,
+        configurable: true
+    });
+    // ---- modify to new -------------------------
+    URI.prototype.with = function (change) {
+        if (!change) {
+            return this;
+        }
+        var scheme = change.scheme, authority = change.authority, path = change.path, query = change.query, fragment = change.fragment;
+        if (scheme === undefined) {
+            scheme = this.scheme;
+        }
+        else if (scheme === null) {
+            scheme = _empty;
+        }
+        if (authority === undefined) {
+            authority = this.authority;
+        }
+        else if (authority === null) {
+            authority = _empty;
+        }
+        if (path === undefined) {
+            path = this.path;
+        }
+        else if (path === null) {
+            path = _empty;
+        }
+        if (query === undefined) {
+            query = this.query;
+        }
+        else if (query === null) {
+            query = _empty;
+        }
+        if (fragment === undefined) {
+            fragment = this.fragment;
+        }
+        else if (fragment === null) {
+            fragment = _empty;
+        }
+        if (scheme === this.scheme
+            && authority === this.authority
+            && path === this.path
+            && query === this.query
+            && fragment === this.fragment) {
+            return this;
+        }
+        return new _URI(scheme, authority, path, query, fragment);
+    };
+    // ---- parse & validate ------------------------
+    /**
+     * Creates a new URI from a string, e.g. `http://www.msft.com/some/path`,
+     * `file:///usr/home`, or `scheme:with/path`.
+     *
+     * @param value A string which represents an URI (see `URI#toString`).
+     */
+    URI.parse = function (value, _strict) {
+        if (_strict === void 0) { _strict = false; }
+        var match = _regexp.exec(value);
+        if (!match) {
+            return new _URI(_empty, _empty, _empty, _empty, _empty);
+        }
+        return new _URI(match[2] || _empty, decodeURIComponent(match[4] || _empty), decodeURIComponent(match[5] || _empty), decodeURIComponent(match[7] || _empty), decodeURIComponent(match[9] || _empty), _strict);
+    };
+    /**
+     * Creates a new URI from a file system path, e.g. `c:\my\files`,
+     * `/usr/home`, or `\\server\share\some\path`.
+     *
+     * The *difference* between `URI#parse` and `URI#file` is that the latter treats the argument
+     * as path, not as stringified-uri. E.g. `URI.file(path)` is **not the same as**
+     * `URI.parse('file://' + path)` because the path might contain characters that are
+     * interpreted (# and ?). See the following sample:
+     * ```ts
+    const good = URI.file('/coding/c#/project1');
+    good.scheme === 'file';
+    good.path === '/coding/c#/project1';
+    good.fragment === '';
+    const bad = URI.parse('file://' + '/coding/c#/project1');
+    bad.scheme === 'file';
+    bad.path === '/coding/c'; // path is now broken
+    bad.fragment === '/project1';
+    ```
+     *
+     * @param path A file system path (see `URI#fsPath`)
+     */
+    URI.file = function (path) {
+        var authority = _empty;
+        // normalize to fwd-slashes on windows,
+        // on other systems bwd-slashes are valid
+        // filename character, eg /f\oo/ba\r.txt
+        if (isWindows) {
+            path = path.replace(/\\/g, _slash);
+        }
+        // check for authority as used in UNC shares
+        // or use the path as given
+        if (path[0] === _slash && path[1] === _slash) {
+            var idx = path.indexOf(_slash, 2);
+            if (idx === -1) {
+                authority = path.substring(2);
+                path = _slash;
+            }
+            else {
+                authority = path.substring(2, idx);
+                path = path.substring(idx) || _slash;
+            }
+        }
+        return new _URI('file', authority, path, _empty, _empty);
+    };
+    URI.from = function (components) {
+        return new _URI(components.scheme, components.authority, components.path, components.query, components.fragment);
+    };
+    // ---- printing/externalize ---------------------------
+    /**
+     * Creates a string representation for this URI. It's guaranteed that calling
+     * `URI.parse` with the result of this function creates an URI which is equal
+     * to this URI.
+     *
+     * * The result shall *not* be used for display purposes but for externalization or transport.
+     * * The result will be encoded using the percentage encoding and encoding happens mostly
+     * ignore the scheme-specific encoding rules.
+     *
+     * @param skipEncoding Do not encode the result, default is `false`
+     */
+    URI.prototype.toString = function (skipEncoding) {
+        if (skipEncoding === void 0) { skipEncoding = false; }
+        return _asFormatted(this, skipEncoding);
+    };
+    URI.prototype.toJSON = function () {
+        return this;
+    };
+    URI.revive = function (data) {
+        if (!data) {
+            return data;
+        }
+        else if (data instanceof URI) {
+            return data;
+        }
+        else {
+            var result = new _URI(data);
+            result._formatted = data.external;
+            result._fsPath = data._sep === _pathSepMarker ? data.fsPath : null;
+            return result;
+        }
+    };
+    return URI;
+}());
+
+var _pathSepMarker = isWindows ? 1 : undefined;
+// tslint:disable-next-line:class-name
+var _URI = /** @class */ (function (_super) {
+    __extends(_URI, _super);
+    function _URI() {
+        var _this = _super !== null && _super.apply(this, arguments) || this;
+        _this._formatted = null;
+        _this._fsPath = null;
+        return _this;
+    }
+    Object.defineProperty(_URI.prototype, "fsPath", {
+        get: function () {
+            if (!this._fsPath) {
+                this._fsPath = _makeFsPath(this);
+            }
+            return this._fsPath;
+        },
+        enumerable: true,
+        configurable: true
+    });
+    _URI.prototype.toString = function (skipEncoding) {
+        if (skipEncoding === void 0) { skipEncoding = false; }
+        if (!skipEncoding) {
+            if (!this._formatted) {
+                this._formatted = _asFormatted(this, false);
+            }
+            return this._formatted;
+        }
+        else {
+            // we don't cache that
+            return _asFormatted(this, true);
+        }
+    };
+    _URI.prototype.toJSON = function () {
+        var res = {
+            $mid: 1
+        };
+        // cached state
+        if (this._fsPath) {
+            res.fsPath = this._fsPath;
+            res._sep = _pathSepMarker;
+        }
+        if (this._formatted) {
+            res.external = this._formatted;
+        }
+        // uri components
+        if (this.path) {
+            res.path = this.path;
+        }
+        if (this.scheme) {
+            res.scheme = this.scheme;
+        }
+        if (this.authority) {
+            res.authority = this.authority;
+        }
+        if (this.query) {
+            res.query = this.query;
+        }
+        if (this.fragment) {
+            res.fragment = this.fragment;
+        }
+        return res;
+    };
+    return _URI;
+}(URI));
+// reserved characters: https://tools.ietf.org/html/rfc3986#section-2.2
+var encodeTable = (_a = {},
+    _a[58 /* Colon */] = '%3A',
+    _a[47 /* Slash */] = '%2F',
+    _a[63 /* QuestionMark */] = '%3F',
+    _a[35 /* Hash */] = '%23',
+    _a[91 /* OpenSquareBracket */] = '%5B',
+    _a[93 /* CloseSquareBracket */] = '%5D',
+    _a[64 /* AtSign */] = '%40',
+    _a[33 /* ExclamationMark */] = '%21',
+    _a[36 /* DollarSign */] = '%24',
+    _a[38 /* Ampersand */] = '%26',
+    _a[39 /* SingleQuote */] = '%27',
+    _a[40 /* OpenParen */] = '%28',
+    _a[41 /* CloseParen */] = '%29',
+    _a[42 /* Asterisk */] = '%2A',
+    _a[43 /* Plus */] = '%2B',
+    _a[44 /* Comma */] = '%2C',
+    _a[59 /* Semicolon */] = '%3B',
+    _a[61 /* Equals */] = '%3D',
+    _a[32 /* Space */] = '%20',
+    _a);
+function encodeURIComponentFast(uriComponent, allowSlash) {
+    var res = undefined;
+    var nativeEncodePos = -1;
+    for (var pos = 0; pos < uriComponent.length; pos++) {
+        var code = uriComponent.charCodeAt(pos);
+        // unreserved characters: https://tools.ietf.org/html/rfc3986#section-2.3
+        if ((code >= 97 /* a */ && code <= 122 /* z */)
+            || (code >= 65 /* A */ && code <= 90 /* Z */)
+            || (code >= 48 /* Digit0 */ && code <= 57 /* Digit9 */)
+            || code === 45 /* Dash */
+            || code === 46 /* Period */
+            || code === 95 /* Underline */
+            || code === 126 /* Tilde */
+            || (allowSlash && code === 47 /* Slash */)) {
+            // check if we are delaying native encode
+            if (nativeEncodePos !== -1) {
+                res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos));
+                nativeEncodePos = -1;
+            }
+            // check if we write into a new string (by default we try to return the param)
+            if (res !== undefined) {
+                res += uriComponent.charAt(pos);
+            }
+        }
+        else {
+            // encoding needed, we need to allocate a new string
+            if (res === undefined) {
+                res = uriComponent.substr(0, pos);
+            }
+            // check with default table first
+            var escaped = encodeTable[code];
+            if (escaped !== undefined) {
+                // check if we are delaying native encode
+                if (nativeEncodePos !== -1) {
+                    res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos));
+                    nativeEncodePos = -1;
+                }
+                // append escaped variant to result
+                res += escaped;
+            }
+            else if (nativeEncodePos === -1) {
+                // use native encode only when needed
+                nativeEncodePos = pos;
+            }
+        }
+    }
+    if (nativeEncodePos !== -1) {
+        res += encodeURIComponent(uriComponent.substring(nativeEncodePos));
+    }
+    return res !== undefined ? res : uriComponent;
+}
+function encodeURIComponentMinimal(path) {
+    var res = undefined;
+    for (var pos = 0; pos < path.length; pos++) {
+        var code = path.charCodeAt(pos);
+        if (code === 35 /* Hash */ || code === 63 /* QuestionMark */) {
+            if (res === undefined) {
+                res = path.substr(0, pos);
+            }
+            res += encodeTable[code];
+        }
+        else {
+            if (res !== undefined) {
+                res += path[pos];
+            }
+        }
+    }
+    return res !== undefined ? res : path;
+}
+/**
+ * Compute `fsPath` for the given uri
+ */
+function _makeFsPath(uri) {
+    var value;
+    if (uri.authority && uri.path.length > 1 && uri.scheme === 'file') {
+        // unc path: file://shares/c$/far/boo
+        value = "//" + uri.authority + uri.path;
+    }
+    else if (uri.path.charCodeAt(0) === 47 /* Slash */
+        && (uri.path.charCodeAt(1) >= 65 /* A */ && uri.path.charCodeAt(1) <= 90 /* Z */ || uri.path.charCodeAt(1) >= 97 /* a */ && uri.path.charCodeAt(1) <= 122 /* z */)
+        && uri.path.charCodeAt(2) === 58 /* Colon */) {
+        // windows drive letter: file:///c:/far/boo
+        value = uri.path[1].toLowerCase() + uri.path.substr(2);
+    }
+    else {
+        // other path
+        value = uri.path;
+    }
+    if (isWindows) {
+        value = value.replace(/\//g, '\\');
+    }
+    return value;
+}
+/**
+ * Create the external version of a uri
+ */
+function _asFormatted(uri, skipEncoding) {
+    var encoder = !skipEncoding
+        ? encodeURIComponentFast
+        : encodeURIComponentMinimal;
+    var res = '';
+    var scheme = uri.scheme, authority = uri.authority, path = uri.path, query = uri.query, fragment = uri.fragment;
+    if (scheme) {
+        res += scheme;
+        res += ':';
+    }
+    if (authority || scheme === 'file') {
+        res += _slash;
+        res += _slash;
+    }
+    if (authority) {
+        var idx = authority.indexOf('@');
+        if (idx !== -1) {
+            // <user>@<auth>
+            var userinfo = authority.substr(0, idx);
+            authority = authority.substr(idx + 1);
+            idx = userinfo.indexOf(':');
+            if (idx === -1) {
+                res += encoder(userinfo, false);
+            }
+            else {
+                // <user>:<pass>@<auth>
+                res += encoder(userinfo.substr(0, idx), false);
+                res += ':';
+                res += encoder(userinfo.substr(idx + 1), false);
+            }
+            res += '@';
+        }
+        authority = authority.toLowerCase();
+        idx = authority.indexOf(':');
+        if (idx === -1) {
+            res += encoder(authority, false);
+        }
+        else {
+            // <auth>:<port>
+            res += encoder(authority.substr(0, idx), false);
+            res += authority.substr(idx);
+        }
+    }
+    if (path) {
+        // lower-case windows drive letters in /C:/fff or C:/fff
+        if (path.length >= 3 && path.charCodeAt(0) === 47 /* Slash */ && path.charCodeAt(2) === 58 /* Colon */) {
+            var code = path.charCodeAt(1);
+            if (code >= 65 /* A */ && code <= 90 /* Z */) {
+                path = "/" + String.fromCharCode(code + 32) + ":" + path.substr(3); // "/c:".length === 3
+            }
+        }
+        else if (path.length >= 2 && path.charCodeAt(1) === 58 /* Colon */) {
+            var code = path.charCodeAt(0);
+            if (code >= 65 /* A */ && code <= 90 /* Z */) {
+                path = String.fromCharCode(code + 32) + ":" + path.substr(2); // "/c:".length === 3
+            }
+        }
+        // encode the rest of the path
+        res += encoder(path, true);
+    }
+    if (query) {
+        res += '?';
+        res += encoder(query, false);
+    }
+    if (fragment) {
+        res += '#';
+        res += !skipEncoding ? encodeURIComponentFast(fragment, false) : fragment;
+    }
+    return res;
+}
+
+
+/***/ }),
+/* 47 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+Object.defineProperty(exports, "__esModule", { value: true });
+var Is;
+(function (Is) {
+    const toString = Object.prototype.toString;
+    function boolean(value) {
+        return value === true || value === false;
+    }
+    Is.boolean = boolean;
+    function string(value) {
+        return toString.call(value) === '[object String]';
+    }
+    Is.string = string;
+})(Is = exports.Is || (exports.Is = {}));
+var DirectoryItem;
+(function (DirectoryItem) {
+    function is(item) {
+        let candidate = item;
+        return (candidate &&
+            Is.string(candidate.directory) &&
+            (Is.boolean(candidate.changeProcessCWD) ||
+                candidate.changeProcessCWD === void 0));
+    }
+    DirectoryItem.is = is;
+})(DirectoryItem = exports.DirectoryItem || (exports.DirectoryItem = {}));
+
+
+/***/ }),
+/* 48 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+var __importStar = (this && this.__importStar) || function (mod) {
+    if (mod && mod.__esModule) return mod;
+    var result = {};
+    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
+    result["default"] = mod;
+    return result;
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+    return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const path = __importStar(__webpack_require__(3));
+const fast_diff_1 = __importDefault(__webpack_require__(49));
+const types_1 = __webpack_require__(47);
+const vscode_uri_1 = __webpack_require__(46);
+const resolve_from_1 = __importDefault(__webpack_require__(50));
+/**
+ * Check if the path follows this pattern: `\\hostname\sharename`.
+ *
+ * @see https://msdn.microsoft.com/en-us/library/gg465305.aspx
+ * @return A boolean indication if the path is a UNC path, on none-windows
+ * always false.
+ */
+function isUNC(path) {
+    if (process.platform !== 'win32') {
+        // UNC is a windows concept
+        return false;
+    }
+    if (!path || path.length < 5) {
+        // at least \\a\b
+        return false;
+    }
+    let code = path.charCodeAt(0);
+    if (code !== 92 /* Backslash */) {
+        return false;
+    }
+    code = path.charCodeAt(1);
+    if (code !== 92 /* Backslash */) {
+        return false;
+    }
+    let pos = 2;
+    let start = pos;
+    for (; pos < path.length; pos++) {
+        code = path.charCodeAt(pos);
+        if (code === 92 /* Backslash */) {
+            break;
+        }
+    }
+    if (start === pos) {
+        return false;
+    }
+    code = path.charCodeAt(pos + 1);
+    if (isNaN(code) || code === 92 /* Backslash */) {
+        return false;
+    }
+    return true;
+}
+exports.isUNC = isUNC;
+function getFileSystemPath(uri) {
+    let result = uri.fsPath;
+    if (process.platform === 'win32' && result.length >= 2 && result[1] === ':') {
+        // Node by default uses an upper case drive letter and ESLint uses
+        // === to compare pathes which results in the equal check failing
+        // if the drive letter is lower case in th URI. Ensure upper case.
+        return result[0].toUpperCase() + result.substr(1);
+    }
+    else {
+        return result;
+    }
+}
+function getFilePath(documentOrUri) {
+    if (!documentOrUri) {
+        return undefined;
+    }
+    let uri = types_1.Is.string(documentOrUri)
+        ? vscode_uri_1.URI.parse(documentOrUri)
+        : vscode_uri_1.URI.parse(documentOrUri.uri);
+    if (uri.scheme !== 'file') {
+        return undefined;
+    }
+    return getFileSystemPath(uri);
+}
+exports.getFilePath = getFilePath;
+function getAllFixEdits(document, settings) {
+    const uri = vscode_uri_1.URI.parse(document.uri);
+    if (uri.scheme != 'file')
+        return [];
+    const content = document.getText();
+    const newOptions = Object.assign(Object.assign({}, settings.options), { fix: true });
+    return executeInWorkspaceDirectory(document, settings, newOptions, (filename, options) => {
+        if (!settings.validate) {
+            return [];
+        }
+        const engine = new settings.library.CLIEngine(options);
+        const res = engine.executeOnText(content, filename);
+        if (!res.results.length)
+            return [];
+        const { output } = res.results[0];
+        if (output == null)
+            return [];
+        const change = getChange(content, output);
+        return [{
+                range: {
+                    start: document.positionAt(change.start),
+                    end: document.positionAt(change.end)
+                },
+                newText: change.newText
+            }];
+    });
+}
+exports.getAllFixEdits = getAllFixEdits;
+function getChange(oldStr, newStr) {
+    let result = fast_diff_1.default(oldStr, newStr, 1);
+    let curr = 0;
+    let start = -1;
+    let end = -1;
+    let newText = '';
+    let remain = '';
+    for (let item of result) {
+        let [t, str] = item;
+        // equal
+        if (t == 0) {
+            curr = curr + str.length;
+            if (start != -1)
+                remain = remain + str;
+        }
+        else {
+            if (start == -1)
+                start = curr;
+            if (t == 1) {
+                newText = newText + remain + str;
+                end = curr;
+            }
+            else {
+                newText = newText + remain;
+                end = curr + str.length;
+            }
+            remain = '';
+            if (t == -1)
+                curr = curr + str.length;
+        }
+    }
+    return { start, end, newText };
+}
+exports.getChange = getChange;
+function resolveModule(name, localPath, globalPath) {
+    if (localPath) {
+        let path = resolve_from_1.default.silent(localPath, name);
+        if (path)
+            return Promise.resolve(path);
+    }
+    try {
+        let path = resolve_from_1.default(globalPath, name);
+        return Promise.resolve(path);
+    }
+    catch (e) {
+        return Promise.reject(e);
+    }
+}
+exports.resolveModule = resolveModule;
+function executeInWorkspaceDirectory(document, settings, newOptions, callback) {
+    const filename = getFilePath(document);
+    const cwd = process.cwd();
+    try {
+        if (filename) {
+            if (settings.workingDirectory) {
+                newOptions.cwd = settings.workingDirectory.directory;
+                if (settings.workingDirectory.changeProcessCWD) {
+                    process.chdir(settings.workingDirectory.directory);
+                }
+            }
+            else if (settings.workspaceFolder) {
+                const workspaceFolderUri = vscode_uri_1.URI.parse(settings.workspaceFolder.uri);
+                if (workspaceFolderUri.scheme === 'file') {
+                    const fsPath = getFileSystemPath(workspaceFolderUri);
+                    newOptions.cwd = fsPath;
+                    process.chdir(fsPath);
+                }
+            }
+            else if (!settings.workspaceFolder && !isUNC(filename)) {
+                const directory = path.dirname(filename);
+                if (directory && path.isAbsolute(directory))
+                    newOptions.cwd = directory;
+            }
+        }
+        return callback(filename, newOptions);
+    }
+    finally {
+        if (cwd !== process.cwd())
+            process.chdir(cwd);
+    }
+}
+exports.executeInWorkspaceDirectory = executeInWorkspaceDirectory;
+
+
+/***/ }),
+/* 49 */
+/***/ (function(module, exports) {
+
+/**
+ * This library modifies the diff-patch-match library by Neil Fraser
+ * by removing the patch and match functionality and certain advanced
+ * options in the diff function. The original license is as follows:
+ *
+ * ===
+ *
+ * Diff Match and Patch
+ *
+ * Copyright 2006 Google Inc.
+ * http://code.google.com/p/google-diff-match-patch/
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+/**
+ * The data structure representing a diff is an array of tuples:
+ * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]
+ * which means: delete 'Hello', add 'Goodbye' and keep ' world.'
+ */
+var DIFF_DELETE = -1;
+var DIFF_INSERT = 1;
+var DIFF_EQUAL = 0;
+
+
+/**
+ * Find the differences between two texts.  Simplifies the problem by stripping
+ * any common prefix or suffix off the texts before diffing.
+ * @param {string} text1 Old string to be diffed.
+ * @param {string} text2 New string to be diffed.
+ * @param {Int|Object} [cursor_pos] Edit position in text1 or object with more info
+ * @return {Array} Array of diff tuples.
+ */
+function diff_main(text1, text2, cursor_pos, _fix_unicode) {
+  // Check for equality
+  if (text1 === text2) {
+    if (text1) {
+      return [[DIFF_EQUAL, text1]];
+    }
+    return [];
+  }
+
+  if (cursor_pos != null) {
+    var editdiff = find_cursor_edit_diff(text1, text2, cursor_pos);
+    if (editdiff) {
+      return editdiff;
+    }
+  }
+
+  // Trim off common prefix (speedup).
+  var commonlength = diff_commonPrefix(text1, text2);
+  var commonprefix = text1.substring(0, commonlength);
+  text1 = text1.substring(commonlength);
+  text2 = text2.substring(commonlength);
+
+  // Trim off common suffix (speedup).
+  commonlength = diff_commonSuffix(text1, text2);
+  var commonsuffix = text1.substring(text1.length - commonlength);
+  text1 = text1.substring(0, text1.length - commonlength);
+  text2 = text2.substring(0, text2.length - commonlength);
+
+  // Compute the diff on the middle block.
+  var diffs = diff_compute_(text1, text2);
+
+  // Restore the prefix and suffix.
+  if (commonprefix) {
+    diffs.unshift([DIFF_EQUAL, commonprefix]);
+  }
+  if (commonsuffix) {
+    diffs.push([DIFF_EQUAL, commonsuffix]);
+  }
+  diff_cleanupMerge(diffs, _fix_unicode);
+  return diffs;
+};
+
+
+/**
+ * Find the differences between two texts.  Assumes that the texts do not
+ * have any common prefix or suffix.
+ * @param {string} text1 Old string to be diffed.
+ * @param {string} text2 New string to be diffed.
+ * @return {Array} Array of diff tuples.
+ */
+function diff_compute_(text1, text2) {
+  var diffs;
+
+  if (!text1) {
+    // Just add some text (speedup).
+    return [[DIFF_INSERT, text2]];
+  }
+
+  if (!text2) {
+    // Just delete some text (speedup).
+    return [[DIFF_DELETE, text1]];
+  }
+
+  var longtext = text1.length > text2.length ? text1 : text2;
+  var shorttext = text1.length > text2.length ? text2 : text1;
+  var i = longtext.indexOf(shorttext);
+  if (i !== -1) {
+    // Shorter text is inside the longer text (speedup).
+    diffs = [
+      [DIFF_INSERT, longtext.substring(0, i)],
+      [DIFF_EQUAL, shorttext],
+      [DIFF_INSERT, longtext.substring(i + shorttext.length)]
+    ];
+    // Swap insertions for deletions if diff is reversed.
+    if (text1.length > text2.length) {
+      diffs[0][0] = diffs[2][0] = DIFF_DELETE;
+    }
+    return diffs;
+  }
+
+  if (shorttext.length === 1) {
+    // Single character string.
+    // After the previous speedup, the character can't be an equality.
+    return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];
+  }
+
+  // Check to see if the problem can be split in two.
+  var hm = diff_halfMatch_(text1, text2);
+  if (hm) {
+    // A half-match was found, sort out the return data.
+    var text1_a = hm[0];
+    var text1_b = hm[1];
+    var text2_a = hm[2];
+    var text2_b = hm[3];
+    var mid_common = hm[4];
+    // Send both pairs off for separate processing.
+    var diffs_a = diff_main(text1_a, text2_a);
+    var diffs_b = diff_main(text1_b, text2_b);
+    // Merge the results.
+    return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);
+  }
+
+  return diff_bisect_(text1, text2);
+};
+
+
+/**
+ * Find the 'middle snake' of a diff, split the problem in two
+ * and return the recursively constructed diff.
+ * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.
+ * @param {string} text1 Old string to be diffed.
+ * @param {string} text2 New string to be diffed.
+ * @return {Array} Array of diff tuples.
+ * @private
+ */
+function diff_bisect_(text1, text2) {
+  // Cache the text lengths to prevent multiple calls.
+  var text1_length = text1.length;
+  var text2_length = text2.length;
+  var max_d = Math.ceil((text1_length + text2_length) / 2);
+  var v_offset = max_d;
+  var v_length = 2 * max_d;
+  var v1 = new Array(v_length);
+  var v2 = new Array(v_length);
+  // Setting all elements to -1 is faster in Chrome & Firefox than mixing
+  // integers and undefined.
+  for (var x = 0; x < v_length; x++) {
+    v1[x] = -1;
+    v2[x] = -1;
+  }
+  v1[v_offset + 1] = 0;
+  v2[v_offset + 1] = 0;
+  var delta = text1_length - text2_length;
+  // If the total number of characters is odd, then the front path will collide
+  // with the reverse path.
+  var front = (delta % 2 !== 0);
+  // Offsets for start and end of k loop.
+  // Prevents mapping of space beyond the grid.
+  var k1start = 0;
+  var k1end = 0;
+  var k2start = 0;
+  var k2end = 0;
+  for (var d = 0; d < max_d; d++) {
+    // Walk the front path one step.
+    for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {
+      var k1_offset = v_offset + k1;
+      var x1;
+      if (k1 === -d || (k1 !== d && v1[k1_offset - 1] < v1[k1_offset + 1])) {
+        x1 = v1[k1_offset + 1];
+      } else {
+        x1 = v1[k1_offset - 1] + 1;
+      }
+      var y1 = x1 - k1;
+      while (
+        x1 < text1_length && y1 < text2_length &&
+        text1.charAt(x1) === text2.charAt(y1)
+      ) {
+        x1++;
+        y1++;
+      }
+      v1[k1_offset] = x1;
+      if (x1 > text1_length) {
+        // Ran off the right of the graph.
+        k1end += 2;
+      } else if (y1 > text2_length) {
+        // Ran off the bottom of the graph.
+        k1start += 2;
+      } else if (front) {
+        var k2_offset = v_offset + delta - k1;
+        if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] !== -1) {
+          // Mirror x2 onto top-left coordinate system.
+          var x2 = text1_length - v2[k2_offset];
+          if (x1 >= x2) {
+            // Overlap detected.
+            return diff_bisectSplit_(text1, text2, x1, y1);
+          }
+        }
+      }
+    }
+
+    // Walk the reverse path one step.
+    for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {
+      var k2_offset = v_offset + k2;
+      var x2;
+      if (k2 === -d || (k2 !== d && v2[k2_offset - 1] < v2[k2_offset + 1])) {
+        x2 = v2[k2_offset + 1];
+      } else {
+        x2 = v2[k2_offset - 1] + 1;
+      }
+      var y2 = x2 - k2;
+      while (
+        x2 < text1_length && y2 < text2_length &&
+        text1.charAt(text1_length - x2 - 1) === text2.charAt(text2_length - y2 - 1)
+      ) {
+        x2++;
+        y2++;
+      }
+      v2[k2_offset] = x2;
+      if (x2 > text1_length) {
+        // Ran off the left of the graph.
+        k2end += 2;
+      } else if (y2 > text2_length) {
+        // Ran off the top of the graph.
+        k2start += 2;
+      } else if (!front) {
+        var k1_offset = v_offset + delta - k2;
+        if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] !== -1) {
+          var x1 = v1[k1_offset];
+          var y1 = v_offset + x1 - k1_offset;
+          // Mirror x2 onto top-left coordinate system.
+          x2 = text1_length - x2;
+          if (x1 >= x2) {
+            // Overlap detected.
+            return diff_bisectSplit_(text1, text2, x1, y1);
+          }
+        }
+      }
+    }
+  }
+  // Diff took too long and hit the deadline or
+  // number of diffs equals number of characters, no commonality at all.
+  return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];
+};
+
+
+/**
+ * Given the location of the 'middle snake', split the diff in two parts
+ * and recurse.
+ * @param {string} text1 Old string to be diffed.
+ * @param {string} text2 New string to be diffed.
+ * @param {number} x Index of split point in text1.
+ * @param {number} y Index of split point in text2.
+ * @return {Array} Array of diff tuples.
+ */
+function diff_bisectSplit_(text1, text2, x, y) {
+  var text1a = text1.substring(0, x);
+  var text2a = text2.substring(0, y);
+  var text1b = text1.substring(x);
+  var text2b = text2.substring(y);
+
+  // Compute both diffs serially.
+  var diffs = diff_main(text1a, text2a);
+  var diffsb = diff_main(text1b, text2b);
+
+  return diffs.concat(diffsb);
+};
+
+
+/**
+ * Determine the common prefix of two strings.
+ * @param {string} text1 First string.
+ * @param {string} text2 Second string.
+ * @return {number} The number of characters common to the start of each
+ *     string.
+ */
+function diff_commonPrefix(text1, text2) {
+  // Quick check for common null cases.
+  if (!text1 || !text2 || text1.charAt(0) !== text2.charAt(0)) {
+    return 0;
+  }
+  // Binary search.
+  // Performance analysis: http://neil.fraser.name/news/2007/10/09/
+  var pointermin = 0;
+  var pointermax = Math.min(text1.length, text2.length);
+  var pointermid = pointermax;
+  var pointerstart = 0;
+  while (pointermin < pointermid) {
+    if (
+      text1.substring(pointerstart, pointermid) ==
+      text2.substring(pointerstart, pointermid)
+    ) {
+      pointermin = pointermid;
+      pointerstart = pointermin;
+    } else {
+      pointermax = pointermid;
+    }
+    pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
+  }
+
+  if (is_surrogate_pair_start(text1.charCodeAt(pointermid - 1))) {
+    pointermid--;
+  }
+
+  return pointermid;
+};
+
+
+/**
+ * Determine the common suffix of two strings.
+ * @param {string} text1 First string.
+ * @param {string} text2 Second string.
+ * @return {number} The number of characters common to the end of each string.
+ */
+function diff_commonSuffix(text1, text2) {
+  // Quick check for common null cases.
+  if (!text1 || !text2 || text1.slice(-1) !== text2.slice(-1)) {
+    return 0;
+  }
+  // Binary search.
+  // Performance analysis: http://neil.fraser.name/news/2007/10/09/
+  var pointermin = 0;
+  var pointermax = Math.min(text1.length, text2.length);
+  var pointermid = pointermax;
+  var pointerend = 0;
+  while (pointermin < pointermid) {
+    if (
+      text1.substring(text1.length - pointermid, text1.length - pointerend) ==
+      text2.substring(text2.length - pointermid, text2.length - pointerend)
+    ) {
+      pointermin = pointermid;
+      pointerend = pointermin;
+    } else {
+      pointermax = pointermid;
+    }
+    pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
+  }
+
+  if (is_surrogate_pair_end(text1.charCodeAt(text1.length - pointermid))) {
+    pointermid--;
+  }
+
+  return pointermid;
+};
+
+
+/**
+ * Do the two texts share a substring which is at least half the length of the
+ * longer text?
+ * This speedup can produce non-minimal diffs.
+ * @param {string} text1 First string.
+ * @param {string} text2 Second string.
+ * @return {Array.<string>} Five element Array, containing the prefix of
+ *     text1, the suffix of text1, the prefix of text2, the suffix of
+ *     text2 and the common middle.  Or null if there was no match.
+ */
+function diff_halfMatch_(text1, text2) {
+  var longtext = text1.length > text2.length ? text1 : text2;
+  var shorttext = text1.length > text2.length ? text2 : text1;
+  if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {
+    return null;  // Pointless.
+  }
+
+  /**
+   * Does a substring of shorttext exist within longtext such that the substring
+   * is at least half the length of longtext?
+   * Closure, but does not reference any external variables.
+   * @param {string} longtext Longer string.
+   * @param {string} shorttext Shorter string.
+   * @param {number} i Start index of quarter length substring within longtext.
+   * @return {Array.<string>} Five element Array, containing the prefix of
+   *     longtext, the suffix of longtext, the prefix of shorttext, the suffix
+   *     of shorttext and the common middle.  Or null if there was no match.
+   * @private
+   */
+  function diff_halfMatchI_(longtext, shorttext, i) {
+    // Start with a 1/4 length substring at position i as a seed.
+    var seed = longtext.substring(i, i + Math.floor(longtext.length / 4));
+    var j = -1;
+    var best_common = '';
+    var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;
+    while ((j = shorttext.indexOf(seed, j + 1)) !== -1) {
+      var prefixLength = diff_commonPrefix(
+        longtext.substring(i), shorttext.substring(j));
+      var suffixLength = diff_commonSuffix(
+        longtext.substring(0, i), shorttext.substring(0, j));
+      if (best_common.length < suffixLength + prefixLength) {
+        best_common = shorttext.substring(
+          j - suffixLength, j) + shorttext.substring(j, j + prefixLength);
+        best_longtext_a = longtext.substring(0, i - suffixLength);
+        best_longtext_b = longtext.substring(i + prefixLength);
+        best_shorttext_a = shorttext.substring(0, j - suffixLength);
+        best_shorttext_b = shorttext.substring(j + prefixLength);
+      }
+    }
+    if (best_common.length * 2 >= longtext.length) {
+      return [
+        best_longtext_a, best_longtext_b,
+        best_shorttext_a, best_shorttext_b, best_common
+      ];
+    } else {
+      return null;
+    }
+  }
+
+  // First check if the second quarter is the seed for a half-match.
+  var hm1 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 4));
+  // Check again based on the third quarter.
+  var hm2 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 2));
+  var hm;
+  if (!hm1 && !hm2) {
+    return null;
+  } else if (!hm2) {
+    hm = hm1;
+  } else if (!hm1) {
+    hm = hm2;
+  } else {
+    // Both matched.  Select the longest.
+    hm = hm1[4].length > hm2[4].length ? hm1 : hm2;
+  }
+
+  // A half-match was found, sort out the return data.
+  var text1_a, text1_b, text2_a, text2_b;
+  if (text1.length > text2.length) {
+    text1_a = hm[0];
+    text1_b = hm[1];
+    text2_a = hm[2];
+    text2_b = hm[3];
+  } else {
+    text2_a = hm[0];
+    text2_b = hm[1];
+    text1_a = hm[2];
+    text1_b = hm[3];
+  }
+  var mid_common = hm[4];
+  return [text1_a, text1_b, text2_a, text2_b, mid_common];
+};
+
+
+/**
+ * Reorder and merge like edit sections.  Merge equalities.
+ * Any edit section can move as long as it doesn't cross an equality.
+ * @param {Array} diffs Array of diff tuples.
+ * @param {boolean} fix_unicode Whether to normalize to a unicode-correct diff
+ */
+function diff_cleanupMerge(diffs, fix_unicode) {
+  diffs.push([DIFF_EQUAL, '']);  // Add a dummy entry at the end.
+  var pointer = 0;
+  var count_delete = 0;
+  var count_insert = 0;
+  var text_delete = '';
+  var text_insert = '';
+  var commonlength;
+  while (pointer < diffs.length) {
+    if (pointer < diffs.length - 1 && !diffs[pointer][1]) {
+      diffs.splice(pointer, 1);
+      continue;
+    }
+    switch (diffs[pointer][0]) {
+      case DIFF_INSERT:
+
+        count_insert++;
+        text_insert += diffs[pointer][1];
+        pointer++;
+        break;
+      case DIFF_DELETE:
+        count_delete++;
+        text_delete += diffs[pointer][1];
+        pointer++;
+        break;
+      case DIFF_EQUAL:
+        var previous_equality = pointer - count_insert - count_delete - 1;
+        if (fix_unicode) {
+          // prevent splitting of unicode surrogate pairs.  when fix_unicode is true,
+          // we assume that the old and new text in the diff are complete and correct
+          // unicode-encoded JS strings, but the tuple boundaries may fall between
+          // surrogate pairs.  we fix this by shaving off stray surrogates from the end
+          // of the previous equality and the beginning of this equality.  this may create
+          // empty equalities or a common prefix or suffix.  for example, if AB and AC are
+          // emojis, `[[0, 'A'], [-1, 'BA'], [0, 'C']]` would turn into deleting 'ABAC' and
+          // inserting 'AC', and then the common suffix 'AC' will be eliminated.  in this
+          // particular case, both equalities go away, we absorb any previous inequalities,
+          // and we keep scanning for the next equality before rewriting the tuples.
+          if (previous_equality >= 0 && ends_with_pair_start(diffs[previous_equality][1])) {
+            var stray = diffs[previous_equality][1].slice(-1);
+            diffs[previous_equality][1] = diffs[previous_equality][1].slice(0, -1);
+            text_delete = stray + text_delete;
+            text_insert = stray + text_insert;
+            if (!diffs[previous_equality][1]) {
+              // emptied out previous equality, so delete it and include previous delete/insert
+              diffs.splice(previous_equality, 1);
+              pointer--;
+              var k = previous_equality - 1;
+              if (diffs[k] && diffs[k][0] === DIFF_INSERT) {
+                count_insert++;
+                text_insert = diffs[k][1] + text_insert;
+                k--;
+              }
+              if (diffs[k] && diffs[k][0] === DIFF_DELETE) {
+                count_delete++;
+                text_delete = diffs[k][1] + text_delete;
+                k--;
+              }
+              previous_equality = k;
+            }
+          }
+          if (starts_with_pair_end(diffs[pointer][1])) {
+            var stray = diffs[pointer][1].charAt(0);
+            diffs[pointer][1] = diffs[pointer][1].slice(1);
+            text_delete += stray;
+            text_insert += stray;
+          }
+        }
+        if (pointer < diffs.length - 1 && !diffs[pointer][1]) {
+          // for empty equality not at end, wait for next equality
+          diffs.splice(pointer, 1);
+          break;
+        }
+        if (text_delete.length > 0 || text_insert.length > 0) {
+          // note that diff_commonPrefix and diff_commonSuffix are unicode-aware
+          if (text_delete.length > 0 && text_insert.length > 0) {
+            // Factor out any common prefixes.
+            commonlength = diff_commonPrefix(text_insert, text_delete);
+            if (commonlength !== 0) {
+              if (previous_equality >= 0) {
+                diffs[previous_equality][1] += text_insert.substring(0, commonlength);
+              } else {
+                diffs.splice(0, 0, [DIFF_EQUAL, text_insert.substring(0, commonlength)]);
+                pointer++;
+              }
+              text_insert = text_insert.substring(commonlength);
+              text_delete = text_delete.substring(commonlength);
+            }
+            // Factor out any common suffixes.
+            commonlength = diff_commonSuffix(text_insert, text_delete);
+            if (commonlength !== 0) {
+              diffs[pointer][1] =
+                text_insert.substring(text_insert.length - commonlength) + diffs[pointer][1];
+              text_insert = text_insert.substring(0, text_insert.length - commonlength);
+              text_delete = text_delete.substring(0, text_delete.length - commonlength);
+            }
+          }
+          // Delete the offending records and add the merged ones.
+          var n = count_insert + count_delete;
+          if (text_delete.length === 0 && text_insert.length === 0) {
+            diffs.splice(pointer - n, n);
+            pointer = pointer - n;
+          } else if (text_delete.length === 0) {
+            diffs.splice(pointer - n, n, [DIFF_INSERT, text_insert]);
+            pointer = pointer - n + 1;
+          } else if (text_insert.length === 0) {
+            diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete]);
+            pointer = pointer - n + 1;
+          } else {
+            diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete], [DIFF_INSERT, text_insert]);
+            pointer = pointer - n + 2;
+          }
+        }
+        if (pointer !== 0 && diffs[pointer - 1][0] === DIFF_EQUAL) {
+          // Merge this equality with the previous one.
+          diffs[pointer - 1][1] += diffs[pointer][1];
+          diffs.splice(pointer, 1);
+        } else {
+          pointer++;
+        }
+        count_insert = 0;
+        count_delete = 0;
+        text_delete = '';
+        text_insert = '';
+        break;
+    }
+  }
+  if (diffs[diffs.length - 1][1] === '') {
+    diffs.pop();  // Remove the dummy entry at the end.
+  }
+
+  // Second pass: look for single edits surrounded on both sides by equalities
+  // which can be shifted sideways to eliminate an equality.
+  // e.g: A<ins>BA</ins>C -> <ins>AB</ins>AC
+  var changes = false;
+  pointer = 1;
+  // Intentionally ignore the first and last element (don't need checking).
+  while (pointer < diffs.length - 1) {
+    if (diffs[pointer - 1][0] === DIFF_EQUAL &&
+      diffs[pointer + 1][0] === DIFF_EQUAL) {
+      // This is a single edit surrounded by equalities.
+      if (diffs[pointer][1].substring(diffs[pointer][1].length -
+        diffs[pointer - 1][1].length) === diffs[pointer - 1][1]) {
+        // Shift the edit over the previous equality.
+        diffs[pointer][1] = diffs[pointer - 1][1] +
+          diffs[pointer][1].substring(0, diffs[pointer][1].length -
+            diffs[pointer - 1][1].length);
+        diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];
+        diffs.splice(pointer - 1, 1);
+        changes = true;
+      } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) ==
+        diffs[pointer + 1][1]) {
+        // Shift the edit over the next equality.
+        diffs[pointer - 1][1] += diffs[pointer + 1][1];
+        diffs[pointer][1] =
+          diffs[pointer][1].substring(diffs[pointer + 1][1].length) +
+          diffs[pointer + 1][1];
+        diffs.splice(pointer + 1, 1);
+        changes = true;
+      }
+    }
+    pointer++;
+  }
+  // If shifts were made, the diff needs reordering and another shift sweep.
+  if (changes) {
+    diff_cleanupMerge(diffs, fix_unicode);
+  }
+};
+
+function is_surrogate_pair_start(charCode) {
+  return charCode >= 0xD800 && charCode <= 0xDBFF;
+}
+
+function is_surrogate_pair_end(charCode) {
+  return charCode >= 0xDC00 && charCode <= 0xDFFF;
+}
+
+function starts_with_pair_end(str) {
+  return is_surrogate_pair_end(str.charCodeAt(0));
+}
+
+function ends_with_pair_start(str) {
+  return is_surrogate_pair_start(str.charCodeAt(str.length - 1));
+}
+
+function remove_empty_tuples(tuples) {
+  var ret = [];
+  for (var i = 0; i < tuples.length; i++) {
+    if (tuples[i][1].length > 0) {
+      ret.push(tuples[i]);
+    }
+  }
+  return ret;
+}
+
+function make_edit_splice(before, oldMiddle, newMiddle, after) {
+  if (ends_with_pair_start(before) || starts_with_pair_end(after)) {
+    return null;
+  }
+  return remove_empty_tuples([
+    [DIFF_EQUAL, before],
+    [DIFF_DELETE, oldMiddle],
+    [DIFF_INSERT, newMiddle],
+    [DIFF_EQUAL, after]
+  ]);
+}
+
+function find_cursor_edit_diff(oldText, newText, cursor_pos) {
+  // note: this runs after equality check has ruled out exact equality
+  var oldRange = typeof cursor_pos === 'number' ?
+    { index: cursor_pos, length: 0 } : cursor_pos.oldRange;
+  var newRange = typeof cursor_pos === 'number' ?
+    null : cursor_pos.newRange;
+  // take into account the old and new selection to generate the best diff
+  // possible for a text edit.  for example, a text change from "xxx" to "xx"
+  // could be a delete or forwards-delete of any one of the x's, or the
+  // result of selecting two of the x's and typing "x".
+  var oldLength = oldText.length;
+  var newLength = newText.length;
+  if (oldRange.length === 0 && (newRange === null || newRange.length === 0)) {
+    // see if we have an insert or delete before or after cursor
+    var oldCursor = oldRange.index;
+    var oldBefore = oldText.slice(0, oldCursor);
+    var oldAfter = oldText.slice(oldCursor);
+    var maybeNewCursor = newRange ? newRange.index : null;
+    editBefore: {
+      // is this an insert or delete right before oldCursor?
+      var newCursor = oldCursor + newLength - oldLength;
+      if (maybeNewCursor !== null && maybeNewCursor !== newCursor) {
+        break editBefore;
+      }
+      if (newCursor < 0 || newCursor > newLength) {
+        break editBefore;
+      }
+      var newBefore = newText.slice(0, newCursor);
+      var newAfter = newText.slice(newCursor);
+      if (newAfter !== oldAfter) {
+        break editBefore;
+      }
+      var prefixLength = Math.min(oldCursor, newCursor);
+      var oldPrefix = oldBefore.slice(0, prefixLength);
+      var newPrefix = newBefore.slice(0, prefixLength);
+      if (oldPrefix !== newPrefix) {
+        break editBefore;
+      }
+      var oldMiddle = oldBefore.slice(prefixLength);
+      var newMiddle = newBefore.slice(prefixLength);
+      return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldAfter);
+    }
+    editAfter: {
+      // is this an insert or delete right after oldCursor?
+      if (maybeNewCursor !== null && maybeNewCursor !== oldCursor) {
+        break editAfter;
+      }
+      var cursor = oldCursor;
+      var newBefore = newText.slice(0, cursor);
+      var newAfter = newText.slice(cursor);
+      if (newBefore !== oldBefore) {
+        break editAfter;
+      }
+      var suffixLength = Math.min(oldLength - cursor, newLength - cursor);
+      var oldSuffix = oldAfter.slice(oldAfter.length - suffixLength);
+      var newSuffix = newAfter.slice(newAfter.length - suffixLength);
+      if (oldSuffix !== newSuffix) {
+        break editAfter;
+      }
+      var oldMiddle = oldAfter.slice(0, oldAfter.length - suffixLength);
+      var newMiddle = newAfter.slice(0, newAfter.length - suffixLength);
+      return make_edit_splice(oldBefore, oldMiddle, newMiddle, oldSuffix);
+    }
+  }
+  if (oldRange.length > 0 && newRange && newRange.length === 0) {
+    replaceRange: {
+      // see if diff could be a splice of the old selection range
+      var oldPrefix = oldText.slice(0, oldRange.index);
+      var oldSuffix = oldText.slice(oldRange.index + oldRange.length);
+      var prefixLength = oldPrefix.length;
+      var suffixLength = oldSuffix.length;
+      if (newLength < prefixLength + suffixLength) {
+        break replaceRange;
+      }
+      var newPrefix = newText.slice(0, prefixLength);
+      var newSuffix = newText.slice(newLength - suffixLength);
+      if (oldPrefix !== newPrefix || oldSuffix !== newSuffix) {
+        break replaceRange;
+      }
+      var oldMiddle = oldText.slice(prefixLength, oldLength - suffixLength);
+      var newMiddle = newText.slice(prefixLength, newLength - suffixLength);
+      return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldSuffix);
+    }
+  }
+
+  return null;
+}
+
+function diff(text1, text2, cursor_pos) {
+  // only pass fix_unicode=true at the top level, not when diff_main is
+  // recursively invoked
+  return diff_main(text1, text2, cursor_pos, true);
+}
+
+diff.INSERT = DIFF_INSERT;
+diff.DELETE = DIFF_DELETE;
+diff.EQUAL = DIFF_EQUAL;
+
+module.exports = diff;
+
+
+/***/ }),
+/* 50 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+const path = __webpack_require__(3);
+const Module = __webpack_require__(51);
+const fs = __webpack_require__(2);
+
+const resolveFrom = (fromDirectory, moduleId, silent) => {
+       if (typeof fromDirectory !== 'string') {
+               throw new TypeError(`Expected \`fromDir\` to be of type \`string\`, got \`${typeof fromDirectory}\``);
+       }
+
+       if (typeof moduleId !== 'string') {
+               throw new TypeError(`Expected \`moduleId\` to be of type \`string\`, got \`${typeof moduleId}\``);
+       }
+
+       try {
+               fromDirectory = fs.realpathSync(fromDirectory);
+       } catch (error) {
+               if (error.code === 'ENOENT') {
+                       fromDirectory = path.resolve(fromDirectory);
+               } else if (silent) {
+                       return;
+               } else {
+                       throw error;
+               }
+       }
+
+       const fromFile = path.join(fromDirectory, 'noop.js');
+
+       const resolveFileName = () => Module._resolveFilename(moduleId, {
+               id: fromFile,
+               filename: fromFile,
+               paths: Module._nodeModulePaths(fromDirectory)
+       });
+
+       if (silent) {
+               try {
+                       return resolveFileName();
+               } catch (error) {
+                       return;
+               }
+       }
+
+       return resolveFileName();
+};
+
+module.exports = (fromDirectory, moduleId) => resolveFrom(fromDirectory, moduleId);
+module.exports.silent = (fromDirectory, moduleId) => resolveFrom(fromDirectory, moduleId, true);
+
+
+/***/ }),
+/* 51 */
+/***/ (function(module, exports) {
+
+module.exports = require("module");
+
+/***/ }),
+/* 52 */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextDocument", function() { return TextDocument; });
+/* --------------------------------------------------------------------------------------------\r
+ * Copyright (c) Microsoft Corporation. All rights reserved.\r
+ * Licensed under the MIT License. See License.txt in the project root for license information.\r
+ * ------------------------------------------------------------------------------------------ */\r
+\r
+var __spreadArrays = (undefined && undefined.__spreadArrays) || function () {\r
+    for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r
+    for (var r = Array(s), k = 0, i = 0; i < il; i++)\r
+        for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r
+            r[k] = a[j];\r
+    return r;\r
+};\r
+var FullTextDocument = /** @class */ (function () {\r
+    function FullTextDocument(uri, languageId, version, content) {\r
+        this._uri = uri;\r
+        this._languageId = languageId;\r
+        this._version = version;\r
+        this._content = content;\r
+        this._lineOffsets = undefined;\r
+    }\r
+    Object.defineProperty(FullTextDocument.prototype, "uri", {\r
+        get: function () {\r
+            return this._uri;\r
+        },\r
+        enumerable: true,\r
+        configurable: true\r
+    });\r
+    Object.defineProperty(FullTextDocument.prototype, "languageId", {\r
+        get: function () {\r
+            return this._languageId;\r
+        },\r
+        enumerable: true,\r
+        configurable: true\r
+    });\r
+    Object.defineProperty(FullTextDocument.prototype, "version", {\r
+        get: function () {\r
+            return this._version;\r
+        },\r
+        enumerable: true,\r
+        configurable: true\r
+    });\r
+    FullTextDocument.prototype.getText = function (range) {\r
+        if (range) {\r
+            var start = this.offsetAt(range.start);\r
+            var end = this.offsetAt(range.end);\r
+            return this._content.substring(start, end);\r
+        }\r
+        return this._content;\r
+    };\r
+    FullTextDocument.prototype.update = function (changes, version) {\r
+        for (var _i = 0, changes_1 = changes; _i < changes_1.length; _i++) {\r
+            var change = changes_1[_i];\r
+            if (FullTextDocument.isIncremental(change)) {\r
+                // makes sure start is before end\r
+                var range = getWellformedRange(change.range);\r
+                // update content\r
+                var startOffset = this.offsetAt(range.start);\r
+                var endOffset = this.offsetAt(range.end);\r
+                this._content = this._content.substring(0, startOffset) + change.text + this._content.substring(endOffset, this._content.length);\r
+                // update the offsets\r
+                var startLine = Math.max(range.start.line, 0);\r
+                var endLine = Math.max(range.end.line, 0);\r
+                var lineOffsets = this._lineOffsets;\r
+                var addedLineOffsets = computeLineOffsets(change.text, false, startOffset);\r
+                if (endLine - startLine === addedLineOffsets.length) {\r
+                    for (var i = 0, len = addedLineOffsets.length; i < len; i++) {\r
+                        lineOffsets[i + startLine + 1] = addedLineOffsets[i];\r
+                    }\r
+                }\r
+                else {\r
+                    if (addedLineOffsets.length < 10000) {\r
+                        lineOffsets.splice.apply(lineOffsets, __spreadArrays([startLine + 1, endLine - startLine], addedLineOffsets));\r
+                    }\r
+                    else { // avoid too many arguments for splice\r
+                        this._lineOffsets = lineOffsets = lineOffsets.slice(0, startLine + 1).concat(addedLineOffsets, lineOffsets.slice(endLine + 1));\r
+                    }\r
+                }\r
+                var diff = change.text.length - (endOffset - startOffset);\r
+                if (diff !== 0) {\r
+                    for (var i = startLine + 1 + addedLineOffsets.length, len = lineOffsets.length; i < len; i++) {\r
+                        lineOffsets[i] = lineOffsets[i] + diff;\r
+                    }\r
+                }\r
+            }\r
+            else if (FullTextDocument.isFull(change)) {\r
+                this._content = change.text;\r
+                this._lineOffsets = undefined;\r
+            }\r
+            else {\r
+                throw new Error('Unknown change event received');\r
+            }\r
+        }\r
+        this._version = version;\r
+    };\r
+    FullTextDocument.prototype.getLineOffsets = function () {\r
+        if (this._lineOffsets === undefined) {\r
+            this._lineOffsets = computeLineOffsets(this._content, true);\r
+        }\r
+        return this._lineOffsets;\r
+    };\r
+    FullTextDocument.prototype.positionAt = function (offset) {\r
+        offset = Math.max(Math.min(offset, this._content.length), 0);\r
+        var lineOffsets = this.getLineOffsets();\r
+        var low = 0, high = lineOffsets.length;\r
+        if (high === 0) {\r
+            return { line: 0, character: offset };\r
+        }\r
+        while (low < high) {\r
+            var mid = Math.floor((low + high) / 2);\r
+            if (lineOffsets[mid] > offset) {\r
+                high = mid;\r
+            }\r
+            else {\r
+                low = mid + 1;\r
+            }\r
+        }\r
+        // low is the least x for which the line offset is larger than the current offset\r
+        // or array.length if no line offset is larger than the current offset\r
+        var line = low - 1;\r
+        return { line: line, character: offset - lineOffsets[line] };\r
+    };\r
+    FullTextDocument.prototype.offsetAt = function (position) {\r
+        var lineOffsets = this.getLineOffsets();\r
+        if (position.line >= lineOffsets.length) {\r
+            return this._content.length;\r
+        }\r
+        else if (position.line < 0) {\r
+            return 0;\r
+        }\r
+        var lineOffset = lineOffsets[position.line];\r
+        var nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length;\r
+        return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset);\r
+    };\r
+    Object.defineProperty(FullTextDocument.prototype, "lineCount", {\r
+        get: function () {\r
+            return this.getLineOffsets().length;\r
+        },\r
+        enumerable: true,\r
+        configurable: true\r
+    });\r
+    FullTextDocument.isIncremental = function (event) {\r
+        var candidate = event;\r
+        return candidate !== undefined && candidate !== null &&\r
+            typeof candidate.text === 'string' && candidate.range !== undefined &&\r
+            (candidate.rangeLength === undefined || typeof candidate.rangeLength === 'number');\r
+    };\r
+    FullTextDocument.isFull = function (event) {\r
+        var candidate = event;\r
+        return candidate !== undefined && candidate !== null &&\r
+            typeof candidate.text === 'string' && candidate.range === undefined && candidate.rangeLength === undefined;\r
+    };\r
+    return FullTextDocument;\r
+}());\r
+var TextDocument;\r
+(function (TextDocument) {\r
+    /**\r
+     * Creates a new text document.\r
+     *\r
+     * @param uri The document's uri.\r
+     * @param languageId  The document's language Id.\r
+     * @param version The document's initial version number.\r
+     * @param content The document's content.\r
+     */\r
+    function create(uri, languageId, version, content) {\r
+        return new FullTextDocument(uri, languageId, version, content);\r
+    }\r
+    TextDocument.create = create;\r
+    /**\r
+     * Updates a TextDocument by modifing its content.\r
+     *\r
+     * @param document the document to update. Only documents created by TextDocument.create are valid inputs.\r
+     * @param changes the changes to apply to the document.\r
+     * @returns The updated TextDocument. Note: That's the same document instance passed in as first parameter.\r
+     *\r
+     */\r
+    function update(document, changes, version) {\r
+        if (document instanceof FullTextDocument) {\r
+            document.update(changes, version);\r
+            return document;\r
+        }\r
+        else {\r
+            throw new Error('TextDocument.update: document must be created by TextDocument.create');\r
+        }\r
+    }\r
+    TextDocument.update = update;\r
+    function applyEdits(document, edits) {\r
+        var text = document.getText();\r
+        var sortedEdits = mergeSort(edits.map(getWellformedEdit), function (a, b) {\r
+            var diff = a.range.start.line - b.range.start.line;\r
+            if (diff === 0) {\r
+                return a.range.start.character - b.range.start.character;\r
+            }\r
+            return diff;\r
+        });\r
+        var lastModifiedOffset = text.length;\r
+        for (var i = sortedEdits.length - 1; i >= 0; i--) {\r
+            var e = sortedEdits[i];\r
+            var startOffset = document.offsetAt(e.range.start);\r
+            var endOffset = document.offsetAt(e.range.end);\r
+            if (endOffset <= lastModifiedOffset) {\r
+                text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length);\r
+            }\r
+            else {\r
+                throw new Error('Overlapping edit');\r
+            }\r
+            lastModifiedOffset = startOffset;\r
+        }\r
+        return text;\r
+    }\r
+    TextDocument.applyEdits = applyEdits;\r
+})(TextDocument || (TextDocument = {}));\r
+function mergeSort(data, compare) {\r
+    if (data.length <= 1) {\r
+        // sorted\r
+        return data;\r
+    }\r
+    var p = (data.length / 2) | 0;\r
+    var left = data.slice(0, p);\r
+    var right = data.slice(p);\r
+    mergeSort(left, compare);\r
+    mergeSort(right, compare);\r
+    var leftIdx = 0;\r
+    var rightIdx = 0;\r
+    var i = 0;\r
+    while (leftIdx < left.length && rightIdx < right.length) {\r
+        var ret = compare(left[leftIdx], right[rightIdx]);\r
+        if (ret <= 0) {\r
+            // smaller_equal -> take left to preserve order\r
+            data[i++] = left[leftIdx++];\r
+        }\r
+        else {\r
+            // greater -> take right\r
+            data[i++] = right[rightIdx++];\r
+        }\r
+    }\r
+    while (leftIdx < left.length) {\r
+        data[i++] = left[leftIdx++];\r
+    }\r
+    while (rightIdx < right.length) {\r
+        data[i++] = right[rightIdx++];\r
+    }\r
+    return data;\r
+}\r
+function computeLineOffsets(text, isAtLineStart, textOffset) {\r
+    if (textOffset === void 0) { textOffset = 0; }\r
+    var result = isAtLineStart ? [textOffset] : [];\r
+    for (var i = 0; i < text.length; i++) {\r
+        var ch = text.charCodeAt(i);\r
+        if (ch === 13 /* CarriageReturn */ || ch === 10 /* LineFeed */) {\r
+            if (ch === 13 /* CarriageReturn */ && i + 1 < text.length && text.charCodeAt(i + 1) === 10 /* LineFeed */) {\r
+                i++;\r
+            }\r
+            result.push(textOffset + i + 1);\r
+        }\r
+    }\r
+    return result;\r
+}\r
+function getWellformedRange(range) {\r
+    var start = range.start;\r
+    var end = range.end;\r
+    if (start.line > end.line || (start.line === end.line && start.character > end.character)) {\r
+        return { start: end, end: start };\r
+    }\r
+    return range;\r
+}\r
+function getWellformedEdit(textEdit) {\r
+    var range = getWellformedRange(textEdit.range);\r
+    if (range !== textEdit.range) {\r
+        return { newText: textEdit.newText, range: range };\r
+    }\r
+    return textEdit;\r
+}\r
+
+
+/***/ })
+/******/ ])));
\ No newline at end of file