X-Git-Url: https://git.josue.xyz/?p=dotfiles%2F.git;a=blobdiff_plain;f=.config%2Fcoc%2Fextensions%2Fnode_modules%2Fcoc-html%2Flib%2Findex.js;h=0cd720a4c531260736a151fabe52d4d0bed0686d;hp=90dec9131d3a7c0e56324900f46e2a6a3e301a25;hb=4d07c77cf4d78cab8639e13ddc3c22495e585b0b;hpb=b3950616b54221c40a7dab9099bda675007e5b6e diff --git a/.config/coc/extensions/node_modules/coc-html/lib/index.js b/.config/coc/extensions/node_modules/coc-html/lib/index.js index 90dec913..0cd720a4 100644 --- a/.config/coc/extensions/node_modules/coc-html/lib/index.js +++ b/.config/coc/extensions/node_modules/coc-html/lib/index.js @@ -1,108 +1,26 @@ -(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 = 0); -/******/ }) -/************************************************************************/ -/******/ ([ +(function(e, a) { for(var i in a) e[i] = a[i]; if(a.__esModule) Object.defineProperty(e, "__esModule", { value: true }); }(exports, +/******/ (() => { // webpackBootstrap +/******/ "use strict"; +/******/ var __webpack_modules__ = ([ /* 0 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { -"use strict"; 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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -Object.defineProperty(exports, "__esModule", { value: true }); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.activate = void 0; const coc_nvim_1 = __webpack_require__(1); const customData_1 = __webpack_require__(2); const vscode_languageserver_protocol_1 = __webpack_require__(4); -const tagClosing_1 = __webpack_require__(31); +const tagClosing_1 = __webpack_require__(41); var TagCloseRequest; (function (TagCloseRequest) { TagCloseRequest.type = new vscode_languageserver_protocol_1.RequestType('html/tag'); @@ -115,7 +33,7 @@ function activate(context) { if (enable === false) return; const file = context.asAbsolutePath('lib/server.js'); - const selector = config.filetypes || ['html', 'handlebars', 'htmldjango']; + const selector = config.filetypes || ['html', 'handlebars', 'htmldjango', 'blade']; const embeddedLanguages = { css: true, javascript: true }; let serverOptions = { module: file, @@ -174,28 +92,40 @@ exports.activate = activate; /***/ }), /* 1 */ -/***/ (function(module, exports) { +/***/ ((module) => { -module.exports = require("coc.nvim"); +module.exports = require("coc.nvim");; /***/ }), /* 2 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(__unused_webpack_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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); 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; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); return result; }; -Object.defineProperty(exports, "__esModule", { value: true }); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getCustomDataPathsFromAllExtensions = exports.getCustomDataPathsInAllWorkspaces = void 0; const path = __importStar(__webpack_require__(3)); const coc_nvim_1 = __webpack_require__(1); function getCustomDataPathsInAllWorkspaces() { @@ -204,2494 +134,3006 @@ function getCustomDataPathsInAllWorkspaces() { if (!workspaceFolders) { return dataPaths; } - workspaceFolders.forEach(wf => { - const allHtmlConfig = coc_nvim_1.workspace.getConfiguration(undefined, wf.uri); - const wfHtmlConfig = allHtmlConfig.inspect('html'); - if (wfHtmlConfig && - wfHtmlConfig.workspaceFolderValue && - wfHtmlConfig.workspaceFolderValue.experimental && - wfHtmlConfig.workspaceFolderValue.experimental.customData) { - const customData = wfHtmlConfig.workspaceFolderValue.experimental.customData; - if (Array.isArray(customData)) { - customData.forEach(t => { - if (typeof t === 'string') { - dataPaths.push(path.resolve(coc_nvim_1.Uri.parse(wf.uri).fsPath, t)); - } - }); + workspaceFolders.forEach(wf => { + const allHtmlConfig = coc_nvim_1.workspace.getConfiguration(undefined, wf.uri); + const wfHtmlConfig = allHtmlConfig.inspect('html'); + if (wfHtmlConfig && + wfHtmlConfig.workspaceFolderValue && + wfHtmlConfig.workspaceFolderValue.experimental && + wfHtmlConfig.workspaceFolderValue.experimental.customData) { + const customData = wfHtmlConfig.workspaceFolderValue.experimental.customData; + if (Array.isArray(customData)) { + customData.forEach(t => { + if (typeof t === 'string') { + dataPaths.push(path.resolve(coc_nvim_1.Uri.parse(wf.uri).fsPath, t)); + } + }); + } + } + }); + return dataPaths; +} +exports.getCustomDataPathsInAllWorkspaces = getCustomDataPathsInAllWorkspaces; +function getCustomDataPathsFromAllExtensions() { + const dataPaths = []; + for (const extension of coc_nvim_1.extensions.all) { + const contributes = extension.packageJSON && extension.packageJSON.contributes; + if (contributes && + contributes.html && + contributes.html.experimental.customData && + Array.isArray(contributes.html.experimental.customData)) { + const relativePaths = contributes.html.experimental.customData; + relativePaths.forEach(rp => { + dataPaths.push(path.resolve(extension.extensionPath, rp)); + }); + } + } + return dataPaths; +} +exports.getCustomDataPathsFromAllExtensions = getCustomDataPathsFromAllExtensions; + + +/***/ }), +/* 3 */ +/***/ ((module) => { + +module.exports = require("path");; + +/***/ }), +/* 4 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +Object.defineProperty(exports, "__esModule", ({ value: true })); +const node_1 = __webpack_require__(5); +__export(__webpack_require__(5)); +__export(__webpack_require__(24)); +function createProtocolConnection(input, output, logger, options) { + return node_1.createMessageConnection(input, output, logger, options); +} +exports.createProtocolConnection = createProtocolConnection; +//# sourceMappingURL=main.js.map + +/***/ }), +/* 5 */ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ----------------------------------------------------------------------------------------- */ + + +module.exports = __webpack_require__(6); + +/***/ }), +/* 6 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +Object.defineProperty(exports, "__esModule", ({ value: true })); +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ----------------------------------------------------------------------------------------- */ +const ril_1 = __webpack_require__(7); +// Install the node runtime abstract. +ril_1.default.install(); +const api_1 = __webpack_require__(11); +const path = __webpack_require__(3); +const os = __webpack_require__(21); +const crypto_1 = __webpack_require__(22); +const net_1 = __webpack_require__(23); +__export(__webpack_require__(11)); +class IPCMessageReader extends api_1.AbstractMessageReader { + constructor(process) { + super(); + this.process = process; + let eventEmitter = this.process; + eventEmitter.on('error', (error) => this.fireError(error)); + eventEmitter.on('close', () => this.fireClose()); + } + listen(callback) { + this.process.on('message', callback); + return api_1.Disposable.create(() => this.process.off('message', callback)); + } +} +exports.IPCMessageReader = IPCMessageReader; +class IPCMessageWriter extends api_1.AbstractMessageWriter { + constructor(process) { + super(); + this.process = process; + this.errorCount = 0; + let eventEmitter = this.process; + eventEmitter.on('error', (error) => this.fireError(error)); + eventEmitter.on('close', () => this.fireClose); + } + write(msg) { + try { + if (typeof this.process.send === 'function') { + this.process.send(msg, undefined, undefined, (error) => { + if (error) { + this.errorCount++; + this.handleError(error, msg); + } + else { + this.errorCount = 0; + } + }); + } + return Promise.resolve(); + } + catch (error) { + this.handleError(error, msg); + return Promise.reject(error); + } + } + handleError(error, msg) { + this.errorCount++; + this.fireError(error, msg, this.errorCount); + } +} +exports.IPCMessageWriter = IPCMessageWriter; +class SocketMessageReader extends api_1.ReadableStreamMessageReader { + constructor(socket, encoding = 'utf-8') { + super(ril_1.default().stream.asReadableStream(socket), encoding); + } +} +exports.SocketMessageReader = SocketMessageReader; +class SocketMessageWriter extends api_1.WriteableStreamMessageWriter { + constructor(socket, options) { + super(ril_1.default().stream.asWritableStream(socket), options); + this.socket = socket; + } + dispose() { + super.dispose(); + this.socket.destroy(); + } +} +exports.SocketMessageWriter = SocketMessageWriter; +class StreamMessageReader extends api_1.ReadableStreamMessageReader { + constructor(readble, encoding) { + super(ril_1.default().stream.asReadableStream(readble), encoding); + } +} +exports.StreamMessageReader = StreamMessageReader; +class StreamMessageWriter extends api_1.WriteableStreamMessageWriter { + constructor(writable, options) { + super(ril_1.default().stream.asWritableStream(writable), options); + } +} +exports.StreamMessageWriter = StreamMessageWriter; +function generateRandomPipeName() { + const randomSuffix = crypto_1.randomBytes(21).toString('hex'); + if (process.platform === 'win32') { + return `\\\\.\\pipe\\vscode-jsonrpc-${randomSuffix}-sock`; + } + else { + // Mac/Unix: use socket file + return path.join(os.tmpdir(), `vscode-${randomSuffix}.sock`); + } +} +exports.generateRandomPipeName = generateRandomPipeName; +function createClientPipeTransport(pipeName, encoding = 'utf-8') { + let connectResolve; + const connected = new Promise((resolve, _reject) => { + connectResolve = resolve; + }); + return new Promise((resolve, reject) => { + let server = net_1.createServer((socket) => { + server.close(); + connectResolve([ + new SocketMessageReader(socket, encoding), + new SocketMessageWriter(socket, encoding) + ]); + }); + server.on('error', reject); + server.listen(pipeName, () => { + server.removeListener('error', reject); + resolve({ + onConnected: () => { return connected; } + }); + }); + }); +} +exports.createClientPipeTransport = createClientPipeTransport; +function createServerPipeTransport(pipeName, encoding = 'utf-8') { + const socket = net_1.createConnection(pipeName); + return [ + new SocketMessageReader(socket, encoding), + new SocketMessageWriter(socket, encoding) + ]; +} +exports.createServerPipeTransport = createServerPipeTransport; +function createClientSocketTransport(port, encoding = 'utf-8') { + let connectResolve; + const connected = new Promise((resolve, _reject) => { + connectResolve = resolve; + }); + return new Promise((resolve, reject) => { + const server = net_1.createServer((socket) => { + server.close(); + connectResolve([ + new SocketMessageReader(socket, encoding), + new SocketMessageWriter(socket, encoding) + ]); + }); + server.on('error', reject); + server.listen(port, '127.0.0.1', () => { + server.removeListener('error', reject); + resolve({ + onConnected: () => { return connected; } + }); + }); + }); +} +exports.createClientSocketTransport = createClientSocketTransport; +function createServerSocketTransport(port, encoding = 'utf-8') { + const socket = net_1.createConnection(port, '127.0.0.1'); + return [ + new SocketMessageReader(socket, encoding), + new SocketMessageWriter(socket, encoding) + ]; +} +exports.createServerSocketTransport = createServerSocketTransport; +function isMessageReader(value) { + return value.listen !== undefined && value.read === undefined; +} +function isMessageWriter(value) { + return value.write !== undefined && value.end === undefined; +} +function createMessageConnection(input, output, logger, options) { + if (!logger) { + logger = api_1.NullLogger; + } + const reader = isMessageReader(input) ? input : new StreamMessageReader(input); + const writer = isMessageWriter(output) ? output : new StreamMessageWriter(output); + if (api_1.ConnectionStrategy.is(options)) { + options = { connectionStrategy: options }; + } + return api_1.createMessageConnection(reader, writer, logger, options); +} +exports.createMessageConnection = createMessageConnection; +//# sourceMappingURL=main.js.map + +/***/ }), +/* 7 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +const ral_1 = __webpack_require__(8); +const disposable_1 = __webpack_require__(9); +const util_1 = __webpack_require__(10); +const DefaultSize = 8192; +const CR = Buffer.from('\r', 'ascii')[0]; +const LF = Buffer.from('\n', 'ascii')[0]; +const CRLF = '\r\n'; +class MessageBuffer { + constructor(encoding = 'utf-8') { + this._encoding = encoding; + this.index = 0; + this.buffer = Buffer.allocUnsafe(DefaultSize); + } + get encoding() { + return this._encoding; + } + append(chunk) { + let toAppend; + if (typeof chunk === 'string') { + toAppend = Buffer.from(chunk, this._encoding); + } + else { + toAppend = chunk; + } + if (this.buffer.length - this.index >= toAppend.length) { + this.buffer.set(toAppend, this.index); + } + else { + var newSize = (Math.ceil((this.index + toAppend.length) / DefaultSize) + 1) * DefaultSize; + if (this.index === 0) { + this.buffer = Buffer.allocUnsafe(newSize); + this.buffer.set(toAppend); + } + else { + this.buffer = Buffer.concat([this.buffer.slice(0, this.index), toAppend], newSize); + } + } + this.index += toAppend.length; + } + tryReadHeaders() { + let current = 0; + while (current + 3 < this.index && (this.buffer[current] !== CR || this.buffer[current + 1] !== LF || this.buffer[current + 2] !== CR || this.buffer[current + 3] !== LF)) { + current++; + } + // No header / body separator found (e.g CRLFCRLF) + if (current + 3 >= this.index) { + return undefined; + } + const result = new Map(); + const headers = this.buffer.toString('ascii', 0, current).split(CRLF); + headers.forEach((header) => { + let index = header.indexOf(':'); + if (index === -1) { + throw new Error('Message header must separate key and value using :'); + } + let key = header.substr(0, index); + let value = header.substr(index + 1).trim(); + result.set(key, value); + }); + let nextStart = current + 4; + this.buffer = this.buffer.slice(nextStart); + this.index = this.index - nextStart; + return result; + } + tryReadBody(length) { + if (this.index < length) { + return undefined; + } + const result = Buffer.alloc(length); + this.buffer.copy(result, 0, 0, length); + const nextStart = length; + this.buffer.copy(this.buffer, 0, nextStart); + this.index = this.index - nextStart; + return result; + } + get numberOfBytes() { + return this.index; + } +} +class ReadableStreamWrapper { + constructor(stream) { + this.stream = stream; + } + onClose(listener) { + this.stream.on('close', listener); + return disposable_1.Disposable.create(() => this.stream.off('close', listener)); + } + onError(listener) { + this.stream.on('error', listener); + return disposable_1.Disposable.create(() => this.stream.off('error', listener)); + } + onEnd(listener) { + this.stream.on('end', listener); + return disposable_1.Disposable.create(() => this.stream.off('end', listener)); + } + onData(listener) { + this.stream.on('data', listener); + return disposable_1.Disposable.create(() => this.stream.off('data', listener)); + } +} +class WritableStreamWrapper { + constructor(stream) { + this.stream = stream; + } + onClose(listener) { + this.stream.on('close', listener); + return disposable_1.Disposable.create(() => this.stream.off('close', listener)); + } + onError(listener) { + this.stream.on('error', listener); + return disposable_1.Disposable.create(() => this.stream.off('error', listener)); + } + onEnd(listener) { + this.stream.on('end', listener); + return disposable_1.Disposable.create(() => this.stream.off('end', listener)); + } + write(data, encoding) { + return new Promise((resolve, reject) => { + const callback = (error) => { + if (error === undefined || error === null) { + resolve(); + } + else { + reject(error); + } + }; + if (typeof data === 'string') { + this.stream.write(data, encoding, callback); + } + else { + this.stream.write(data, callback); + } + }); + } + end() { + this.stream.end(); + } +} +const _ril = Object.freeze({ + messageBuffer: Object.freeze({ + create: (encoding) => new MessageBuffer(encoding) + }), + applicationJson: Object.freeze({ + encoder: Object.freeze({ + name: 'application/json', + encode: (msg, options) => { + return Promise.resolve(Buffer.from(JSON.stringify(msg, undefined, 0), options.charset)); + } + }), + decoder: Object.freeze({ + name: 'application/json', + decode: (buffer, options) => { + if (buffer instanceof Buffer) { + return Promise.resolve(JSON.parse(buffer.toString(options.charset))); + } + else { + return Promise.resolve(JSON.parse(new util_1.TextDecoder(options.charset).decode(buffer))); + } + } + }) + }), + stream: Object.freeze({ + asReadableStream: (socket) => new ReadableStreamWrapper(socket), + asWritableStream: (socket) => new WritableStreamWrapper(socket) + }), + console: console, + timer: Object.freeze({ + setTimeout(callback, ms, ...args) { + return setTimeout(callback, ms, ...args); + }, + clearTimeout(handle) { + clearTimeout(handle); + }, + setImmediate(callback, ...args) { + return setImmediate(callback, ...args); + }, + clearImmediate(handle) { + clearImmediate(handle); + } + }) +}); +function RIL() { + return _ril; +} +(function (RIL) { + function install() { + ral_1.default.install(_ril); + } + RIL.install = install; +})(RIL || (RIL = {})); +exports.default = RIL; +//# sourceMappingURL=ril.js.map + +/***/ }), +/* 8 */ +/***/ ((__unused_webpack_module, exports) => { + + +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +let _ral; +function RAL() { + if (_ral === undefined) { + throw new Error(`No runtime abstraction layer installed`); + } + return _ral; +} +(function (RAL) { + function install(ral) { + if (ral === undefined) { + throw new Error(`No runtime abstraction layer provided`); + } + _ral = ral; + } + RAL.install = install; +})(RAL || (RAL = {})); +exports.default = RAL; +//# sourceMappingURL=ral.js.map + +/***/ }), +/* 9 */ +/***/ ((__unused_webpack_module, exports) => { + + +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +Object.defineProperty(exports, "__esModule", ({ value: true })); +var Disposable; +(function (Disposable) { + function create(func) { + return { + dispose: func + }; + } + Disposable.create = create; +})(Disposable = exports.Disposable || (exports.Disposable = {})); +//# sourceMappingURL=disposable.js.map + +/***/ }), +/* 10 */ +/***/ ((module) => { + +module.exports = require("util");; + +/***/ }), +/* 11 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ +/// +Object.defineProperty(exports, "__esModule", ({ value: true })); +const messages_1 = __webpack_require__(12); +exports.RequestType = messages_1.RequestType; +exports.RequestType0 = messages_1.RequestType0; +exports.RequestType1 = messages_1.RequestType1; +exports.RequestType2 = messages_1.RequestType2; +exports.RequestType3 = messages_1.RequestType3; +exports.RequestType4 = messages_1.RequestType4; +exports.RequestType5 = messages_1.RequestType5; +exports.RequestType6 = messages_1.RequestType6; +exports.RequestType7 = messages_1.RequestType7; +exports.RequestType8 = messages_1.RequestType8; +exports.RequestType9 = messages_1.RequestType9; +exports.ResponseError = messages_1.ResponseError; +exports.ErrorCodes = messages_1.ErrorCodes; +exports.NotificationType = messages_1.NotificationType; +exports.NotificationType0 = messages_1.NotificationType0; +exports.NotificationType1 = messages_1.NotificationType1; +exports.NotificationType2 = messages_1.NotificationType2; +exports.NotificationType3 = messages_1.NotificationType3; +exports.NotificationType4 = messages_1.NotificationType4; +exports.NotificationType5 = messages_1.NotificationType5; +exports.NotificationType6 = messages_1.NotificationType6; +exports.NotificationType7 = messages_1.NotificationType7; +exports.NotificationType8 = messages_1.NotificationType8; +exports.NotificationType9 = messages_1.NotificationType9; +const disposable_1 = __webpack_require__(9); +exports.Disposable = disposable_1.Disposable; +const events_1 = __webpack_require__(14); +exports.Event = events_1.Event; +exports.Emitter = events_1.Emitter; +const cancellation_1 = __webpack_require__(15); +exports.CancellationTokenSource = cancellation_1.CancellationTokenSource; +exports.CancellationToken = cancellation_1.CancellationToken; +const messageReader_1 = __webpack_require__(16); +exports.MessageReader = messageReader_1.MessageReader; +exports.AbstractMessageReader = messageReader_1.AbstractMessageReader; +exports.ReadableStreamMessageReader = messageReader_1.ReadableStreamMessageReader; +const messageWriter_1 = __webpack_require__(17); +exports.MessageWriter = messageWriter_1.MessageWriter; +exports.AbstractMessageWriter = messageWriter_1.AbstractMessageWriter; +exports.WriteableStreamMessageWriter = messageWriter_1.WriteableStreamMessageWriter; +const connection_1 = __webpack_require__(19); +exports.ConnectionStrategy = connection_1.ConnectionStrategy; +exports.ConnectionOptions = connection_1.ConnectionOptions; +exports.NullLogger = connection_1.NullLogger; +exports.createMessageConnection = connection_1.createMessageConnection; +exports.ProgressType = connection_1.ProgressType; +exports.Trace = connection_1.Trace; +exports.TraceFormat = connection_1.TraceFormat; +exports.SetTraceNotification = connection_1.SetTraceNotification; +exports.LogTraceNotification = connection_1.LogTraceNotification; +exports.ConnectionErrors = connection_1.ConnectionErrors; +exports.ConnectionError = connection_1.ConnectionError; +exports.CancellationReceiverStrategy = connection_1.CancellationReceiverStrategy; +exports.CancellationSenderStrategy = connection_1.CancellationSenderStrategy; +exports.CancellationStrategy = connection_1.CancellationStrategy; +const ral_1 = __webpack_require__(8); +exports.RAL = ral_1.default; +//# sourceMappingURL=api.js.map + +/***/ }), +/* 12 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +const is = __webpack_require__(13); +/** + * Predefined error codes. + */ +var ErrorCodes; +(function (ErrorCodes) { + // Defined by JSON RPC + ErrorCodes.ParseError = -32700; + ErrorCodes.InvalidRequest = -32600; + ErrorCodes.MethodNotFound = -32601; + ErrorCodes.InvalidParams = -32602; + ErrorCodes.InternalError = -32603; + ErrorCodes.serverErrorStart = -32099; + ErrorCodes.serverErrorEnd = -32000; + ErrorCodes.ServerNotInitialized = -32002; + ErrorCodes.UnknownErrorCode = -32001; + // Defined by the protocol. + ErrorCodes.RequestCancelled = -32800; + ErrorCodes.ContentModified = -32801; + // Defined by VSCode library. + ErrorCodes.MessageWriteError = 1; + ErrorCodes.MessageReadError = 2; +})(ErrorCodes = exports.ErrorCodes || (exports.ErrorCodes = {})); +/** + * An error object return in a response in case a request + * has failed. + */ +class ResponseError extends Error { + constructor(code, message, data) { + super(message); + this.code = is.number(code) ? code : ErrorCodes.UnknownErrorCode; + this.data = data; + Object.setPrototypeOf(this, ResponseError.prototype); + } + toJson() { + return { + code: this.code, + message: this.message, + data: this.data, + }; + } +} +exports.ResponseError = ResponseError; +/** + * An abstract implementation of a MessageType. + */ +class AbstractMessageSignature { + constructor(_method, _numberOfParams) { + this._method = _method; + this._numberOfParams = _numberOfParams; + } + get method() { + return this._method; + } + get numberOfParams() { + return this._numberOfParams; + } +} +exports.AbstractMessageSignature = AbstractMessageSignature; +/** + * Classes to type request response pairs + * + * The type parameter RO will be removed in the next major version + * of the JSON RPC library since it is a LSP concept and doesn't + * belong here. For now it is tagged as default never. + */ +class RequestType0 extends AbstractMessageSignature { + constructor(method) { + super(method, 0); + } +} +exports.RequestType0 = RequestType0; +class RequestType extends AbstractMessageSignature { + constructor(method) { + super(method, 1); + } +} +exports.RequestType = RequestType; +class RequestType1 extends AbstractMessageSignature { + constructor(method) { + super(method, 1); + } +} +exports.RequestType1 = RequestType1; +class RequestType2 extends AbstractMessageSignature { + constructor(method) { + super(method, 2); + } +} +exports.RequestType2 = RequestType2; +class RequestType3 extends AbstractMessageSignature { + constructor(method) { + super(method, 3); + } +} +exports.RequestType3 = RequestType3; +class RequestType4 extends AbstractMessageSignature { + constructor(method) { + super(method, 4); + } +} +exports.RequestType4 = RequestType4; +class RequestType5 extends AbstractMessageSignature { + constructor(method) { + super(method, 5); + } +} +exports.RequestType5 = RequestType5; +class RequestType6 extends AbstractMessageSignature { + constructor(method) { + super(method, 6); + } +} +exports.RequestType6 = RequestType6; +class RequestType7 extends AbstractMessageSignature { + constructor(method) { + super(method, 7); + } +} +exports.RequestType7 = RequestType7; +class RequestType8 extends AbstractMessageSignature { + constructor(method) { + super(method, 8); + } +} +exports.RequestType8 = RequestType8; +class RequestType9 extends AbstractMessageSignature { + constructor(method) { + super(method, 9); + } +} +exports.RequestType9 = RequestType9; +/** + * The type parameter RO will be removed in the next major version + * of the JSON RPC library since it is a LSP concept and doesn't + * belong here. For now it is tagged as default never. + */ +class NotificationType extends AbstractMessageSignature { + constructor(method) { + super(method, 1); + this._ = undefined; + } +} +exports.NotificationType = NotificationType; +class NotificationType0 extends AbstractMessageSignature { + constructor(method) { + super(method, 0); + } +} +exports.NotificationType0 = NotificationType0; +class NotificationType1 extends AbstractMessageSignature { + constructor(method) { + super(method, 1); + } +} +exports.NotificationType1 = NotificationType1; +class NotificationType2 extends AbstractMessageSignature { + constructor(method) { + super(method, 2); + } +} +exports.NotificationType2 = NotificationType2; +class NotificationType3 extends AbstractMessageSignature { + constructor(method) { + super(method, 3); + } +} +exports.NotificationType3 = NotificationType3; +class NotificationType4 extends AbstractMessageSignature { + constructor(method) { + super(method, 4); + } +} +exports.NotificationType4 = NotificationType4; +class NotificationType5 extends AbstractMessageSignature { + constructor(method) { + super(method, 5); + } +} +exports.NotificationType5 = NotificationType5; +class NotificationType6 extends AbstractMessageSignature { + constructor(method) { + super(method, 6); + } +} +exports.NotificationType6 = NotificationType6; +class NotificationType7 extends AbstractMessageSignature { + constructor(method) { + super(method, 7); + } +} +exports.NotificationType7 = NotificationType7; +class NotificationType8 extends AbstractMessageSignature { + constructor(method) { + super(method, 8); + } +} +exports.NotificationType8 = NotificationType8; +class NotificationType9 extends AbstractMessageSignature { + constructor(method) { + super(method, 9); + } +} +exports.NotificationType9 = NotificationType9; +/** + * Tests if the given message is a request message + */ +function isRequestMessage(message) { + const candidate = message; + return candidate && is.string(candidate.method) && (is.string(candidate.id) || is.number(candidate.id)); +} +exports.isRequestMessage = isRequestMessage; +/** + * Tests if the given message is a notification message + */ +function isNotificationMessage(message) { + const candidate = message; + return candidate && is.string(candidate.method) && message.id === void 0; +} +exports.isNotificationMessage = isNotificationMessage; +/** + * Tests if the given message is a response message + */ +function isResponseMessage(message) { + const candidate = message; + return candidate && (candidate.result !== void 0 || !!candidate.error) && (is.string(candidate.id) || is.number(candidate.id) || candidate.id === null); +} +exports.isResponseMessage = isResponseMessage; +//# sourceMappingURL=messages.js.map + +/***/ }), +/* 13 */ +/***/ ((__unused_webpack_module, exports) => { + + +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +function boolean(value) { + return value === true || value === false; +} +exports.boolean = boolean; +function string(value) { + return typeof value === 'string' || value instanceof String; +} +exports.string = string; +function number(value) { + return typeof value === 'number' || value instanceof Number; +} +exports.number = number; +function error(value) { + return value instanceof Error; +} +exports.error = error; +function func(value) { + return typeof value === 'function'; +} +exports.func = func; +function array(value) { + return Array.isArray(value); +} +exports.array = array; +function stringArray(value) { + return array(value) && value.every(elem => string(elem)); +} +exports.stringArray = stringArray; +//# sourceMappingURL=is.js.map + +/***/ }), +/* 14 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +const ral_1 = __webpack_require__(8); +var Event; +(function (Event) { + const _disposable = { dispose() { } }; + Event.None = function () { return _disposable; }; +})(Event = exports.Event || (exports.Event = {})); +class CallbackList { + add(callback, context = null, bucket) { + if (!this._callbacks) { + this._callbacks = []; + this._contexts = []; + } + this._callbacks.push(callback); + this._contexts.push(context); + if (Array.isArray(bucket)) { + bucket.push({ dispose: () => this.remove(callback, context) }); + } + } + remove(callback, context = null) { + if (!this._callbacks) { + return; + } + let foundCallbackWithDifferentContext = false; + for (let i = 0, len = this._callbacks.length; i < len; i++) { + if (this._callbacks[i] === callback) { + if (this._contexts[i] === context) { + // callback & context match => remove it + this._callbacks.splice(i, 1); + this._contexts.splice(i, 1); + return; + } + else { + foundCallbackWithDifferentContext = true; + } + } + } + if (foundCallbackWithDifferentContext) { + throw new Error('When adding a listener with a context, you should remove it with the same context'); + } + } + invoke(...args) { + if (!this._callbacks) { + return []; + } + const ret = [], callbacks = this._callbacks.slice(0), contexts = this._contexts.slice(0); + for (let i = 0, len = callbacks.length; i < len; i++) { + try { + ret.push(callbacks[i].apply(contexts[i], args)); + } + catch (e) { + // eslint-disable-next-line no-console + ral_1.default().console.error(e); + } + } + return ret; + } + isEmpty() { + return !this._callbacks || this._callbacks.length === 0; + } + dispose() { + this._callbacks = undefined; + this._contexts = undefined; + } +} +class Emitter { + constructor(_options) { + this._options = _options; + } + /** + * For the public to allow to subscribe + * to events from this Emitter + */ + get event() { + if (!this._event) { + this._event = (listener, thisArgs, disposables) => { + if (!this._callbacks) { + this._callbacks = new CallbackList(); + } + if (this._options && this._options.onFirstListenerAdd && this._callbacks.isEmpty()) { + this._options.onFirstListenerAdd(this); + } + this._callbacks.add(listener, thisArgs); + const result = { + dispose: () => { + if (!this._callbacks) { + // disposable is disposed after emitter is disposed. + return; + } + this._callbacks.remove(listener, thisArgs); + result.dispose = Emitter._noop; + if (this._options && this._options.onLastListenerRemove && this._callbacks.isEmpty()) { + this._options.onLastListenerRemove(this); + } + } + }; + if (Array.isArray(disposables)) { + disposables.push(result); + } + return result; + }; + } + return this._event; + } + /** + * To be kept private to fire an event to + * subscribers + */ + fire(event) { + if (this._callbacks) { + this._callbacks.invoke.call(this._callbacks, event); + } + } + dispose() { + if (this._callbacks) { + this._callbacks.dispose(); + this._callbacks = undefined; + } + } +} +exports.Emitter = Emitter; +Emitter._noop = function () { }; +//# sourceMappingURL=events.js.map + +/***/ }), +/* 15 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +Object.defineProperty(exports, "__esModule", ({ value: true })); +const ral_1 = __webpack_require__(8); +const Is = __webpack_require__(13); +const events_1 = __webpack_require__(14); +var CancellationToken; +(function (CancellationToken) { + CancellationToken.None = Object.freeze({ + isCancellationRequested: false, + onCancellationRequested: events_1.Event.None + }); + CancellationToken.Cancelled = Object.freeze({ + isCancellationRequested: true, + onCancellationRequested: events_1.Event.None + }); + function is(value) { + const candidate = value; + return candidate && (candidate === CancellationToken.None + || candidate === CancellationToken.Cancelled + || (Is.boolean(candidate.isCancellationRequested) && !!candidate.onCancellationRequested)); + } + CancellationToken.is = is; +})(CancellationToken = exports.CancellationToken || (exports.CancellationToken = {})); +const shortcutEvent = Object.freeze(function (callback, context) { + const handle = ral_1.default().timer.setTimeout(callback.bind(context), 0); + return { dispose() { ral_1.default().timer.clearTimeout(handle); } }; +}); +class MutableToken { + constructor() { + this._isCancelled = false; + } + cancel() { + if (!this._isCancelled) { + this._isCancelled = true; + if (this._emitter) { + this._emitter.fire(undefined); + this.dispose(); + } + } + } + get isCancellationRequested() { + return this._isCancelled; + } + get onCancellationRequested() { + if (this._isCancelled) { + return shortcutEvent; + } + if (!this._emitter) { + this._emitter = new events_1.Emitter(); + } + return this._emitter.event; + } + dispose() { + if (this._emitter) { + this._emitter.dispose(); + this._emitter = undefined; + } + } +} +class CancellationTokenSource { + get token() { + if (!this._token) { + // be lazy and create the token only when + // actually needed + this._token = new MutableToken(); + } + return this._token; + } + cancel() { + if (!this._token) { + // save an object by returning the default + // cancelled token when cancellation happens + // before someone asks for the token + this._token = CancellationToken.Cancelled; + } + else { + this._token.cancel(); + } + } + dispose() { + if (!this._token) { + // ensure to initialize with an empty token if we had none + this._token = CancellationToken.None; + } + else if (this._token instanceof MutableToken) { + // actually dispose + this._token.dispose(); + } + } +} +exports.CancellationTokenSource = CancellationTokenSource; +//# sourceMappingURL=cancellation.js.map + +/***/ }), +/* 16 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +const ral_1 = __webpack_require__(8); +const Is = __webpack_require__(13); +const events_1 = __webpack_require__(14); +var MessageReader; +(function (MessageReader) { + function is(value) { + let candidate = value; + return candidate && Is.func(candidate.listen) && Is.func(candidate.dispose) && + Is.func(candidate.onError) && Is.func(candidate.onClose) && Is.func(candidate.onPartialMessage); + } + MessageReader.is = is; +})(MessageReader = exports.MessageReader || (exports.MessageReader = {})); +class AbstractMessageReader { + constructor() { + this.errorEmitter = new events_1.Emitter(); + this.closeEmitter = new events_1.Emitter(); + this.partialMessageEmitter = new events_1.Emitter(); + } + dispose() { + this.errorEmitter.dispose(); + this.closeEmitter.dispose(); + } + get onError() { + return this.errorEmitter.event; + } + fireError(error) { + this.errorEmitter.fire(this.asError(error)); + } + get onClose() { + return this.closeEmitter.event; + } + fireClose() { + this.closeEmitter.fire(undefined); + } + get onPartialMessage() { + return this.partialMessageEmitter.event; + } + firePartialMessage(info) { + this.partialMessageEmitter.fire(info); + } + asError(error) { + if (error instanceof Error) { + return error; + } + else { + return new Error(`Reader received error. Reason: ${Is.string(error.message) ? error.message : 'unknown'}`); + } + } +} +exports.AbstractMessageReader = AbstractMessageReader; +var ResolvedMessageReaderOptions; +(function (ResolvedMessageReaderOptions) { + function fromOptions(options) { + var _a; + let charset; + let result; + let contentDecoder; + const contentDecoders = new Map(); + let contentTypeDecoder; + const contentTypeDecoders = new Map(); + if (options === undefined || typeof options === 'string') { + charset = options !== null && options !== void 0 ? options : 'utf-8'; + } + else { + charset = (_a = options.charset) !== null && _a !== void 0 ? _a : 'utf-8'; + if (options.contentDecoder !== undefined) { + contentDecoder = options.contentDecoder; + contentDecoders.set(contentDecoder.name, contentDecoder); + } + if (options.contentDecoders !== undefined) { + for (const decoder of options.contentDecoders) { + contentDecoders.set(decoder.name, decoder); + } + } + if (options.contentTypeDecoder !== undefined) { + contentTypeDecoder = options.contentTypeDecoder; + contentTypeDecoders.set(contentTypeDecoder.name, contentTypeDecoder); + } + if (options.contentTypeDecoders !== undefined) { + for (const decoder of options.contentTypeDecoders) { + contentTypeDecoders.set(decoder.name, decoder); + } + } + } + if (contentTypeDecoder === undefined) { + contentTypeDecoder = ral_1.default().applicationJson.decoder; + contentTypeDecoders.set(contentTypeDecoder.name, contentTypeDecoder); + } + return { charset, contentDecoder, contentDecoders, contentTypeDecoder, contentTypeDecoders }; + } + ResolvedMessageReaderOptions.fromOptions = fromOptions; +})(ResolvedMessageReaderOptions || (ResolvedMessageReaderOptions = {})); +class ReadableStreamMessageReader extends AbstractMessageReader { + constructor(readable, options) { + super(); + this.readable = readable; + this.options = ResolvedMessageReaderOptions.fromOptions(options); + this.buffer = ral_1.default().messageBuffer.create(this.options.charset); + this._partialMessageTimeout = 10000; + this.nextMessageLength = -1; + this.messageToken = 0; + } + set partialMessageTimeout(timeout) { + this._partialMessageTimeout = timeout; + } + get partialMessageTimeout() { + return this._partialMessageTimeout; + } + listen(callback) { + this.nextMessageLength = -1; + this.messageToken = 0; + this.partialMessageTimer = undefined; + this.callback = callback; + const result = this.readable.onData((data) => { + this.onData(data); + }); + this.readable.onError((error) => this.fireError(error)); + this.readable.onClose(() => this.fireClose()); + return result; + } + onData(data) { + this.buffer.append(data); + while (true) { + if (this.nextMessageLength === -1) { + const headers = this.buffer.tryReadHeaders(); + if (!headers) { + return; + } + const contentLength = headers.get('Content-Length'); + if (!contentLength) { + throw new Error('Header must provide a Content-Length property.'); + } + const length = parseInt(contentLength); + if (isNaN(length)) { + throw new Error('Content-Length value must be a number.'); + } + this.nextMessageLength = length; + } + const body = this.buffer.tryReadBody(this.nextMessageLength); + if (body === undefined) { + /** We haven't received the full message yet. */ + this.setPartialMessageTimer(); + return; + } + this.clearPartialMessageTimer(); + this.nextMessageLength = -1; + let p; + if (this.options.contentDecoder !== undefined) { + p = this.options.contentDecoder.decode(body); + } + else { + p = Promise.resolve(body); + } + p.then((value) => { + this.options.contentTypeDecoder.decode(value, this.options).then((msg) => { + this.callback(msg); + }, (error) => { + this.fireError(error); + }); + }, (error) => { + this.fireError(error); + }); + } + } + clearPartialMessageTimer() { + if (this.partialMessageTimer) { + ral_1.default().timer.clearTimeout(this.partialMessageTimer); + this.partialMessageTimer = undefined; + } + } + setPartialMessageTimer() { + this.clearPartialMessageTimer(); + if (this._partialMessageTimeout <= 0) { + return; + } + this.partialMessageTimer = ral_1.default().timer.setTimeout((token, timeout) => { + this.partialMessageTimer = undefined; + if (token === this.messageToken) { + this.firePartialMessage({ messageToken: token, waitingTime: timeout }); + this.setPartialMessageTimer(); + } + }, this._partialMessageTimeout, this.messageToken, this._partialMessageTimeout); + } +} +exports.ReadableStreamMessageReader = ReadableStreamMessageReader; +//# sourceMappingURL=messageReader.js.map + +/***/ }), +/* 17 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +const ral_1 = __webpack_require__(8); +const Is = __webpack_require__(13); +const semaphore_1 = __webpack_require__(18); +const events_1 = __webpack_require__(14); +const ContentLength = 'Content-Length: '; +const CRLF = '\r\n'; +var MessageWriter; +(function (MessageWriter) { + function is(value) { + let candidate = value; + return candidate && Is.func(candidate.dispose) && Is.func(candidate.onClose) && + Is.func(candidate.onError) && Is.func(candidate.write); + } + MessageWriter.is = is; +})(MessageWriter = exports.MessageWriter || (exports.MessageWriter = {})); +class AbstractMessageWriter { + constructor() { + this.errorEmitter = new events_1.Emitter(); + this.closeEmitter = new events_1.Emitter(); + } + dispose() { + this.errorEmitter.dispose(); + this.closeEmitter.dispose(); + } + get onError() { + return this.errorEmitter.event; + } + fireError(error, message, count) { + this.errorEmitter.fire([this.asError(error), message, count]); + } + get onClose() { + return this.closeEmitter.event; + } + fireClose() { + this.closeEmitter.fire(undefined); + } + asError(error) { + if (error instanceof Error) { + return error; + } + else { + return new Error(`Writer received error. Reason: ${Is.string(error.message) ? error.message : 'unknown'}`); + } + } +} +exports.AbstractMessageWriter = AbstractMessageWriter; +var ResolvedMessageWriterOptions; +(function (ResolvedMessageWriterOptions) { + function fromOptions(options) { + var _a, _b; + if (options === undefined || typeof options === 'string') { + return { charset: options !== null && options !== void 0 ? options : 'utf-8', contentTypeEncoder: ral_1.default().applicationJson.encoder }; + } + else { + return { charset: (_a = options.charset) !== null && _a !== void 0 ? _a : 'utf-8', contentEncoder: options.contentEncoder, contentTypeEncoder: (_b = options.contentTypeEncoder) !== null && _b !== void 0 ? _b : ral_1.default().applicationJson.encoder }; + } + } + ResolvedMessageWriterOptions.fromOptions = fromOptions; +})(ResolvedMessageWriterOptions || (ResolvedMessageWriterOptions = {})); +class WriteableStreamMessageWriter extends AbstractMessageWriter { + constructor(writable, options) { + super(); + this.writable = writable; + this.options = ResolvedMessageWriterOptions.fromOptions(options); + this.errorCount = 0; + this.writeSemaphore = new semaphore_1.Semaphore(1); + this.writable.onError((error) => this.fireError(error)); + this.writable.onClose(() => this.fireClose()); + } + async write(msg) { + const payload = this.options.contentTypeEncoder.encode(msg, this.options).then((buffer) => { + if (this.options.contentEncoder !== undefined) { + return this.options.contentEncoder.encode(buffer); + } + else { + return buffer; + } + }); + return payload.then((buffer) => { + const headers = []; + headers.push(ContentLength, buffer.byteLength.toString(), CRLF); + headers.push(CRLF); + return this.doWrite(msg, headers, buffer); + }, (error) => { + this.fireError(error); + throw error; + }); + } + doWrite(msg, headers, data) { + return this.writeSemaphore.lock(async () => { + try { + await this.writable.write(headers.join(''), 'ascii'); + return this.writable.write(data); + } + catch (error) { + this.handleError(error, msg); + } + }); + } + handleError(error, msg) { + this.errorCount++; + this.fireError(error, msg, this.errorCount); + } +} +exports.WriteableStreamMessageWriter = WriteableStreamMessageWriter; +//# sourceMappingURL=messageWriter.js.map + +/***/ }), +/* 18 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +const ral_1 = __webpack_require__(8); +class Semaphore { + constructor(capacity = 1) { + if (capacity <= 0) { + throw new Error('Capacity must be greater than 0'); + } + this._capacity = capacity; + this._active = 0; + this._waiting = []; + } + lock(thunk) { + return new Promise((resolve, reject) => { + this._waiting.push({ thunk, resolve, reject }); + this.runNext(); + }); + } + get active() { + return this._active; + } + runNext() { + if (this._waiting.length === 0 || this._active === this._capacity) { + return; + } + ral_1.default().timer.setImmediate(() => this.doRunNext()); + } + doRunNext() { + if (this._waiting.length === 0 || this._active === this._capacity) { + return; + } + const next = this._waiting.shift(); + this._active++; + if (this._active > this._capacity) { + throw new Error(`To many thunks active`); + } + try { + const result = next.thunk(); + if (result instanceof Promise) { + result.then((value) => { + this._active--; + next.resolve(value); + this.runNext(); + }, (err) => { + this._active--; + next.reject(err); + this.runNext(); + }); + } + else { + this._active--; + next.resolve(result); + this.runNext(); + } + } + catch (err) { + this._active--; + next.reject(err); + this.runNext(); + } + } +} +exports.Semaphore = Semaphore; +//# sourceMappingURL=semaphore.js.map + +/***/ }), +/* 19 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +const ral_1 = __webpack_require__(8); +const Is = __webpack_require__(13); +const messages_1 = __webpack_require__(12); +const linkedMap_1 = __webpack_require__(20); +const events_1 = __webpack_require__(14); +const cancellation_1 = __webpack_require__(15); +var CancelNotification; +(function (CancelNotification) { + CancelNotification.type = new messages_1.NotificationType('$/cancelRequest'); +})(CancelNotification || (CancelNotification = {})); +var ProgressNotification; +(function (ProgressNotification) { + ProgressNotification.type = new messages_1.NotificationType('$/progress'); +})(ProgressNotification || (ProgressNotification = {})); +class ProgressType { + constructor() { + } +} +exports.ProgressType = ProgressType; +exports.NullLogger = Object.freeze({ + error: () => { }, + warn: () => { }, + info: () => { }, + log: () => { } +}); +var Trace; +(function (Trace) { + Trace[Trace["Off"] = 0] = "Off"; + Trace[Trace["Messages"] = 1] = "Messages"; + Trace[Trace["Verbose"] = 2] = "Verbose"; +})(Trace = exports.Trace || (exports.Trace = {})); +(function (Trace) { + function fromString(value) { + if (!Is.string(value)) { + return Trace.Off; + } + value = value.toLowerCase(); + switch (value) { + case 'off': + return Trace.Off; + case 'messages': + return Trace.Messages; + case 'verbose': + return Trace.Verbose; + default: + return Trace.Off; + } + } + Trace.fromString = fromString; + function toString(value) { + switch (value) { + case Trace.Off: + return 'off'; + case Trace.Messages: + return 'messages'; + case Trace.Verbose: + return 'verbose'; + default: + return 'off'; + } + } + Trace.toString = toString; +})(Trace = exports.Trace || (exports.Trace = {})); +var TraceFormat; +(function (TraceFormat) { + TraceFormat["Text"] = "text"; + TraceFormat["JSON"] = "json"; +})(TraceFormat = exports.TraceFormat || (exports.TraceFormat = {})); +(function (TraceFormat) { + function fromString(value) { + value = value.toLowerCase(); + if (value === 'json') { + return TraceFormat.JSON; + } + else { + return TraceFormat.Text; + } + } + TraceFormat.fromString = fromString; +})(TraceFormat = exports.TraceFormat || (exports.TraceFormat = {})); +var SetTraceNotification; +(function (SetTraceNotification) { + SetTraceNotification.type = new messages_1.NotificationType('$/setTraceNotification'); +})(SetTraceNotification = exports.SetTraceNotification || (exports.SetTraceNotification = {})); +var LogTraceNotification; +(function (LogTraceNotification) { + LogTraceNotification.type = new messages_1.NotificationType('$/logTraceNotification'); +})(LogTraceNotification = exports.LogTraceNotification || (exports.LogTraceNotification = {})); +var ConnectionErrors; +(function (ConnectionErrors) { + /** + * The connection is closed. + */ + ConnectionErrors[ConnectionErrors["Closed"] = 1] = "Closed"; + /** + * The connection got disposed. + */ + ConnectionErrors[ConnectionErrors["Disposed"] = 2] = "Disposed"; + /** + * The connection is already in listening mode. + */ + ConnectionErrors[ConnectionErrors["AlreadyListening"] = 3] = "AlreadyListening"; +})(ConnectionErrors = exports.ConnectionErrors || (exports.ConnectionErrors = {})); +class ConnectionError extends Error { + constructor(code, message) { + super(message); + this.code = code; + Object.setPrototypeOf(this, ConnectionError.prototype); + } +} +exports.ConnectionError = ConnectionError; +var ConnectionStrategy; +(function (ConnectionStrategy) { + function is(value) { + const candidate = value; + return candidate && Is.func(candidate.cancelUndispatched); + } + ConnectionStrategy.is = is; +})(ConnectionStrategy = exports.ConnectionStrategy || (exports.ConnectionStrategy = {})); +var CancellationReceiverStrategy; +(function (CancellationReceiverStrategy) { + CancellationReceiverStrategy.Message = Object.freeze({ + createCancellationTokenSource(_) { + return new cancellation_1.CancellationTokenSource(); + } + }); + function is(value) { + const candidate = value; + return candidate && Is.func(candidate.createCancellationTokenSource); + } + CancellationReceiverStrategy.is = is; +})(CancellationReceiverStrategy = exports.CancellationReceiverStrategy || (exports.CancellationReceiverStrategy = {})); +var CancellationSenderStrategy; +(function (CancellationSenderStrategy) { + CancellationSenderStrategy.Message = Object.freeze({ + sendCancellation(conn, id) { + conn.sendNotification(CancelNotification.type, { id }); + }, + cleanup(_) { } + }); + function is(value) { + const candidate = value; + return candidate && Is.func(candidate.sendCancellation) && Is.func(candidate.cleanup); + } + CancellationSenderStrategy.is = is; +})(CancellationSenderStrategy = exports.CancellationSenderStrategy || (exports.CancellationSenderStrategy = {})); +var CancellationStrategy; +(function (CancellationStrategy) { + CancellationStrategy.Message = Object.freeze({ + receiver: CancellationReceiverStrategy.Message, + sender: CancellationSenderStrategy.Message + }); + function is(value) { + const candidate = value; + return candidate && CancellationReceiverStrategy.is(candidate.receiver) && CancellationSenderStrategy.is(candidate.sender); + } + CancellationStrategy.is = is; +})(CancellationStrategy = exports.CancellationStrategy || (exports.CancellationStrategy = {})); +var ConnectionOptions; +(function (ConnectionOptions) { + function is(value) { + const candidate = value; + return candidate && (CancellationStrategy.is(candidate.cancellationStrategy) || ConnectionStrategy.is(candidate.connectionStrategy)); + } + ConnectionOptions.is = is; +})(ConnectionOptions = exports.ConnectionOptions || (exports.ConnectionOptions = {})); +var ConnectionState; +(function (ConnectionState) { + ConnectionState[ConnectionState["New"] = 1] = "New"; + ConnectionState[ConnectionState["Listening"] = 2] = "Listening"; + ConnectionState[ConnectionState["Closed"] = 3] = "Closed"; + ConnectionState[ConnectionState["Disposed"] = 4] = "Disposed"; +})(ConnectionState || (ConnectionState = {})); +function createMessageConnection(messageReader, messageWriter, _logger, options) { + const logger = _logger !== undefined ? _logger : exports.NullLogger; + let sequenceNumber = 0; + let notificationSquenceNumber = 0; + let unknownResponseSquenceNumber = 0; + const version = '2.0'; + let starRequestHandler = undefined; + const requestHandlers = Object.create(null); + let starNotificationHandler = undefined; + const notificationHandlers = Object.create(null); + const progressHandlers = new Map(); + let timer; + let messageQueue = new linkedMap_1.LinkedMap(); + let responsePromises = Object.create(null); + let requestTokens = Object.create(null); + let trace = Trace.Off; + let traceFormat = TraceFormat.Text; + let tracer; + let state = ConnectionState.New; + const errorEmitter = new events_1.Emitter(); + const closeEmitter = new events_1.Emitter(); + const unhandledNotificationEmitter = new events_1.Emitter(); + const unhandledProgressEmitter = new events_1.Emitter(); + const disposeEmitter = new events_1.Emitter(); + const cancellationStrategy = (options && options.cancellationStrategy) ? options.cancellationStrategy : CancellationStrategy.Message; + function createRequestQueueKey(id) { + return 'req-' + id.toString(); + } + function createResponseQueueKey(id) { + if (id === null) { + return 'res-unknown-' + (++unknownResponseSquenceNumber).toString(); + } + else { + return 'res-' + id.toString(); + } + } + function createNotificationQueueKey() { + return 'not-' + (++notificationSquenceNumber).toString(); + } + function addMessageToQueue(queue, message) { + if (messages_1.isRequestMessage(message)) { + queue.set(createRequestQueueKey(message.id), message); + } + else if (messages_1.isResponseMessage(message)) { + queue.set(createResponseQueueKey(message.id), message); + } + else { + queue.set(createNotificationQueueKey(), message); + } + } + function cancelUndispatched(_message) { + return undefined; + } + function isListening() { + return state === ConnectionState.Listening; + } + function isClosed() { + return state === ConnectionState.Closed; + } + function isDisposed() { + return state === ConnectionState.Disposed; + } + function closeHandler() { + if (state === ConnectionState.New || state === ConnectionState.Listening) { + state = ConnectionState.Closed; + closeEmitter.fire(undefined); + } + // If the connection is disposed don't sent close events. + } + function readErrorHandler(error) { + errorEmitter.fire([error, undefined, undefined]); + } + function writeErrorHandler(data) { + errorEmitter.fire(data); + } + messageReader.onClose(closeHandler); + messageReader.onError(readErrorHandler); + messageWriter.onClose(closeHandler); + messageWriter.onError(writeErrorHandler); + function triggerMessageQueue() { + if (timer || messageQueue.size === 0) { + return; + } + timer = ral_1.default().timer.setImmediate(() => { + timer = undefined; + processMessageQueue(); + }); + } + function processMessageQueue() { + if (messageQueue.size === 0) { + return; + } + const message = messageQueue.shift(); + try { + if (messages_1.isRequestMessage(message)) { + handleRequest(message); + } + else if (messages_1.isNotificationMessage(message)) { + handleNotification(message); + } + else if (messages_1.isResponseMessage(message)) { + handleResponse(message); + } + else { + handleInvalidMessage(message); + } + } + finally { + triggerMessageQueue(); + } + } + const callback = (message) => { + try { + // We have received a cancellation message. Check if the message is still in the queue + // and cancel it if allowed to do so. + if (messages_1.isNotificationMessage(message) && message.method === CancelNotification.type.method) { + const key = createRequestQueueKey(message.params.id); + const toCancel = messageQueue.get(key); + if (messages_1.isRequestMessage(toCancel)) { + const strategy = options === null || options === void 0 ? void 0 : options.connectionStrategy; + const response = (strategy && strategy.cancelUndispatched) ? strategy.cancelUndispatched(toCancel, cancelUndispatched) : cancelUndispatched(toCancel); + if (response && (response.error !== undefined || response.result !== undefined)) { + messageQueue.delete(key); + response.id = toCancel.id; + traceSendingResponse(response, message.method, Date.now()); + messageWriter.write(response); + return; + } + } + } + addMessageToQueue(messageQueue, message); + } + finally { + triggerMessageQueue(); + } + }; + function handleRequest(requestMessage) { + if (isDisposed()) { + // we return here silently since we fired an event when the + // connection got disposed. + return; + } + function reply(resultOrError, method, startTime) { + const message = { + jsonrpc: version, + id: requestMessage.id + }; + if (resultOrError instanceof messages_1.ResponseError) { + message.error = resultOrError.toJson(); + } + else { + message.result = resultOrError === undefined ? null : resultOrError; + } + traceSendingResponse(message, method, startTime); + messageWriter.write(message); + } + function replyError(error, method, startTime) { + const message = { + jsonrpc: version, + id: requestMessage.id, + error: error.toJson() + }; + traceSendingResponse(message, method, startTime); + messageWriter.write(message); + } + function replySuccess(result, method, startTime) { + // The JSON RPC defines that a response must either have a result or an error + // So we can't treat undefined as a valid response result. + if (result === undefined) { + result = null; + } + const message = { + jsonrpc: version, + id: requestMessage.id, + result: result + }; + traceSendingResponse(message, method, startTime); + messageWriter.write(message); + } + traceReceivedRequest(requestMessage); + const element = requestHandlers[requestMessage.method]; + let type; + let requestHandler; + if (element) { + type = element.type; + requestHandler = element.handler; + } + const startTime = Date.now(); + if (requestHandler || starRequestHandler) { + const tokenKey = String(requestMessage.id); + const cancellationSource = cancellationStrategy.receiver.createCancellationTokenSource(tokenKey); + requestTokens[tokenKey] = cancellationSource; + try { + let handlerResult; + if (requestMessage.params === undefined || (type !== undefined && type.numberOfParams === 0)) { + handlerResult = requestHandler + ? requestHandler(cancellationSource.token) + : starRequestHandler(requestMessage.method, cancellationSource.token); + } + else if (Is.array(requestMessage.params) && (type === undefined || type.numberOfParams > 1)) { + handlerResult = requestHandler + ? requestHandler(...requestMessage.params, cancellationSource.token) + : starRequestHandler(requestMessage.method, ...requestMessage.params, cancellationSource.token); + } + else { + handlerResult = requestHandler + ? requestHandler(requestMessage.params, cancellationSource.token) + : starRequestHandler(requestMessage.method, requestMessage.params, cancellationSource.token); + } + const promise = handlerResult; + if (!handlerResult) { + delete requestTokens[tokenKey]; + replySuccess(handlerResult, requestMessage.method, startTime); + } + else if (promise.then) { + promise.then((resultOrError) => { + delete requestTokens[tokenKey]; + reply(resultOrError, requestMessage.method, startTime); + }, error => { + delete requestTokens[tokenKey]; + if (error instanceof messages_1.ResponseError) { + replyError(error, requestMessage.method, startTime); + } + else if (error && Is.string(error.message)) { + replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed with message: ${error.message}`), requestMessage.method, startTime); + } + else { + replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed unexpectedly without providing any details.`), requestMessage.method, startTime); + } + }); + } + else { + delete requestTokens[tokenKey]; + reply(handlerResult, requestMessage.method, startTime); + } + } + catch (error) { + delete requestTokens[tokenKey]; + if (error instanceof messages_1.ResponseError) { + reply(error, requestMessage.method, startTime); + } + else if (error && Is.string(error.message)) { + replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed with message: ${error.message}`), requestMessage.method, startTime); + } + else { + replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed unexpectedly without providing any details.`), requestMessage.method, startTime); + } + } + } + else { + replyError(new messages_1.ResponseError(messages_1.ErrorCodes.MethodNotFound, `Unhandled method ${requestMessage.method}`), requestMessage.method, startTime); + } + } + function handleResponse(responseMessage) { + if (isDisposed()) { + // See handle request. + return; + } + if (responseMessage.id === null) { + if (responseMessage.error) { + logger.error(`Received response message without id: Error is: \n${JSON.stringify(responseMessage.error, undefined, 4)}`); + } + else { + logger.error(`Received response message without id. No further error information provided.`); + } + } + else { + const key = String(responseMessage.id); + const responsePromise = responsePromises[key]; + traceReceivedResponse(responseMessage, responsePromise); + if (responsePromise) { + delete responsePromises[key]; + try { + if (responseMessage.error) { + const error = responseMessage.error; + responsePromise.reject(new messages_1.ResponseError(error.code, error.message, error.data)); + } + else if (responseMessage.result !== undefined) { + responsePromise.resolve(responseMessage.result); + } + else { + throw new Error('Should never happen.'); + } + } + catch (error) { + if (error.message) { + logger.error(`Response handler '${responsePromise.method}' failed with message: ${error.message}`); + } + else { + logger.error(`Response handler '${responsePromise.method}' failed unexpectedly.`); + } + } + } + } + } + function handleNotification(message) { + if (isDisposed()) { + // See handle request. + return; + } + let type = undefined; + let notificationHandler; + if (message.method === CancelNotification.type.method) { + notificationHandler = (params) => { + const id = params.id; + const source = requestTokens[String(id)]; + if (source) { + source.cancel(); + } + }; + } + else { + const element = notificationHandlers[message.method]; + if (element) { + notificationHandler = element.handler; + type = element.type; + } + } + if (notificationHandler || starNotificationHandler) { + try { + traceReceivedNotification(message); + if (message.params === undefined || (type !== undefined && type.numberOfParams === 0)) { + notificationHandler ? notificationHandler() : starNotificationHandler(message.method); + } + else if (Is.array(message.params) && (type === undefined || type.numberOfParams > 1)) { + notificationHandler ? notificationHandler(...message.params) : starNotificationHandler(message.method, ...message.params); + } + else { + notificationHandler ? notificationHandler(message.params) : starNotificationHandler(message.method, message.params); + } + } + catch (error) { + if (error.message) { + logger.error(`Notification handler '${message.method}' failed with message: ${error.message}`); + } + else { + logger.error(`Notification handler '${message.method}' failed unexpectedly.`); + } + } + } + else { + unhandledNotificationEmitter.fire(message); + } + } + function handleInvalidMessage(message) { + if (!message) { + logger.error('Received empty message.'); + return; + } + logger.error(`Received message which is neither a response nor a notification message:\n${JSON.stringify(message, null, 4)}`); + // Test whether we find an id to reject the promise + const responseMessage = message; + if (Is.string(responseMessage.id) || Is.number(responseMessage.id)) { + const key = String(responseMessage.id); + const responseHandler = responsePromises[key]; + if (responseHandler) { + responseHandler.reject(new Error('The received response has neither a result nor an error property.')); + } + } + } + function traceSendingRequest(message) { + if (trace === Trace.Off || !tracer) { + return; + } + if (traceFormat === TraceFormat.Text) { + let data = undefined; + if (trace === Trace.Verbose && message.params) { + data = `Params: ${JSON.stringify(message.params, null, 4)}\n\n`; + } + tracer.log(`Sending request '${message.method} - (${message.id})'.`, data); + } + else { + logLSPMessage('send-request', message); + } + } + function traceSendingNotification(message) { + if (trace === Trace.Off || !tracer) { + return; + } + if (traceFormat === TraceFormat.Text) { + let data = undefined; + if (trace === Trace.Verbose) { + if (message.params) { + data = `Params: ${JSON.stringify(message.params, null, 4)}\n\n`; + } + else { + data = 'No parameters provided.\n\n'; + } + } + tracer.log(`Sending notification '${message.method}'.`, data); + } + else { + logLSPMessage('send-notification', message); + } + } + function traceSendingResponse(message, method, startTime) { + if (trace === Trace.Off || !tracer) { + return; + } + if (traceFormat === TraceFormat.Text) { + let data = undefined; + if (trace === Trace.Verbose) { + if (message.error && message.error.data) { + data = `Error data: ${JSON.stringify(message.error.data, null, 4)}\n\n`; + } + else { + if (message.result) { + data = `Result: ${JSON.stringify(message.result, null, 4)}\n\n`; + } + else if (message.error === undefined) { + data = 'No result returned.\n\n'; + } + } + } + tracer.log(`Sending response '${method} - (${message.id})'. Processing request took ${Date.now() - startTime}ms`, data); + } + else { + logLSPMessage('send-response', message); + } + } + function traceReceivedRequest(message) { + if (trace === Trace.Off || !tracer) { + return; + } + if (traceFormat === TraceFormat.Text) { + let data = undefined; + if (trace === Trace.Verbose && message.params) { + data = `Params: ${JSON.stringify(message.params, null, 4)}\n\n`; + } + tracer.log(`Received request '${message.method} - (${message.id})'.`, data); + } + else { + logLSPMessage('receive-request', message); + } + } + function traceReceivedNotification(message) { + if (trace === Trace.Off || !tracer || message.method === LogTraceNotification.type.method) { + return; + } + if (traceFormat === TraceFormat.Text) { + let data = undefined; + if (trace === Trace.Verbose) { + if (message.params) { + data = `Params: ${JSON.stringify(message.params, null, 4)}\n\n`; + } + else { + data = 'No parameters provided.\n\n'; + } + } + tracer.log(`Received notification '${message.method}'.`, data); + } + else { + logLSPMessage('receive-notification', message); + } + } + function traceReceivedResponse(message, responsePromise) { + if (trace === Trace.Off || !tracer) { + return; + } + if (traceFormat === TraceFormat.Text) { + let data = undefined; + if (trace === Trace.Verbose) { + if (message.error && message.error.data) { + data = `Error data: ${JSON.stringify(message.error.data, null, 4)}\n\n`; + } + else { + if (message.result) { + data = `Result: ${JSON.stringify(message.result, null, 4)}\n\n`; + } + else if (message.error === undefined) { + data = 'No result returned.\n\n'; + } + } + } + if (responsePromise) { + const error = message.error ? ` Request failed: ${message.error.message} (${message.error.code}).` : ''; + tracer.log(`Received response '${responsePromise.method} - (${message.id})' in ${Date.now() - responsePromise.timerStart}ms.${error}`, data); + } + else { + tracer.log(`Received response ${message.id} without active response promise.`, data); + } + } + else { + logLSPMessage('receive-response', message); + } + } + function logLSPMessage(type, message) { + if (!tracer || trace === Trace.Off) { + return; + } + const lspMessage = { + isLSPMessage: true, + type, + message, + timestamp: Date.now() + }; + tracer.log(lspMessage); + } + function throwIfClosedOrDisposed() { + if (isClosed()) { + throw new ConnectionError(ConnectionErrors.Closed, 'Connection is closed.'); + } + if (isDisposed()) { + throw new ConnectionError(ConnectionErrors.Disposed, 'Connection is disposed.'); + } + } + function throwIfListening() { + if (isListening()) { + throw new ConnectionError(ConnectionErrors.AlreadyListening, 'Connection is already listening'); + } + } + function throwIfNotListening() { + if (!isListening()) { + throw new Error('Call listen() first.'); + } + } + function undefinedToNull(param) { + if (param === undefined) { + return null; + } + else { + return param; + } + } + function computeMessageParams(type, params) { + let result; + const numberOfParams = type.numberOfParams; + switch (numberOfParams) { + case 0: + result = null; + break; + case 1: + result = undefinedToNull(params[0]); + break; + default: + result = []; + for (let i = 0; i < params.length && i < numberOfParams; i++) { + result.push(undefinedToNull(params[i])); + } + if (params.length < numberOfParams) { + for (let i = params.length; i < numberOfParams; i++) { + result.push(null); + } + } + break; + } + return result; + } + const connection = { + sendNotification: (type, ...params) => { + throwIfClosedOrDisposed(); + let method; + let messageParams; + if (Is.string(type)) { + method = type; + switch (params.length) { + case 0: + messageParams = null; + break; + case 1: + messageParams = params[0]; + break; + default: + messageParams = params; + break; + } + } + else { + method = type.method; + messageParams = computeMessageParams(type, params); + } + const notificationMessage = { + jsonrpc: version, + method: method, + params: messageParams + }; + traceSendingNotification(notificationMessage); + messageWriter.write(notificationMessage); + }, + onNotification: (type, handler) => { + throwIfClosedOrDisposed(); + if (Is.func(type)) { + starNotificationHandler = type; + } + else if (handler) { + if (Is.string(type)) { + notificationHandlers[type] = { type: undefined, handler }; + } + else { + notificationHandlers[type.method] = { type, handler }; + } + } + }, + onProgress: (_type, token, handler) => { + if (progressHandlers.has(token)) { + throw new Error(`Progress handler for token ${token} already registered`); + } + progressHandlers.set(token, handler); + return { + dispose: () => { + progressHandlers.delete(token); + } + }; + }, + sendProgress: (_type, token, value) => { + connection.sendNotification(ProgressNotification.type, { token, value }); + }, + onUnhandledProgress: unhandledProgressEmitter.event, + sendRequest: (type, ...params) => { + throwIfClosedOrDisposed(); + throwIfNotListening(); + let method; + let messageParams; + let token = undefined; + if (Is.string(type)) { + method = type; + switch (params.length) { + case 0: + messageParams = null; + break; + case 1: + // The cancellation token is optional so it can also be undefined. + if (cancellation_1.CancellationToken.is(params[0])) { + messageParams = null; + token = params[0]; + } + else { + messageParams = undefinedToNull(params[0]); + } + break; + default: + const last = params.length - 1; + if (cancellation_1.CancellationToken.is(params[last])) { + token = params[last]; + if (params.length === 2) { + messageParams = undefinedToNull(params[0]); + } + else { + messageParams = params.slice(0, last).map(value => undefinedToNull(value)); + } + } + else { + messageParams = params.map(value => undefinedToNull(value)); + } + break; + } + } + else { + method = type.method; + messageParams = computeMessageParams(type, params); + const numberOfParams = type.numberOfParams; + token = cancellation_1.CancellationToken.is(params[numberOfParams]) ? params[numberOfParams] : undefined; + } + const id = sequenceNumber++; + let disposable; + if (token) { + disposable = token.onCancellationRequested(() => { + cancellationStrategy.sender.sendCancellation(connection, id); + }); + } + const result = new Promise((resolve, reject) => { + const requestMessage = { + jsonrpc: version, + id: id, + method: method, + params: messageParams + }; + const resolveWithCleanup = (r) => { + resolve(r); + cancellationStrategy.sender.cleanup(id); + disposable === null || disposable === void 0 ? void 0 : disposable.dispose(); + }; + const rejectWithCleanup = (r) => { + reject(r); + cancellationStrategy.sender.cleanup(id); + disposable === null || disposable === void 0 ? void 0 : disposable.dispose(); + }; + let responsePromise = { method: method, timerStart: Date.now(), resolve: resolveWithCleanup, reject: rejectWithCleanup }; + traceSendingRequest(requestMessage); + try { + messageWriter.write(requestMessage); + } + catch (e) { + // Writing the message failed. So we need to reject the promise. + responsePromise.reject(new messages_1.ResponseError(messages_1.ErrorCodes.MessageWriteError, e.message ? e.message : 'Unknown reason')); + responsePromise = null; + } + if (responsePromise) { + responsePromises[String(id)] = responsePromise; + } + }); + return result; + }, + onRequest: (type, handler) => { + throwIfClosedOrDisposed(); + if (Is.func(type)) { + starRequestHandler = type; + } + else if (handler) { + if (Is.string(type)) { + requestHandlers[type] = { type: undefined, handler }; + } + else { + requestHandlers[type.method] = { type, handler }; + } + } + }, + trace: (_value, _tracer, sendNotificationOrTraceOptions) => { + let _sendNotification = false; + let _traceFormat = TraceFormat.Text; + if (sendNotificationOrTraceOptions !== undefined) { + if (Is.boolean(sendNotificationOrTraceOptions)) { + _sendNotification = sendNotificationOrTraceOptions; + } + else { + _sendNotification = sendNotificationOrTraceOptions.sendNotification || false; + _traceFormat = sendNotificationOrTraceOptions.traceFormat || TraceFormat.Text; + } + } + trace = _value; + traceFormat = _traceFormat; + if (trace === Trace.Off) { + tracer = undefined; + } + else { + tracer = _tracer; + } + if (_sendNotification && !isClosed() && !isDisposed()) { + connection.sendNotification(SetTraceNotification.type, { value: Trace.toString(_value) }); + } + }, + onError: errorEmitter.event, + onClose: closeEmitter.event, + onUnhandledNotification: unhandledNotificationEmitter.event, + onDispose: disposeEmitter.event, + dispose: () => { + if (isDisposed()) { + return; + } + state = ConnectionState.Disposed; + disposeEmitter.fire(undefined); + const error = new Error('Connection got disposed.'); + Object.keys(responsePromises).forEach((key) => { + responsePromises[key].reject(error); + }); + responsePromises = Object.create(null); + requestTokens = Object.create(null); + messageQueue = new linkedMap_1.LinkedMap(); + // Test for backwards compatibility + if (Is.func(messageWriter.dispose)) { + messageWriter.dispose(); + } + if (Is.func(messageReader.dispose)) { + messageReader.dispose(); + } + }, + listen: () => { + throwIfClosedOrDisposed(); + throwIfListening(); + state = ConnectionState.Listening; + messageReader.listen(callback); + }, + inspect: () => { + // eslint-disable-next-line no-console + ral_1.default().console.log('inspect'); + } + }; + connection.onNotification(LogTraceNotification.type, (params) => { + if (trace === Trace.Off || !tracer) { + return; + } + tracer.log(params.message, trace === Trace.Verbose ? params.verbose : undefined); + }); + connection.onNotification(ProgressNotification.type, (params) => { + const handler = progressHandlers.get(params.token); + if (handler) { + handler(params.value); + } + else { + unhandledProgressEmitter.fire(params); + } + }); + return connection; +} +exports.createMessageConnection = createMessageConnection; +//# sourceMappingURL=connection.js.map + +/***/ }), +/* 20 */ +/***/ ((__unused_webpack_module, exports) => { + + +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +Object.defineProperty(exports, "__esModule", ({ value: true })); +var Touch; +(function (Touch) { + Touch.None = 0; + Touch.First = 1; + Touch.AsOld = Touch.First; + Touch.Last = 2; + Touch.AsNew = Touch.Last; +})(Touch = exports.Touch || (exports.Touch = {})); +class LinkedMap { + constructor() { + this[Symbol.toStringTag] = 'LinkedMap'; + this._map = new Map(); + this._head = undefined; + this._tail = undefined; + this._size = 0; + this._state = 0; + } + clear() { + this._map.clear(); + this._head = undefined; + this._tail = undefined; + this._size = 0; + this._state++; + } + isEmpty() { + return !this._head && !this._tail; + } + get size() { + return this._size; + } + get first() { + var _a; + return (_a = this._head) === null || _a === void 0 ? void 0 : _a.value; + } + get last() { + var _a; + return (_a = this._tail) === null || _a === void 0 ? void 0 : _a.value; + } + has(key) { + return this._map.has(key); + } + get(key, touch = Touch.None) { + const item = this._map.get(key); + if (!item) { + return undefined; + } + if (touch !== Touch.None) { + this.touch(item, touch); + } + return item.value; + } + set(key, value, touch = Touch.None) { + let item = this._map.get(key); + if (item) { + item.value = value; + if (touch !== Touch.None) { + this.touch(item, touch); + } + } + else { + item = { key, value, next: undefined, previous: undefined }; + switch (touch) { + case Touch.None: + this.addItemLast(item); + break; + case Touch.First: + this.addItemFirst(item); + break; + case Touch.Last: + this.addItemLast(item); + break; + default: + this.addItemLast(item); + break; + } + this._map.set(key, item); + this._size++; + } + return this; + } + delete(key) { + return !!this.remove(key); + } + remove(key) { + const item = this._map.get(key); + if (!item) { + return undefined; + } + this._map.delete(key); + this.removeItem(item); + this._size--; + return item.value; + } + shift() { + if (!this._head && !this._tail) { + return undefined; + } + if (!this._head || !this._tail) { + throw new Error('Invalid list'); + } + const item = this._head; + this._map.delete(item.key); + this.removeItem(item); + this._size--; + return item.value; + } + forEach(callbackfn, thisArg) { + const state = this._state; + let current = this._head; + while (current) { + if (thisArg) { + callbackfn.bind(thisArg)(current.value, current.key, this); + } + else { + callbackfn(current.value, current.key, this); + } + if (this._state !== state) { + throw new Error(`LinkedMap got modified during iteration.`); + } + current = current.next; + } + } + keys() { + const map = this; + const state = this._state; + let current = this._head; + const iterator = { + [Symbol.iterator]() { + return iterator; + }, + next() { + if (map._state !== state) { + throw new Error(`LinkedMap got modified during iteration.`); + } + if (current) { + const result = { value: current.key, done: false }; + current = current.next; + return result; + } + else { + return { value: undefined, done: true }; + } + } + }; + return iterator; + } + values() { + const map = this; + const state = this._state; + let current = this._head; + const iterator = { + [Symbol.iterator]() { + return iterator; + }, + next() { + if (map._state !== state) { + throw new Error(`LinkedMap got modified during iteration.`); + } + if (current) { + const result = { value: current.value, done: false }; + current = current.next; + return result; + } + else { + return { value: undefined, done: true }; + } + } + }; + return iterator; + } + entries() { + const map = this; + const state = this._state; + let current = this._head; + const iterator = { + [Symbol.iterator]() { + return iterator; + }, + next() { + if (map._state !== state) { + throw new Error(`LinkedMap got modified during iteration.`); + } + if (current) { + const result = { value: [current.key, current.value], done: false }; + current = current.next; + return result; + } + else { + return { value: undefined, done: true }; + } } + }; + return iterator; + } + [Symbol.iterator]() { + return this.entries(); + } + trimOld(newSize) { + if (newSize >= this.size) { + return; } - }); - return dataPaths; + if (newSize === 0) { + this.clear(); + return; + } + let current = this._head; + let currentSize = this.size; + while (current && currentSize > newSize) { + this._map.delete(current.key); + current = current.next; + currentSize--; + } + this._head = current; + this._size = currentSize; + if (current) { + current.previous = undefined; + } + this._state++; + } + addItemFirst(item) { + // First time Insert + if (!this._head && !this._tail) { + this._tail = item; + } + else if (!this._head) { + throw new Error('Invalid list'); + } + else { + item.next = this._head; + this._head.previous = item; + } + this._head = item; + this._state++; + } + addItemLast(item) { + // First time Insert + if (!this._head && !this._tail) { + this._head = item; + } + else if (!this._tail) { + throw new Error('Invalid list'); + } + else { + item.previous = this._tail; + this._tail.next = item; + } + this._tail = item; + this._state++; + } + removeItem(item) { + if (item === this._head && item === this._tail) { + this._head = undefined; + this._tail = undefined; + } + else if (item === this._head) { + // This can only happend if size === 1 which is handle + // by the case above. + if (!item.next) { + throw new Error('Invalid list'); + } + item.next.previous = undefined; + this._head = item.next; + } + else if (item === this._tail) { + // This can only happend if size === 1 which is handle + // by the case above. + if (!item.previous) { + throw new Error('Invalid list'); + } + item.previous.next = undefined; + this._tail = item.previous; + } + else { + const next = item.next; + const previous = item.previous; + if (!next || !previous) { + throw new Error('Invalid list'); + } + next.previous = previous; + previous.next = next; + } + item.next = undefined; + item.previous = undefined; + this._state++; + } + touch(item, touch) { + if (!this._head || !this._tail) { + throw new Error('Invalid list'); + } + if ((touch !== Touch.First && touch !== Touch.Last)) { + return; + } + if (touch === Touch.First) { + if (item === this._head) { + return; + } + const next = item.next; + const previous = item.previous; + // Unlink the item + if (item === this._tail) { + // previous must be defined since item was not head but is tail + // So there are more than on item in the map + previous.next = undefined; + this._tail = previous; + } + else { + // Both next and previous are not undefined since item was neither head nor tail. + next.previous = previous; + previous.next = next; + } + // Insert the node at head + item.previous = undefined; + item.next = this._head; + this._head.previous = item; + this._head = item; + this._state++; + } + else if (touch === Touch.Last) { + if (item === this._tail) { + return; + } + const next = item.next; + const previous = item.previous; + // Unlink the item. + if (item === this._head) { + // next must be defined since item was not tail but is head + // So there are more than on item in the map + next.previous = undefined; + this._head = next; + } + else { + // Both next and previous are not undefined since item was neither head nor tail. + next.previous = previous; + previous.next = next; + } + item.next = undefined; + item.previous = this._tail; + this._tail.next = item; + this._tail = item; + this._state++; + } + } + toJSON() { + const data = []; + this.forEach((value, key) => { + data.push([key, value]); + }); + return data; + } + fromJSON(data) { + this.clear(); + for (const [key, value] of data) { + this.set(key, value); + } + } } -exports.getCustomDataPathsInAllWorkspaces = getCustomDataPathsInAllWorkspaces; -function getCustomDataPathsFromAllExtensions() { - const dataPaths = []; - for (const extension of coc_nvim_1.extensions.all) { - const contributes = extension.packageJSON && extension.packageJSON.contributes; - if (contributes && - contributes.html && - contributes.html.experimental.customData && - Array.isArray(contributes.html.experimental.customData)) { - const relativePaths = contributes.html.experimental.customData; - relativePaths.forEach(rp => { - dataPaths.push(path.resolve(extension.extensionPath, rp)); - }); +exports.LinkedMap = LinkedMap; +class LRUCache extends LinkedMap { + constructor(limit, ratio = 1) { + super(); + this._limit = limit; + this._ratio = Math.min(Math.max(0, ratio), 1); + } + get limit() { + return this._limit; + } + set limit(limit) { + this._limit = limit; + this.checkTrim(); + } + get ratio() { + return this._ratio; + } + set ratio(ratio) { + this._ratio = Math.min(Math.max(0, ratio), 1); + this.checkTrim(); + } + get(key, touch = Touch.AsNew) { + return super.get(key, touch); + } + peek(key) { + return super.get(key, Touch.None); + } + set(key, value) { + super.set(key, value, Touch.Last); + this.checkTrim(); + return this; + } + checkTrim() { + if (this.size > this._limit) { + this.trimOld(Math.round(this._limit * this._ratio)); } } - return dataPaths; } -exports.getCustomDataPathsFromAllExtensions = getCustomDataPathsFromAllExtensions; +exports.LRUCache = LRUCache; +//# sourceMappingURL=linkedMap.js.map + +/***/ }), +/* 21 */ +/***/ ((module) => { +module.exports = require("os");; /***/ }), -/* 3 */ -/***/ (function(module, exports) { +/* 22 */ +/***/ ((module) => { -module.exports = require("path"); +module.exports = require("crypto");; /***/ }), -/* 4 */ -/***/ (function(module, exports, __webpack_require__) { +/* 23 */ +/***/ ((module) => { + +module.exports = require("net");; + +/***/ }), +/* 24 */ +/***/ ((__unused_webpack_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. * ------------------------------------------------------------------------------------------ */ - function __export(m) { for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; } -Object.defineProperty(exports, "__esModule", { value: true }); -const vscode_jsonrpc_1 = __webpack_require__(5); -exports.ErrorCodes = vscode_jsonrpc_1.ErrorCodes; -exports.ResponseError = vscode_jsonrpc_1.ResponseError; -exports.CancellationToken = vscode_jsonrpc_1.CancellationToken; -exports.CancellationTokenSource = vscode_jsonrpc_1.CancellationTokenSource; -exports.Disposable = vscode_jsonrpc_1.Disposable; -exports.Event = vscode_jsonrpc_1.Event; -exports.Emitter = vscode_jsonrpc_1.Emitter; -exports.Trace = vscode_jsonrpc_1.Trace; -exports.TraceFormat = vscode_jsonrpc_1.TraceFormat; -exports.SetTraceNotification = vscode_jsonrpc_1.SetTraceNotification; -exports.LogTraceNotification = vscode_jsonrpc_1.LogTraceNotification; -exports.RequestType = vscode_jsonrpc_1.RequestType; -exports.RequestType0 = vscode_jsonrpc_1.RequestType0; -exports.NotificationType = vscode_jsonrpc_1.NotificationType; -exports.NotificationType0 = vscode_jsonrpc_1.NotificationType0; -exports.MessageReader = vscode_jsonrpc_1.MessageReader; -exports.MessageWriter = vscode_jsonrpc_1.MessageWriter; -exports.ConnectionStrategy = vscode_jsonrpc_1.ConnectionStrategy; -exports.StreamMessageReader = vscode_jsonrpc_1.StreamMessageReader; -exports.StreamMessageWriter = vscode_jsonrpc_1.StreamMessageWriter; -exports.IPCMessageReader = vscode_jsonrpc_1.IPCMessageReader; -exports.IPCMessageWriter = vscode_jsonrpc_1.IPCMessageWriter; -exports.createClientPipeTransport = vscode_jsonrpc_1.createClientPipeTransport; -exports.createServerPipeTransport = vscode_jsonrpc_1.createServerPipeTransport; -exports.generateRandomPipeName = vscode_jsonrpc_1.generateRandomPipeName; -exports.createClientSocketTransport = vscode_jsonrpc_1.createClientSocketTransport; -exports.createServerSocketTransport = vscode_jsonrpc_1.createServerSocketTransport; -__export(__webpack_require__(18)); -__export(__webpack_require__(19)); -const callHierarchy = __webpack_require__(29); -const progress = __webpack_require__(30); +Object.defineProperty(exports, "__esModule", ({ value: true })); +__export(__webpack_require__(6)); +__export(__webpack_require__(25)); +__export(__webpack_require__(26)); +__export(__webpack_require__(27)); +var connection_1 = __webpack_require__(39); +exports.createProtocolConnection = connection_1.createProtocolConnection; +const st = __webpack_require__(40); var Proposed; (function (Proposed) { - let CallHierarchyRequest; - (function (CallHierarchyRequest) { - CallHierarchyRequest.type = callHierarchy.CallHierarchyRequest.type; - })(CallHierarchyRequest = Proposed.CallHierarchyRequest || (Proposed.CallHierarchyRequest = {})); - let CallHierarchyDirection; - (function (CallHierarchyDirection) { - CallHierarchyDirection.CallsFrom = callHierarchy.CallHierarchyDirection.CallsFrom; - CallHierarchyDirection.CallsTo = callHierarchy.CallHierarchyDirection.CallsTo; - })(CallHierarchyDirection = Proposed.CallHierarchyDirection || (Proposed.CallHierarchyDirection = {})); - let ProgressStartNotification; - (function (ProgressStartNotification) { - ProgressStartNotification.type = progress.ProgressStartNotification.type; - })(ProgressStartNotification = Proposed.ProgressStartNotification || (Proposed.ProgressStartNotification = {})); - let ProgressReportNotification; - (function (ProgressReportNotification) { - ProgressReportNotification.type = progress.ProgressReportNotification.type; - })(ProgressReportNotification = Proposed.ProgressReportNotification || (Proposed.ProgressReportNotification = {})); - let ProgressDoneNotification; - (function (ProgressDoneNotification) { - ProgressDoneNotification.type = progress.ProgressDoneNotification.type; - })(ProgressDoneNotification = Proposed.ProgressDoneNotification || (Proposed.ProgressDoneNotification = {})); - let ProgressCancelNotification; - (function (ProgressCancelNotification) { - ProgressCancelNotification.type = progress.ProgressCancelNotification.type; - })(ProgressCancelNotification = Proposed.ProgressCancelNotification || (Proposed.ProgressCancelNotification = {})); + Proposed.SemanticTokenTypes = st.SemanticTokenTypes; + Proposed.SemanticTokenModifiers = st.SemanticTokenModifiers; + Proposed.SemanticTokens = st.SemanticTokens; + let SemanticTokensRequest; + (function (SemanticTokensRequest) { + SemanticTokensRequest.method = st.SemanticTokensRequest.method; + SemanticTokensRequest.type = st.SemanticTokensRequest.type; + })(SemanticTokensRequest = Proposed.SemanticTokensRequest || (Proposed.SemanticTokensRequest = {})); + let SemanticTokensEditsRequest; + (function (SemanticTokensEditsRequest) { + SemanticTokensEditsRequest.method = st.SemanticTokensEditsRequest.method; + SemanticTokensEditsRequest.type = st.SemanticTokensEditsRequest.type; + })(SemanticTokensEditsRequest = Proposed.SemanticTokensEditsRequest || (Proposed.SemanticTokensEditsRequest = {})); + let SemanticTokensRangeRequest; + (function (SemanticTokensRangeRequest) { + SemanticTokensRangeRequest.method = st.SemanticTokensRangeRequest.method; + SemanticTokensRangeRequest.type = st.SemanticTokensRangeRequest.type; + })(SemanticTokensRangeRequest = Proposed.SemanticTokensRangeRequest || (Proposed.SemanticTokensRangeRequest = {})); })(Proposed = exports.Proposed || (exports.Proposed = {})); -function createProtocolConnection(reader, writer, logger, strategy) { - return vscode_jsonrpc_1.createMessageConnection(reader, writer, logger, strategy); -} -exports.createProtocolConnection = createProtocolConnection; - - -/***/ }), -/* 5 */ -/***/ (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. - * ------------------------------------------------------------------------------------------ */ -/// - -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -const Is = __webpack_require__(6); -const messages_1 = __webpack_require__(7); -exports.RequestType = messages_1.RequestType; -exports.RequestType0 = messages_1.RequestType0; -exports.RequestType1 = messages_1.RequestType1; -exports.RequestType2 = messages_1.RequestType2; -exports.RequestType3 = messages_1.RequestType3; -exports.RequestType4 = messages_1.RequestType4; -exports.RequestType5 = messages_1.RequestType5; -exports.RequestType6 = messages_1.RequestType6; -exports.RequestType7 = messages_1.RequestType7; -exports.RequestType8 = messages_1.RequestType8; -exports.RequestType9 = messages_1.RequestType9; -exports.ResponseError = messages_1.ResponseError; -exports.ErrorCodes = messages_1.ErrorCodes; -exports.NotificationType = messages_1.NotificationType; -exports.NotificationType0 = messages_1.NotificationType0; -exports.NotificationType1 = messages_1.NotificationType1; -exports.NotificationType2 = messages_1.NotificationType2; -exports.NotificationType3 = messages_1.NotificationType3; -exports.NotificationType4 = messages_1.NotificationType4; -exports.NotificationType5 = messages_1.NotificationType5; -exports.NotificationType6 = messages_1.NotificationType6; -exports.NotificationType7 = messages_1.NotificationType7; -exports.NotificationType8 = messages_1.NotificationType8; -exports.NotificationType9 = messages_1.NotificationType9; -const messageReader_1 = __webpack_require__(8); -exports.MessageReader = messageReader_1.MessageReader; -exports.StreamMessageReader = messageReader_1.StreamMessageReader; -exports.IPCMessageReader = messageReader_1.IPCMessageReader; -exports.SocketMessageReader = messageReader_1.SocketMessageReader; -const messageWriter_1 = __webpack_require__(10); -exports.MessageWriter = messageWriter_1.MessageWriter; -exports.StreamMessageWriter = messageWriter_1.StreamMessageWriter; -exports.IPCMessageWriter = messageWriter_1.IPCMessageWriter; -exports.SocketMessageWriter = messageWriter_1.SocketMessageWriter; -const events_1 = __webpack_require__(9); -exports.Disposable = events_1.Disposable; -exports.Event = events_1.Event; -exports.Emitter = events_1.Emitter; -const cancellation_1 = __webpack_require__(11); -exports.CancellationTokenSource = cancellation_1.CancellationTokenSource; -exports.CancellationToken = cancellation_1.CancellationToken; -const linkedMap_1 = __webpack_require__(12); -__export(__webpack_require__(13)); -__export(__webpack_require__(17)); -var CancelNotification; -(function (CancelNotification) { - CancelNotification.type = new messages_1.NotificationType('$/cancelRequest'); -})(CancelNotification || (CancelNotification = {})); -exports.NullLogger = Object.freeze({ - error: () => { }, - warn: () => { }, - info: () => { }, - log: () => { } -}); -var Trace; -(function (Trace) { - Trace[Trace["Off"] = 0] = "Off"; - Trace[Trace["Messages"] = 1] = "Messages"; - Trace[Trace["Verbose"] = 2] = "Verbose"; -})(Trace = exports.Trace || (exports.Trace = {})); -(function (Trace) { - function fromString(value) { - value = value.toLowerCase(); - switch (value) { - case 'off': - return Trace.Off; - case 'messages': - return Trace.Messages; - case 'verbose': - return Trace.Verbose; - default: - return Trace.Off; - } - } - Trace.fromString = fromString; - function toString(value) { - switch (value) { - case Trace.Off: - return 'off'; - case Trace.Messages: - return 'messages'; - case Trace.Verbose: - return 'verbose'; - default: - return 'off'; - } - } - Trace.toString = toString; -})(Trace = exports.Trace || (exports.Trace = {})); -var TraceFormat; -(function (TraceFormat) { - TraceFormat["Text"] = "text"; - TraceFormat["JSON"] = "json"; -})(TraceFormat = exports.TraceFormat || (exports.TraceFormat = {})); -(function (TraceFormat) { - function fromString(value) { - value = value.toLowerCase(); - if (value === 'json') { - return TraceFormat.JSON; - } - else { - return TraceFormat.Text; - } - } - TraceFormat.fromString = fromString; -})(TraceFormat = exports.TraceFormat || (exports.TraceFormat = {})); -var SetTraceNotification; -(function (SetTraceNotification) { - SetTraceNotification.type = new messages_1.NotificationType('$/setTraceNotification'); -})(SetTraceNotification = exports.SetTraceNotification || (exports.SetTraceNotification = {})); -var LogTraceNotification; -(function (LogTraceNotification) { - LogTraceNotification.type = new messages_1.NotificationType('$/logTraceNotification'); -})(LogTraceNotification = exports.LogTraceNotification || (exports.LogTraceNotification = {})); -var ConnectionErrors; -(function (ConnectionErrors) { - /** - * The connection is closed. - */ - ConnectionErrors[ConnectionErrors["Closed"] = 1] = "Closed"; - /** - * The connection got disposed. - */ - ConnectionErrors[ConnectionErrors["Disposed"] = 2] = "Disposed"; - /** - * The connection is already in listening mode. - */ - ConnectionErrors[ConnectionErrors["AlreadyListening"] = 3] = "AlreadyListening"; -})(ConnectionErrors = exports.ConnectionErrors || (exports.ConnectionErrors = {})); -class ConnectionError extends Error { - constructor(code, message) { - super(message); - this.code = code; - Object.setPrototypeOf(this, ConnectionError.prototype); - } -} -exports.ConnectionError = ConnectionError; -var ConnectionStrategy; -(function (ConnectionStrategy) { - function is(value) { - let candidate = value; - return candidate && Is.func(candidate.cancelUndispatched); - } - ConnectionStrategy.is = is; -})(ConnectionStrategy = exports.ConnectionStrategy || (exports.ConnectionStrategy = {})); -var ConnectionState; -(function (ConnectionState) { - ConnectionState[ConnectionState["New"] = 1] = "New"; - ConnectionState[ConnectionState["Listening"] = 2] = "Listening"; - ConnectionState[ConnectionState["Closed"] = 3] = "Closed"; - ConnectionState[ConnectionState["Disposed"] = 4] = "Disposed"; -})(ConnectionState || (ConnectionState = {})); -function _createMessageConnection(messageReader, messageWriter, logger, strategy) { - let sequenceNumber = 0; - let notificationSquenceNumber = 0; - let unknownResponseSquenceNumber = 0; - const version = '2.0'; - let starRequestHandler = undefined; - let requestHandlers = Object.create(null); - let starNotificationHandler = undefined; - let notificationHandlers = Object.create(null); - let timer; - let messageQueue = new linkedMap_1.LinkedMap(); - let responsePromises = Object.create(null); - let requestTokens = Object.create(null); - let trace = Trace.Off; - let traceFormat = TraceFormat.Text; - let tracer; - let state = ConnectionState.New; - let errorEmitter = new events_1.Emitter(); - let closeEmitter = new events_1.Emitter(); - let unhandledNotificationEmitter = new events_1.Emitter(); - let disposeEmitter = new events_1.Emitter(); - function createRequestQueueKey(id) { - return 'req-' + id.toString(); - } - function createResponseQueueKey(id) { - if (id === null) { - return 'res-unknown-' + (++unknownResponseSquenceNumber).toString(); - } - else { - return 'res-' + id.toString(); - } - } - function createNotificationQueueKey() { - return 'not-' + (++notificationSquenceNumber).toString(); - } - function addMessageToQueue(queue, message) { - if (messages_1.isRequestMessage(message)) { - queue.set(createRequestQueueKey(message.id), message); - } - else if (messages_1.isResponseMessage(message)) { - queue.set(createResponseQueueKey(message.id), message); - } - else { - queue.set(createNotificationQueueKey(), message); - } - } - function cancelUndispatched(_message) { - return undefined; - } - function isListening() { - return state === ConnectionState.Listening; - } - function isClosed() { - return state === ConnectionState.Closed; - } - function isDisposed() { - return state === ConnectionState.Disposed; - } - function closeHandler() { - if (state === ConnectionState.New || state === ConnectionState.Listening) { - state = ConnectionState.Closed; - closeEmitter.fire(undefined); - } - // If the connection is disposed don't sent close events. - } - ; - function readErrorHandler(error) { - errorEmitter.fire([error, undefined, undefined]); - } - function writeErrorHandler(data) { - errorEmitter.fire(data); - } - messageReader.onClose(closeHandler); - messageReader.onError(readErrorHandler); - messageWriter.onClose(closeHandler); - messageWriter.onError(writeErrorHandler); - function triggerMessageQueue() { - if (timer || messageQueue.size === 0) { - return; - } - timer = setImmediate(() => { - timer = undefined; - processMessageQueue(); - }); - } - function processMessageQueue() { - if (messageQueue.size === 0) { - return; - } - let message = messageQueue.shift(); - try { - if (messages_1.isRequestMessage(message)) { - handleRequest(message); - } - else if (messages_1.isNotificationMessage(message)) { - handleNotification(message); - } - else if (messages_1.isResponseMessage(message)) { - handleResponse(message); - } - else { - handleInvalidMessage(message); - } - } - finally { - triggerMessageQueue(); - } - } - let callback = (message) => { - try { - // We have received a cancellation message. Check if the message is still in the queue - // and cancel it if allowed to do so. - if (messages_1.isNotificationMessage(message) && message.method === CancelNotification.type.method) { - let key = createRequestQueueKey(message.params.id); - let toCancel = messageQueue.get(key); - if (messages_1.isRequestMessage(toCancel)) { - let response = strategy && strategy.cancelUndispatched ? strategy.cancelUndispatched(toCancel, cancelUndispatched) : cancelUndispatched(toCancel); - if (response && (response.error !== void 0 || response.result !== void 0)) { - messageQueue.delete(key); - response.id = toCancel.id; - traceSendingResponse(response, message.method, Date.now()); - messageWriter.write(response); - return; - } - } - } - addMessageToQueue(messageQueue, message); - } - finally { - triggerMessageQueue(); - } - }; - function handleRequest(requestMessage) { - if (isDisposed()) { - // we return here silently since we fired an event when the - // connection got disposed. - return; - } - function reply(resultOrError, method, startTime) { - let message = { - jsonrpc: version, - id: requestMessage.id - }; - if (resultOrError instanceof messages_1.ResponseError) { - message.error = resultOrError.toJson(); - } - else { - message.result = resultOrError === void 0 ? null : resultOrError; - } - traceSendingResponse(message, method, startTime); - messageWriter.write(message); - } - function replyError(error, method, startTime) { - let message = { - jsonrpc: version, - id: requestMessage.id, - error: error.toJson() - }; - traceSendingResponse(message, method, startTime); - messageWriter.write(message); - } - function replySuccess(result, method, startTime) { - // The JSON RPC defines that a response must either have a result or an error - // So we can't treat undefined as a valid response result. - if (result === void 0) { - result = null; - } - let message = { - jsonrpc: version, - id: requestMessage.id, - result: result - }; - traceSendingResponse(message, method, startTime); - messageWriter.write(message); - } - traceReceivedRequest(requestMessage); - let element = requestHandlers[requestMessage.method]; - let type; - let requestHandler; - if (element) { - type = element.type; - requestHandler = element.handler; - } - let startTime = Date.now(); - if (requestHandler || starRequestHandler) { - let cancellationSource = new cancellation_1.CancellationTokenSource(); - let tokenKey = String(requestMessage.id); - requestTokens[tokenKey] = cancellationSource; - try { - let handlerResult; - if (requestMessage.params === void 0 || (type !== void 0 && type.numberOfParams === 0)) { - handlerResult = requestHandler - ? requestHandler(cancellationSource.token) - : starRequestHandler(requestMessage.method, cancellationSource.token); - } - else if (Is.array(requestMessage.params) && (type === void 0 || type.numberOfParams > 1)) { - handlerResult = requestHandler - ? requestHandler(...requestMessage.params, cancellationSource.token) - : starRequestHandler(requestMessage.method, ...requestMessage.params, cancellationSource.token); - } - else { - handlerResult = requestHandler - ? requestHandler(requestMessage.params, cancellationSource.token) - : starRequestHandler(requestMessage.method, requestMessage.params, cancellationSource.token); - } - let promise = handlerResult; - if (!handlerResult) { - delete requestTokens[tokenKey]; - replySuccess(handlerResult, requestMessage.method, startTime); - } - else if (promise.then) { - promise.then((resultOrError) => { - delete requestTokens[tokenKey]; - reply(resultOrError, requestMessage.method, startTime); - }, error => { - delete requestTokens[tokenKey]; - if (error instanceof messages_1.ResponseError) { - replyError(error, requestMessage.method, startTime); - } - else if (error && Is.string(error.message)) { - replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed with message: ${error.message}`), requestMessage.method, startTime); - } - else { - replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed unexpectedly without providing any details.`), requestMessage.method, startTime); - } - }); - } - else { - delete requestTokens[tokenKey]; - reply(handlerResult, requestMessage.method, startTime); - } - } - catch (error) { - delete requestTokens[tokenKey]; - if (error instanceof messages_1.ResponseError) { - reply(error, requestMessage.method, startTime); - } - else if (error && Is.string(error.message)) { - replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed with message: ${error.message}`), requestMessage.method, startTime); - } - else { - replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed unexpectedly without providing any details.`), requestMessage.method, startTime); - } - } - } - else { - replyError(new messages_1.ResponseError(messages_1.ErrorCodes.MethodNotFound, `Unhandled method ${requestMessage.method}`), requestMessage.method, startTime); - } - } - function handleResponse(responseMessage) { - if (isDisposed()) { - // See handle request. - return; - } - if (responseMessage.id === null) { - if (responseMessage.error) { - logger.error(`Received response message without id: Error is: \n${JSON.stringify(responseMessage.error, undefined, 4)}`); - } - else { - logger.error(`Received response message without id. No further error information provided.`); - } - } - else { - let key = String(responseMessage.id); - let responsePromise = responsePromises[key]; - traceReceivedResponse(responseMessage, responsePromise); - if (responsePromise) { - delete responsePromises[key]; - try { - if (responseMessage.error) { - let error = responseMessage.error; - responsePromise.reject(new messages_1.ResponseError(error.code, error.message, error.data)); - } - else if (responseMessage.result !== void 0) { - responsePromise.resolve(responseMessage.result); - } - else { - throw new Error('Should never happen.'); - } - } - catch (error) { - if (error.message) { - logger.error(`Response handler '${responsePromise.method}' failed with message: ${error.message}`); - } - else { - logger.error(`Response handler '${responsePromise.method}' failed unexpectedly.`); - } - } - } - } - } - function handleNotification(message) { - if (isDisposed()) { - // See handle request. - return; - } - let type = undefined; - let notificationHandler; - if (message.method === CancelNotification.type.method) { - notificationHandler = (params) => { - let id = params.id; - let source = requestTokens[String(id)]; - if (source) { - source.cancel(); - } - }; - } - else { - let element = notificationHandlers[message.method]; - if (element) { - notificationHandler = element.handler; - type = element.type; - } - } - if (notificationHandler || starNotificationHandler) { - try { - traceReceivedNotification(message); - if (message.params === void 0 || (type !== void 0 && type.numberOfParams === 0)) { - notificationHandler ? notificationHandler() : starNotificationHandler(message.method); - } - else if (Is.array(message.params) && (type === void 0 || type.numberOfParams > 1)) { - notificationHandler ? notificationHandler(...message.params) : starNotificationHandler(message.method, ...message.params); - } - else { - notificationHandler ? notificationHandler(message.params) : starNotificationHandler(message.method, message.params); - } - } - catch (error) { - if (error.message) { - logger.error(`Notification handler '${message.method}' failed with message: ${error.message}`); - } - else { - logger.error(`Notification handler '${message.method}' failed unexpectedly.`); - } - } - } - else { - unhandledNotificationEmitter.fire(message); - } - } - function handleInvalidMessage(message) { - if (!message) { - logger.error('Received empty message.'); - return; - } - logger.error(`Received message which is neither a response nor a notification message:\n${JSON.stringify(message, null, 4)}`); - // Test whether we find an id to reject the promise - let responseMessage = message; - if (Is.string(responseMessage.id) || Is.number(responseMessage.id)) { - let key = String(responseMessage.id); - let responseHandler = responsePromises[key]; - if (responseHandler) { - responseHandler.reject(new Error('The received response has neither a result nor an error property.')); - } - } - } - function traceSendingRequest(message) { - if (trace === Trace.Off || !tracer) { - return; - } - if (traceFormat === TraceFormat.Text) { - let data = undefined; - if (trace === Trace.Verbose && message.params) { - data = `Params: ${JSON.stringify(message.params, null, 4)}\n\n`; - } - tracer.log(`Sending request '${message.method} - (${message.id})'.`, data); - } - else { - logLSPMessage('send-request', message); - } - } - function traceSendingNotification(message) { - if (trace === Trace.Off || !tracer) { - return; - } - if (traceFormat === TraceFormat.Text) { - let data = undefined; - if (trace === Trace.Verbose) { - if (message.params) { - data = `Params: ${JSON.stringify(message.params, null, 4)}\n\n`; - } - else { - data = 'No parameters provided.\n\n'; - } - } - tracer.log(`Sending notification '${message.method}'.`, data); - } - else { - logLSPMessage('send-notification', message); - } - } - function traceSendingResponse(message, method, startTime) { - if (trace === Trace.Off || !tracer) { - return; - } - if (traceFormat === TraceFormat.Text) { - let data = undefined; - if (trace === Trace.Verbose) { - if (message.error && message.error.data) { - data = `Error data: ${JSON.stringify(message.error.data, null, 4)}\n\n`; - } - else { - if (message.result) { - data = `Result: ${JSON.stringify(message.result, null, 4)}\n\n`; - } - else if (message.error === void 0) { - data = 'No result returned.\n\n'; - } - } - } - tracer.log(`Sending response '${method} - (${message.id})'. Processing request took ${Date.now() - startTime}ms`, data); - } - else { - logLSPMessage('send-response', message); - } - } - function traceReceivedRequest(message) { - if (trace === Trace.Off || !tracer) { - return; - } - if (traceFormat === TraceFormat.Text) { - let data = undefined; - if (trace === Trace.Verbose && message.params) { - data = `Params: ${JSON.stringify(message.params, null, 4)}\n\n`; - } - tracer.log(`Received request '${message.method} - (${message.id})'.`, data); - } - else { - logLSPMessage('receive-request', message); - } - } - function traceReceivedNotification(message) { - if (trace === Trace.Off || !tracer || message.method === LogTraceNotification.type.method) { - return; - } - if (traceFormat === TraceFormat.Text) { - let data = undefined; - if (trace === Trace.Verbose) { - if (message.params) { - data = `Params: ${JSON.stringify(message.params, null, 4)}\n\n`; - } - else { - data = 'No parameters provided.\n\n'; - } - } - tracer.log(`Received notification '${message.method}'.`, data); - } - else { - logLSPMessage('receive-notification', message); - } - } - function traceReceivedResponse(message, responsePromise) { - if (trace === Trace.Off || !tracer) { - return; - } - if (traceFormat === TraceFormat.Text) { - let data = undefined; - if (trace === Trace.Verbose) { - if (message.error && message.error.data) { - data = `Error data: ${JSON.stringify(message.error.data, null, 4)}\n\n`; - } - else { - if (message.result) { - data = `Result: ${JSON.stringify(message.result, null, 4)}\n\n`; - } - else if (message.error === void 0) { - data = 'No result returned.\n\n'; - } - } - } - if (responsePromise) { - let error = message.error ? ` Request failed: ${message.error.message} (${message.error.code}).` : ''; - tracer.log(`Received response '${responsePromise.method} - (${message.id})' in ${Date.now() - responsePromise.timerStart}ms.${error}`, data); - } - else { - tracer.log(`Received response ${message.id} without active response promise.`, data); - } - } - else { - logLSPMessage('receive-response', message); - } - } - function logLSPMessage(type, message) { - if (!tracer || trace === Trace.Off) { - return; - } - const lspMessage = { - isLSPMessage: true, - type, - message, - timestamp: Date.now() - }; - tracer.log(lspMessage); - } - function throwIfClosedOrDisposed() { - if (isClosed()) { - throw new ConnectionError(ConnectionErrors.Closed, 'Connection is closed.'); - } - if (isDisposed()) { - throw new ConnectionError(ConnectionErrors.Disposed, 'Connection is disposed.'); - } - } - function throwIfListening() { - if (isListening()) { - throw new ConnectionError(ConnectionErrors.AlreadyListening, 'Connection is already listening'); - } - } - function throwIfNotListening() { - if (!isListening()) { - throw new Error('Call listen() first.'); - } - } - function undefinedToNull(param) { - if (param === void 0) { - return null; - } - else { - return param; - } - } - function computeMessageParams(type, params) { - let result; - let numberOfParams = type.numberOfParams; - switch (numberOfParams) { - case 0: - result = null; - break; - case 1: - result = undefinedToNull(params[0]); - break; - default: - result = []; - for (let i = 0; i < params.length && i < numberOfParams; i++) { - result.push(undefinedToNull(params[i])); - } - if (params.length < numberOfParams) { - for (let i = params.length; i < numberOfParams; i++) { - result.push(null); - } - } - break; - } - return result; - } - let connection = { - sendNotification: (type, ...params) => { - throwIfClosedOrDisposed(); - let method; - let messageParams; - if (Is.string(type)) { - method = type; - switch (params.length) { - case 0: - messageParams = null; - break; - case 1: - messageParams = params[0]; - break; - default: - messageParams = params; - break; - } - } - else { - method = type.method; - messageParams = computeMessageParams(type, params); - } - let notificationMessage = { - jsonrpc: version, - method: method, - params: messageParams - }; - traceSendingNotification(notificationMessage); - messageWriter.write(notificationMessage); - }, - onNotification: (type, handler) => { - throwIfClosedOrDisposed(); - if (Is.func(type)) { - starNotificationHandler = type; - } - else if (handler) { - if (Is.string(type)) { - notificationHandlers[type] = { type: undefined, handler }; - } - else { - notificationHandlers[type.method] = { type, handler }; - } - } - }, - sendRequest: (type, ...params) => { - throwIfClosedOrDisposed(); - throwIfNotListening(); - let method; - let messageParams; - let token = undefined; - if (Is.string(type)) { - method = type; - switch (params.length) { - case 0: - messageParams = null; - break; - case 1: - // The cancellation token is optional so it can also be undefined. - if (cancellation_1.CancellationToken.is(params[0])) { - messageParams = null; - token = params[0]; - } - else { - messageParams = undefinedToNull(params[0]); - } - break; - default: - const last = params.length - 1; - if (cancellation_1.CancellationToken.is(params[last])) { - token = params[last]; - if (params.length === 2) { - messageParams = undefinedToNull(params[0]); - } - else { - messageParams = params.slice(0, last).map(value => undefinedToNull(value)); - } - } - else { - messageParams = params.map(value => undefinedToNull(value)); - } - break; - } - } - else { - method = type.method; - messageParams = computeMessageParams(type, params); - let numberOfParams = type.numberOfParams; - token = cancellation_1.CancellationToken.is(params[numberOfParams]) ? params[numberOfParams] : undefined; - } - let id = sequenceNumber++; - let result = new Promise((resolve, reject) => { - let requestMessage = { - jsonrpc: version, - id: id, - method: method, - params: messageParams - }; - let responsePromise = { method: method, timerStart: Date.now(), resolve, reject }; - traceSendingRequest(requestMessage); - try { - messageWriter.write(requestMessage); - } - catch (e) { - // Writing the message failed. So we need to reject the promise. - responsePromise.reject(new messages_1.ResponseError(messages_1.ErrorCodes.MessageWriteError, e.message ? e.message : 'Unknown reason')); - responsePromise = null; - } - if (responsePromise) { - responsePromises[String(id)] = responsePromise; - } - }); - if (token) { - token.onCancellationRequested(() => { - connection.sendNotification(CancelNotification.type, { id }); - }); - } - return result; - }, - onRequest: (type, handler) => { - throwIfClosedOrDisposed(); - if (Is.func(type)) { - starRequestHandler = type; - } - else if (handler) { - if (Is.string(type)) { - requestHandlers[type] = { type: undefined, handler }; - } - else { - requestHandlers[type.method] = { type, handler }; - } - } - }, - trace: (_value, _tracer, sendNotificationOrTraceOptions) => { - let _sendNotification = false; - let _traceFormat = TraceFormat.Text; - if (sendNotificationOrTraceOptions !== void 0) { - if (Is.boolean(sendNotificationOrTraceOptions)) { - _sendNotification = sendNotificationOrTraceOptions; - } - else { - _sendNotification = sendNotificationOrTraceOptions.sendNotification || false; - _traceFormat = sendNotificationOrTraceOptions.traceFormat || TraceFormat.Text; - } - } - trace = _value; - traceFormat = _traceFormat; - if (trace === Trace.Off) { - tracer = undefined; - } - else { - tracer = _tracer; - } - if (_sendNotification && !isClosed() && !isDisposed()) { - connection.sendNotification(SetTraceNotification.type, { value: Trace.toString(_value) }); - } - }, - onError: errorEmitter.event, - onClose: closeEmitter.event, - onUnhandledNotification: unhandledNotificationEmitter.event, - onDispose: disposeEmitter.event, - dispose: () => { - if (isDisposed()) { - return; - } - state = ConnectionState.Disposed; - disposeEmitter.fire(undefined); - let error = new Error('Connection got disposed.'); - Object.keys(responsePromises).forEach((key) => { - responsePromises[key].reject(error); - }); - responsePromises = Object.create(null); - requestTokens = Object.create(null); - messageQueue = new linkedMap_1.LinkedMap(); - // Test for backwards compatibility - if (Is.func(messageWriter.dispose)) { - messageWriter.dispose(); - } - if (Is.func(messageReader.dispose)) { - messageReader.dispose(); - } - }, - listen: () => { - throwIfClosedOrDisposed(); - throwIfListening(); - state = ConnectionState.Listening; - messageReader.listen(callback); - }, - inspect: () => { - console.log("inspect"); - } - }; - connection.onNotification(LogTraceNotification.type, (params) => { - if (trace === Trace.Off || !tracer) { - return; - } - tracer.log(params.message, trace === Trace.Verbose ? params.verbose : undefined); - }); - return connection; -} -function isMessageReader(value) { - return value.listen !== void 0 && value.read === void 0; -} -function isMessageWriter(value) { - return value.write !== void 0 && value.end === void 0; -} -function createMessageConnection(input, output, logger, strategy) { - if (!logger) { - logger = exports.NullLogger; - } - let reader = isMessageReader(input) ? input : new messageReader_1.StreamMessageReader(input); - let writer = isMessageWriter(output) ? output : new messageWriter_1.StreamMessageWriter(output); - return _createMessageConnection(reader, writer, logger, strategy); -} -exports.createMessageConnection = createMessageConnection; - - -/***/ }), -/* 6 */ -/***/ (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. - * ------------------------------------------------------------------------------------------ */ - -Object.defineProperty(exports, "__esModule", { value: true }); -function boolean(value) { - return value === true || value === false; -} -exports.boolean = boolean; -function string(value) { - return typeof value === 'string' || value instanceof String; -} -exports.string = string; -function number(value) { - return typeof value === 'number' || value instanceof Number; -} -exports.number = number; -function error(value) { - return value instanceof Error; -} -exports.error = error; -function func(value) { - return typeof value === 'function'; -} -exports.func = func; -function array(value) { - return Array.isArray(value); -} -exports.array = array; -function stringArray(value) { - return array(value) && value.every(elem => string(elem)); -} -exports.stringArray = stringArray; - - -/***/ }), -/* 7 */ -/***/ (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. - * ------------------------------------------------------------------------------------------ */ - -Object.defineProperty(exports, "__esModule", { value: true }); -const is = __webpack_require__(6); -/** - * Predefined error codes. - */ -var ErrorCodes; -(function (ErrorCodes) { - // Defined by JSON RPC - ErrorCodes.ParseError = -32700; - ErrorCodes.InvalidRequest = -32600; - ErrorCodes.MethodNotFound = -32601; - ErrorCodes.InvalidParams = -32602; - ErrorCodes.InternalError = -32603; - ErrorCodes.serverErrorStart = -32099; - ErrorCodes.serverErrorEnd = -32000; - ErrorCodes.ServerNotInitialized = -32002; - ErrorCodes.UnknownErrorCode = -32001; - // Defined by the protocol. - ErrorCodes.RequestCancelled = -32800; - ErrorCodes.ContentModified = -32801; - // Defined by VSCode library. - ErrorCodes.MessageWriteError = 1; - ErrorCodes.MessageReadError = 2; -})(ErrorCodes = exports.ErrorCodes || (exports.ErrorCodes = {})); -/** - * An error object return in a response in case a request - * has failed. - */ -class ResponseError extends Error { - constructor(code, message, data) { - super(message); - this.code = is.number(code) ? code : ErrorCodes.UnknownErrorCode; - this.data = data; - Object.setPrototypeOf(this, ResponseError.prototype); - } - toJson() { - return { - code: this.code, - message: this.message, - data: this.data, - }; - } -} -exports.ResponseError = ResponseError; -/** - * An abstract implementation of a MessageType. - */ -class AbstractMessageType { - constructor(_method, _numberOfParams) { - this._method = _method; - this._numberOfParams = _numberOfParams; - } - get method() { - return this._method; - } - get numberOfParams() { - return this._numberOfParams; - } -} -exports.AbstractMessageType = AbstractMessageType; -/** - * Classes to type request response pairs - */ -class RequestType0 extends AbstractMessageType { - constructor(method) { - super(method, 0); - this._ = undefined; - } -} -exports.RequestType0 = RequestType0; -class RequestType extends AbstractMessageType { - constructor(method) { - super(method, 1); - this._ = undefined; - } -} -exports.RequestType = RequestType; -class RequestType1 extends AbstractMessageType { - constructor(method) { - super(method, 1); - this._ = undefined; - } -} -exports.RequestType1 = RequestType1; -class RequestType2 extends AbstractMessageType { - constructor(method) { - super(method, 2); - this._ = undefined; - } -} -exports.RequestType2 = RequestType2; -class RequestType3 extends AbstractMessageType { - constructor(method) { - super(method, 3); - this._ = undefined; - } -} -exports.RequestType3 = RequestType3; -class RequestType4 extends AbstractMessageType { - constructor(method) { - super(method, 4); - this._ = undefined; - } -} -exports.RequestType4 = RequestType4; -class RequestType5 extends AbstractMessageType { - constructor(method) { - super(method, 5); - this._ = undefined; - } -} -exports.RequestType5 = RequestType5; -class RequestType6 extends AbstractMessageType { - constructor(method) { - super(method, 6); - this._ = undefined; - } -} -exports.RequestType6 = RequestType6; -class RequestType7 extends AbstractMessageType { - constructor(method) { - super(method, 7); - this._ = undefined; - } -} -exports.RequestType7 = RequestType7; -class RequestType8 extends AbstractMessageType { - constructor(method) { - super(method, 8); - this._ = undefined; - } -} -exports.RequestType8 = RequestType8; -class RequestType9 extends AbstractMessageType { - constructor(method) { - super(method, 9); - this._ = undefined; - } -} -exports.RequestType9 = RequestType9; -class NotificationType extends AbstractMessageType { - constructor(method) { - super(method, 1); - this._ = undefined; - } -} -exports.NotificationType = NotificationType; -class NotificationType0 extends AbstractMessageType { - constructor(method) { - super(method, 0); - this._ = undefined; - } -} -exports.NotificationType0 = NotificationType0; -class NotificationType1 extends AbstractMessageType { - constructor(method) { - super(method, 1); - this._ = undefined; - } -} -exports.NotificationType1 = NotificationType1; -class NotificationType2 extends AbstractMessageType { - constructor(method) { - super(method, 2); - this._ = undefined; - } -} -exports.NotificationType2 = NotificationType2; -class NotificationType3 extends AbstractMessageType { - constructor(method) { - super(method, 3); - this._ = undefined; - } -} -exports.NotificationType3 = NotificationType3; -class NotificationType4 extends AbstractMessageType { - constructor(method) { - super(method, 4); - this._ = undefined; - } -} -exports.NotificationType4 = NotificationType4; -class NotificationType5 extends AbstractMessageType { - constructor(method) { - super(method, 5); - this._ = undefined; - } -} -exports.NotificationType5 = NotificationType5; -class NotificationType6 extends AbstractMessageType { - constructor(method) { - super(method, 6); - this._ = undefined; - } -} -exports.NotificationType6 = NotificationType6; -class NotificationType7 extends AbstractMessageType { - constructor(method) { - super(method, 7); - this._ = undefined; - } -} -exports.NotificationType7 = NotificationType7; -class NotificationType8 extends AbstractMessageType { - constructor(method) { - super(method, 8); - this._ = undefined; - } -} -exports.NotificationType8 = NotificationType8; -class NotificationType9 extends AbstractMessageType { - constructor(method) { - super(method, 9); - this._ = undefined; - } -} -exports.NotificationType9 = NotificationType9; -/** - * Tests if the given message is a request message - */ -function isRequestMessage(message) { - let candidate = message; - return candidate && is.string(candidate.method) && (is.string(candidate.id) || is.number(candidate.id)); -} -exports.isRequestMessage = isRequestMessage; -/** - * Tests if the given message is a notification message - */ -function isNotificationMessage(message) { - let candidate = message; - return candidate && is.string(candidate.method) && message.id === void 0; -} -exports.isNotificationMessage = isNotificationMessage; -/** - * Tests if the given message is a response message - */ -function isResponseMessage(message) { - let candidate = message; - return candidate && (candidate.result !== void 0 || !!candidate.error) && (is.string(candidate.id) || is.number(candidate.id) || candidate.id === null); -} -exports.isResponseMessage = isResponseMessage; - - -/***/ }), -/* 8 */ -/***/ (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. - * ------------------------------------------------------------------------------------------ */ - -Object.defineProperty(exports, "__esModule", { value: true }); -const events_1 = __webpack_require__(9); -const Is = __webpack_require__(6); -let DefaultSize = 8192; -let CR = Buffer.from('\r', 'ascii')[0]; -let LF = Buffer.from('\n', 'ascii')[0]; -let CRLF = '\r\n'; -class MessageBuffer { - constructor(encoding = 'utf8') { - this.encoding = encoding; - this.index = 0; - this.buffer = Buffer.allocUnsafe(DefaultSize); - } - append(chunk) { - var toAppend = chunk; - if (typeof (chunk) === 'string') { - var str = chunk; - var bufferLen = Buffer.byteLength(str, this.encoding); - toAppend = Buffer.allocUnsafe(bufferLen); - toAppend.write(str, 0, bufferLen, this.encoding); - } - if (this.buffer.length - this.index >= toAppend.length) { - toAppend.copy(this.buffer, this.index, 0, toAppend.length); - } - else { - var newSize = (Math.ceil((this.index + toAppend.length) / DefaultSize) + 1) * DefaultSize; - if (this.index === 0) { - this.buffer = Buffer.allocUnsafe(newSize); - toAppend.copy(this.buffer, 0, 0, toAppend.length); - } - else { - this.buffer = Buffer.concat([this.buffer.slice(0, this.index), toAppend], newSize); - } - } - this.index += toAppend.length; - } - tryReadHeaders() { - let result = undefined; - let current = 0; - while (current + 3 < this.index && (this.buffer[current] !== CR || this.buffer[current + 1] !== LF || this.buffer[current + 2] !== CR || this.buffer[current + 3] !== LF)) { - current++; - } - // No header / body separator found (e.g CRLFCRLF) - if (current + 3 >= this.index) { - return result; - } - result = Object.create(null); - let headers = this.buffer.toString('ascii', 0, current).split(CRLF); - headers.forEach((header) => { - let index = header.indexOf(':'); - if (index === -1) { - throw new Error('Message header must separate key and value using :'); - } - let key = header.substr(0, index); - let value = header.substr(index + 1).trim(); - result[key] = value; - }); - let nextStart = current + 4; - this.buffer = this.buffer.slice(nextStart); - this.index = this.index - nextStart; - return result; - } - tryReadContent(length) { - if (this.index < length) { - return null; - } - let result = this.buffer.toString(this.encoding, 0, length); - let nextStart = length; - this.buffer.copy(this.buffer, 0, nextStart); - this.index = this.index - nextStart; - return result; - } - get numberOfBytes() { - return this.index; - } -} -var MessageReader; -(function (MessageReader) { - function is(value) { - let candidate = value; - return candidate && Is.func(candidate.listen) && Is.func(candidate.dispose) && - Is.func(candidate.onError) && Is.func(candidate.onClose) && Is.func(candidate.onPartialMessage); - } - MessageReader.is = is; -})(MessageReader = exports.MessageReader || (exports.MessageReader = {})); -class AbstractMessageReader { - constructor() { - this.errorEmitter = new events_1.Emitter(); - this.closeEmitter = new events_1.Emitter(); - this.partialMessageEmitter = new events_1.Emitter(); - } - dispose() { - this.errorEmitter.dispose(); - this.closeEmitter.dispose(); - } - get onError() { - return this.errorEmitter.event; - } - fireError(error) { - this.errorEmitter.fire(this.asError(error)); - } - get onClose() { - return this.closeEmitter.event; - } - fireClose() { - this.closeEmitter.fire(undefined); - } - get onPartialMessage() { - return this.partialMessageEmitter.event; - } - firePartialMessage(info) { - this.partialMessageEmitter.fire(info); - } - asError(error) { - if (error instanceof Error) { - return error; - } - else { - return new Error(`Reader received error. Reason: ${Is.string(error.message) ? error.message : 'unknown'}`); - } - } -} -exports.AbstractMessageReader = AbstractMessageReader; -class StreamMessageReader extends AbstractMessageReader { - constructor(readable, encoding = 'utf8') { - super(); - this.readable = readable; - this.buffer = new MessageBuffer(encoding); - this._partialMessageTimeout = 10000; - } - set partialMessageTimeout(timeout) { - this._partialMessageTimeout = timeout; - } - get partialMessageTimeout() { - return this._partialMessageTimeout; - } - listen(callback) { - this.nextMessageLength = -1; - this.messageToken = 0; - this.partialMessageTimer = undefined; - this.callback = callback; - this.readable.on('data', (data) => { - this.onData(data); - }); - this.readable.on('error', (error) => this.fireError(error)); - this.readable.on('close', () => this.fireClose()); - } - onData(data) { - this.buffer.append(data); - while (true) { - if (this.nextMessageLength === -1) { - let headers = this.buffer.tryReadHeaders(); - if (!headers) { - return; - } - let contentLength = headers['Content-Length']; - if (!contentLength) { - throw new Error('Header must provide a Content-Length property.'); - } - let length = parseInt(contentLength); - if (isNaN(length)) { - throw new Error('Content-Length value must be a number.'); - } - this.nextMessageLength = length; - // Take the encoding form the header. For compatibility - // treat both utf-8 and utf8 as node utf8 - } - var msg = this.buffer.tryReadContent(this.nextMessageLength); - if (msg === null) { - /** We haven't received the full message yet. */ - this.setPartialMessageTimer(); - return; - } - this.clearPartialMessageTimer(); - this.nextMessageLength = -1; - this.messageToken++; - var json = JSON.parse(msg); - this.callback(json); - } - } - clearPartialMessageTimer() { - if (this.partialMessageTimer) { - clearTimeout(this.partialMessageTimer); - this.partialMessageTimer = undefined; - } - } - setPartialMessageTimer() { - this.clearPartialMessageTimer(); - if (this._partialMessageTimeout <= 0) { - return; - } - this.partialMessageTimer = setTimeout((token, timeout) => { - this.partialMessageTimer = undefined; - if (token === this.messageToken) { - this.firePartialMessage({ messageToken: token, waitingTime: timeout }); - this.setPartialMessageTimer(); - } - }, this._partialMessageTimeout, this.messageToken, this._partialMessageTimeout); - } -} -exports.StreamMessageReader = StreamMessageReader; -class IPCMessageReader extends AbstractMessageReader { - constructor(process) { - super(); - this.process = process; - let eventEmitter = this.process; - eventEmitter.on('error', (error) => this.fireError(error)); - eventEmitter.on('close', () => this.fireClose()); - } - listen(callback) { - this.process.on('message', callback); - } -} -exports.IPCMessageReader = IPCMessageReader; -class SocketMessageReader extends StreamMessageReader { - constructor(socket, encoding = 'utf-8') { - super(socket, encoding); - } -} -exports.SocketMessageReader = SocketMessageReader; - - -/***/ }), -/* 9 */ -/***/ (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. - * ------------------------------------------------------------------------------------------ */ - -Object.defineProperty(exports, "__esModule", { value: true }); -var Disposable; -(function (Disposable) { - function create(func) { - return { - dispose: func - }; - } - Disposable.create = create; -})(Disposable = exports.Disposable || (exports.Disposable = {})); -var Event; -(function (Event) { - const _disposable = { dispose() { } }; - Event.None = function () { return _disposable; }; -})(Event = exports.Event || (exports.Event = {})); -class CallbackList { - add(callback, context = null, bucket) { - if (!this._callbacks) { - this._callbacks = []; - this._contexts = []; - } - this._callbacks.push(callback); - this._contexts.push(context); - if (Array.isArray(bucket)) { - bucket.push({ dispose: () => this.remove(callback, context) }); - } - } - remove(callback, context = null) { - if (!this._callbacks) { - return; - } - var foundCallbackWithDifferentContext = false; - for (var i = 0, len = this._callbacks.length; i < len; i++) { - if (this._callbacks[i] === callback) { - if (this._contexts[i] === context) { - // callback & context match => remove it - this._callbacks.splice(i, 1); - this._contexts.splice(i, 1); - return; - } - else { - foundCallbackWithDifferentContext = true; - } - } - } - if (foundCallbackWithDifferentContext) { - throw new Error('When adding a listener with a context, you should remove it with the same context'); - } - } - invoke(...args) { - if (!this._callbacks) { - return []; - } - var ret = [], callbacks = this._callbacks.slice(0), contexts = this._contexts.slice(0); - for (var i = 0, len = callbacks.length; i < len; i++) { - try { - ret.push(callbacks[i].apply(contexts[i], args)); - } - catch (e) { - console.error(e); - } - } - return ret; - } - isEmpty() { - return !this._callbacks || this._callbacks.length === 0; - } - dispose() { - this._callbacks = undefined; - this._contexts = undefined; - } -} -class Emitter { - constructor(_options) { - this._options = _options; - } - /** - * For the public to allow to subscribe - * to events from this Emitter - */ - get event() { - if (!this._event) { - this._event = (listener, thisArgs, disposables) => { - if (!this._callbacks) { - this._callbacks = new CallbackList(); - } - if (this._options && this._options.onFirstListenerAdd && this._callbacks.isEmpty()) { - this._options.onFirstListenerAdd(this); - } - this._callbacks.add(listener, thisArgs); - let result; - result = { - dispose: () => { - this._callbacks.remove(listener, thisArgs); - result.dispose = Emitter._noop; - if (this._options && this._options.onLastListenerRemove && this._callbacks.isEmpty()) { - this._options.onLastListenerRemove(this); - } - } - }; - if (Array.isArray(disposables)) { - disposables.push(result); - } - return result; - }; - } - return this._event; - } - /** - * To be kept private to fire an event to - * subscribers - */ - fire(event) { - if (this._callbacks) { - this._callbacks.invoke.call(this._callbacks, event); - } - } - dispose() { - if (this._callbacks) { - this._callbacks.dispose(); - this._callbacks = undefined; - } - } -} -Emitter._noop = function () { }; -exports.Emitter = Emitter; - - -/***/ }), -/* 10 */ -/***/ (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. - * ------------------------------------------------------------------------------------------ */ - -Object.defineProperty(exports, "__esModule", { value: true }); -const events_1 = __webpack_require__(9); -const Is = __webpack_require__(6); -let ContentLength = 'Content-Length: '; -let CRLF = '\r\n'; -var MessageWriter; -(function (MessageWriter) { - function is(value) { - let candidate = value; - return candidate && Is.func(candidate.dispose) && Is.func(candidate.onClose) && - Is.func(candidate.onError) && Is.func(candidate.write); - } - MessageWriter.is = is; -})(MessageWriter = exports.MessageWriter || (exports.MessageWriter = {})); -class AbstractMessageWriter { - constructor() { - this.errorEmitter = new events_1.Emitter(); - this.closeEmitter = new events_1.Emitter(); - } - dispose() { - this.errorEmitter.dispose(); - this.closeEmitter.dispose(); - } - get onError() { - return this.errorEmitter.event; - } - fireError(error, message, count) { - this.errorEmitter.fire([this.asError(error), message, count]); - } - get onClose() { - return this.closeEmitter.event; - } - fireClose() { - this.closeEmitter.fire(undefined); - } - asError(error) { - if (error instanceof Error) { - return error; - } - else { - return new Error(`Writer received error. Reason: ${Is.string(error.message) ? error.message : 'unknown'}`); - } - } -} -exports.AbstractMessageWriter = AbstractMessageWriter; -class StreamMessageWriter extends AbstractMessageWriter { - constructor(writable, encoding = 'utf8') { - super(); - this.writable = writable; - this.encoding = encoding; - this.errorCount = 0; - this.writable.on('error', (error) => this.fireError(error)); - this.writable.on('close', () => this.fireClose()); - } - write(msg) { - let json = JSON.stringify(msg); - let contentLength = Buffer.byteLength(json, this.encoding); - let headers = [ - ContentLength, contentLength.toString(), CRLF, - CRLF - ]; - try { - // Header must be written in ASCII encoding - this.writable.write(headers.join(''), 'ascii'); - // Now write the content. This can be written in any encoding - this.writable.write(json, this.encoding); - this.errorCount = 0; - } - catch (error) { - this.errorCount++; - this.fireError(error, msg, this.errorCount); - } - } -} -exports.StreamMessageWriter = StreamMessageWriter; -class IPCMessageWriter extends AbstractMessageWriter { - constructor(process) { - super(); - this.process = process; - this.errorCount = 0; - this.queue = []; - this.sending = false; - let eventEmitter = this.process; - eventEmitter.on('error', (error) => this.fireError(error)); - eventEmitter.on('close', () => this.fireClose); - } - write(msg) { - if (!this.sending && this.queue.length === 0) { - // See https://github.com/nodejs/node/issues/7657 - this.doWriteMessage(msg); - } - else { - this.queue.push(msg); - } - } - doWriteMessage(msg) { - try { - if (this.process.send) { - this.sending = true; - this.process.send(msg, undefined, undefined, (error) => { - this.sending = false; - if (error) { - this.errorCount++; - this.fireError(error, msg, this.errorCount); - } - else { - this.errorCount = 0; - } - if (this.queue.length > 0) { - this.doWriteMessage(this.queue.shift()); - } - }); - } - } - catch (error) { - this.errorCount++; - this.fireError(error, msg, this.errorCount); - } - } -} -exports.IPCMessageWriter = IPCMessageWriter; -class SocketMessageWriter extends AbstractMessageWriter { - constructor(socket, encoding = 'utf8') { - super(); - this.socket = socket; - this.queue = []; - this.sending = false; - this.encoding = encoding; - this.errorCount = 0; - this.socket.on('error', (error) => this.fireError(error)); - this.socket.on('close', () => this.fireClose()); - } - dispose() { - super.dispose(); - this.socket.destroy(); - } - write(msg) { - if (!this.sending && this.queue.length === 0) { - // See https://github.com/nodejs/node/issues/7657 - this.doWriteMessage(msg); - } - else { - this.queue.push(msg); - } - } - doWriteMessage(msg) { - let json = JSON.stringify(msg); - let contentLength = Buffer.byteLength(json, this.encoding); - let headers = [ - ContentLength, contentLength.toString(), CRLF, - CRLF - ]; - try { - // Header must be written in ASCII encoding - this.sending = true; - this.socket.write(headers.join(''), 'ascii', (error) => { - if (error) { - this.handleError(error, msg); - } - try { - // Now write the content. This can be written in any encoding - this.socket.write(json, this.encoding, (error) => { - this.sending = false; - if (error) { - this.handleError(error, msg); - } - else { - this.errorCount = 0; - } - if (this.queue.length > 0) { - this.doWriteMessage(this.queue.shift()); - } - }); - } - catch (error) { - this.handleError(error, msg); - } - }); - } - catch (error) { - this.handleError(error, msg); - } - } - handleError(error, msg) { - this.errorCount++; - this.fireError(error, msg, this.errorCount); - } -} -exports.SocketMessageWriter = SocketMessageWriter; - - -/***/ }), -/* 11 */ -/***/ (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. - *--------------------------------------------------------------------------------------------*/ - -Object.defineProperty(exports, "__esModule", { value: true }); -const events_1 = __webpack_require__(9); -const Is = __webpack_require__(6); -var CancellationToken; -(function (CancellationToken) { - CancellationToken.None = Object.freeze({ - isCancellationRequested: false, - onCancellationRequested: events_1.Event.None - }); - CancellationToken.Cancelled = Object.freeze({ - isCancellationRequested: true, - onCancellationRequested: events_1.Event.None - }); - function is(value) { - let candidate = value; - return candidate && (candidate === CancellationToken.None - || candidate === CancellationToken.Cancelled - || (Is.boolean(candidate.isCancellationRequested) && !!candidate.onCancellationRequested)); - } - CancellationToken.is = is; -})(CancellationToken = exports.CancellationToken || (exports.CancellationToken = {})); -const shortcutEvent = Object.freeze(function (callback, context) { - let handle = setTimeout(callback.bind(context), 0); - return { dispose() { clearTimeout(handle); } }; -}); -class MutableToken { - constructor() { - this._isCancelled = false; - } - cancel() { - if (!this._isCancelled) { - this._isCancelled = true; - if (this._emitter) { - this._emitter.fire(undefined); - this.dispose(); - } - } - } - get isCancellationRequested() { - return this._isCancelled; - } - get onCancellationRequested() { - if (this._isCancelled) { - return shortcutEvent; - } - if (!this._emitter) { - this._emitter = new events_1.Emitter(); - } - return this._emitter.event; - } - dispose() { - if (this._emitter) { - this._emitter.dispose(); - this._emitter = undefined; - } - } -} -class CancellationTokenSource { - get token() { - if (!this._token) { - // be lazy and create the token only when - // actually needed - this._token = new MutableToken(); - } - return this._token; - } - cancel() { - if (!this._token) { - // save an object by returning the default - // cancelled token when cancellation happens - // before someone asks for the token - this._token = CancellationToken.Cancelled; - } - else { - this._token.cancel(); - } - } - dispose() { - if (!this._token) { - // ensure to initialize with an empty token if we had none - this._token = CancellationToken.None; - } - else if (this._token instanceof MutableToken) { - // actually dispose - this._token.dispose(); - } - } -} -exports.CancellationTokenSource = CancellationTokenSource; - - -/***/ }), -/* 12 */ -/***/ (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. - *--------------------------------------------------------------------------------------------*/ -Object.defineProperty(exports, "__esModule", { value: true }); -var Touch; -(function (Touch) { - Touch.None = 0; - Touch.First = 1; - Touch.Last = 2; -})(Touch = exports.Touch || (exports.Touch = {})); -class LinkedMap { - constructor() { - this._map = new Map(); - this._head = undefined; - this._tail = undefined; - this._size = 0; - } - clear() { - this._map.clear(); - this._head = undefined; - this._tail = undefined; - this._size = 0; - } - isEmpty() { - return !this._head && !this._tail; - } - get size() { - return this._size; - } - has(key) { - return this._map.has(key); - } - get(key) { - const item = this._map.get(key); - if (!item) { - return undefined; - } - return item.value; - } - set(key, value, touch = Touch.None) { - let item = this._map.get(key); - if (item) { - item.value = value; - if (touch !== Touch.None) { - this.touch(item, touch); - } - } - else { - item = { key, value, next: undefined, previous: undefined }; - switch (touch) { - case Touch.None: - this.addItemLast(item); - break; - case Touch.First: - this.addItemFirst(item); - break; - case Touch.Last: - this.addItemLast(item); - break; - default: - this.addItemLast(item); - break; - } - this._map.set(key, item); - this._size++; - } - } - delete(key) { - const item = this._map.get(key); - if (!item) { - return false; - } - this._map.delete(key); - this.removeItem(item); - this._size--; - return true; - } - shift() { - if (!this._head && !this._tail) { - return undefined; - } - if (!this._head || !this._tail) { - throw new Error('Invalid list'); - } - const item = this._head; - this._map.delete(item.key); - this.removeItem(item); - this._size--; - return item.value; - } - forEach(callbackfn, thisArg) { - let current = this._head; - while (current) { - if (thisArg) { - callbackfn.bind(thisArg)(current.value, current.key, this); - } - else { - callbackfn(current.value, current.key, this); - } - current = current.next; - } - } - forEachReverse(callbackfn, thisArg) { - let current = this._tail; - while (current) { - if (thisArg) { - callbackfn.bind(thisArg)(current.value, current.key, this); - } - else { - callbackfn(current.value, current.key, this); - } - current = current.previous; - } - } - values() { - let result = []; - let current = this._head; - while (current) { - result.push(current.value); - current = current.next; - } - return result; - } - keys() { - let result = []; - let current = this._head; - while (current) { - result.push(current.key); - current = current.next; - } - return result; - } - /* JSON RPC run on es5 which has no Symbol.iterator - public keys(): IterableIterator { - let current = this._head; - let iterator: IterableIterator = { - [Symbol.iterator]() { - return iterator; - }, - next():IteratorResult { - if (current) { - let result = { value: current.key, done: false }; - current = current.next; - return result; - } else { - return { value: undefined, done: true }; - } - } - }; - return iterator; - } - - public values(): IterableIterator { - let current = this._head; - let iterator: IterableIterator = { - [Symbol.iterator]() { - return iterator; - }, - next():IteratorResult { - if (current) { - let result = { value: current.value, done: false }; - current = current.next; - return result; - } else { - return { value: undefined, done: true }; - } - } - }; - return iterator; - } - */ - addItemFirst(item) { - // First time Insert - if (!this._head && !this._tail) { - this._tail = item; - } - else if (!this._head) { - throw new Error('Invalid list'); - } - else { - item.next = this._head; - this._head.previous = item; - } - this._head = item; - } - addItemLast(item) { - // First time Insert - if (!this._head && !this._tail) { - this._head = item; - } - else if (!this._tail) { - throw new Error('Invalid list'); - } - else { - item.previous = this._tail; - this._tail.next = item; - } - this._tail = item; - } - removeItem(item) { - if (item === this._head && item === this._tail) { - this._head = undefined; - this._tail = undefined; - } - else if (item === this._head) { - this._head = item.next; - } - else if (item === this._tail) { - this._tail = item.previous; - } - else { - const next = item.next; - const previous = item.previous; - if (!next || !previous) { - throw new Error('Invalid list'); - } - next.previous = previous; - previous.next = next; - } - } - touch(item, touch) { - if (!this._head || !this._tail) { - throw new Error('Invalid list'); - } - if ((touch !== Touch.First && touch !== Touch.Last)) { - return; - } - if (touch === Touch.First) { - if (item === this._head) { - return; - } - const next = item.next; - const previous = item.previous; - // Unlink the item - if (item === this._tail) { - // previous must be defined since item was not head but is tail - // So there are more than on item in the map - previous.next = undefined; - this._tail = previous; - } - else { - // Both next and previous are not undefined since item was neither head nor tail. - next.previous = previous; - previous.next = next; - } - // Insert the node at head - item.previous = undefined; - item.next = this._head; - this._head.previous = item; - this._head = item; - } - else if (touch === Touch.Last) { - if (item === this._tail) { - return; - } - const next = item.next; - const previous = item.previous; - // Unlink the item. - if (item === this._head) { - // next must be defined since item was not tail but is head - // So there are more than on item in the map - next.previous = undefined; - this._head = next; - } - else { - // Both next and previous are not undefined since item was neither head nor tail. - next.previous = previous; - previous.next = next; - } - item.next = undefined; - item.previous = this._tail; - this._tail.next = item; - this._tail = item; - } - } -} -exports.LinkedMap = LinkedMap; - - -/***/ }), -/* 13 */ -/***/ (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. - * ------------------------------------------------------------------------------------------ */ - -Object.defineProperty(exports, "__esModule", { value: true }); -const path_1 = __webpack_require__(3); -const os_1 = __webpack_require__(14); -const crypto_1 = __webpack_require__(15); -const net_1 = __webpack_require__(16); -const messageReader_1 = __webpack_require__(8); -const messageWriter_1 = __webpack_require__(10); -function generateRandomPipeName() { - const randomSuffix = crypto_1.randomBytes(21).toString('hex'); - if (process.platform === 'win32') { - return `\\\\.\\pipe\\vscode-jsonrpc-${randomSuffix}-sock`; - } - else { - // Mac/Unix: use socket file - return path_1.join(os_1.tmpdir(), `vscode-${randomSuffix}.sock`); - } -} -exports.generateRandomPipeName = generateRandomPipeName; -function createClientPipeTransport(pipeName, encoding = 'utf-8') { - let connectResolve; - let connected = new Promise((resolve, _reject) => { - connectResolve = resolve; - }); - return new Promise((resolve, reject) => { - let server = net_1.createServer((socket) => { - server.close(); - connectResolve([ - new messageReader_1.SocketMessageReader(socket, encoding), - new messageWriter_1.SocketMessageWriter(socket, encoding) - ]); - }); - server.on('error', reject); - server.listen(pipeName, () => { - server.removeListener('error', reject); - resolve({ - onConnected: () => { return connected; } - }); - }); - }); -} -exports.createClientPipeTransport = createClientPipeTransport; -function createServerPipeTransport(pipeName, encoding = 'utf-8') { - const socket = net_1.createConnection(pipeName); - return [ - new messageReader_1.SocketMessageReader(socket, encoding), - new messageWriter_1.SocketMessageWriter(socket, encoding) - ]; -} -exports.createServerPipeTransport = createServerPipeTransport; - - -/***/ }), -/* 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"; -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ------------------------------------------------------------------------------------------ */ - -Object.defineProperty(exports, "__esModule", { value: true }); -const net_1 = __webpack_require__(16); -const messageReader_1 = __webpack_require__(8); -const messageWriter_1 = __webpack_require__(10); -function createClientSocketTransport(port, encoding = 'utf-8') { - let connectResolve; - let connected = new Promise((resolve, _reject) => { - connectResolve = resolve; - }); - return new Promise((resolve, reject) => { - let server = net_1.createServer((socket) => { - server.close(); - connectResolve([ - new messageReader_1.SocketMessageReader(socket, encoding), - new messageWriter_1.SocketMessageWriter(socket, encoding) - ]); - }); - server.on('error', reject); - server.listen(port, '127.0.0.1', () => { - server.removeListener('error', reject); - resolve({ - onConnected: () => { return connected; } - }); - }); - }); -} -exports.createClientSocketTransport = createClientSocketTransport; -function createServerSocketTransport(port, encoding = 'utf-8') { - const socket = net_1.createConnection(port, '127.0.0.1'); - return [ - new messageReader_1.SocketMessageReader(socket, encoding), - new messageWriter_1.SocketMessageWriter(socket, encoding) - ]; -} -exports.createServerSocketTransport = createServerSocketTransport; - +//# sourceMappingURL=api.js.map /***/ }), -/* 18 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/* 25 */ +/***/ ((__unused_webpack_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__, "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__, "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; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextDocumentSaveReason", function() { return TextDocumentSaveReason; }); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "Position": () => /* binding */ Position, +/* harmony export */ "Range": () => /* binding */ Range, +/* harmony export */ "Location": () => /* binding */ Location, +/* harmony export */ "LocationLink": () => /* binding */ LocationLink, +/* harmony export */ "Color": () => /* binding */ Color, +/* harmony export */ "ColorInformation": () => /* binding */ ColorInformation, +/* harmony export */ "ColorPresentation": () => /* binding */ ColorPresentation, +/* harmony export */ "FoldingRangeKind": () => /* binding */ FoldingRangeKind, +/* harmony export */ "FoldingRange": () => /* binding */ FoldingRange, +/* harmony export */ "DiagnosticRelatedInformation": () => /* binding */ DiagnosticRelatedInformation, +/* harmony export */ "DiagnosticSeverity": () => /* binding */ DiagnosticSeverity, +/* harmony export */ "DiagnosticTag": () => /* binding */ DiagnosticTag, +/* harmony export */ "DiagnosticCode": () => /* binding */ DiagnosticCode, +/* harmony export */ "Diagnostic": () => /* binding */ Diagnostic, +/* harmony export */ "Command": () => /* binding */ Command, +/* harmony export */ "TextEdit": () => /* binding */ TextEdit, +/* harmony export */ "TextDocumentEdit": () => /* binding */ TextDocumentEdit, +/* harmony export */ "CreateFile": () => /* binding */ CreateFile, +/* harmony export */ "RenameFile": () => /* binding */ RenameFile, +/* harmony export */ "DeleteFile": () => /* binding */ DeleteFile, +/* harmony export */ "WorkspaceEdit": () => /* binding */ WorkspaceEdit, +/* harmony export */ "WorkspaceChange": () => /* binding */ WorkspaceChange, +/* harmony export */ "TextDocumentIdentifier": () => /* binding */ TextDocumentIdentifier, +/* harmony export */ "VersionedTextDocumentIdentifier": () => /* binding */ VersionedTextDocumentIdentifier, +/* harmony export */ "TextDocumentItem": () => /* binding */ TextDocumentItem, +/* harmony export */ "MarkupKind": () => /* binding */ MarkupKind, +/* harmony export */ "MarkupContent": () => /* binding */ MarkupContent, +/* harmony export */ "CompletionItemKind": () => /* binding */ CompletionItemKind, +/* harmony export */ "InsertTextFormat": () => /* binding */ InsertTextFormat, +/* harmony export */ "CompletionItemTag": () => /* binding */ CompletionItemTag, +/* harmony export */ "InsertReplaceEdit": () => /* binding */ InsertReplaceEdit, +/* harmony export */ "CompletionItem": () => /* binding */ CompletionItem, +/* harmony export */ "CompletionList": () => /* binding */ CompletionList, +/* harmony export */ "MarkedString": () => /* binding */ MarkedString, +/* harmony export */ "Hover": () => /* binding */ Hover, +/* harmony export */ "ParameterInformation": () => /* binding */ ParameterInformation, +/* harmony export */ "SignatureInformation": () => /* binding */ SignatureInformation, +/* harmony export */ "DocumentHighlightKind": () => /* binding */ DocumentHighlightKind, +/* harmony export */ "DocumentHighlight": () => /* binding */ DocumentHighlight, +/* harmony export */ "SymbolKind": () => /* binding */ SymbolKind, +/* harmony export */ "SymbolTag": () => /* binding */ SymbolTag, +/* harmony export */ "SymbolInformation": () => /* binding */ SymbolInformation, +/* harmony export */ "DocumentSymbol": () => /* binding */ DocumentSymbol, +/* harmony export */ "CodeActionKind": () => /* binding */ CodeActionKind, +/* harmony export */ "CodeActionContext": () => /* binding */ CodeActionContext, +/* harmony export */ "CodeAction": () => /* binding */ CodeAction, +/* harmony export */ "CodeLens": () => /* binding */ CodeLens, +/* harmony export */ "FormattingOptions": () => /* binding */ FormattingOptions, +/* harmony export */ "DocumentLink": () => /* binding */ DocumentLink, +/* harmony export */ "SelectionRange": () => /* binding */ SelectionRange, +/* harmony export */ "EOL": () => /* binding */ EOL, +/* harmony export */ "TextDocument": () => /* binding */ TextDocument +/* harmony export */ }); /* -------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -2986,6 +3428,11 @@ var DiagnosticSeverity; */ DiagnosticSeverity.Hint = 4; })(DiagnosticSeverity || (DiagnosticSeverity = {})); +/** + * The diagnostic tags. + * + * @since 3.15.0 + */ var DiagnosticTag; (function (DiagnosticTag) { /** @@ -2995,7 +3442,29 @@ var DiagnosticTag; * an error squiggle. */ DiagnosticTag.Unnecessary = 1; + /** + * Deprecated or obsolete code. + * + * Clients are allowed to rendered diagnostics with this tag strike through. + */ + DiagnosticTag.Deprecated = 2; })(DiagnosticTag || (DiagnosticTag = {})); +/** + * The DiagnosticCode namespace provides functions to deal with complex diagnostic codes. + * + * @since 3.16.0 - Proposed state + */ +var DiagnosticCode; +(function (DiagnosticCode) { + /** + * Checks whether the given liternal conforms to the [DiagnosticCode](#DiagnosticCode) interface. + */ + function is(value) { + var candidate = value; + return candidate !== undefined && candidate !== null && (Is.number(candidate.value) || Is.string(candidate.value)) && Is.string(candidate.target); + } + DiagnosticCode.is = is; +})(DiagnosticCode || (DiagnosticCode = {})); /** * The Diagnostic namespace provides helper functions to work with * [Diagnostic](#Diagnostic) literals. @@ -3264,6 +3733,9 @@ var WorkspaceChange = /** @class */ (function () { * use to be returned from a workspace edit operation like rename. */ get: function () { + if (this._workspaceEdit === undefined) { + return { documentChanges: [] }; + } return this._workspaceEdit; }, enumerable: true, @@ -3493,10 +3965,46 @@ var InsertTextFormat; * the end of the snippet. Placeholders with equal identifiers are linked, * that is typing in one will update others too. * - * See also: https://github.com/Microsoft/vscode/blob/master/src/vs/editor/contrib/snippet/common/snippet.md + * See also: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#snippet_syntax */ InsertTextFormat.Snippet = 2; })(InsertTextFormat || (InsertTextFormat = {})); +/** + * Completion item tags are extra annotations that tweak the rendering of a completion + * item. + * + * @since 3.15.0 + */ +var CompletionItemTag; +(function (CompletionItemTag) { + /** + * Render a completion as obsolete, usually using a strike-out. + */ + CompletionItemTag.Deprecated = 1; +})(CompletionItemTag || (CompletionItemTag = {})); +/** + * The InsertReplaceEdit namespace provides functions to deal with insert / replace edits. + * + * @since 3.16.0 - Proposed state + */ +var InsertReplaceEdit; +(function (InsertReplaceEdit) { + /** + * Creates a new insert / replace edit + */ + function create(newText, insert, replace) { + return { newText: newText, insert: insert, replace: replace }; + } + InsertReplaceEdit.create = create; + /** + * Checks whether the given liternal conforms to the [InsertReplaceEdit](#InsertReplaceEdit) interface. + */ + function is(value) { + var candidate = value; + return candidate && Is.string(candidate.newText) && Range.is(candidate.insert) && Range.is(candidate.replace); + } + InsertReplaceEdit.is = is; +})(InsertReplaceEdit || (InsertReplaceEdit = {})); /** * The CompletionItem namespace provides functions to deal with * completion items. @@ -3537,7 +4045,7 @@ var MarkedString; * @param plainText The plain text. */ function fromPlainText(plainText) { - return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, "\\$&"); // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash + return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, '\\$&'); // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash } MarkedString.fromPlainText = fromPlainText; /** @@ -3578,7 +4086,6 @@ var ParameterInformation; return documentation ? { label: label, documentation: documentation } : { label: label }; } ParameterInformation.create = create; - ; })(ParameterInformation || (ParameterInformation = {})); /** * The SignatureInformation namespace provides helper functions to work with @@ -3674,6 +4181,17 @@ var SymbolKind; SymbolKind.Operator = 25; SymbolKind.TypeParameter = 26; })(SymbolKind || (SymbolKind = {})); +/** + * Symbol tags are extra annotations that tweak the rendering of a symbol. + * @since 3.15 + */ +var SymbolTag; +(function (SymbolTag) { + /** + * Render a symbol as obsolete, usually using a strike-out. + */ + SymbolTag.Deprecated = 1; +})(SymbolTag || (SymbolTag = {})); var SymbolInformation; (function (SymbolInformation) { /** @@ -3698,18 +4216,7 @@ var SymbolInformation; } SymbolInformation.create = create; })(SymbolInformation || (SymbolInformation = {})); -/** - * Represents programming constructs like variables, classes, interfaces etc. - * that appear in a document. Document symbols can be hierarchical and they - * have two ranges: one that encloses its definition and one that points to - * its most interesting range, e.g. the range of an identifier. - */ -var DocumentSymbol = /** @class */ (function () { - function DocumentSymbol() { - } - return DocumentSymbol; -}()); - +var DocumentSymbol; (function (DocumentSymbol) { /** * Creates a new symbol information literal. @@ -3745,7 +4252,8 @@ var DocumentSymbol = /** @class */ (function () { Range.is(candidate.range) && Range.is(candidate.selectionRange) && (candidate.detail === void 0 || Is.string(candidate.detail)) && (candidate.deprecated === void 0 || Is.boolean(candidate.deprecated)) && - (candidate.children === void 0 || Array.isArray(candidate.children)); + (candidate.children === void 0 || Array.isArray(candidate.children)) && + (candidate.tags === void 0 || Array.isArray(candidate.tags)); } DocumentSymbol.is = is; })(DocumentSymbol || (DocumentSymbol = {})); @@ -3754,6 +4262,10 @@ var DocumentSymbol = /** @class */ (function () { */ var CodeActionKind; (function (CodeActionKind) { + /** + * Empty kind. + */ + CodeActionKind.Empty = ''; /** * Base kind for quickfix actions: 'quickfix' */ @@ -3808,6 +4320,15 @@ var CodeActionKind; * Base kind for an organize imports source action: `source.organizeImports` */ CodeActionKind.SourceOrganizeImports = 'source.organizeImports'; + /** + * Base kind for auto-fix source actions: `source.fixAll`. + * + * Fix all actions automatically fix errors that have a clear fix that do not require user input. + * They should not suppress errors or perform unsafe fixes such as generating new types or classes. + * + * @since 3.15.0 + */ + CodeActionKind.SourceFixAll = 'source.fixAll'; })(CodeActionKind || (CodeActionKind = {})); /** * The CodeActionContext namespace provides helper functions to work with @@ -3845,7 +4366,7 @@ var CodeAction; else { result.edit = commandOrEdit; } - if (kind !== void null) { + if (kind !== void 0) { result.kind = kind; } return result; @@ -3858,6 +4379,7 @@ var CodeAction; (candidate.kind === void 0 || Is.string(candidate.kind)) && (candidate.edit !== void 0 || candidate.command !== void 0) && (candidate.command === void 0 || Command.is(candidate.command)) && + (candidate.isPreferred === void 0 || Is.boolean(candidate.isPreferred)) && (candidate.edit === void 0 || WorkspaceEdit.is(candidate.edit)); } CodeAction.is = is; @@ -3873,8 +4395,9 @@ var CodeLens; */ function create(range, data) { var result = { range: range }; - if (Is.defined(data)) + if (Is.defined(data)) { result.data = data; + } return result; } CodeLens.create = create; @@ -3909,20 +4432,11 @@ var FormattingOptions; } FormattingOptions.is = is; })(FormattingOptions || (FormattingOptions = {})); -/** - * A document link is a range in a text document that links to an internal or external resource, like another - * text document or a web site. - */ -var DocumentLink = /** @class */ (function () { - function DocumentLink() { - } - return DocumentLink; -}()); - /** * The DocumentLink namespace provides helper functions to work with * [DocumentLink](#DocumentLink) literals. */ +var DocumentLink; (function (DocumentLink) { /** * Creates a new DocumentLink literal. @@ -3962,6 +4476,9 @@ var SelectionRange; SelectionRange.is = is; })(SelectionRange || (SelectionRange = {})); var EOL = ['\n', '\r\n', '\r']; +/** + * @deprecated Use the text document from the new vscode-languageserver-textdocument package. + */ var TextDocument; (function (TextDocument) { /** @@ -4035,38 +4552,19 @@ var TextDocument; while (leftIdx < left.length) { data[i++] = left[leftIdx++]; } - while (rightIdx < right.length) { - data[i++] = right[rightIdx++]; - } - return data; - } -})(TextDocument || (TextDocument = {})); -/** - * Represents reasons why a text document is saved. - */ -var TextDocumentSaveReason; -(function (TextDocumentSaveReason) { - /** - * Manually triggered, e.g. by the user pressing save, by starting debugging, - * or by an API call. - */ - TextDocumentSaveReason.Manual = 1; - /** - * Automatic after a delay. - */ - TextDocumentSaveReason.AfterDelay = 2; - /** - * When the editor lost focus. - */ - TextDocumentSaveReason.FocusOut = 3; -})(TextDocumentSaveReason || (TextDocumentSaveReason = {})); + while (rightIdx < right.length) { + data[i++] = right[rightIdx++]; + } + return data; + } +})(TextDocument || (TextDocument = {})); var FullTextDocument = /** @class */ (function () { function FullTextDocument(uri, languageId, version, content) { this._uri = uri; this._languageId = languageId; this._version = version; this._content = content; - this._lineOffsets = null; + this._lineOffsets = undefined; } Object.defineProperty(FullTextDocument.prototype, "uri", { get: function () { @@ -4100,10 +4598,10 @@ var FullTextDocument = /** @class */ (function () { FullTextDocument.prototype.update = function (event, version) { this._content = event.text; this._version = version; - this._lineOffsets = null; + this._lineOffsets = undefined; }; FullTextDocument.prototype.getLineOffsets = function () { - if (this._lineOffsets === null) { + if (this._lineOffsets === undefined) { var lineOffsets = []; var text = this._content; var isLineStart = true; @@ -4209,53 +4707,121 @@ var Is; /***/ }), -/* 19 */ -/***/ (function(module, exports, __webpack_require__) { +/* 26 */ +/***/ ((__unused_webpack_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. * ------------------------------------------------------------------------------------------ */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +const vscode_jsonrpc_1 = __webpack_require__(6); +class ProtocolRequestType0 extends vscode_jsonrpc_1.RequestType0 { + constructor(method) { + super(method); + } +} +exports.ProtocolRequestType0 = ProtocolRequestType0; +class ProtocolRequestType extends vscode_jsonrpc_1.RequestType { + constructor(method) { + super(method); + } +} +exports.ProtocolRequestType = ProtocolRequestType; +class ProtocolNotificationType extends vscode_jsonrpc_1.NotificationType { + constructor(method) { + super(method); + } +} +exports.ProtocolNotificationType = ProtocolNotificationType; +class ProtocolNotificationType0 extends vscode_jsonrpc_1.NotificationType0 { + constructor(method) { + super(method); + } +} +exports.ProtocolNotificationType0 = ProtocolNotificationType0; +//# sourceMappingURL=messages.js.map + +/***/ }), +/* 27 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { -Object.defineProperty(exports, "__esModule", { value: true }); -const Is = __webpack_require__(20); -const vscode_jsonrpc_1 = __webpack_require__(5); -const protocol_implementation_1 = __webpack_require__(21); + +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +const Is = __webpack_require__(28); +const vscode_jsonrpc_1 = __webpack_require__(6); +const messages_1 = __webpack_require__(26); +const protocol_implementation_1 = __webpack_require__(29); exports.ImplementationRequest = protocol_implementation_1.ImplementationRequest; -const protocol_typeDefinition_1 = __webpack_require__(22); +const protocol_typeDefinition_1 = __webpack_require__(30); exports.TypeDefinitionRequest = protocol_typeDefinition_1.TypeDefinitionRequest; -const protocol_workspaceFolders_1 = __webpack_require__(23); +const protocol_workspaceFolders_1 = __webpack_require__(31); exports.WorkspaceFoldersRequest = protocol_workspaceFolders_1.WorkspaceFoldersRequest; exports.DidChangeWorkspaceFoldersNotification = protocol_workspaceFolders_1.DidChangeWorkspaceFoldersNotification; -const protocol_configuration_1 = __webpack_require__(24); +const protocol_configuration_1 = __webpack_require__(32); exports.ConfigurationRequest = protocol_configuration_1.ConfigurationRequest; -const protocol_colorProvider_1 = __webpack_require__(25); +const protocol_colorProvider_1 = __webpack_require__(33); exports.DocumentColorRequest = protocol_colorProvider_1.DocumentColorRequest; exports.ColorPresentationRequest = protocol_colorProvider_1.ColorPresentationRequest; -const protocol_foldingRange_1 = __webpack_require__(26); +const protocol_foldingRange_1 = __webpack_require__(34); exports.FoldingRangeRequest = protocol_foldingRange_1.FoldingRangeRequest; -const protocol_declaration_1 = __webpack_require__(27); +const protocol_declaration_1 = __webpack_require__(35); exports.DeclarationRequest = protocol_declaration_1.DeclarationRequest; -const protocol_selectionRange_1 = __webpack_require__(28); +const protocol_selectionRange_1 = __webpack_require__(36); exports.SelectionRangeRequest = protocol_selectionRange_1.SelectionRangeRequest; +const protocol_progress_1 = __webpack_require__(37); +exports.WorkDoneProgress = protocol_progress_1.WorkDoneProgress; +exports.WorkDoneProgressCreateRequest = protocol_progress_1.WorkDoneProgressCreateRequest; +exports.WorkDoneProgressCancelNotification = protocol_progress_1.WorkDoneProgressCancelNotification; +const protocol_callHierarchy_1 = __webpack_require__(38); +exports.CallHierarchyIncomingCallsRequest = protocol_callHierarchy_1.CallHierarchyIncomingCallsRequest; +exports.CallHierarchyOutgoingCallsRequest = protocol_callHierarchy_1.CallHierarchyOutgoingCallsRequest; +exports.CallHierarchyPrepareRequest = protocol_callHierarchy_1.CallHierarchyPrepareRequest; // @ts-ignore: to avoid inlining LocatioLink as dynamic import let __noDynamicImport; +/** + * The DocumentFilter namespace provides helper functions to work with + * [DocumentFilter](#DocumentFilter) literals. + */ var DocumentFilter; (function (DocumentFilter) { function is(value) { - let candidate = value; + const candidate = value; return Is.string(candidate.language) || Is.string(candidate.scheme) || Is.string(candidate.pattern); } DocumentFilter.is = is; })(DocumentFilter = exports.DocumentFilter || (exports.DocumentFilter = {})); +/** + * The DocumentSelector namespace provides helper functions to work with + * [DocumentSelector](#DocumentSelector)s. + */ +var DocumentSelector; +(function (DocumentSelector) { + function is(value) { + if (!Array.isArray(value)) { + return false; + } + for (let elem of value) { + if (!Is.string(elem) && !DocumentFilter.is(elem)) { + return false; + } + } + return true; + } + DocumentSelector.is = is; +})(DocumentSelector = exports.DocumentSelector || (exports.DocumentSelector = {})); /** * The `client/registerCapability` request is sent from the server to the client to register a new capability * handler on the client side. */ var RegistrationRequest; (function (RegistrationRequest) { - RegistrationRequest.type = new vscode_jsonrpc_1.RequestType('client/registerCapability'); + RegistrationRequest.type = new messages_1.ProtocolRequestType('client/registerCapability'); })(RegistrationRequest = exports.RegistrationRequest || (exports.RegistrationRequest = {})); /** * The `client/unregisterCapability` request is sent from the server to the client to unregister a previously registered capability @@ -4263,7 +4829,7 @@ var RegistrationRequest; */ var UnregistrationRequest; (function (UnregistrationRequest) { - UnregistrationRequest.type = new vscode_jsonrpc_1.RequestType('client/unregisterCapability'); + UnregistrationRequest.type = new messages_1.ProtocolRequestType('client/unregisterCapability'); })(UnregistrationRequest = exports.UnregistrationRequest || (exports.UnregistrationRequest = {})); var ResourceOperationKind; (function (ResourceOperationKind) { @@ -4300,32 +4866,51 @@ var FailureHandlingKind; FailureHandlingKind.TextOnlyTransactional = 'textOnlyTransactional'; /** * The client tries to undo the operations already executed. But there is no - * guaruntee that this is succeeding. + * guarantee that this is succeeding. */ FailureHandlingKind.Undo = 'undo'; })(FailureHandlingKind = exports.FailureHandlingKind || (exports.FailureHandlingKind = {})); /** - * Defines how the host (editor) should sync - * document changes to the language server. + * The StaticRegistrationOptions namespace provides helper functions to work with + * [StaticRegistrationOptions](#StaticRegistrationOptions) literals. */ -var TextDocumentSyncKind; -(function (TextDocumentSyncKind) { - /** - * Documents should not be synced at all. - */ - TextDocumentSyncKind.None = 0; - /** - * Documents are synced by always sending the full content - * of the document. - */ - TextDocumentSyncKind.Full = 1; - /** - * Documents are synced by sending the full content on open. - * After that only incremental updates to the document are - * send. - */ - TextDocumentSyncKind.Incremental = 2; -})(TextDocumentSyncKind = exports.TextDocumentSyncKind || (exports.TextDocumentSyncKind = {})); +var StaticRegistrationOptions; +(function (StaticRegistrationOptions) { + function hasId(value) { + const candidate = value; + return candidate && Is.string(candidate.id) && candidate.id.length > 0; + } + StaticRegistrationOptions.hasId = hasId; +})(StaticRegistrationOptions = exports.StaticRegistrationOptions || (exports.StaticRegistrationOptions = {})); +/** + * The TextDocumentRegistrationOptions namespace provides helper functions to work with + * [TextDocumentRegistrationOptions](#TextDocumentRegistrationOptions) literals. + */ +var TextDocumentRegistrationOptions; +(function (TextDocumentRegistrationOptions) { + function is(value) { + const candidate = value; + return candidate && (candidate.documentSelector === null || DocumentSelector.is(candidate.documentSelector)); + } + TextDocumentRegistrationOptions.is = is; +})(TextDocumentRegistrationOptions = exports.TextDocumentRegistrationOptions || (exports.TextDocumentRegistrationOptions = {})); +/** + * The WorkDoneProgressOptions namespace provides helper functions to work with + * [WorkDoneProgressOptions](#WorkDoneProgressOptions) literals. + */ +var WorkDoneProgressOptions; +(function (WorkDoneProgressOptions) { + function is(value) { + const candidate = value; + return Is.objectLiteral(candidate) && (candidate.workDoneProgress === undefined || Is.boolean(candidate.workDoneProgress)); + } + WorkDoneProgressOptions.is = is; + function hasWorkDoneProgress(value) { + const candidate = value; + return candidate && Is.boolean(candidate.workDoneProgress); + } + WorkDoneProgressOptions.hasWorkDoneProgress = hasWorkDoneProgress; +})(WorkDoneProgressOptions = exports.WorkDoneProgressOptions || (exports.WorkDoneProgressOptions = {})); /** * The initialize request is sent from the client to the server. * It is sent once as the request after starting up the server. @@ -4335,7 +4920,7 @@ var TextDocumentSyncKind; */ var InitializeRequest; (function (InitializeRequest) { - InitializeRequest.type = new vscode_jsonrpc_1.RequestType('initialize'); + InitializeRequest.type = new messages_1.ProtocolRequestType('initialize'); })(InitializeRequest = exports.InitializeRequest || (exports.InitializeRequest = {})); /** * Known error codes for an `InitializeError`; @@ -4356,7 +4941,7 @@ var InitializeError; */ var InitializedNotification; (function (InitializedNotification) { - InitializedNotification.type = new vscode_jsonrpc_1.NotificationType('initialized'); + InitializedNotification.type = new messages_1.ProtocolNotificationType('initialized'); })(InitializedNotification = exports.InitializedNotification || (exports.InitializedNotification = {})); //---- Shutdown Method ---- /** @@ -4367,7 +4952,7 @@ var InitializedNotification; */ var ShutdownRequest; (function (ShutdownRequest) { - ShutdownRequest.type = new vscode_jsonrpc_1.RequestType0('shutdown'); + ShutdownRequest.type = new messages_1.ProtocolRequestType0('shutdown'); })(ShutdownRequest = exports.ShutdownRequest || (exports.ShutdownRequest = {})); //---- Exit Notification ---- /** @@ -4376,9 +4961,8 @@ var ShutdownRequest; */ var ExitNotification; (function (ExitNotification) { - ExitNotification.type = new vscode_jsonrpc_1.NotificationType0('exit'); + ExitNotification.type = new messages_1.ProtocolNotificationType0('exit'); })(ExitNotification = exports.ExitNotification || (exports.ExitNotification = {})); -//---- Configuration notification ---- /** * The configuration change notification is sent from the client to the server * when the client's configuration has changed. The notification contains @@ -4386,7 +4970,7 @@ var ExitNotification; */ var DidChangeConfigurationNotification; (function (DidChangeConfigurationNotification) { - DidChangeConfigurationNotification.type = new vscode_jsonrpc_1.NotificationType('workspace/didChangeConfiguration'); + DidChangeConfigurationNotification.type = new messages_1.ProtocolNotificationType('workspace/didChangeConfiguration'); })(DidChangeConfigurationNotification = exports.DidChangeConfigurationNotification || (exports.DidChangeConfigurationNotification = {})); //---- Message show and log notifications ---- /** @@ -4417,7 +5001,7 @@ var MessageType; */ var ShowMessageNotification; (function (ShowMessageNotification) { - ShowMessageNotification.type = new vscode_jsonrpc_1.NotificationType('window/showMessage'); + ShowMessageNotification.type = new messages_1.ProtocolNotificationType('window/showMessage'); })(ShowMessageNotification = exports.ShowMessageNotification || (exports.ShowMessageNotification = {})); /** * The show message request is sent from the server to the client to show a message @@ -4425,7 +5009,7 @@ var ShowMessageNotification; */ var ShowMessageRequest; (function (ShowMessageRequest) { - ShowMessageRequest.type = new vscode_jsonrpc_1.RequestType('window/showMessageRequest'); + ShowMessageRequest.type = new messages_1.ProtocolRequestType('window/showMessageRequest'); })(ShowMessageRequest = exports.ShowMessageRequest || (exports.ShowMessageRequest = {})); /** * The log message notification is sent from the server to the client to ask @@ -4433,7 +5017,7 @@ var ShowMessageRequest; */ var LogMessageNotification; (function (LogMessageNotification) { - LogMessageNotification.type = new vscode_jsonrpc_1.NotificationType('window/logMessage'); + LogMessageNotification.type = new messages_1.ProtocolNotificationType('window/logMessage'); })(LogMessageNotification = exports.LogMessageNotification || (exports.LogMessageNotification = {})); //---- Telemetry notification /** @@ -4442,8 +5026,30 @@ var LogMessageNotification; */ var TelemetryEventNotification; (function (TelemetryEventNotification) { - TelemetryEventNotification.type = new vscode_jsonrpc_1.NotificationType('telemetry/event'); + TelemetryEventNotification.type = new messages_1.ProtocolNotificationType('telemetry/event'); })(TelemetryEventNotification = exports.TelemetryEventNotification || (exports.TelemetryEventNotification = {})); +/** + * Defines how the host (editor) should sync + * document changes to the language server. + */ +var TextDocumentSyncKind; +(function (TextDocumentSyncKind) { + /** + * Documents should not be synced at all. + */ + TextDocumentSyncKind.None = 0; + /** + * Documents are synced by always sending the full content + * of the document. + */ + TextDocumentSyncKind.Full = 1; + /** + * Documents are synced by sending the full content on open. + * After that only incremental updates to the document are + * send. + */ + TextDocumentSyncKind.Incremental = 2; +})(TextDocumentSyncKind = exports.TextDocumentSyncKind || (exports.TextDocumentSyncKind = {})); /** * The document open notification is sent from the client to the server to signal * newly opened text documents. The document's truth is now managed by the client @@ -4456,7 +5062,8 @@ var TelemetryEventNotification; */ var DidOpenTextDocumentNotification; (function (DidOpenTextDocumentNotification) { - DidOpenTextDocumentNotification.type = new vscode_jsonrpc_1.NotificationType('textDocument/didOpen'); + DidOpenTextDocumentNotification.method = 'textDocument/didOpen'; + DidOpenTextDocumentNotification.type = new messages_1.ProtocolNotificationType(DidOpenTextDocumentNotification.method); })(DidOpenTextDocumentNotification = exports.DidOpenTextDocumentNotification || (exports.DidOpenTextDocumentNotification = {})); /** * The document change notification is sent from the client to the server to signal @@ -4464,7 +5071,8 @@ var DidOpenTextDocumentNotification; */ var DidChangeTextDocumentNotification; (function (DidChangeTextDocumentNotification) { - DidChangeTextDocumentNotification.type = new vscode_jsonrpc_1.NotificationType('textDocument/didChange'); + DidChangeTextDocumentNotification.method = 'textDocument/didChange'; + DidChangeTextDocumentNotification.type = new messages_1.ProtocolNotificationType(DidChangeTextDocumentNotification.method); })(DidChangeTextDocumentNotification = exports.DidChangeTextDocumentNotification || (exports.DidChangeTextDocumentNotification = {})); /** * The document close notification is sent from the client to the server when @@ -4477,7 +5085,8 @@ var DidChangeTextDocumentNotification; */ var DidCloseTextDocumentNotification; (function (DidCloseTextDocumentNotification) { - DidCloseTextDocumentNotification.type = new vscode_jsonrpc_1.NotificationType('textDocument/didClose'); + DidCloseTextDocumentNotification.method = 'textDocument/didClose'; + DidCloseTextDocumentNotification.type = new messages_1.ProtocolNotificationType(DidCloseTextDocumentNotification.method); })(DidCloseTextDocumentNotification = exports.DidCloseTextDocumentNotification || (exports.DidCloseTextDocumentNotification = {})); /** * The document save notification is sent from the client to the server when @@ -4485,15 +5094,36 @@ var DidCloseTextDocumentNotification; */ var DidSaveTextDocumentNotification; (function (DidSaveTextDocumentNotification) { - DidSaveTextDocumentNotification.type = new vscode_jsonrpc_1.NotificationType('textDocument/didSave'); + DidSaveTextDocumentNotification.method = 'textDocument/didSave'; + DidSaveTextDocumentNotification.type = new messages_1.ProtocolNotificationType(DidSaveTextDocumentNotification.method); })(DidSaveTextDocumentNotification = exports.DidSaveTextDocumentNotification || (exports.DidSaveTextDocumentNotification = {})); +/** + * Represents reasons why a text document is saved. + */ +var TextDocumentSaveReason; +(function (TextDocumentSaveReason) { + /** + * Manually triggered, e.g. by the user pressing save, by starting debugging, + * or by an API call. + */ + TextDocumentSaveReason.Manual = 1; + /** + * Automatic after a delay. + */ + TextDocumentSaveReason.AfterDelay = 2; + /** + * When the editor lost focus. + */ + TextDocumentSaveReason.FocusOut = 3; +})(TextDocumentSaveReason = exports.TextDocumentSaveReason || (exports.TextDocumentSaveReason = {})); /** * A document will save notification is sent from the client to the server before * the document is actually saved. */ var WillSaveTextDocumentNotification; (function (WillSaveTextDocumentNotification) { - WillSaveTextDocumentNotification.type = new vscode_jsonrpc_1.NotificationType('textDocument/willSave'); + WillSaveTextDocumentNotification.method = 'textDocument/willSave'; + WillSaveTextDocumentNotification.type = new messages_1.ProtocolNotificationType(WillSaveTextDocumentNotification.method); })(WillSaveTextDocumentNotification = exports.WillSaveTextDocumentNotification || (exports.WillSaveTextDocumentNotification = {})); /** * A document will save request is sent from the client to the server before @@ -4505,16 +5135,16 @@ var WillSaveTextDocumentNotification; */ var WillSaveTextDocumentWaitUntilRequest; (function (WillSaveTextDocumentWaitUntilRequest) { - WillSaveTextDocumentWaitUntilRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/willSaveWaitUntil'); + WillSaveTextDocumentWaitUntilRequest.method = 'textDocument/willSaveWaitUntil'; + WillSaveTextDocumentWaitUntilRequest.type = new messages_1.ProtocolRequestType(WillSaveTextDocumentWaitUntilRequest.method); })(WillSaveTextDocumentWaitUntilRequest = exports.WillSaveTextDocumentWaitUntilRequest || (exports.WillSaveTextDocumentWaitUntilRequest = {})); -//---- File eventing ---- /** * The watched files notification is sent from the client to the server when * the client detects changes to file watched by the language client. */ var DidChangeWatchedFilesNotification; (function (DidChangeWatchedFilesNotification) { - DidChangeWatchedFilesNotification.type = new vscode_jsonrpc_1.NotificationType('workspace/didChangeWatchedFiles'); + DidChangeWatchedFilesNotification.type = new messages_1.ProtocolNotificationType('workspace/didChangeWatchedFiles'); })(DidChangeWatchedFilesNotification = exports.DidChangeWatchedFilesNotification || (exports.DidChangeWatchedFilesNotification = {})); /** * The file event type @@ -4549,14 +5179,13 @@ var WatchKind; */ WatchKind.Delete = 4; })(WatchKind = exports.WatchKind || (exports.WatchKind = {})); -//---- Diagnostic notification ---- /** * Diagnostics notification are sent from the server to the client to signal * results of validation runs. */ var PublishDiagnosticsNotification; (function (PublishDiagnosticsNotification) { - PublishDiagnosticsNotification.type = new vscode_jsonrpc_1.NotificationType('textDocument/publishDiagnostics'); + PublishDiagnosticsNotification.type = new messages_1.ProtocolNotificationType('textDocument/publishDiagnostics'); })(PublishDiagnosticsNotification = exports.PublishDiagnosticsNotification || (exports.PublishDiagnosticsNotification = {})); /** * How a completion was triggered @@ -4591,7 +5220,10 @@ var CompletionTriggerKind; */ var CompletionRequest; (function (CompletionRequest) { - CompletionRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/completion'); + CompletionRequest.method = 'textDocument/completion'; + CompletionRequest.type = new messages_1.ProtocolRequestType(CompletionRequest.method); + /** @deprecated Use CompletionRequest.type */ + CompletionRequest.resultType = new vscode_jsonrpc_1.ProgressType(); })(CompletionRequest = exports.CompletionRequest || (exports.CompletionRequest = {})); /** * Request to resolve additional information for a given completion item.The request's @@ -4600,9 +5232,9 @@ var CompletionRequest; */ var CompletionResolveRequest; (function (CompletionResolveRequest) { - CompletionResolveRequest.type = new vscode_jsonrpc_1.RequestType('completionItem/resolve'); + CompletionResolveRequest.method = 'completionItem/resolve'; + CompletionResolveRequest.type = new messages_1.ProtocolRequestType(CompletionResolveRequest.method); })(CompletionResolveRequest = exports.CompletionResolveRequest || (exports.CompletionResolveRequest = {})); -//---- Hover Support ------------------------------- /** * Request to request hover information at a given text document position. The request's * parameter is of type [TextDocumentPosition](#TextDocumentPosition) the response is of @@ -4610,13 +5242,34 @@ var CompletionResolveRequest; */ var HoverRequest; (function (HoverRequest) { - HoverRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/hover'); + HoverRequest.method = 'textDocument/hover'; + HoverRequest.type = new messages_1.ProtocolRequestType(HoverRequest.method); })(HoverRequest = exports.HoverRequest || (exports.HoverRequest = {})); +/** + * How a signature help was triggered. + * + * @since 3.15.0 + */ +var SignatureHelpTriggerKind; +(function (SignatureHelpTriggerKind) { + /** + * Signature help was invoked manually by the user or by a command. + */ + SignatureHelpTriggerKind.Invoked = 1; + /** + * Signature help was triggered by a trigger character. + */ + SignatureHelpTriggerKind.TriggerCharacter = 2; + /** + * Signature help was triggered by the cursor moving or by the document content changing. + */ + SignatureHelpTriggerKind.ContentChange = 3; +})(SignatureHelpTriggerKind = exports.SignatureHelpTriggerKind || (exports.SignatureHelpTriggerKind = {})); var SignatureHelpRequest; (function (SignatureHelpRequest) { - SignatureHelpRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/signatureHelp'); + SignatureHelpRequest.method = 'textDocument/signatureHelp'; + SignatureHelpRequest.type = new messages_1.ProtocolRequestType(SignatureHelpRequest.method); })(SignatureHelpRequest = exports.SignatureHelpRequest || (exports.SignatureHelpRequest = {})); -//---- Goto Definition ------------------------------------- /** * A request to resolve the definition location of a symbol at a given text * document position. The request's parameter is of type [TextDocumentPosition] @@ -4626,7 +5279,10 @@ var SignatureHelpRequest; */ var DefinitionRequest; (function (DefinitionRequest) { - DefinitionRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/definition'); + DefinitionRequest.method = 'textDocument/definition'; + DefinitionRequest.type = new messages_1.ProtocolRequestType(DefinitionRequest.method); + /** @deprecated Use DefinitionRequest.type */ + DefinitionRequest.resultType = new vscode_jsonrpc_1.ProgressType(); })(DefinitionRequest = exports.DefinitionRequest || (exports.DefinitionRequest = {})); /** * A request to resolve project-wide references for the symbol denoted @@ -4636,9 +5292,11 @@ var DefinitionRequest; */ var ReferencesRequest; (function (ReferencesRequest) { - ReferencesRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/references'); + ReferencesRequest.method = 'textDocument/references'; + ReferencesRequest.type = new messages_1.ProtocolRequestType(ReferencesRequest.method); + /** @deprecated Use ReferencesRequest.type */ + ReferencesRequest.resultType = new vscode_jsonrpc_1.ProgressType(); })(ReferencesRequest = exports.ReferencesRequest || (exports.ReferencesRequest = {})); -//---- Document Highlight ---------------------------------- /** * Request to resolve a [DocumentHighlight](#DocumentHighlight) for a given * text document position. The request's parameter is of type [TextDocumentPosition] @@ -4647,9 +5305,11 @@ var ReferencesRequest; */ var DocumentHighlightRequest; (function (DocumentHighlightRequest) { - DocumentHighlightRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/documentHighlight'); + DocumentHighlightRequest.method = 'textDocument/documentHighlight'; + DocumentHighlightRequest.type = new messages_1.ProtocolRequestType(DocumentHighlightRequest.method); + /** @deprecated Use DocumentHighlightRequest.type */ + DocumentHighlightRequest.resultType = new vscode_jsonrpc_1.ProgressType(); })(DocumentHighlightRequest = exports.DocumentHighlightRequest || (exports.DocumentHighlightRequest = {})); -//---- Document Symbol Provider --------------------------- /** * A request to list all symbols found in a given text document. The request's * parameter is of type [TextDocumentIdentifier](#TextDocumentIdentifier) the @@ -4658,9 +5318,21 @@ var DocumentHighlightRequest; */ var DocumentSymbolRequest; (function (DocumentSymbolRequest) { - DocumentSymbolRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/documentSymbol'); + DocumentSymbolRequest.method = 'textDocument/documentSymbol'; + DocumentSymbolRequest.type = new messages_1.ProtocolRequestType(DocumentSymbolRequest.method); + /** @deprecated Use DocumentSymbolRequest.type */ + DocumentSymbolRequest.resultType = new vscode_jsonrpc_1.ProgressType(); })(DocumentSymbolRequest = exports.DocumentSymbolRequest || (exports.DocumentSymbolRequest = {})); -//---- Workspace Symbol Provider --------------------------- +/** + * A request to provide commands for the given text document and range. + */ +var CodeActionRequest; +(function (CodeActionRequest) { + CodeActionRequest.method = 'textDocument/codeAction'; + CodeActionRequest.type = new messages_1.ProtocolRequestType(CodeActionRequest.method); + /** @deprecated Use CodeActionRequest.type */ + CodeActionRequest.resultType = new vscode_jsonrpc_1.ProgressType(); +})(CodeActionRequest = exports.CodeActionRequest || (exports.CodeActionRequest = {})); /** * A request to list project-wide symbols matching the query string given * by the [WorkspaceSymbolParams](#WorkspaceSymbolParams). The response is @@ -4669,108 +5341,113 @@ var DocumentSymbolRequest; */ var WorkspaceSymbolRequest; (function (WorkspaceSymbolRequest) { - WorkspaceSymbolRequest.type = new vscode_jsonrpc_1.RequestType('workspace/symbol'); + WorkspaceSymbolRequest.method = 'workspace/symbol'; + WorkspaceSymbolRequest.type = new messages_1.ProtocolRequestType(WorkspaceSymbolRequest.method); + /** @deprecated Use WorkspaceSymbolRequest.type */ + WorkspaceSymbolRequest.resultType = new vscode_jsonrpc_1.ProgressType(); })(WorkspaceSymbolRequest = exports.WorkspaceSymbolRequest || (exports.WorkspaceSymbolRequest = {})); -/** - * A request to provide commands for the given text document and range. - */ -var CodeActionRequest; -(function (CodeActionRequest) { - CodeActionRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/codeAction'); -})(CodeActionRequest = exports.CodeActionRequest || (exports.CodeActionRequest = {})); /** * A request to provide code lens for the given text document. */ var CodeLensRequest; (function (CodeLensRequest) { - CodeLensRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/codeLens'); + CodeLensRequest.type = new messages_1.ProtocolRequestType('textDocument/codeLens'); + /** @deprecated Use CodeLensRequest.type */ + CodeLensRequest.resultType = new vscode_jsonrpc_1.ProgressType(); })(CodeLensRequest = exports.CodeLensRequest || (exports.CodeLensRequest = {})); /** * A request to resolve a command for a given code lens. */ var CodeLensResolveRequest; (function (CodeLensResolveRequest) { - CodeLensResolveRequest.type = new vscode_jsonrpc_1.RequestType('codeLens/resolve'); + CodeLensResolveRequest.type = new messages_1.ProtocolRequestType('codeLens/resolve'); })(CodeLensResolveRequest = exports.CodeLensResolveRequest || (exports.CodeLensResolveRequest = {})); +/** + * A request to provide document links + */ +var DocumentLinkRequest; +(function (DocumentLinkRequest) { + DocumentLinkRequest.method = 'textDocument/documentLink'; + DocumentLinkRequest.type = new messages_1.ProtocolRequestType(DocumentLinkRequest.method); + /** @deprecated Use DocumentLinkRequest.type */ + DocumentLinkRequest.resultType = new vscode_jsonrpc_1.ProgressType(); +})(DocumentLinkRequest = exports.DocumentLinkRequest || (exports.DocumentLinkRequest = {})); +/** + * Request to resolve additional information for a given document link. The request's + * parameter is of type [DocumentLink](#DocumentLink) the response + * is of type [DocumentLink](#DocumentLink) or a Thenable that resolves to such. + */ +var DocumentLinkResolveRequest; +(function (DocumentLinkResolveRequest) { + DocumentLinkResolveRequest.type = new messages_1.ProtocolRequestType('documentLink/resolve'); +})(DocumentLinkResolveRequest = exports.DocumentLinkResolveRequest || (exports.DocumentLinkResolveRequest = {})); /** * A request to to format a whole document. */ var DocumentFormattingRequest; (function (DocumentFormattingRequest) { - DocumentFormattingRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/formatting'); + DocumentFormattingRequest.method = 'textDocument/formatting'; + DocumentFormattingRequest.type = new messages_1.ProtocolRequestType(DocumentFormattingRequest.method); })(DocumentFormattingRequest = exports.DocumentFormattingRequest || (exports.DocumentFormattingRequest = {})); /** * A request to to format a range in a document. */ var DocumentRangeFormattingRequest; (function (DocumentRangeFormattingRequest) { - DocumentRangeFormattingRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/rangeFormatting'); + DocumentRangeFormattingRequest.method = 'textDocument/rangeFormatting'; + DocumentRangeFormattingRequest.type = new messages_1.ProtocolRequestType(DocumentRangeFormattingRequest.method); })(DocumentRangeFormattingRequest = exports.DocumentRangeFormattingRequest || (exports.DocumentRangeFormattingRequest = {})); /** * A request to format a document on type. */ var DocumentOnTypeFormattingRequest; (function (DocumentOnTypeFormattingRequest) { - DocumentOnTypeFormattingRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/onTypeFormatting'); + DocumentOnTypeFormattingRequest.method = 'textDocument/onTypeFormatting'; + DocumentOnTypeFormattingRequest.type = new messages_1.ProtocolRequestType(DocumentOnTypeFormattingRequest.method); })(DocumentOnTypeFormattingRequest = exports.DocumentOnTypeFormattingRequest || (exports.DocumentOnTypeFormattingRequest = {})); /** * A request to rename a symbol. */ var RenameRequest; (function (RenameRequest) { - RenameRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/rename'); + RenameRequest.method = 'textDocument/rename'; + RenameRequest.type = new messages_1.ProtocolRequestType(RenameRequest.method); })(RenameRequest = exports.RenameRequest || (exports.RenameRequest = {})); /** * A request to test and perform the setup necessary for a rename. */ var PrepareRenameRequest; (function (PrepareRenameRequest) { - PrepareRenameRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/prepareRename'); + PrepareRenameRequest.method = 'textDocument/prepareRename'; + PrepareRenameRequest.type = new messages_1.ProtocolRequestType(PrepareRenameRequest.method); })(PrepareRenameRequest = exports.PrepareRenameRequest || (exports.PrepareRenameRequest = {})); -/** - * A request to provide document links - */ -var DocumentLinkRequest; -(function (DocumentLinkRequest) { - DocumentLinkRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/documentLink'); -})(DocumentLinkRequest = exports.DocumentLinkRequest || (exports.DocumentLinkRequest = {})); -/** - * Request to resolve additional information for a given document link. The request's - * parameter is of type [DocumentLink](#DocumentLink) the response - * is of type [DocumentLink](#DocumentLink) or a Thenable that resolves to such. - */ -var DocumentLinkResolveRequest; -(function (DocumentLinkResolveRequest) { - DocumentLinkResolveRequest.type = new vscode_jsonrpc_1.RequestType('documentLink/resolve'); -})(DocumentLinkResolveRequest = exports.DocumentLinkResolveRequest || (exports.DocumentLinkResolveRequest = {})); /** * A request send from the client to the server to execute a command. The request might return * a workspace edit which the client will apply to the workspace. */ var ExecuteCommandRequest; (function (ExecuteCommandRequest) { - ExecuteCommandRequest.type = new vscode_jsonrpc_1.RequestType('workspace/executeCommand'); + ExecuteCommandRequest.type = new messages_1.ProtocolRequestType('workspace/executeCommand'); })(ExecuteCommandRequest = exports.ExecuteCommandRequest || (exports.ExecuteCommandRequest = {})); /** * A request sent from the server to the client to modified certain resources. */ var ApplyWorkspaceEditRequest; (function (ApplyWorkspaceEditRequest) { - ApplyWorkspaceEditRequest.type = new vscode_jsonrpc_1.RequestType('workspace/applyEdit'); + ApplyWorkspaceEditRequest.type = new messages_1.ProtocolRequestType('workspace/applyEdit'); })(ApplyWorkspaceEditRequest = exports.ApplyWorkspaceEditRequest || (exports.ApplyWorkspaceEditRequest = {})); - +//# sourceMappingURL=protocol.js.map /***/ }), -/* 20 */ -/***/ (function(module, exports, __webpack_require__) { +/* 28 */ +/***/ ((__unused_webpack_module, exports) => { -"use strict"; /* -------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. * ------------------------------------------------------------------------------------------ */ -Object.defineProperty(exports, "__esModule", { value: true }); +Object.defineProperty(exports, "__esModule", ({ value: true })); function boolean(value) { return value === true || value === false; } @@ -4803,24 +5480,27 @@ function typedArray(value, check) { return Array.isArray(value) && value.every(check); } exports.typedArray = typedArray; -function thenable(value) { - return value && func(value.then); +function objectLiteral(value) { + // Strictly speaking class instances pass this check as well. Since the LSP + // doesn't use classes we ignore this for now. If we do we need to add something + // like this: `Object.getPrototypeOf(Object.getPrototypeOf(x)) === null` + return value !== null && typeof value === 'object'; } -exports.thenable = thenable; - +exports.objectLiteral = objectLiteral; +//# sourceMappingURL=is.js.map /***/ }), -/* 21 */ -/***/ (function(module, exports, __webpack_require__) { +/* 29 */ +/***/ ((__unused_webpack_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. * ------------------------------------------------------------------------------------------ */ - -Object.defineProperty(exports, "__esModule", { value: true }); -const vscode_jsonrpc_1 = __webpack_require__(5); +Object.defineProperty(exports, "__esModule", ({ value: true })); +const vscode_jsonrpc_1 = __webpack_require__(6); +const messages_1 = __webpack_require__(26); // @ts-ignore: to avoid inlining LocatioLink as dynamic import let __noDynamicImport; /** @@ -4831,22 +5511,25 @@ let __noDynamicImport; */ var ImplementationRequest; (function (ImplementationRequest) { - ImplementationRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/implementation'); + ImplementationRequest.method = 'textDocument/implementation'; + ImplementationRequest.type = new messages_1.ProtocolRequestType(ImplementationRequest.method); + /** @deprecated Use ImplementationRequest.type */ + ImplementationRequest.resultType = new vscode_jsonrpc_1.ProgressType(); })(ImplementationRequest = exports.ImplementationRequest || (exports.ImplementationRequest = {})); - +//# sourceMappingURL=protocol.implementation.js.map /***/ }), -/* 22 */ -/***/ (function(module, exports, __webpack_require__) { +/* 30 */ +/***/ ((__unused_webpack_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. * ------------------------------------------------------------------------------------------ */ - -Object.defineProperty(exports, "__esModule", { value: true }); -const vscode_jsonrpc_1 = __webpack_require__(5); +Object.defineProperty(exports, "__esModule", ({ value: true })); +const vscode_jsonrpc_1 = __webpack_require__(6); +const messages_1 = __webpack_require__(26); // @ts-ignore: to avoid inlining LocatioLink as dynamic import let __noDynamicImport; /** @@ -4857,28 +5540,30 @@ let __noDynamicImport; */ var TypeDefinitionRequest; (function (TypeDefinitionRequest) { - TypeDefinitionRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/typeDefinition'); + TypeDefinitionRequest.method = 'textDocument/typeDefinition'; + TypeDefinitionRequest.type = new messages_1.ProtocolRequestType(TypeDefinitionRequest.method); + /** @deprecated Use TypeDefinitionRequest.type */ + TypeDefinitionRequest.resultType = new vscode_jsonrpc_1.ProgressType(); })(TypeDefinitionRequest = exports.TypeDefinitionRequest || (exports.TypeDefinitionRequest = {})); - +//# sourceMappingURL=protocol.typeDefinition.js.map /***/ }), -/* 23 */ -/***/ (function(module, exports, __webpack_require__) { +/* 31 */ +/***/ ((__unused_webpack_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. * ------------------------------------------------------------------------------------------ */ - -Object.defineProperty(exports, "__esModule", { value: true }); -const vscode_jsonrpc_1 = __webpack_require__(5); +Object.defineProperty(exports, "__esModule", ({ value: true })); +const messages_1 = __webpack_require__(26); /** * The `workspace/workspaceFolders` is sent from the server to the client to fetch the open workspace folders. */ var WorkspaceFoldersRequest; (function (WorkspaceFoldersRequest) { - WorkspaceFoldersRequest.type = new vscode_jsonrpc_1.RequestType0('workspace/workspaceFolders'); + WorkspaceFoldersRequest.type = new messages_1.ProtocolRequestType0('workspace/workspaceFolders'); })(WorkspaceFoldersRequest = exports.WorkspaceFoldersRequest || (exports.WorkspaceFoldersRequest = {})); /** * The `workspace/didChangeWorkspaceFolders` notification is sent from the client to the server when the workspace @@ -4886,22 +5571,21 @@ var WorkspaceFoldersRequest; */ var DidChangeWorkspaceFoldersNotification; (function (DidChangeWorkspaceFoldersNotification) { - DidChangeWorkspaceFoldersNotification.type = new vscode_jsonrpc_1.NotificationType('workspace/didChangeWorkspaceFolders'); + DidChangeWorkspaceFoldersNotification.type = new messages_1.ProtocolNotificationType('workspace/didChangeWorkspaceFolders'); })(DidChangeWorkspaceFoldersNotification = exports.DidChangeWorkspaceFoldersNotification || (exports.DidChangeWorkspaceFoldersNotification = {})); - +//# sourceMappingURL=protocol.workspaceFolders.js.map /***/ }), -/* 24 */ -/***/ (function(module, exports, __webpack_require__) { +/* 32 */ +/***/ ((__unused_webpack_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. * ------------------------------------------------------------------------------------------ */ - -Object.defineProperty(exports, "__esModule", { value: true }); -const vscode_jsonrpc_1 = __webpack_require__(5); +Object.defineProperty(exports, "__esModule", ({ value: true })); +const messages_1 = __webpack_require__(26); /** * The 'workspace/configuration' request is sent from the server to the client to fetch a certain * configuration setting. @@ -4913,22 +5597,22 @@ const vscode_jsonrpc_1 = __webpack_require__(5); */ var ConfigurationRequest; (function (ConfigurationRequest) { - ConfigurationRequest.type = new vscode_jsonrpc_1.RequestType('workspace/configuration'); + ConfigurationRequest.type = new messages_1.ProtocolRequestType('workspace/configuration'); })(ConfigurationRequest = exports.ConfigurationRequest || (exports.ConfigurationRequest = {})); - +//# sourceMappingURL=protocol.configuration.js.map /***/ }), -/* 25 */ -/***/ (function(module, exports, __webpack_require__) { +/* 33 */ +/***/ ((__unused_webpack_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. * ------------------------------------------------------------------------------------------ */ - -Object.defineProperty(exports, "__esModule", { value: true }); -const vscode_jsonrpc_1 = __webpack_require__(5); +Object.defineProperty(exports, "__esModule", ({ value: true })); +const vscode_jsonrpc_1 = __webpack_require__(6); +const messages_1 = __webpack_require__(26); /** * A request to list all color symbols found in a given text document. The request's * parameter is of type [DocumentColorParams](#DocumentColorParams) the @@ -4937,7 +5621,10 @@ const vscode_jsonrpc_1 = __webpack_require__(5); */ var DocumentColorRequest; (function (DocumentColorRequest) { - DocumentColorRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/documentColor'); + DocumentColorRequest.method = 'textDocument/documentColor'; + DocumentColorRequest.type = new messages_1.ProtocolRequestType(DocumentColorRequest.method); + /** @deprecated Use DocumentColorRequest.type */ + DocumentColorRequest.resultType = new vscode_jsonrpc_1.ProgressType(); })(DocumentColorRequest = exports.DocumentColorRequest || (exports.DocumentColorRequest = {})); /** * A request to list all presentation for a color. The request's @@ -4947,22 +5634,22 @@ var DocumentColorRequest; */ var ColorPresentationRequest; (function (ColorPresentationRequest) { - ColorPresentationRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/colorPresentation'); + ColorPresentationRequest.type = new messages_1.ProtocolRequestType('textDocument/colorPresentation'); })(ColorPresentationRequest = exports.ColorPresentationRequest || (exports.ColorPresentationRequest = {})); - +//# sourceMappingURL=protocol.colorProvider.js.map /***/ }), -/* 26 */ -/***/ (function(module, exports, __webpack_require__) { +/* 34 */ +/***/ ((__unused_webpack_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. *--------------------------------------------------------------------------------------------*/ -Object.defineProperty(exports, "__esModule", { value: true }); -const vscode_jsonrpc_1 = __webpack_require__(5); +Object.defineProperty(exports, "__esModule", ({ value: true })); +const vscode_jsonrpc_1 = __webpack_require__(6); +const messages_1 = __webpack_require__(26); /** * Enum of known range kinds */ @@ -4989,22 +5676,25 @@ var FoldingRangeKind; */ var FoldingRangeRequest; (function (FoldingRangeRequest) { - FoldingRangeRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/foldingRange'); + FoldingRangeRequest.method = 'textDocument/foldingRange'; + FoldingRangeRequest.type = new messages_1.ProtocolRequestType(FoldingRangeRequest.method); + /** @deprecated Use FoldingRangeRequest.type */ + FoldingRangeRequest.resultType = new vscode_jsonrpc_1.ProgressType(); })(FoldingRangeRequest = exports.FoldingRangeRequest || (exports.FoldingRangeRequest = {})); - +//# sourceMappingURL=protocol.foldingRange.js.map /***/ }), -/* 27 */ -/***/ (function(module, exports, __webpack_require__) { +/* 35 */ +/***/ ((__unused_webpack_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. * ------------------------------------------------------------------------------------------ */ - -Object.defineProperty(exports, "__esModule", { value: true }); -const vscode_jsonrpc_1 = __webpack_require__(5); +Object.defineProperty(exports, "__esModule", ({ value: true })); +const vscode_jsonrpc_1 = __webpack_require__(6); +const messages_1 = __webpack_require__(26); // @ts-ignore: to avoid inlining LocatioLink as dynamic import let __noDynamicImport; /** @@ -5016,22 +5706,25 @@ let __noDynamicImport; */ var DeclarationRequest; (function (DeclarationRequest) { - DeclarationRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/declaration'); + DeclarationRequest.method = 'textDocument/declaration'; + DeclarationRequest.type = new messages_1.ProtocolRequestType(DeclarationRequest.method); + /** @deprecated Use DeclarationRequest.type */ + DeclarationRequest.resultType = new vscode_jsonrpc_1.ProgressType(); })(DeclarationRequest = exports.DeclarationRequest || (exports.DeclarationRequest = {})); - +//# sourceMappingURL=protocol.declaration.js.map /***/ }), -/* 28 */ -/***/ (function(module, exports, __webpack_require__) { +/* 36 */ +/***/ ((__unused_webpack_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. *--------------------------------------------------------------------------------------------*/ -Object.defineProperty(exports, "__esModule", { value: true }); -const vscode_jsonrpc_1 = __webpack_require__(5); +Object.defineProperty(exports, "__esModule", ({ value: true })); +const vscode_jsonrpc_1 = __webpack_require__(6); +const messages_1 = __webpack_require__(26); /** * A request to provide selection ranges in a document. The request's * parameter is of type [SelectionRangeParams](#SelectionRangeParams), the @@ -5040,115 +5733,232 @@ const vscode_jsonrpc_1 = __webpack_require__(5); */ var SelectionRangeRequest; (function (SelectionRangeRequest) { - SelectionRangeRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/selectionRange'); + SelectionRangeRequest.method = 'textDocument/selectionRange'; + SelectionRangeRequest.type = new messages_1.ProtocolRequestType(SelectionRangeRequest.method); + /** @deprecated Use SelectionRangeRequest.type */ + SelectionRangeRequest.resultType = new vscode_jsonrpc_1.ProgressType(); })(SelectionRangeRequest = exports.SelectionRangeRequest || (exports.SelectionRangeRequest = {})); +//# sourceMappingURL=protocol.selectionRange.js.map +/***/ }), +/* 37 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +const vscode_jsonrpc_1 = __webpack_require__(6); +const messages_1 = __webpack_require__(26); +var WorkDoneProgress; +(function (WorkDoneProgress) { + WorkDoneProgress.type = new vscode_jsonrpc_1.ProgressType(); +})(WorkDoneProgress = exports.WorkDoneProgress || (exports.WorkDoneProgress = {})); +/** + * The `window/workDoneProgress/create` request is sent from the server to the client to initiate progress + * reporting from the server. + */ +var WorkDoneProgressCreateRequest; +(function (WorkDoneProgressCreateRequest) { + WorkDoneProgressCreateRequest.type = new messages_1.ProtocolRequestType('window/workDoneProgress/create'); +})(WorkDoneProgressCreateRequest = exports.WorkDoneProgressCreateRequest || (exports.WorkDoneProgressCreateRequest = {})); +/** + * The `window/workDoneProgress/cancel` notification is sent from the client to the server to cancel a progress + * initiated on the server side. + */ +var WorkDoneProgressCancelNotification; +(function (WorkDoneProgressCancelNotification) { + WorkDoneProgressCancelNotification.type = new messages_1.ProtocolNotificationType('window/workDoneProgress/cancel'); +})(WorkDoneProgressCancelNotification = exports.WorkDoneProgressCancelNotification || (exports.WorkDoneProgressCancelNotification = {})); +//# sourceMappingURL=protocol.progress.js.map /***/ }), -/* 29 */ -/***/ (function(module, exports, __webpack_require__) { +/* 38 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + -"use strict"; /* -------------------------------------------------------------------------------------------- * Copyright (c) TypeFox and others. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. * ------------------------------------------------------------------------------------------ */ - -Object.defineProperty(exports, "__esModule", { value: true }); -const vscode_jsonrpc_1 = __webpack_require__(5); +Object.defineProperty(exports, "__esModule", ({ value: true })); +const messages_1 = __webpack_require__(26); /** - * The direction of a call hierarchy request. + * A request to result a `CallHierarchyItem` in a document at a given position. + * Can be used as an input to a incoming or outgoing call hierarchy. + * + * @since 3.16.0 */ -var CallHierarchyDirection; -(function (CallHierarchyDirection) { - /** - * The callers - */ - CallHierarchyDirection.CallsFrom = 1; - /** - * The callees - */ - CallHierarchyDirection.CallsTo = 2; -})(CallHierarchyDirection = exports.CallHierarchyDirection || (exports.CallHierarchyDirection = {})); +var CallHierarchyPrepareRequest; +(function (CallHierarchyPrepareRequest) { + CallHierarchyPrepareRequest.method = 'textDocument/prepareCallHierarchy'; + CallHierarchyPrepareRequest.type = new messages_1.ProtocolRequestType(CallHierarchyPrepareRequest.method); +})(CallHierarchyPrepareRequest = exports.CallHierarchyPrepareRequest || (exports.CallHierarchyPrepareRequest = {})); /** - * Request to provide the call hierarchy at a given text document position. + * A request to resolve the incoming calls for a given `CallHierarchyItem`. * - * The request's parameter is of type [CallHierarchyParams](#CallHierarchyParams). The response - * is of type [CallHierarchyCall[]](#CallHierarchyCall) or a Thenable that resolves to such. + * @since 3.16.0 + */ +var CallHierarchyIncomingCallsRequest; +(function (CallHierarchyIncomingCallsRequest) { + CallHierarchyIncomingCallsRequest.method = 'callHierarchy/incomingCalls'; + CallHierarchyIncomingCallsRequest.type = new messages_1.ProtocolRequestType(CallHierarchyIncomingCallsRequest.method); +})(CallHierarchyIncomingCallsRequest = exports.CallHierarchyIncomingCallsRequest || (exports.CallHierarchyIncomingCallsRequest = {})); +/** + * A request to resolve the outgoing calls for a given `CallHierarchyItem`. * - * Evaluates the symbol defined (or referenced) at the given position, and returns all incoming or outgoing calls to the symbol(s). + * @since 3.16.0 */ -var CallHierarchyRequest; -(function (CallHierarchyRequest) { - CallHierarchyRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/callHierarchy'); -})(CallHierarchyRequest = exports.CallHierarchyRequest || (exports.CallHierarchyRequest = {})); - +var CallHierarchyOutgoingCallsRequest; +(function (CallHierarchyOutgoingCallsRequest) { + CallHierarchyOutgoingCallsRequest.method = 'callHierarchy/outgoingCalls'; + CallHierarchyOutgoingCallsRequest.type = new messages_1.ProtocolRequestType(CallHierarchyOutgoingCallsRequest.method); +})(CallHierarchyOutgoingCallsRequest = exports.CallHierarchyOutgoingCallsRequest || (exports.CallHierarchyOutgoingCallsRequest = {})); +//# sourceMappingURL=protocol.callHierarchy.js.map /***/ }), -/* 30 */ -/***/ (function(module, exports, __webpack_require__) { +/* 39 */ +/***/ ((__unused_webpack_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. * ------------------------------------------------------------------------------------------ */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +const vscode_jsonrpc_1 = __webpack_require__(6); +function createProtocolConnection(input, output, logger, options) { + if (vscode_jsonrpc_1.ConnectionStrategy.is(options)) { + options = { connectionStrategy: options }; + } + return vscode_jsonrpc_1.createMessageConnection(input, output, logger, options); +} +exports.createProtocolConnection = createProtocolConnection; +//# sourceMappingURL=connection.js.map -Object.defineProperty(exports, "__esModule", { value: true }); -const vscode_jsonrpc_1 = __webpack_require__(5); +/***/ }), +/* 40 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +const messages_1 = __webpack_require__(26); +/** + * A set of predefined token types. This set is not fixed + * an clients can specify additional token types via the + * corresponding client capabilities. + * + * @since 3.16.0 - Proposed state + */ +var SemanticTokenTypes; +(function (SemanticTokenTypes) { + SemanticTokenTypes["namespace"] = "namespace"; + SemanticTokenTypes["type"] = "type"; + SemanticTokenTypes["class"] = "class"; + SemanticTokenTypes["enum"] = "enum"; + SemanticTokenTypes["interface"] = "interface"; + SemanticTokenTypes["struct"] = "struct"; + SemanticTokenTypes["typeParameter"] = "typeParameter"; + SemanticTokenTypes["parameter"] = "parameter"; + SemanticTokenTypes["variable"] = "variable"; + SemanticTokenTypes["property"] = "property"; + SemanticTokenTypes["enumMember"] = "enumMember"; + SemanticTokenTypes["event"] = "event"; + SemanticTokenTypes["function"] = "function"; + SemanticTokenTypes["member"] = "member"; + SemanticTokenTypes["macro"] = "macro"; + SemanticTokenTypes["keyword"] = "keyword"; + SemanticTokenTypes["modifier"] = "modifier"; + SemanticTokenTypes["comment"] = "comment"; + SemanticTokenTypes["string"] = "string"; + SemanticTokenTypes["number"] = "number"; + SemanticTokenTypes["regexp"] = "regexp"; + SemanticTokenTypes["operator"] = "operator"; +})(SemanticTokenTypes = exports.SemanticTokenTypes || (exports.SemanticTokenTypes = {})); /** - * The `window/progress/start` notification is sent from the server to the client - * to initiate a progress. + * A set of predefined token modifiers. This set is not fixed + * an clients can specify additional token types via the + * corresponding client capabilities. + * + * @since 3.16.0 - Proposed state */ -var ProgressStartNotification; -(function (ProgressStartNotification) { - ProgressStartNotification.type = new vscode_jsonrpc_1.NotificationType('window/progress/start'); -})(ProgressStartNotification = exports.ProgressStartNotification || (exports.ProgressStartNotification = {})); +var SemanticTokenModifiers; +(function (SemanticTokenModifiers) { + SemanticTokenModifiers["declaration"] = "declaration"; + SemanticTokenModifiers["definition"] = "definition"; + SemanticTokenModifiers["readonly"] = "readonly"; + SemanticTokenModifiers["static"] = "static"; + SemanticTokenModifiers["deprecated"] = "deprecated"; + SemanticTokenModifiers["abstract"] = "abstract"; + SemanticTokenModifiers["async"] = "async"; + SemanticTokenModifiers["modification"] = "modification"; + SemanticTokenModifiers["documentation"] = "documentation"; + SemanticTokenModifiers["defaultLibrary"] = "defaultLibrary"; +})(SemanticTokenModifiers = exports.SemanticTokenModifiers || (exports.SemanticTokenModifiers = {})); /** - * The `window/progress/report` notification is sent from the server to the client - * to initiate a progress. + * @since 3.16.0 - Proposed state */ -var ProgressReportNotification; -(function (ProgressReportNotification) { - ProgressReportNotification.type = new vscode_jsonrpc_1.NotificationType('window/progress/report'); -})(ProgressReportNotification = exports.ProgressReportNotification || (exports.ProgressReportNotification = {})); +var SemanticTokens; +(function (SemanticTokens) { + function is(value) { + const candidate = value; + return candidate !== undefined && (candidate.resultId === undefined || typeof candidate.resultId === 'string') && + Array.isArray(candidate.data) && (candidate.data.length === 0 || typeof candidate.data[0] === 'number'); + } + SemanticTokens.is = is; +})(SemanticTokens = exports.SemanticTokens || (exports.SemanticTokens = {})); /** - * The `window/progress/done` notification is sent from the server to the client - * to initiate a progress. + * @since 3.16.0 - Proposed state */ -var ProgressDoneNotification; -(function (ProgressDoneNotification) { - ProgressDoneNotification.type = new vscode_jsonrpc_1.NotificationType('window/progress/done'); -})(ProgressDoneNotification = exports.ProgressDoneNotification || (exports.ProgressDoneNotification = {})); +var SemanticTokensRequest; +(function (SemanticTokensRequest) { + SemanticTokensRequest.method = 'textDocument/semanticTokens'; + SemanticTokensRequest.type = new messages_1.ProtocolRequestType(SemanticTokensRequest.method); +})(SemanticTokensRequest = exports.SemanticTokensRequest || (exports.SemanticTokensRequest = {})); /** - * The `window/progress/cancel` notification is sent client to the server to cancel a progress - * initiated on the server side. + * @since 3.16.0 - Proposed state */ -var ProgressCancelNotification; -(function (ProgressCancelNotification) { - ProgressCancelNotification.type = new vscode_jsonrpc_1.NotificationType('window/progress/cancel'); -})(ProgressCancelNotification = exports.ProgressCancelNotification || (exports.ProgressCancelNotification = {})); - +var SemanticTokensEditsRequest; +(function (SemanticTokensEditsRequest) { + SemanticTokensEditsRequest.method = 'textDocument/semanticTokens/edits'; + SemanticTokensEditsRequest.type = new messages_1.ProtocolRequestType(SemanticTokensEditsRequest.method); +})(SemanticTokensEditsRequest = exports.SemanticTokensEditsRequest || (exports.SemanticTokensEditsRequest = {})); +/** + * @since 3.16.0 - Proposed state + */ +var SemanticTokensRangeRequest; +(function (SemanticTokensRangeRequest) { + SemanticTokensRangeRequest.method = 'textDocument/semanticTokens/range'; + SemanticTokensRangeRequest.type = new messages_1.ProtocolRequestType(SemanticTokensRangeRequest.method); +})(SemanticTokensRangeRequest = exports.SemanticTokensRangeRequest || (exports.SemanticTokensRangeRequest = {})); +//# sourceMappingURL=protocol.semanticTokens.proposed.js.map /***/ }), -/* 31 */ -/***/ (function(module, exports, __webpack_require__) { +/* 41 */ +/***/ (function(__unused_webpack_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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -Object.defineProperty(exports, "__esModule", { value: true }); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.activateTagClosing = void 0; const coc_nvim_1 = __webpack_require__(1); const vscode_languageserver_protocol_1 = __webpack_require__(4); function activateTagClosing(tagProvider, supportedLanguages, configName) { @@ -5207,11 +6017,14 @@ function activateTagClosing(tagProvider, supportedLanguages, configName) { clearTimeout(timeout); } let lastChange = changes[changes.length - 1]; + if (!vscode_languageserver_protocol_1.Range.is(lastChange['range']) || !emptyRange(lastChange['range'])) { + return; + } let lastCharacter = lastChange.text[lastChange.text.length - 1]; - if (lastChange.rangeLength > 0 || lastCharacter !== '>' && lastCharacter !== '/') { + if (lastCharacter !== '>' && lastCharacter !== '/') { return; } - let rangeStart = lastChange.range.start; + let rangeStart = lastChange['range'].start; let version = document.version; timeout = setTimeout(() => __awaiter(this, void 0, void 0, function* () { let position = vscode_languageserver_protocol_1.Position.create(rangeStart.line, rangeStart.character + lastChange.text.length); @@ -5242,7 +6055,71 @@ function activateTagClosing(tagProvider, supportedLanguages, configName) { }); } exports.activateTagClosing = activateTagClosing; +function emptyRange(range) { + return range.start.line == range.end.line && range.start.character == range.end.character; +} /***/ }) -/******/ ]))); \ No newline at end of file +/******/ ]); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ if(__webpack_module_cache__[moduleId]) { +/******/ return __webpack_module_cache__[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop) +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/************************************************************************/ +/******/ // module exports must be returned from runtime so entry inlining is disabled +/******/ // startup +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ })() + +)); \ No newline at end of file