My dotfiles
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 

5403 satır
243 KiB

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