1 (function(e, a) { for(var i in a) e[i] = a[i]; }(exports, /******/ (function(modules) { // webpackBootstrap
2 /******/ // The module cache
3 /******/ var installedModules = {};
5 /******/ // The require function
6 /******/ function __webpack_require__(moduleId) {
8 /******/ // Check if module is in cache
9 /******/ if(installedModules[moduleId]) {
10 /******/ return installedModules[moduleId].exports;
12 /******/ // Create a new module (and put it into the cache)
13 /******/ var module = installedModules[moduleId] = {
19 /******/ // Execute the module function
20 /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
22 /******/ // Flag the module as loaded
23 /******/ module.l = true;
25 /******/ // Return the exports of the module
26 /******/ return module.exports;
30 /******/ // expose the modules object (__webpack_modules__)
31 /******/ __webpack_require__.m = modules;
33 /******/ // expose the module cache
34 /******/ __webpack_require__.c = installedModules;
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 });
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' });
48 /******/ Object.defineProperty(exports, '__esModule', { value: true });
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));
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;
76 /******/ // Object.prototype.hasOwnProperty.call
77 /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
79 /******/ // __webpack_public_path__
80 /******/ __webpack_require__.p = "";
83 /******/ // Load entry module and return exports
84 /******/ return __webpack_require__(__webpack_require__.s = 0);
86 /************************************************************************/
89 /***/ (function(module, exports, __webpack_require__) {
93 var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
94 return new (P || (P = Promise))(function (resolve, reject) {
95 function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
96 function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
97 function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
98 step((generator = generator.apply(thisArg, _arguments || [])).next());
101 var __importDefault = (this && this.__importDefault) || function (mod) {
102 return (mod && mod.__esModule) ? mod : { "default": mod };
104 Object.defineProperty(exports, "__esModule", { value: true });
105 const path_1 = __importDefault(__webpack_require__(1));
106 const fs_1 = __importDefault(__webpack_require__(2));
107 const vscode_languageserver_protocol_1 = __webpack_require__(3);
108 const catalog_json_1 = __importDefault(__webpack_require__(30));
109 const hash_1 = __webpack_require__(31);
110 const coc_nvim_1 = __webpack_require__(32);
111 var ForceValidateRequest;
112 (function (ForceValidateRequest) {
113 ForceValidateRequest.type = new vscode_languageserver_protocol_1.RequestType('json/validate');
114 })(ForceValidateRequest || (ForceValidateRequest = {}));
115 function activate(context) {
116 return __awaiter(this, void 0, void 0, function* () {
117 let { subscriptions, logger } = context;
118 const config = coc_nvim_1.workspace.getConfiguration().get('json', {});
121 const file = context.asAbsolutePath('lib/server.js');
122 const selector = ['json', 'jsonc'];
123 let schemaContent = yield readFile(path_1.default.join(coc_nvim_1.workspace.pluginRoot, 'data/schema.json'), 'utf8');
124 let settingsSchema = JSON.parse(schemaContent);
125 let fileSchemaErrors = new Map();
126 coc_nvim_1.events.on('BufEnter', bufnr => {
127 let doc = coc_nvim_1.workspace.getDocument(bufnr);
130 let msg = fileSchemaErrors.get(doc.uri);
132 coc_nvim_1.workspace.showMessage(`Schema error: ${msg}`, 'warning');
133 }, null, subscriptions);
134 let serverOptions = {
136 transport: coc_nvim_1.TransportKind.ipc,
138 cwd: coc_nvim_1.workspace.root,
139 execArgv: config.execArgv
142 let clientOptions = {
143 documentSelector: selector,
145 configurationSection: ['json', 'http'],
146 fileEvents: coc_nvim_1.workspace.createFileSystemWatcher('**/*.json')
148 outputChannelName: 'json',
149 diagnosticCollectionName: 'json',
152 didChangeConfiguration: () => client.sendNotification(vscode_languageserver_protocol_1.DidChangeConfigurationNotification.type, { settings: getSettings() })
154 handleDiagnostics: (uri, diagnostics, next) => {
155 const schemaErrorIndex = diagnostics.findIndex(candidate => candidate.code === /* SchemaResolveError */ 0x300);
156 if (uri.endsWith('coc-settings.json')) {
157 diagnostics = diagnostics.filter(o => o.code != 521);
159 if (schemaErrorIndex === -1) {
160 fileSchemaErrors.delete(uri.toString());
161 return next(uri, diagnostics);
163 const schemaResolveDiagnostic = diagnostics[schemaErrorIndex];
164 fileSchemaErrors.set(uri.toString(), schemaResolveDiagnostic.message);
165 let doc = coc_nvim_1.workspace.getDocument(uri);
166 if (doc && doc.uri == uri) {
167 coc_nvim_1.workspace.showMessage(`Schema error: ${schemaResolveDiagnostic.message}`, 'warning');
169 next(uri, diagnostics);
171 resolveCompletionItem: (item, token, next) => {
172 return Promise.resolve(next(item, token)).then((item) => {
173 if (item.data.detail) {
174 item.detail = item.data.detail;
180 provideCompletionItem: (document, position, context, token, next) => {
181 return Promise.resolve(next(document, position, context, token)).then((res) => {
182 let doc = coc_nvim_1.workspace.getDocument(document.uri);
185 let items = res.hasOwnProperty('isIncomplete') ? res.items : res;
186 let line = doc.getline(position.line);
187 for (let item of items) {
188 let { textEdit, insertText, label, filterText } = item; // tslint:disable-line
189 item.insertText = null; // tslint:disable-line
190 if (textEdit && textEdit.newText) {
191 let newText = insertText || textEdit.newText;
192 textEdit.newText = newText;
193 let { start, end } = textEdit.range;
194 if (line[start.character] && line[end.character - 1] && /^".*"$/.test(label)) {
195 item.label = item.label.slice(1, -1);
198 if (filterText && /^".*"$/.test(filterText)) {
199 item.filterText = filterText.slice(1, -1);
206 if (items.length && items.every(o => o.kind == vscode_languageserver_protocol_1.CompletionItemKind.Property)) {
207 result.startcol = doc.fixStartcol(position, ['.']);
214 let client = new coc_nvim_1.LanguageClient('json', 'Json language server', serverOptions, clientOptions);
215 subscriptions.push(coc_nvim_1.services.registLanguageClient(client));
216 client.onReady().then(() => {
217 for (let doc of coc_nvim_1.workspace.documents) {
218 onDocumentCreate(doc.textDocument).catch(_e => {
222 let associations = {};
223 for (let item of catalog_json_1.default.schemas) {
224 let { fileMatch, url } = item;
225 if (Array.isArray(fileMatch)) {
226 for (let key of fileMatch) {
227 associations[key] = [url];
230 else if (typeof fileMatch === 'string') {
231 associations[fileMatch] = [url];
234 coc_nvim_1.extensions.all.forEach(extension => {
235 let { packageJSON } = extension;
236 let { contributes } = packageJSON;
239 let { jsonValidation } = contributes;
240 if (jsonValidation && jsonValidation.length) {
241 for (let item of jsonValidation) {
242 let { url, fileMatch } = item;
244 if (url && !/^http(s)?:/.test(url)) {
245 let file = path_1.default.join(extension.extensionPath, url);
246 if (fs_1.default.existsSync(file))
247 url = coc_nvim_1.Uri.file(file).toString();
250 let curr = associations[fileMatch];
252 associations[fileMatch] = [url];
254 else if (curr && curr.indexOf(url) == -1) {
261 associations['coc-settings.json'] = ['vscode://settings'];
262 client.sendNotification('json/schemaAssociations', associations);
263 client.onRequest('vscode/content', (uri) => __awaiter(this, void 0, void 0, function* () {
264 if (uri == 'vscode://settings') {
265 let schema = Object.assign({}, settingsSchema);
266 schema.properties = schema.properties || {};
267 if (coc_nvim_1.extensions.schemes)
268 Object.assign(schema.properties, coc_nvim_1.extensions.schemes);
269 coc_nvim_1.extensions.all.forEach(extension => {
270 let { packageJSON } = extension;
271 let { contributes } = packageJSON;
274 let { configuration } = contributes;
276 let { properties, definitions } = configuration;
278 Object.assign(schema.properties, properties);
280 Object.assign(schema.definitions, definitions);
283 return JSON.stringify(schema);
285 logger.error(`Unknown schema for ${uri}`);
291 function onDocumentCreate(document) {
292 return __awaiter(this, void 0, void 0, function* () {
293 if (!coc_nvim_1.workspace.match(selector, document))
295 if (client.serviceState !== coc_nvim_1.ServiceStat.Running)
297 let file = coc_nvim_1.Uri.parse(document.uri).fsPath;
298 let associations = {};
299 let content = document.getText();
300 if (content.indexOf('"$schema"') !== -1)
302 let miniProgrameRoot = yield coc_nvim_1.workspace.resolveRootFolder(coc_nvim_1.Uri.parse(document.uri), ['project.config.json']);
303 if (miniProgrameRoot) {
304 if (path_1.default.dirname(file) == miniProgrameRoot) {
307 let arr = ['page', 'component'].map(str => {
308 return coc_nvim_1.Uri.file(context.asAbsolutePath(`data/${str}.json`)).toString();
310 associations['/' + file] = arr;
311 associations['app.json'] = [coc_nvim_1.Uri.file(context.asAbsolutePath('data/app.json')).toString()];
313 if (Object.keys(associations).length > 0) {
314 client.sendNotification('json/schemaAssociations', associations);
318 coc_nvim_1.workspace.onDidOpenTextDocument(onDocumentCreate, null, subscriptions);
319 coc_nvim_1.workspace.onDidCloseTextDocument(doc => {
320 fileSchemaErrors.delete(doc.uri);
321 }, null, subscriptions);
322 let statusItem = coc_nvim_1.workspace.createStatusBarItem(0, { progress: true });
323 subscriptions.push(statusItem);
324 subscriptions.push(coc_nvim_1.commands.registerCommand('json.retryResolveSchema', () => __awaiter(this, void 0, void 0, function* () {
325 let doc = yield coc_nvim_1.workspace.document;
326 if (!doc || ['json', 'jsonc'].indexOf(doc.filetype) == -1)
328 statusItem.isProgress = true;
329 statusItem.text = 'loading schema';
331 client.sendRequest(ForceValidateRequest.type, doc.uri).then(diagnostics => {
332 statusItem.text = '⚠️';
333 statusItem.isProgress = false;
334 const schemaErrorIndex = diagnostics.findIndex(candidate => candidate.code === /* SchemaResolveError */ 0x300);
335 if (schemaErrorIndex !== -1) {
336 // Show schema resolution errors in status bar only; ref: #51032
337 const schemaResolveDiagnostic = diagnostics[schemaErrorIndex];
338 fileSchemaErrors.set(doc.uri, schemaResolveDiagnostic.message);
346 statusItem.isProgress = false;
347 statusItem.text = '⚠️';
352 exports.activate = activate;
353 function getSettings() {
354 let httpSettings = coc_nvim_1.workspace.getConfiguration('http');
357 proxy: httpSettings.get('proxy'),
358 proxyStrictSSL: httpSettings.get('proxyStrictSSL')
361 format: coc_nvim_1.workspace.getConfiguration('json').get('format'),
365 let schemaSettingsById = Object.create(null);
366 let collectSchemaSettings = (schemaSettings, rootPath, fileMatchPrefix) => {
367 for (let setting of schemaSettings) {
368 let url = getSchemaId(setting, rootPath);
372 let schemaSetting = schemaSettingsById[url];
373 if (!schemaSetting) {
374 schemaSetting = schemaSettingsById[url] = { url, fileMatch: [] };
375 settings.json.schemas.push(schemaSetting);
377 let fileMatches = setting.fileMatch;
378 let resultingFileMatches = schemaSetting.fileMatch;
379 if (Array.isArray(fileMatches)) {
380 if (fileMatchPrefix) {
381 for (let fileMatch of fileMatches) {
382 if (fileMatch[0] === '/') {
383 resultingFileMatches.push(fileMatchPrefix + fileMatch);
384 resultingFileMatches.push(fileMatchPrefix + '/*' + fileMatch);
387 resultingFileMatches.push(fileMatchPrefix + '/' + fileMatch);
388 resultingFileMatches.push(fileMatchPrefix + '/*/' + fileMatch);
393 resultingFileMatches.push(...fileMatches);
396 if (setting.schema) {
397 schemaSetting.schema = setting.schema;
401 // merge global and folder settings. Qualify all file matches with the folder path.
402 let globalSettings = coc_nvim_1.workspace.getConfiguration('json', null).get('schemas');
403 if (Array.isArray(globalSettings)) {
404 collectSchemaSettings(globalSettings, coc_nvim_1.workspace.root);
408 function getSchemaId(schema, rootPath) {
409 let url = schema.url;
412 url = schema.schema.id || `vscode://schemas/custom/${encodeURIComponent(hash_1.hash(schema.schema).toString(16))}`;
415 else if (rootPath && (url[0] === '.' || url[0] === '/')) {
416 url = coc_nvim_1.Uri.file(path_1.default.normalize(path_1.default.join(rootPath, url))).toString();
420 function readFile(fullpath, encoding) {
421 return new Promise((resolve, reject) => {
422 fs_1.default.readFile(fullpath, encoding, (err, content) => {
433 /***/ (function(module, exports) {
435 module.exports = require("path");
439 /***/ (function(module, exports) {
441 module.exports = require("fs");
445 /***/ (function(module, exports, __webpack_require__) {
448 /* --------------------------------------------------------------------------------------------
\r
449 * Copyright (c) Microsoft Corporation. All rights reserved.
\r
450 * Licensed under the MIT License. See License.txt in the project root for license information.
\r
451 * ------------------------------------------------------------------------------------------ */
\r
453 function __export(m) {
\r
454 for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
\r
456 Object.defineProperty(exports, "__esModule", { value: true });
\r
457 const vscode_jsonrpc_1 = __webpack_require__(4);
\r
458 exports.ErrorCodes = vscode_jsonrpc_1.ErrorCodes;
\r
459 exports.ResponseError = vscode_jsonrpc_1.ResponseError;
\r
460 exports.CancellationToken = vscode_jsonrpc_1.CancellationToken;
\r
461 exports.CancellationTokenSource = vscode_jsonrpc_1.CancellationTokenSource;
\r
462 exports.Disposable = vscode_jsonrpc_1.Disposable;
\r
463 exports.Event = vscode_jsonrpc_1.Event;
\r
464 exports.Emitter = vscode_jsonrpc_1.Emitter;
\r
465 exports.Trace = vscode_jsonrpc_1.Trace;
\r
466 exports.TraceFormat = vscode_jsonrpc_1.TraceFormat;
\r
467 exports.SetTraceNotification = vscode_jsonrpc_1.SetTraceNotification;
\r
468 exports.LogTraceNotification = vscode_jsonrpc_1.LogTraceNotification;
\r
469 exports.RequestType = vscode_jsonrpc_1.RequestType;
\r
470 exports.RequestType0 = vscode_jsonrpc_1.RequestType0;
\r
471 exports.NotificationType = vscode_jsonrpc_1.NotificationType;
\r
472 exports.NotificationType0 = vscode_jsonrpc_1.NotificationType0;
\r
473 exports.MessageReader = vscode_jsonrpc_1.MessageReader;
\r
474 exports.MessageWriter = vscode_jsonrpc_1.MessageWriter;
\r
475 exports.ConnectionStrategy = vscode_jsonrpc_1.ConnectionStrategy;
\r
476 exports.StreamMessageReader = vscode_jsonrpc_1.StreamMessageReader;
\r
477 exports.StreamMessageWriter = vscode_jsonrpc_1.StreamMessageWriter;
\r
478 exports.IPCMessageReader = vscode_jsonrpc_1.IPCMessageReader;
\r
479 exports.IPCMessageWriter = vscode_jsonrpc_1.IPCMessageWriter;
\r
480 exports.createClientPipeTransport = vscode_jsonrpc_1.createClientPipeTransport;
\r
481 exports.createServerPipeTransport = vscode_jsonrpc_1.createServerPipeTransport;
\r
482 exports.generateRandomPipeName = vscode_jsonrpc_1.generateRandomPipeName;
\r
483 exports.createClientSocketTransport = vscode_jsonrpc_1.createClientSocketTransport;
\r
484 exports.createServerSocketTransport = vscode_jsonrpc_1.createServerSocketTransport;
\r
485 __export(__webpack_require__(17));
\r
486 __export(__webpack_require__(18));
\r
487 const callHierarchy = __webpack_require__(27);
\r
488 const progress = __webpack_require__(28);
\r
489 const sr = __webpack_require__(29);
\r
491 (function (Proposed) {
\r
492 let SelectionRangeRequest;
\r
493 (function (SelectionRangeRequest) {
\r
494 SelectionRangeRequest.type = sr.SelectionRangeRequest.type;
\r
495 })(SelectionRangeRequest = Proposed.SelectionRangeRequest || (Proposed.SelectionRangeRequest = {}));
\r
496 let CallHierarchyRequest;
\r
497 (function (CallHierarchyRequest) {
\r
498 CallHierarchyRequest.type = callHierarchy.CallHierarchyRequest.type;
\r
499 })(CallHierarchyRequest = Proposed.CallHierarchyRequest || (Proposed.CallHierarchyRequest = {}));
\r
500 let CallHierarchyDirection;
\r
501 (function (CallHierarchyDirection) {
\r
502 CallHierarchyDirection.CallsFrom = callHierarchy.CallHierarchyDirection.CallsFrom;
\r
503 CallHierarchyDirection.CallsTo = callHierarchy.CallHierarchyDirection.CallsTo;
\r
504 })(CallHierarchyDirection = Proposed.CallHierarchyDirection || (Proposed.CallHierarchyDirection = {}));
\r
505 let ProgressStartNotification;
\r
506 (function (ProgressStartNotification) {
\r
507 ProgressStartNotification.type = progress.ProgressStartNotification.type;
\r
508 })(ProgressStartNotification = Proposed.ProgressStartNotification || (Proposed.ProgressStartNotification = {}));
\r
509 let ProgressReportNotification;
\r
510 (function (ProgressReportNotification) {
\r
511 ProgressReportNotification.type = progress.ProgressReportNotification.type;
\r
512 })(ProgressReportNotification = Proposed.ProgressReportNotification || (Proposed.ProgressReportNotification = {}));
\r
513 let ProgressDoneNotification;
\r
514 (function (ProgressDoneNotification) {
\r
515 ProgressDoneNotification.type = progress.ProgressDoneNotification.type;
\r
516 })(ProgressDoneNotification = Proposed.ProgressDoneNotification || (Proposed.ProgressDoneNotification = {}));
\r
517 let ProgressCancelNotification;
\r
518 (function (ProgressCancelNotification) {
\r
519 ProgressCancelNotification.type = progress.ProgressCancelNotification.type;
\r
520 })(ProgressCancelNotification = Proposed.ProgressCancelNotification || (Proposed.ProgressCancelNotification = {}));
\r
521 })(Proposed = exports.Proposed || (exports.Proposed = {}));
\r
522 function createProtocolConnection(reader, writer, logger, strategy) {
\r
523 return vscode_jsonrpc_1.createMessageConnection(reader, writer, logger, strategy);
\r
525 exports.createProtocolConnection = createProtocolConnection;
\r
530 /***/ (function(module, exports, __webpack_require__) {
533 /* --------------------------------------------------------------------------------------------
\r
534 * Copyright (c) Microsoft Corporation. All rights reserved.
\r
535 * Licensed under the MIT License. See License.txt in the project root for license information.
\r
536 * ------------------------------------------------------------------------------------------ */
\r
537 /// <reference path="./thenable.ts" />
\r
539 function __export(m) {
\r
540 for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
\r
542 Object.defineProperty(exports, "__esModule", { value: true });
\r
543 const Is = __webpack_require__(5);
\r
544 const messages_1 = __webpack_require__(6);
\r
545 exports.RequestType = messages_1.RequestType;
\r
546 exports.RequestType0 = messages_1.RequestType0;
\r
547 exports.RequestType1 = messages_1.RequestType1;
\r
548 exports.RequestType2 = messages_1.RequestType2;
\r
549 exports.RequestType3 = messages_1.RequestType3;
\r
550 exports.RequestType4 = messages_1.RequestType4;
\r
551 exports.RequestType5 = messages_1.RequestType5;
\r
552 exports.RequestType6 = messages_1.RequestType6;
\r
553 exports.RequestType7 = messages_1.RequestType7;
\r
554 exports.RequestType8 = messages_1.RequestType8;
\r
555 exports.RequestType9 = messages_1.RequestType9;
\r
556 exports.ResponseError = messages_1.ResponseError;
\r
557 exports.ErrorCodes = messages_1.ErrorCodes;
\r
558 exports.NotificationType = messages_1.NotificationType;
\r
559 exports.NotificationType0 = messages_1.NotificationType0;
\r
560 exports.NotificationType1 = messages_1.NotificationType1;
\r
561 exports.NotificationType2 = messages_1.NotificationType2;
\r
562 exports.NotificationType3 = messages_1.NotificationType3;
\r
563 exports.NotificationType4 = messages_1.NotificationType4;
\r
564 exports.NotificationType5 = messages_1.NotificationType5;
\r
565 exports.NotificationType6 = messages_1.NotificationType6;
\r
566 exports.NotificationType7 = messages_1.NotificationType7;
\r
567 exports.NotificationType8 = messages_1.NotificationType8;
\r
568 exports.NotificationType9 = messages_1.NotificationType9;
\r
569 const messageReader_1 = __webpack_require__(7);
\r
570 exports.MessageReader = messageReader_1.MessageReader;
\r
571 exports.StreamMessageReader = messageReader_1.StreamMessageReader;
\r
572 exports.IPCMessageReader = messageReader_1.IPCMessageReader;
\r
573 exports.SocketMessageReader = messageReader_1.SocketMessageReader;
\r
574 const messageWriter_1 = __webpack_require__(9);
\r
575 exports.MessageWriter = messageWriter_1.MessageWriter;
\r
576 exports.StreamMessageWriter = messageWriter_1.StreamMessageWriter;
\r
577 exports.IPCMessageWriter = messageWriter_1.IPCMessageWriter;
\r
578 exports.SocketMessageWriter = messageWriter_1.SocketMessageWriter;
\r
579 const events_1 = __webpack_require__(8);
\r
580 exports.Disposable = events_1.Disposable;
\r
581 exports.Event = events_1.Event;
\r
582 exports.Emitter = events_1.Emitter;
\r
583 const cancellation_1 = __webpack_require__(10);
\r
584 exports.CancellationTokenSource = cancellation_1.CancellationTokenSource;
\r
585 exports.CancellationToken = cancellation_1.CancellationToken;
\r
586 const linkedMap_1 = __webpack_require__(11);
\r
587 __export(__webpack_require__(12));
\r
588 __export(__webpack_require__(16));
\r
589 var CancelNotification;
\r
590 (function (CancelNotification) {
\r
591 CancelNotification.type = new messages_1.NotificationType('$/cancelRequest');
\r
592 })(CancelNotification || (CancelNotification = {}));
\r
593 exports.NullLogger = Object.freeze({
\r
600 (function (Trace) {
\r
601 Trace[Trace["Off"] = 0] = "Off";
\r
602 Trace[Trace["Messages"] = 1] = "Messages";
\r
603 Trace[Trace["Verbose"] = 2] = "Verbose";
\r
604 })(Trace = exports.Trace || (exports.Trace = {}));
\r
605 (function (Trace) {
\r
606 function fromString(value) {
\r
607 value = value.toLowerCase();
\r
612 return Trace.Messages;
\r
614 return Trace.Verbose;
\r
619 Trace.fromString = fromString;
\r
620 function toString(value) {
\r
624 case Trace.Messages:
\r
626 case Trace.Verbose:
\r
632 Trace.toString = toString;
\r
633 })(Trace = exports.Trace || (exports.Trace = {}));
\r
635 (function (TraceFormat) {
\r
636 TraceFormat["Text"] = "text";
\r
637 TraceFormat["JSON"] = "json";
\r
638 })(TraceFormat = exports.TraceFormat || (exports.TraceFormat = {}));
\r
639 (function (TraceFormat) {
\r
640 function fromString(value) {
\r
641 value = value.toLowerCase();
\r
642 if (value === 'json') {
\r
643 return TraceFormat.JSON;
\r
646 return TraceFormat.Text;
\r
649 TraceFormat.fromString = fromString;
\r
650 })(TraceFormat = exports.TraceFormat || (exports.TraceFormat = {}));
\r
651 var SetTraceNotification;
\r
652 (function (SetTraceNotification) {
\r
653 SetTraceNotification.type = new messages_1.NotificationType('$/setTraceNotification');
\r
654 })(SetTraceNotification = exports.SetTraceNotification || (exports.SetTraceNotification = {}));
\r
655 var LogTraceNotification;
\r
656 (function (LogTraceNotification) {
\r
657 LogTraceNotification.type = new messages_1.NotificationType('$/logTraceNotification');
\r
658 })(LogTraceNotification = exports.LogTraceNotification || (exports.LogTraceNotification = {}));
\r
659 var ConnectionErrors;
\r
660 (function (ConnectionErrors) {
\r
662 * The connection is closed.
\r
664 ConnectionErrors[ConnectionErrors["Closed"] = 1] = "Closed";
\r
666 * The connection got disposed.
\r
668 ConnectionErrors[ConnectionErrors["Disposed"] = 2] = "Disposed";
\r
670 * The connection is already in listening mode.
\r
672 ConnectionErrors[ConnectionErrors["AlreadyListening"] = 3] = "AlreadyListening";
\r
673 })(ConnectionErrors = exports.ConnectionErrors || (exports.ConnectionErrors = {}));
\r
674 class ConnectionError extends Error {
\r
675 constructor(code, message) {
\r
678 Object.setPrototypeOf(this, ConnectionError.prototype);
\r
681 exports.ConnectionError = ConnectionError;
\r
682 var ConnectionStrategy;
\r
683 (function (ConnectionStrategy) {
\r
684 function is(value) {
\r
685 let candidate = value;
\r
686 return candidate && Is.func(candidate.cancelUndispatched);
\r
688 ConnectionStrategy.is = is;
\r
689 })(ConnectionStrategy = exports.ConnectionStrategy || (exports.ConnectionStrategy = {}));
\r
690 var ConnectionState;
\r
691 (function (ConnectionState) {
\r
692 ConnectionState[ConnectionState["New"] = 1] = "New";
\r
693 ConnectionState[ConnectionState["Listening"] = 2] = "Listening";
\r
694 ConnectionState[ConnectionState["Closed"] = 3] = "Closed";
\r
695 ConnectionState[ConnectionState["Disposed"] = 4] = "Disposed";
\r
696 })(ConnectionState || (ConnectionState = {}));
\r
697 function _createMessageConnection(messageReader, messageWriter, logger, strategy) {
\r
698 let sequenceNumber = 0;
\r
699 let notificationSquenceNumber = 0;
\r
700 let unknownResponseSquenceNumber = 0;
\r
701 const version = '2.0';
\r
702 let starRequestHandler = undefined;
\r
703 let requestHandlers = Object.create(null);
\r
704 let starNotificationHandler = undefined;
\r
705 let notificationHandlers = Object.create(null);
\r
707 let messageQueue = new linkedMap_1.LinkedMap();
\r
708 let responsePromises = Object.create(null);
\r
709 let requestTokens = Object.create(null);
\r
710 let trace = Trace.Off;
\r
711 let traceFormat = TraceFormat.Text;
\r
713 let state = ConnectionState.New;
\r
714 let errorEmitter = new events_1.Emitter();
\r
715 let closeEmitter = new events_1.Emitter();
\r
716 let unhandledNotificationEmitter = new events_1.Emitter();
\r
717 let disposeEmitter = new events_1.Emitter();
\r
718 function createRequestQueueKey(id) {
\r
719 return 'req-' + id.toString();
\r
721 function createResponseQueueKey(id) {
\r
723 return 'res-unknown-' + (++unknownResponseSquenceNumber).toString();
\r
726 return 'res-' + id.toString();
\r
729 function createNotificationQueueKey() {
\r
730 return 'not-' + (++notificationSquenceNumber).toString();
\r
732 function addMessageToQueue(queue, message) {
\r
733 if (messages_1.isRequestMessage(message)) {
\r
734 queue.set(createRequestQueueKey(message.id), message);
\r
736 else if (messages_1.isResponseMessage(message)) {
\r
737 queue.set(createResponseQueueKey(message.id), message);
\r
740 queue.set(createNotificationQueueKey(), message);
\r
743 function cancelUndispatched(_message) {
\r
746 function isListening() {
\r
747 return state === ConnectionState.Listening;
\r
749 function isClosed() {
\r
750 return state === ConnectionState.Closed;
\r
752 function isDisposed() {
\r
753 return state === ConnectionState.Disposed;
\r
755 function closeHandler() {
\r
756 if (state === ConnectionState.New || state === ConnectionState.Listening) {
\r
757 state = ConnectionState.Closed;
\r
758 closeEmitter.fire(undefined);
\r
760 // If the connection is disposed don't sent close events.
\r
763 function readErrorHandler(error) {
\r
764 errorEmitter.fire([error, undefined, undefined]);
\r
766 function writeErrorHandler(data) {
\r
767 errorEmitter.fire(data);
\r
769 messageReader.onClose(closeHandler);
\r
770 messageReader.onError(readErrorHandler);
\r
771 messageWriter.onClose(closeHandler);
\r
772 messageWriter.onError(writeErrorHandler);
\r
773 function triggerMessageQueue() {
\r
774 if (timer || messageQueue.size === 0) {
\r
777 timer = setImmediate(() => {
\r
779 processMessageQueue();
\r
782 function processMessageQueue() {
\r
783 if (messageQueue.size === 0) {
\r
786 let message = messageQueue.shift();
\r
788 if (messages_1.isRequestMessage(message)) {
\r
789 handleRequest(message);
\r
791 else if (messages_1.isNotificationMessage(message)) {
\r
792 handleNotification(message);
\r
794 else if (messages_1.isResponseMessage(message)) {
\r
795 handleResponse(message);
\r
798 handleInvalidMessage(message);
\r
802 triggerMessageQueue();
\r
805 let callback = (message) => {
\r
807 // We have received a cancellation message. Check if the message is still in the queue
\r
808 // and cancel it if allowed to do so.
\r
809 if (messages_1.isNotificationMessage(message) && message.method === CancelNotification.type.method) {
\r
810 let key = createRequestQueueKey(message.params.id);
\r
811 let toCancel = messageQueue.get(key);
\r
812 if (messages_1.isRequestMessage(toCancel)) {
\r
813 let response = strategy && strategy.cancelUndispatched ? strategy.cancelUndispatched(toCancel, cancelUndispatched) : cancelUndispatched(toCancel);
\r
814 if (response && (response.error !== void 0 || response.result !== void 0)) {
\r
815 messageQueue.delete(key);
\r
816 response.id = toCancel.id;
\r
817 traceSendingResponse(response, message.method, Date.now());
\r
818 messageWriter.write(response);
\r
823 addMessageToQueue(messageQueue, message);
\r
826 triggerMessageQueue();
\r
829 function handleRequest(requestMessage) {
\r
830 if (isDisposed()) {
\r
831 // we return here silently since we fired an event when the
\r
832 // connection got disposed.
\r
835 function reply(resultOrError, method, startTime) {
\r
838 id: requestMessage.id
\r
840 if (resultOrError instanceof messages_1.ResponseError) {
\r
841 message.error = resultOrError.toJson();
\r
844 message.result = resultOrError === void 0 ? null : resultOrError;
\r
846 traceSendingResponse(message, method, startTime);
\r
847 messageWriter.write(message);
\r
849 function replyError(error, method, startTime) {
\r
852 id: requestMessage.id,
\r
853 error: error.toJson()
\r
855 traceSendingResponse(message, method, startTime);
\r
856 messageWriter.write(message);
\r
858 function replySuccess(result, method, startTime) {
\r
859 // The JSON RPC defines that a response must either have a result or an error
\r
860 // So we can't treat undefined as a valid response result.
\r
861 if (result === void 0) {
\r
866 id: requestMessage.id,
\r
869 traceSendingResponse(message, method, startTime);
\r
870 messageWriter.write(message);
\r
872 traceReceivedRequest(requestMessage);
\r
873 let element = requestHandlers[requestMessage.method];
\r
875 let requestHandler;
\r
877 type = element.type;
\r
878 requestHandler = element.handler;
\r
880 let startTime = Date.now();
\r
881 if (requestHandler || starRequestHandler) {
\r
882 let cancellationSource = new cancellation_1.CancellationTokenSource();
\r
883 let tokenKey = String(requestMessage.id);
\r
884 requestTokens[tokenKey] = cancellationSource;
\r
887 if (requestMessage.params === void 0 || (type !== void 0 && type.numberOfParams === 0)) {
\r
888 handlerResult = requestHandler
\r
889 ? requestHandler(cancellationSource.token)
\r
890 : starRequestHandler(requestMessage.method, cancellationSource.token);
\r
892 else if (Is.array(requestMessage.params) && (type === void 0 || type.numberOfParams > 1)) {
\r
893 handlerResult = requestHandler
\r
894 ? requestHandler(...requestMessage.params, cancellationSource.token)
\r
895 : starRequestHandler(requestMessage.method, ...requestMessage.params, cancellationSource.token);
\r
898 handlerResult = requestHandler
\r
899 ? requestHandler(requestMessage.params, cancellationSource.token)
\r
900 : starRequestHandler(requestMessage.method, requestMessage.params, cancellationSource.token);
\r
902 let promise = handlerResult;
\r
903 if (!handlerResult) {
\r
904 delete requestTokens[tokenKey];
\r
905 replySuccess(handlerResult, requestMessage.method, startTime);
\r
907 else if (promise.then) {
\r
908 promise.then((resultOrError) => {
\r
909 delete requestTokens[tokenKey];
\r
910 reply(resultOrError, requestMessage.method, startTime);
\r
912 delete requestTokens[tokenKey];
\r
913 if (error instanceof messages_1.ResponseError) {
\r
914 replyError(error, requestMessage.method, startTime);
\r
916 else if (error && Is.string(error.message)) {
\r
917 replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed with message: ${error.message}`), requestMessage.method, startTime);
\r
920 replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed unexpectedly without providing any details.`), requestMessage.method, startTime);
\r
925 delete requestTokens[tokenKey];
\r
926 reply(handlerResult, requestMessage.method, startTime);
\r
930 delete requestTokens[tokenKey];
\r
931 if (error instanceof messages_1.ResponseError) {
\r
932 reply(error, requestMessage.method, startTime);
\r
934 else if (error && Is.string(error.message)) {
\r
935 replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed with message: ${error.message}`), requestMessage.method, startTime);
\r
938 replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed unexpectedly without providing any details.`), requestMessage.method, startTime);
\r
943 replyError(new messages_1.ResponseError(messages_1.ErrorCodes.MethodNotFound, `Unhandled method ${requestMessage.method}`), requestMessage.method, startTime);
\r
946 function handleResponse(responseMessage) {
\r
947 if (isDisposed()) {
\r
948 // See handle request.
\r
951 if (responseMessage.id === null) {
\r
952 if (responseMessage.error) {
\r
953 logger.error(`Received response message without id: Error is: \n${JSON.stringify(responseMessage.error, undefined, 4)}`);
\r
956 logger.error(`Received response message without id. No further error information provided.`);
\r
960 let key = String(responseMessage.id);
\r
961 let responsePromise = responsePromises[key];
\r
962 traceReceivedResponse(responseMessage, responsePromise);
\r
963 if (responsePromise) {
\r
964 delete responsePromises[key];
\r
966 if (responseMessage.error) {
\r
967 let error = responseMessage.error;
\r
968 responsePromise.reject(new messages_1.ResponseError(error.code, error.message, error.data));
\r
970 else if (responseMessage.result !== void 0) {
\r
971 responsePromise.resolve(responseMessage.result);
\r
974 throw new Error('Should never happen.');
\r
978 if (error.message) {
\r
979 logger.error(`Response handler '${responsePromise.method}' failed with message: ${error.message}`);
\r
982 logger.error(`Response handler '${responsePromise.method}' failed unexpectedly.`);
\r
988 function handleNotification(message) {
\r
989 if (isDisposed()) {
\r
990 // See handle request.
\r
993 let type = undefined;
\r
994 let notificationHandler;
\r
995 if (message.method === CancelNotification.type.method) {
\r
996 notificationHandler = (params) => {
\r
997 let id = params.id;
\r
998 let source = requestTokens[String(id)];
\r
1005 let element = notificationHandlers[message.method];
\r
1007 notificationHandler = element.handler;
\r
1008 type = element.type;
\r
1011 if (notificationHandler || starNotificationHandler) {
\r
1013 traceReceivedNotification(message);
\r
1014 if (message.params === void 0 || (type !== void 0 && type.numberOfParams === 0)) {
\r
1015 notificationHandler ? notificationHandler() : starNotificationHandler(message.method);
\r
1017 else if (Is.array(message.params) && (type === void 0 || type.numberOfParams > 1)) {
\r
1018 notificationHandler ? notificationHandler(...message.params) : starNotificationHandler(message.method, ...message.params);
\r
1021 notificationHandler ? notificationHandler(message.params) : starNotificationHandler(message.method, message.params);
\r
1025 if (error.message) {
\r
1026 logger.error(`Notification handler '${message.method}' failed with message: ${error.message}`);
\r
1029 logger.error(`Notification handler '${message.method}' failed unexpectedly.`);
\r
1034 unhandledNotificationEmitter.fire(message);
\r
1037 function handleInvalidMessage(message) {
\r
1039 logger.error('Received empty message.');
\r
1042 logger.error(`Received message which is neither a response nor a notification message:\n${JSON.stringify(message, null, 4)}`);
\r
1043 // Test whether we find an id to reject the promise
\r
1044 let responseMessage = message;
\r
1045 if (Is.string(responseMessage.id) || Is.number(responseMessage.id)) {
\r
1046 let key = String(responseMessage.id);
\r
1047 let responseHandler = responsePromises[key];
\r
1048 if (responseHandler) {
\r
1049 responseHandler.reject(new Error('The received response has neither a result nor an error property.'));
\r
1053 function traceSendingRequest(message) {
\r
1054 if (trace === Trace.Off || !tracer) {
\r
1057 if (traceFormat === TraceFormat.Text) {
\r
1058 let data = undefined;
\r
1059 if (trace === Trace.Verbose && message.params) {
\r
1060 data = `Params: ${JSON.stringify(message.params, null, 4)}\n\n`;
\r
1062 tracer.log(`Sending request '${message.method} - (${message.id})'.`, data);
\r
1065 logLSPMessage('send-request', message);
\r
1068 function traceSendingNotification(message) {
\r
1069 if (trace === Trace.Off || !tracer) {
\r
1072 if (traceFormat === TraceFormat.Text) {
\r
1073 let data = undefined;
\r
1074 if (trace === Trace.Verbose) {
\r
1075 if (message.params) {
\r
1076 data = `Params: ${JSON.stringify(message.params, null, 4)}\n\n`;
\r
1079 data = 'No parameters provided.\n\n';
\r
1082 tracer.log(`Sending notification '${message.method}'.`, data);
\r
1085 logLSPMessage('send-notification', message);
\r
1088 function traceSendingResponse(message, method, startTime) {
\r
1089 if (trace === Trace.Off || !tracer) {
\r
1092 if (traceFormat === TraceFormat.Text) {
\r
1093 let data = undefined;
\r
1094 if (trace === Trace.Verbose) {
\r
1095 if (message.error && message.error.data) {
\r
1096 data = `Error data: ${JSON.stringify(message.error.data, null, 4)}\n\n`;
\r
1099 if (message.result) {
\r
1100 data = `Result: ${JSON.stringify(message.result, null, 4)}\n\n`;
\r
1102 else if (message.error === void 0) {
\r
1103 data = 'No result returned.\n\n';
\r
1107 tracer.log(`Sending response '${method} - (${message.id})'. Processing request took ${Date.now() - startTime}ms`, data);
\r
1110 logLSPMessage('send-response', message);
\r
1113 function traceReceivedRequest(message) {
\r
1114 if (trace === Trace.Off || !tracer) {
\r
1117 if (traceFormat === TraceFormat.Text) {
\r
1118 let data = undefined;
\r
1119 if (trace === Trace.Verbose && message.params) {
\r
1120 data = `Params: ${JSON.stringify(message.params, null, 4)}\n\n`;
\r
1122 tracer.log(`Received request '${message.method} - (${message.id})'.`, data);
\r
1125 logLSPMessage('receive-request', message);
\r
1128 function traceReceivedNotification(message) {
\r
1129 if (trace === Trace.Off || !tracer || message.method === LogTraceNotification.type.method) {
\r
1132 if (traceFormat === TraceFormat.Text) {
\r
1133 let data = undefined;
\r
1134 if (trace === Trace.Verbose) {
\r
1135 if (message.params) {
\r
1136 data = `Params: ${JSON.stringify(message.params, null, 4)}\n\n`;
\r
1139 data = 'No parameters provided.\n\n';
\r
1142 tracer.log(`Received notification '${message.method}'.`, data);
\r
1145 logLSPMessage('receive-notification', message);
\r
1148 function traceReceivedResponse(message, responsePromise) {
\r
1149 if (trace === Trace.Off || !tracer) {
\r
1152 if (traceFormat === TraceFormat.Text) {
\r
1153 let data = undefined;
\r
1154 if (trace === Trace.Verbose) {
\r
1155 if (message.error && message.error.data) {
\r
1156 data = `Error data: ${JSON.stringify(message.error.data, null, 4)}\n\n`;
\r
1159 if (message.result) {
\r
1160 data = `Result: ${JSON.stringify(message.result, null, 4)}\n\n`;
\r
1162 else if (message.error === void 0) {
\r
1163 data = 'No result returned.\n\n';
\r
1167 if (responsePromise) {
\r
1168 let error = message.error ? ` Request failed: ${message.error.message} (${message.error.code}).` : '';
\r
1169 tracer.log(`Received response '${responsePromise.method} - (${message.id})' in ${Date.now() - responsePromise.timerStart}ms.${error}`, data);
\r
1172 tracer.log(`Received response ${message.id} without active response promise.`, data);
\r
1176 logLSPMessage('receive-response', message);
\r
1179 function logLSPMessage(type, message) {
\r
1180 if (!tracer || trace === Trace.Off) {
\r
1183 const lspMessage = {
\r
1184 isLSPMessage: true,
\r
1187 timestamp: Date.now()
\r
1189 tracer.log(lspMessage);
\r
1191 function throwIfClosedOrDisposed() {
\r
1193 throw new ConnectionError(ConnectionErrors.Closed, 'Connection is closed.');
\r
1195 if (isDisposed()) {
\r
1196 throw new ConnectionError(ConnectionErrors.Disposed, 'Connection is disposed.');
\r
1199 function throwIfListening() {
\r
1200 if (isListening()) {
\r
1201 throw new ConnectionError(ConnectionErrors.AlreadyListening, 'Connection is already listening');
\r
1204 function throwIfNotListening() {
\r
1205 if (!isListening()) {
\r
1206 throw new Error('Call listen() first.');
\r
1209 function undefinedToNull(param) {
\r
1210 if (param === void 0) {
\r
1217 function computeMessageParams(type, params) {
\r
1219 let numberOfParams = type.numberOfParams;
\r
1220 switch (numberOfParams) {
\r
1225 result = undefinedToNull(params[0]);
\r
1229 for (let i = 0; i < params.length && i < numberOfParams; i++) {
\r
1230 result.push(undefinedToNull(params[i]));
\r
1232 if (params.length < numberOfParams) {
\r
1233 for (let i = params.length; i < numberOfParams; i++) {
\r
1234 result.push(null);
\r
1241 let connection = {
\r
1242 sendNotification: (type, ...params) => {
\r
1243 throwIfClosedOrDisposed();
\r
1245 let messageParams;
\r
1246 if (Is.string(type)) {
\r
1248 switch (params.length) {
\r
1250 messageParams = null;
\r
1253 messageParams = params[0];
\r
1256 messageParams = params;
\r
1261 method = type.method;
\r
1262 messageParams = computeMessageParams(type, params);
\r
1264 let notificationMessage = {
\r
1267 params: messageParams
\r
1269 traceSendingNotification(notificationMessage);
\r
1270 messageWriter.write(notificationMessage);
\r
1272 onNotification: (type, handler) => {
\r
1273 throwIfClosedOrDisposed();
\r
1274 if (Is.func(type)) {
\r
1275 starNotificationHandler = type;
\r
1277 else if (handler) {
\r
1278 if (Is.string(type)) {
\r
1279 notificationHandlers[type] = { type: undefined, handler };
\r
1282 notificationHandlers[type.method] = { type, handler };
\r
1286 sendRequest: (type, ...params) => {
\r
1287 throwIfClosedOrDisposed();
\r
1288 throwIfNotListening();
\r
1290 let messageParams;
\r
1291 let token = undefined;
\r
1292 if (Is.string(type)) {
\r
1294 switch (params.length) {
\r
1296 messageParams = null;
\r
1299 // The cancellation token is optional so it can also be undefined.
\r
1300 if (cancellation_1.CancellationToken.is(params[0])) {
\r
1301 messageParams = null;
\r
1302 token = params[0];
\r
1305 messageParams = undefinedToNull(params[0]);
\r
1309 const last = params.length - 1;
\r
1310 if (cancellation_1.CancellationToken.is(params[last])) {
\r
1311 token = params[last];
\r
1312 if (params.length === 2) {
\r
1313 messageParams = undefinedToNull(params[0]);
\r
1316 messageParams = params.slice(0, last).map(value => undefinedToNull(value));
\r
1320 messageParams = params.map(value => undefinedToNull(value));
\r
1326 method = type.method;
\r
1327 messageParams = computeMessageParams(type, params);
\r
1328 let numberOfParams = type.numberOfParams;
\r
1329 token = cancellation_1.CancellationToken.is(params[numberOfParams]) ? params[numberOfParams] : undefined;
\r
1331 let id = sequenceNumber++;
\r
1332 let result = new Promise((resolve, reject) => {
\r
1333 let requestMessage = {
\r
1337 params: messageParams
\r
1339 let responsePromise = { method: method, timerStart: Date.now(), resolve, reject };
\r
1340 traceSendingRequest(requestMessage);
\r
1342 messageWriter.write(requestMessage);
\r
1345 // Writing the message failed. So we need to reject the promise.
\r
1346 responsePromise.reject(new messages_1.ResponseError(messages_1.ErrorCodes.MessageWriteError, e.message ? e.message : 'Unknown reason'));
\r
1347 responsePromise = null;
\r
1349 if (responsePromise) {
\r
1350 responsePromises[String(id)] = responsePromise;
\r
1354 token.onCancellationRequested(() => {
\r
1355 connection.sendNotification(CancelNotification.type, { id });
\r
1360 onRequest: (type, handler) => {
\r
1361 throwIfClosedOrDisposed();
\r
1362 if (Is.func(type)) {
\r
1363 starRequestHandler = type;
\r
1365 else if (handler) {
\r
1366 if (Is.string(type)) {
\r
1367 requestHandlers[type] = { type: undefined, handler };
\r
1370 requestHandlers[type.method] = { type, handler };
\r
1374 trace: (_value, _tracer, sendNotificationOrTraceOptions) => {
\r
1375 let _sendNotification = false;
\r
1376 let _traceFormat = TraceFormat.Text;
\r
1377 if (sendNotificationOrTraceOptions !== void 0) {
\r
1378 if (Is.boolean(sendNotificationOrTraceOptions)) {
\r
1379 _sendNotification = sendNotificationOrTraceOptions;
\r
1382 _sendNotification = sendNotificationOrTraceOptions.sendNotification || false;
\r
1383 _traceFormat = sendNotificationOrTraceOptions.traceFormat || TraceFormat.Text;
\r
1387 traceFormat = _traceFormat;
\r
1388 if (trace === Trace.Off) {
\r
1389 tracer = undefined;
\r
1394 if (_sendNotification && !isClosed() && !isDisposed()) {
\r
1395 connection.sendNotification(SetTraceNotification.type, { value: Trace.toString(_value) });
\r
1398 onError: errorEmitter.event,
\r
1399 onClose: closeEmitter.event,
\r
1400 onUnhandledNotification: unhandledNotificationEmitter.event,
\r
1401 onDispose: disposeEmitter.event,
\r
1403 if (isDisposed()) {
\r
1406 state = ConnectionState.Disposed;
\r
1407 disposeEmitter.fire(undefined);
\r
1408 let error = new Error('Connection got disposed.');
\r
1409 Object.keys(responsePromises).forEach((key) => {
\r
1410 responsePromises[key].reject(error);
\r
1412 responsePromises = Object.create(null);
\r
1413 requestTokens = Object.create(null);
\r
1414 messageQueue = new linkedMap_1.LinkedMap();
\r
1415 // Test for backwards compatibility
\r
1416 if (Is.func(messageWriter.dispose)) {
\r
1417 messageWriter.dispose();
\r
1419 if (Is.func(messageReader.dispose)) {
\r
1420 messageReader.dispose();
\r
1424 throwIfClosedOrDisposed();
\r
1425 throwIfListening();
\r
1426 state = ConnectionState.Listening;
\r
1427 messageReader.listen(callback);
\r
1430 console.log("inspect");
\r
1433 connection.onNotification(LogTraceNotification.type, (params) => {
\r
1434 if (trace === Trace.Off || !tracer) {
\r
1437 tracer.log(params.message, trace === Trace.Verbose ? params.verbose : undefined);
\r
1439 return connection;
\r
1441 function isMessageReader(value) {
\r
1442 return value.listen !== void 0 && value.read === void 0;
\r
1444 function isMessageWriter(value) {
\r
1445 return value.write !== void 0 && value.end === void 0;
\r
1447 function createMessageConnection(input, output, logger, strategy) {
\r
1449 logger = exports.NullLogger;
\r
1451 let reader = isMessageReader(input) ? input : new messageReader_1.StreamMessageReader(input);
\r
1452 let writer = isMessageWriter(output) ? output : new messageWriter_1.StreamMessageWriter(output);
\r
1453 return _createMessageConnection(reader, writer, logger, strategy);
\r
1455 exports.createMessageConnection = createMessageConnection;
\r
1460 /***/ (function(module, exports, __webpack_require__) {
1463 /* --------------------------------------------------------------------------------------------
\r
1464 * Copyright (c) Microsoft Corporation. All rights reserved.
\r
1465 * Licensed under the MIT License. See License.txt in the project root for license information.
\r
1466 * ------------------------------------------------------------------------------------------ */
\r
1468 Object.defineProperty(exports, "__esModule", { value: true });
\r
1469 function boolean(value) {
\r
1470 return value === true || value === false;
\r
1472 exports.boolean = boolean;
\r
1473 function string(value) {
\r
1474 return typeof value === 'string' || value instanceof String;
\r
1476 exports.string = string;
\r
1477 function number(value) {
\r
1478 return typeof value === 'number' || value instanceof Number;
\r
1480 exports.number = number;
\r
1481 function error(value) {
\r
1482 return value instanceof Error;
\r
1484 exports.error = error;
\r
1485 function func(value) {
\r
1486 return typeof value === 'function';
\r
1488 exports.func = func;
\r
1489 function array(value) {
\r
1490 return Array.isArray(value);
\r
1492 exports.array = array;
\r
1493 function stringArray(value) {
\r
1494 return array(value) && value.every(elem => string(elem));
\r
1496 exports.stringArray = stringArray;
\r
1501 /***/ (function(module, exports, __webpack_require__) {
1504 /* --------------------------------------------------------------------------------------------
\r
1505 * Copyright (c) Microsoft Corporation. All rights reserved.
\r
1506 * Licensed under the MIT License. See License.txt in the project root for license information.
\r
1507 * ------------------------------------------------------------------------------------------ */
\r
1509 Object.defineProperty(exports, "__esModule", { value: true });
\r
1510 const is = __webpack_require__(5);
\r
1512 * Predefined error codes.
\r
1515 (function (ErrorCodes) {
\r
1516 // Defined by JSON RPC
\r
1517 ErrorCodes.ParseError = -32700;
\r
1518 ErrorCodes.InvalidRequest = -32600;
\r
1519 ErrorCodes.MethodNotFound = -32601;
\r
1520 ErrorCodes.InvalidParams = -32602;
\r
1521 ErrorCodes.InternalError = -32603;
\r
1522 ErrorCodes.serverErrorStart = -32099;
\r
1523 ErrorCodes.serverErrorEnd = -32000;
\r
1524 ErrorCodes.ServerNotInitialized = -32002;
\r
1525 ErrorCodes.UnknownErrorCode = -32001;
\r
1526 // Defined by the protocol.
\r
1527 ErrorCodes.RequestCancelled = -32800;
\r
1528 ErrorCodes.ContentModified = -32801;
\r
1529 // Defined by VSCode library.
\r
1530 ErrorCodes.MessageWriteError = 1;
\r
1531 ErrorCodes.MessageReadError = 2;
\r
1532 })(ErrorCodes = exports.ErrorCodes || (exports.ErrorCodes = {}));
\r
1534 * An error object return in a response in case a request
\r
1537 class ResponseError extends Error {
\r
1538 constructor(code, message, data) {
\r
1540 this.code = is.number(code) ? code : ErrorCodes.UnknownErrorCode;
\r
1542 Object.setPrototypeOf(this, ResponseError.prototype);
\r
1547 message: this.message,
\r
1552 exports.ResponseError = ResponseError;
\r
1554 * An abstract implementation of a MessageType.
\r
1556 class AbstractMessageType {
\r
1557 constructor(_method, _numberOfParams) {
\r
1558 this._method = _method;
\r
1559 this._numberOfParams = _numberOfParams;
\r
1562 return this._method;
\r
1564 get numberOfParams() {
\r
1565 return this._numberOfParams;
\r
1568 exports.AbstractMessageType = AbstractMessageType;
\r
1570 * Classes to type request response pairs
\r
1572 class RequestType0 extends AbstractMessageType {
\r
1573 constructor(method) {
\r
1575 this._ = undefined;
\r
1578 exports.RequestType0 = RequestType0;
\r
1579 class RequestType extends AbstractMessageType {
\r
1580 constructor(method) {
\r
1582 this._ = undefined;
\r
1585 exports.RequestType = RequestType;
\r
1586 class RequestType1 extends AbstractMessageType {
\r
1587 constructor(method) {
\r
1589 this._ = undefined;
\r
1592 exports.RequestType1 = RequestType1;
\r
1593 class RequestType2 extends AbstractMessageType {
\r
1594 constructor(method) {
\r
1596 this._ = undefined;
\r
1599 exports.RequestType2 = RequestType2;
\r
1600 class RequestType3 extends AbstractMessageType {
\r
1601 constructor(method) {
\r
1603 this._ = undefined;
\r
1606 exports.RequestType3 = RequestType3;
\r
1607 class RequestType4 extends AbstractMessageType {
\r
1608 constructor(method) {
\r
1610 this._ = undefined;
\r
1613 exports.RequestType4 = RequestType4;
\r
1614 class RequestType5 extends AbstractMessageType {
\r
1615 constructor(method) {
\r
1617 this._ = undefined;
\r
1620 exports.RequestType5 = RequestType5;
\r
1621 class RequestType6 extends AbstractMessageType {
\r
1622 constructor(method) {
\r
1624 this._ = undefined;
\r
1627 exports.RequestType6 = RequestType6;
\r
1628 class RequestType7 extends AbstractMessageType {
\r
1629 constructor(method) {
\r
1631 this._ = undefined;
\r
1634 exports.RequestType7 = RequestType7;
\r
1635 class RequestType8 extends AbstractMessageType {
\r
1636 constructor(method) {
\r
1638 this._ = undefined;
\r
1641 exports.RequestType8 = RequestType8;
\r
1642 class RequestType9 extends AbstractMessageType {
\r
1643 constructor(method) {
\r
1645 this._ = undefined;
\r
1648 exports.RequestType9 = RequestType9;
\r
1649 class NotificationType extends AbstractMessageType {
\r
1650 constructor(method) {
\r
1652 this._ = undefined;
\r
1655 exports.NotificationType = NotificationType;
\r
1656 class NotificationType0 extends AbstractMessageType {
\r
1657 constructor(method) {
\r
1659 this._ = undefined;
\r
1662 exports.NotificationType0 = NotificationType0;
\r
1663 class NotificationType1 extends AbstractMessageType {
\r
1664 constructor(method) {
\r
1666 this._ = undefined;
\r
1669 exports.NotificationType1 = NotificationType1;
\r
1670 class NotificationType2 extends AbstractMessageType {
\r
1671 constructor(method) {
\r
1673 this._ = undefined;
\r
1676 exports.NotificationType2 = NotificationType2;
\r
1677 class NotificationType3 extends AbstractMessageType {
\r
1678 constructor(method) {
\r
1680 this._ = undefined;
\r
1683 exports.NotificationType3 = NotificationType3;
\r
1684 class NotificationType4 extends AbstractMessageType {
\r
1685 constructor(method) {
\r
1687 this._ = undefined;
\r
1690 exports.NotificationType4 = NotificationType4;
\r
1691 class NotificationType5 extends AbstractMessageType {
\r
1692 constructor(method) {
\r
1694 this._ = undefined;
\r
1697 exports.NotificationType5 = NotificationType5;
\r
1698 class NotificationType6 extends AbstractMessageType {
\r
1699 constructor(method) {
\r
1701 this._ = undefined;
\r
1704 exports.NotificationType6 = NotificationType6;
\r
1705 class NotificationType7 extends AbstractMessageType {
\r
1706 constructor(method) {
\r
1708 this._ = undefined;
\r
1711 exports.NotificationType7 = NotificationType7;
\r
1712 class NotificationType8 extends AbstractMessageType {
\r
1713 constructor(method) {
\r
1715 this._ = undefined;
\r
1718 exports.NotificationType8 = NotificationType8;
\r
1719 class NotificationType9 extends AbstractMessageType {
\r
1720 constructor(method) {
\r
1722 this._ = undefined;
\r
1725 exports.NotificationType9 = NotificationType9;
\r
1727 * Tests if the given message is a request message
\r
1729 function isRequestMessage(message) {
\r
1730 let candidate = message;
\r
1731 return candidate && is.string(candidate.method) && (is.string(candidate.id) || is.number(candidate.id));
\r
1733 exports.isRequestMessage = isRequestMessage;
\r
1735 * Tests if the given message is a notification message
\r
1737 function isNotificationMessage(message) {
\r
1738 let candidate = message;
\r
1739 return candidate && is.string(candidate.method) && message.id === void 0;
\r
1741 exports.isNotificationMessage = isNotificationMessage;
\r
1743 * Tests if the given message is a response message
\r
1745 function isResponseMessage(message) {
\r
1746 let candidate = message;
\r
1747 return candidate && (candidate.result !== void 0 || !!candidate.error) && (is.string(candidate.id) || is.number(candidate.id) || candidate.id === null);
\r
1749 exports.isResponseMessage = isResponseMessage;
\r
1754 /***/ (function(module, exports, __webpack_require__) {
1757 /* --------------------------------------------------------------------------------------------
\r
1758 * Copyright (c) Microsoft Corporation. All rights reserved.
\r
1759 * Licensed under the MIT License. See License.txt in the project root for license information.
\r
1760 * ------------------------------------------------------------------------------------------ */
\r
1762 Object.defineProperty(exports, "__esModule", { value: true });
\r
1763 const events_1 = __webpack_require__(8);
\r
1764 const Is = __webpack_require__(5);
\r
1765 let DefaultSize = 8192;
\r
1766 let CR = Buffer.from('\r', 'ascii')[0];
\r
1767 let LF = Buffer.from('\n', 'ascii')[0];
\r
1768 let CRLF = '\r\n';
\r
1769 class MessageBuffer {
\r
1770 constructor(encoding = 'utf8') {
\r
1771 this.encoding = encoding;
\r
1773 this.buffer = Buffer.allocUnsafe(DefaultSize);
\r
1776 var toAppend = chunk;
\r
1777 if (typeof (chunk) === 'string') {
\r
1779 var bufferLen = Buffer.byteLength(str, this.encoding);
\r
1780 toAppend = Buffer.allocUnsafe(bufferLen);
\r
1781 toAppend.write(str, 0, bufferLen, this.encoding);
\r
1783 if (this.buffer.length - this.index >= toAppend.length) {
\r
1784 toAppend.copy(this.buffer, this.index, 0, toAppend.length);
\r
1787 var newSize = (Math.ceil((this.index + toAppend.length) / DefaultSize) + 1) * DefaultSize;
\r
1788 if (this.index === 0) {
\r
1789 this.buffer = Buffer.allocUnsafe(newSize);
\r
1790 toAppend.copy(this.buffer, 0, 0, toAppend.length);
\r
1793 this.buffer = Buffer.concat([this.buffer.slice(0, this.index), toAppend], newSize);
\r
1796 this.index += toAppend.length;
\r
1798 tryReadHeaders() {
\r
1799 let result = undefined;
\r
1801 while (current + 3 < this.index && (this.buffer[current] !== CR || this.buffer[current + 1] !== LF || this.buffer[current + 2] !== CR || this.buffer[current + 3] !== LF)) {
\r
1804 // No header / body separator found (e.g CRLFCRLF)
\r
1805 if (current + 3 >= this.index) {
\r
1808 result = Object.create(null);
\r
1809 let headers = this.buffer.toString('ascii', 0, current).split(CRLF);
\r
1810 headers.forEach((header) => {
\r
1811 let index = header.indexOf(':');
\r
1812 if (index === -1) {
\r
1813 throw new Error('Message header must separate key and value using :');
\r
1815 let key = header.substr(0, index);
\r
1816 let value = header.substr(index + 1).trim();
\r
1817 result[key] = value;
\r
1819 let nextStart = current + 4;
\r
1820 this.buffer = this.buffer.slice(nextStart);
\r
1821 this.index = this.index - nextStart;
\r
1824 tryReadContent(length) {
\r
1825 if (this.index < length) {
\r
1828 let result = this.buffer.toString(this.encoding, 0, length);
\r
1829 let nextStart = length;
\r
1830 this.buffer.copy(this.buffer, 0, nextStart);
\r
1831 this.index = this.index - nextStart;
\r
1834 get numberOfBytes() {
\r
1835 return this.index;
\r
1838 var MessageReader;
\r
1839 (function (MessageReader) {
\r
1840 function is(value) {
\r
1841 let candidate = value;
\r
1842 return candidate && Is.func(candidate.listen) && Is.func(candidate.dispose) &&
\r
1843 Is.func(candidate.onError) && Is.func(candidate.onClose) && Is.func(candidate.onPartialMessage);
\r
1845 MessageReader.is = is;
\r
1846 })(MessageReader = exports.MessageReader || (exports.MessageReader = {}));
\r
1847 class AbstractMessageReader {
\r
1849 this.errorEmitter = new events_1.Emitter();
\r
1850 this.closeEmitter = new events_1.Emitter();
\r
1851 this.partialMessageEmitter = new events_1.Emitter();
\r
1854 this.errorEmitter.dispose();
\r
1855 this.closeEmitter.dispose();
\r
1858 return this.errorEmitter.event;
\r
1860 fireError(error) {
\r
1861 this.errorEmitter.fire(this.asError(error));
\r
1864 return this.closeEmitter.event;
\r
1867 this.closeEmitter.fire(undefined);
\r
1869 get onPartialMessage() {
\r
1870 return this.partialMessageEmitter.event;
\r
1872 firePartialMessage(info) {
\r
1873 this.partialMessageEmitter.fire(info);
\r
1876 if (error instanceof Error) {
\r
1880 return new Error(`Reader received error. Reason: ${Is.string(error.message) ? error.message : 'unknown'}`);
\r
1884 exports.AbstractMessageReader = AbstractMessageReader;
\r
1885 class StreamMessageReader extends AbstractMessageReader {
\r
1886 constructor(readable, encoding = 'utf8') {
\r
1888 this.readable = readable;
\r
1889 this.buffer = new MessageBuffer(encoding);
\r
1890 this._partialMessageTimeout = 10000;
\r
1892 set partialMessageTimeout(timeout) {
\r
1893 this._partialMessageTimeout = timeout;
\r
1895 get partialMessageTimeout() {
\r
1896 return this._partialMessageTimeout;
\r
1898 listen(callback) {
\r
1899 this.nextMessageLength = -1;
\r
1900 this.messageToken = 0;
\r
1901 this.partialMessageTimer = undefined;
\r
1902 this.callback = callback;
\r
1903 this.readable.on('data', (data) => {
\r
1904 this.onData(data);
\r
1906 this.readable.on('error', (error) => this.fireError(error));
\r
1907 this.readable.on('close', () => this.fireClose());
\r
1910 this.buffer.append(data);
\r
1912 if (this.nextMessageLength === -1) {
\r
1913 let headers = this.buffer.tryReadHeaders();
\r
1917 let contentLength = headers['Content-Length'];
\r
1918 if (!contentLength) {
\r
1919 throw new Error('Header must provide a Content-Length property.');
\r
1921 let length = parseInt(contentLength);
\r
1922 if (isNaN(length)) {
\r
1923 throw new Error('Content-Length value must be a number.');
\r
1925 this.nextMessageLength = length;
\r
1926 // Take the encoding form the header. For compatibility
\r
1927 // treat both utf-8 and utf8 as node utf8
\r
1929 var msg = this.buffer.tryReadContent(this.nextMessageLength);
\r
1930 if (msg === null) {
\r
1931 /** We haven't received the full message yet. */
\r
1932 this.setPartialMessageTimer();
\r
1935 this.clearPartialMessageTimer();
\r
1936 this.nextMessageLength = -1;
\r
1937 this.messageToken++;
\r
1938 var json = JSON.parse(msg);
\r
1939 this.callback(json);
\r
1942 clearPartialMessageTimer() {
\r
1943 if (this.partialMessageTimer) {
\r
1944 clearTimeout(this.partialMessageTimer);
\r
1945 this.partialMessageTimer = undefined;
\r
1948 setPartialMessageTimer() {
\r
1949 this.clearPartialMessageTimer();
\r
1950 if (this._partialMessageTimeout <= 0) {
\r
1953 this.partialMessageTimer = setTimeout((token, timeout) => {
\r
1954 this.partialMessageTimer = undefined;
\r
1955 if (token === this.messageToken) {
\r
1956 this.firePartialMessage({ messageToken: token, waitingTime: timeout });
\r
1957 this.setPartialMessageTimer();
\r
1959 }, this._partialMessageTimeout, this.messageToken, this._partialMessageTimeout);
\r
1962 exports.StreamMessageReader = StreamMessageReader;
\r
1963 class IPCMessageReader extends AbstractMessageReader {
\r
1964 constructor(process) {
\r
1966 this.process = process;
\r
1967 let eventEmitter = this.process;
\r
1968 eventEmitter.on('error', (error) => this.fireError(error));
\r
1969 eventEmitter.on('close', () => this.fireClose());
\r
1971 listen(callback) {
\r
1972 this.process.on('message', callback);
\r
1975 exports.IPCMessageReader = IPCMessageReader;
\r
1976 class SocketMessageReader extends StreamMessageReader {
\r
1977 constructor(socket, encoding = 'utf-8') {
\r
1978 super(socket, encoding);
\r
1981 exports.SocketMessageReader = SocketMessageReader;
\r
1986 /***/ (function(module, exports, __webpack_require__) {
1989 /* --------------------------------------------------------------------------------------------
\r
1990 * Copyright (c) Microsoft Corporation. All rights reserved.
\r
1991 * Licensed under the MIT License. See License.txt in the project root for license information.
\r
1992 * ------------------------------------------------------------------------------------------ */
\r
1994 Object.defineProperty(exports, "__esModule", { value: true });
\r
1996 (function (Disposable) {
\r
1997 function create(func) {
\r
2002 Disposable.create = create;
\r
2003 })(Disposable = exports.Disposable || (exports.Disposable = {}));
\r
2005 (function (Event) {
\r
2006 const _disposable = { dispose() { } };
\r
2007 Event.None = function () { return _disposable; };
\r
2008 })(Event = exports.Event || (exports.Event = {}));
\r
2009 class CallbackList {
\r
2010 add(callback, context = null, bucket) {
\r
2011 if (!this._callbacks) {
\r
2012 this._callbacks = [];
\r
2013 this._contexts = [];
\r
2015 this._callbacks.push(callback);
\r
2016 this._contexts.push(context);
\r
2017 if (Array.isArray(bucket)) {
\r
2018 bucket.push({ dispose: () => this.remove(callback, context) });
\r
2021 remove(callback, context = null) {
\r
2022 if (!this._callbacks) {
\r
2025 var foundCallbackWithDifferentContext = false;
\r
2026 for (var i = 0, len = this._callbacks.length; i < len; i++) {
\r
2027 if (this._callbacks[i] === callback) {
\r
2028 if (this._contexts[i] === context) {
\r
2029 // callback & context match => remove it
\r
2030 this._callbacks.splice(i, 1);
\r
2031 this._contexts.splice(i, 1);
\r
2035 foundCallbackWithDifferentContext = true;
\r
2039 if (foundCallbackWithDifferentContext) {
\r
2040 throw new Error('When adding a listener with a context, you should remove it with the same context');
\r
2044 if (!this._callbacks) {
\r
2047 var ret = [], callbacks = this._callbacks.slice(0), contexts = this._contexts.slice(0);
\r
2048 for (var i = 0, len = callbacks.length; i < len; i++) {
\r
2050 ret.push(callbacks[i].apply(contexts[i], args));
\r
2059 return !this._callbacks || this._callbacks.length === 0;
\r
2062 this._callbacks = undefined;
\r
2063 this._contexts = undefined;
\r
2067 constructor(_options) {
\r
2068 this._options = _options;
\r
2071 * For the public to allow to subscribe
\r
2072 * to events from this Emitter
\r
2075 if (!this._event) {
\r
2076 this._event = (listener, thisArgs, disposables) => {
\r
2077 if (!this._callbacks) {
\r
2078 this._callbacks = new CallbackList();
\r
2080 if (this._options && this._options.onFirstListenerAdd && this._callbacks.isEmpty()) {
\r
2081 this._options.onFirstListenerAdd(this);
\r
2083 this._callbacks.add(listener, thisArgs);
\r
2087 this._callbacks.remove(listener, thisArgs);
\r
2088 result.dispose = Emitter._noop;
\r
2089 if (this._options && this._options.onLastListenerRemove && this._callbacks.isEmpty()) {
\r
2090 this._options.onLastListenerRemove(this);
\r
2094 if (Array.isArray(disposables)) {
\r
2095 disposables.push(result);
\r
2100 return this._event;
\r
2103 * To be kept private to fire an event to
\r
2107 if (this._callbacks) {
\r
2108 this._callbacks.invoke.call(this._callbacks, event);
\r
2112 if (this._callbacks) {
\r
2113 this._callbacks.dispose();
\r
2114 this._callbacks = undefined;
\r
2118 Emitter._noop = function () { };
\r
2119 exports.Emitter = Emitter;
\r
2124 /***/ (function(module, exports, __webpack_require__) {
2127 /* --------------------------------------------------------------------------------------------
\r
2128 * Copyright (c) Microsoft Corporation. All rights reserved.
\r
2129 * Licensed under the MIT License. See License.txt in the project root for license information.
\r
2130 * ------------------------------------------------------------------------------------------ */
\r
2132 Object.defineProperty(exports, "__esModule", { value: true });
\r
2133 const events_1 = __webpack_require__(8);
\r
2134 const Is = __webpack_require__(5);
\r
2135 let ContentLength = 'Content-Length: ';
\r
2136 let CRLF = '\r\n';
\r
2137 var MessageWriter;
\r
2138 (function (MessageWriter) {
\r
2139 function is(value) {
\r
2140 let candidate = value;
\r
2141 return candidate && Is.func(candidate.dispose) && Is.func(candidate.onClose) &&
\r
2142 Is.func(candidate.onError) && Is.func(candidate.write);
\r
2144 MessageWriter.is = is;
\r
2145 })(MessageWriter = exports.MessageWriter || (exports.MessageWriter = {}));
\r
2146 class AbstractMessageWriter {
\r
2148 this.errorEmitter = new events_1.Emitter();
\r
2149 this.closeEmitter = new events_1.Emitter();
\r
2152 this.errorEmitter.dispose();
\r
2153 this.closeEmitter.dispose();
\r
2156 return this.errorEmitter.event;
\r
2158 fireError(error, message, count) {
\r
2159 this.errorEmitter.fire([this.asError(error), message, count]);
\r
2162 return this.closeEmitter.event;
\r
2165 this.closeEmitter.fire(undefined);
\r
2168 if (error instanceof Error) {
\r
2172 return new Error(`Writer received error. Reason: ${Is.string(error.message) ? error.message : 'unknown'}`);
\r
2176 exports.AbstractMessageWriter = AbstractMessageWriter;
\r
2177 class StreamMessageWriter extends AbstractMessageWriter {
\r
2178 constructor(writable, encoding = 'utf8') {
\r
2180 this.writable = writable;
\r
2181 this.encoding = encoding;
\r
2182 this.errorCount = 0;
\r
2183 this.writable.on('error', (error) => this.fireError(error));
\r
2184 this.writable.on('close', () => this.fireClose());
\r
2187 let json = JSON.stringify(msg);
\r
2188 let contentLength = Buffer.byteLength(json, this.encoding);
\r
2190 ContentLength, contentLength.toString(), CRLF,
\r
2194 // Header must be written in ASCII encoding
\r
2195 this.writable.write(headers.join(''), 'ascii');
\r
2196 // Now write the content. This can be written in any encoding
\r
2197 this.writable.write(json, this.encoding);
\r
2198 this.errorCount = 0;
\r
2201 this.errorCount++;
\r
2202 this.fireError(error, msg, this.errorCount);
\r
2206 exports.StreamMessageWriter = StreamMessageWriter;
\r
2207 class IPCMessageWriter extends AbstractMessageWriter {
\r
2208 constructor(process) {
\r
2210 this.process = process;
\r
2211 this.errorCount = 0;
\r
2213 this.sending = false;
\r
2214 let eventEmitter = this.process;
\r
2215 eventEmitter.on('error', (error) => this.fireError(error));
\r
2216 eventEmitter.on('close', () => this.fireClose);
\r
2219 if (!this.sending && this.queue.length === 0) {
\r
2220 // See https://github.com/nodejs/node/issues/7657
\r
2221 this.doWriteMessage(msg);
\r
2224 this.queue.push(msg);
\r
2227 doWriteMessage(msg) {
\r
2229 if (this.process.send) {
\r
2230 this.sending = true;
\r
2231 this.process.send(msg, undefined, undefined, (error) => {
\r
2232 this.sending = false;
\r
2234 this.errorCount++;
\r
2235 this.fireError(error, msg, this.errorCount);
\r
2238 this.errorCount = 0;
\r
2240 if (this.queue.length > 0) {
\r
2241 this.doWriteMessage(this.queue.shift());
\r
2247 this.errorCount++;
\r
2248 this.fireError(error, msg, this.errorCount);
\r
2252 exports.IPCMessageWriter = IPCMessageWriter;
\r
2253 class SocketMessageWriter extends AbstractMessageWriter {
\r
2254 constructor(socket, encoding = 'utf8') {
\r
2256 this.socket = socket;
\r
2258 this.sending = false;
\r
2259 this.encoding = encoding;
\r
2260 this.errorCount = 0;
\r
2261 this.socket.on('error', (error) => this.fireError(error));
\r
2262 this.socket.on('close', () => this.fireClose());
\r
2266 this.socket.destroy();
\r
2269 if (!this.sending && this.queue.length === 0) {
\r
2270 // See https://github.com/nodejs/node/issues/7657
\r
2271 this.doWriteMessage(msg);
\r
2274 this.queue.push(msg);
\r
2277 doWriteMessage(msg) {
\r
2278 let json = JSON.stringify(msg);
\r
2279 let contentLength = Buffer.byteLength(json, this.encoding);
\r
2281 ContentLength, contentLength.toString(), CRLF,
\r
2285 // Header must be written in ASCII encoding
\r
2286 this.sending = true;
\r
2287 this.socket.write(headers.join(''), 'ascii', (error) => {
\r
2289 this.handleError(error, msg);
\r
2292 // Now write the content. This can be written in any encoding
\r
2293 this.socket.write(json, this.encoding, (error) => {
\r
2294 this.sending = false;
\r
2296 this.handleError(error, msg);
\r
2299 this.errorCount = 0;
\r
2301 if (this.queue.length > 0) {
\r
2302 this.doWriteMessage(this.queue.shift());
\r
2307 this.handleError(error, msg);
\r
2312 this.handleError(error, msg);
\r
2315 handleError(error, msg) {
\r
2316 this.errorCount++;
\r
2317 this.fireError(error, msg, this.errorCount);
\r
2320 exports.SocketMessageWriter = SocketMessageWriter;
\r
2325 /***/ (function(module, exports, __webpack_require__) {
2328 /*---------------------------------------------------------------------------------------------
\r
2329 * Copyright (c) Microsoft Corporation. All rights reserved.
\r
2330 * Licensed under the MIT License. See License.txt in the project root for license information.
\r
2331 *--------------------------------------------------------------------------------------------*/
\r
2333 Object.defineProperty(exports, "__esModule", { value: true });
\r
2334 const events_1 = __webpack_require__(8);
\r
2335 const Is = __webpack_require__(5);
\r
2336 var CancellationToken;
\r
2337 (function (CancellationToken) {
\r
2338 CancellationToken.None = Object.freeze({
\r
2339 isCancellationRequested: false,
\r
2340 onCancellationRequested: events_1.Event.None
\r
2342 CancellationToken.Cancelled = Object.freeze({
\r
2343 isCancellationRequested: true,
\r
2344 onCancellationRequested: events_1.Event.None
\r
2346 function is(value) {
\r
2347 let candidate = value;
\r
2348 return candidate && (candidate === CancellationToken.None
\r
2349 || candidate === CancellationToken.Cancelled
\r
2350 || (Is.boolean(candidate.isCancellationRequested) && !!candidate.onCancellationRequested));
\r
2352 CancellationToken.is = is;
\r
2353 })(CancellationToken = exports.CancellationToken || (exports.CancellationToken = {}));
\r
2354 const shortcutEvent = Object.freeze(function (callback, context) {
\r
2355 let handle = setTimeout(callback.bind(context), 0);
\r
2356 return { dispose() { clearTimeout(handle); } };
\r
2358 class MutableToken {
\r
2360 this._isCancelled = false;
\r
2363 if (!this._isCancelled) {
\r
2364 this._isCancelled = true;
\r
2365 if (this._emitter) {
\r
2366 this._emitter.fire(undefined);
\r
2371 get isCancellationRequested() {
\r
2372 return this._isCancelled;
\r
2374 get onCancellationRequested() {
\r
2375 if (this._isCancelled) {
\r
2376 return shortcutEvent;
\r
2378 if (!this._emitter) {
\r
2379 this._emitter = new events_1.Emitter();
\r
2381 return this._emitter.event;
\r
2384 if (this._emitter) {
\r
2385 this._emitter.dispose();
\r
2386 this._emitter = undefined;
\r
2390 class CancellationTokenSource {
\r
2392 if (!this._token) {
\r
2393 // be lazy and create the token only when
\r
2394 // actually needed
\r
2395 this._token = new MutableToken();
\r
2397 return this._token;
\r
2400 if (!this._token) {
\r
2401 // save an object by returning the default
\r
2402 // cancelled token when cancellation happens
\r
2403 // before someone asks for the token
\r
2404 this._token = CancellationToken.Cancelled;
\r
2407 this._token.cancel();
\r
2411 if (!this._token) {
\r
2412 // ensure to initialize with an empty token if we had none
\r
2413 this._token = CancellationToken.None;
\r
2415 else if (this._token instanceof MutableToken) {
\r
2416 // actually dispose
\r
2417 this._token.dispose();
\r
2421 exports.CancellationTokenSource = CancellationTokenSource;
\r
2426 /***/ (function(module, exports, __webpack_require__) {
2430 /*---------------------------------------------------------------------------------------------
\r
2431 * Copyright (c) Microsoft Corporation. All rights reserved.
\r
2432 * Licensed under the MIT License. See License.txt in the project root for license information.
\r
2433 *--------------------------------------------------------------------------------------------*/
\r
2434 Object.defineProperty(exports, "__esModule", { value: true });
\r
2436 (function (Touch) {
\r
2440 })(Touch = exports.Touch || (exports.Touch = {}));
\r
2443 this._map = new Map();
\r
2444 this._head = undefined;
\r
2445 this._tail = undefined;
\r
2449 this._map.clear();
\r
2450 this._head = undefined;
\r
2451 this._tail = undefined;
\r
2455 return !this._head && !this._tail;
\r
2458 return this._size;
\r
2461 return this._map.has(key);
\r
2464 const item = this._map.get(key);
\r
2468 return item.value;
\r
2470 set(key, value, touch = Touch.None) {
\r
2471 let item = this._map.get(key);
\r
2473 item.value = value;
\r
2474 if (touch !== Touch.None) {
\r
2475 this.touch(item, touch);
\r
2479 item = { key, value, next: undefined, previous: undefined };
\r
2482 this.addItemLast(item);
\r
2485 this.addItemFirst(item);
\r
2488 this.addItemLast(item);
\r
2491 this.addItemLast(item);
\r
2494 this._map.set(key, item);
\r
2499 const item = this._map.get(key);
\r
2503 this._map.delete(key);
\r
2504 this.removeItem(item);
\r
2509 if (!this._head && !this._tail) {
\r
2512 if (!this._head || !this._tail) {
\r
2513 throw new Error('Invalid list');
\r
2515 const item = this._head;
\r
2516 this._map.delete(item.key);
\r
2517 this.removeItem(item);
\r
2519 return item.value;
\r
2521 forEach(callbackfn, thisArg) {
\r
2522 let current = this._head;
\r
2525 callbackfn.bind(thisArg)(current.value, current.key, this);
\r
2528 callbackfn(current.value, current.key, this);
\r
2530 current = current.next;
\r
2533 forEachReverse(callbackfn, thisArg) {
\r
2534 let current = this._tail;
\r
2537 callbackfn.bind(thisArg)(current.value, current.key, this);
\r
2540 callbackfn(current.value, current.key, this);
\r
2542 current = current.previous;
\r
2547 let current = this._head;
\r
2549 result.push(current.value);
\r
2550 current = current.next;
\r
2556 let current = this._head;
\r
2558 result.push(current.key);
\r
2559 current = current.next;
\r
2563 /* JSON RPC run on es5 which has no Symbol.iterator
\r
2564 public keys(): IterableIterator<K> {
\r
2565 let current = this._head;
\r
2566 let iterator: IterableIterator<K> = {
\r
2567 [Symbol.iterator]() {
\r
2570 next():IteratorResult<K> {
\r
2572 let result = { value: current.key, done: false };
\r
2573 current = current.next;
\r
2576 return { value: undefined, done: true };
\r
2583 public values(): IterableIterator<V> {
\r
2584 let current = this._head;
\r
2585 let iterator: IterableIterator<V> = {
\r
2586 [Symbol.iterator]() {
\r
2589 next():IteratorResult<V> {
\r
2591 let result = { value: current.value, done: false };
\r
2592 current = current.next;
\r
2595 return { value: undefined, done: true };
\r
2602 addItemFirst(item) {
\r
2603 // First time Insert
\r
2604 if (!this._head && !this._tail) {
\r
2605 this._tail = item;
\r
2607 else if (!this._head) {
\r
2608 throw new Error('Invalid list');
\r
2611 item.next = this._head;
\r
2612 this._head.previous = item;
\r
2614 this._head = item;
\r
2616 addItemLast(item) {
\r
2617 // First time Insert
\r
2618 if (!this._head && !this._tail) {
\r
2619 this._head = item;
\r
2621 else if (!this._tail) {
\r
2622 throw new Error('Invalid list');
\r
2625 item.previous = this._tail;
\r
2626 this._tail.next = item;
\r
2628 this._tail = item;
\r
2630 removeItem(item) {
\r
2631 if (item === this._head && item === this._tail) {
\r
2632 this._head = undefined;
\r
2633 this._tail = undefined;
\r
2635 else if (item === this._head) {
\r
2636 this._head = item.next;
\r
2638 else if (item === this._tail) {
\r
2639 this._tail = item.previous;
\r
2642 const next = item.next;
\r
2643 const previous = item.previous;
\r
2644 if (!next || !previous) {
\r
2645 throw new Error('Invalid list');
\r
2647 next.previous = previous;
\r
2648 previous.next = next;
\r
2651 touch(item, touch) {
\r
2652 if (!this._head || !this._tail) {
\r
2653 throw new Error('Invalid list');
\r
2655 if ((touch !== Touch.First && touch !== Touch.Last)) {
\r
2658 if (touch === Touch.First) {
\r
2659 if (item === this._head) {
\r
2662 const next = item.next;
\r
2663 const previous = item.previous;
\r
2664 // Unlink the item
\r
2665 if (item === this._tail) {
\r
2666 // previous must be defined since item was not head but is tail
\r
2667 // So there are more than on item in the map
\r
2668 previous.next = undefined;
\r
2669 this._tail = previous;
\r
2672 // Both next and previous are not undefined since item was neither head nor tail.
\r
2673 next.previous = previous;
\r
2674 previous.next = next;
\r
2676 // Insert the node at head
\r
2677 item.previous = undefined;
\r
2678 item.next = this._head;
\r
2679 this._head.previous = item;
\r
2680 this._head = item;
\r
2682 else if (touch === Touch.Last) {
\r
2683 if (item === this._tail) {
\r
2686 const next = item.next;
\r
2687 const previous = item.previous;
\r
2688 // Unlink the item.
\r
2689 if (item === this._head) {
\r
2690 // next must be defined since item was not tail but is head
\r
2691 // So there are more than on item in the map
\r
2692 next.previous = undefined;
\r
2693 this._head = next;
\r
2696 // Both next and previous are not undefined since item was neither head nor tail.
\r
2697 next.previous = previous;
\r
2698 previous.next = next;
\r
2700 item.next = undefined;
\r
2701 item.previous = this._tail;
\r
2702 this._tail.next = item;
\r
2703 this._tail = item;
\r
2707 exports.LinkedMap = LinkedMap;
\r
2712 /***/ (function(module, exports, __webpack_require__) {
2715 /* --------------------------------------------------------------------------------------------
\r
2716 * Copyright (c) Microsoft Corporation. All rights reserved.
\r
2717 * Licensed under the MIT License. See License.txt in the project root for license information.
\r
2718 * ------------------------------------------------------------------------------------------ */
\r
2720 Object.defineProperty(exports, "__esModule", { value: true });
\r
2721 const path_1 = __webpack_require__(1);
\r
2722 const os_1 = __webpack_require__(13);
\r
2723 const crypto_1 = __webpack_require__(14);
\r
2724 const net_1 = __webpack_require__(15);
\r
2725 const messageReader_1 = __webpack_require__(7);
\r
2726 const messageWriter_1 = __webpack_require__(9);
\r
2727 function generateRandomPipeName() {
\r
2728 const randomSuffix = crypto_1.randomBytes(21).toString('hex');
\r
2729 if (process.platform === 'win32') {
\r
2730 return `\\\\.\\pipe\\vscode-jsonrpc-${randomSuffix}-sock`;
\r
2733 // Mac/Unix: use socket file
\r
2734 return path_1.join(os_1.tmpdir(), `vscode-${randomSuffix}.sock`);
\r
2737 exports.generateRandomPipeName = generateRandomPipeName;
\r
2738 function createClientPipeTransport(pipeName, encoding = 'utf-8') {
\r
2739 let connectResolve;
\r
2740 let connected = new Promise((resolve, _reject) => {
\r
2741 connectResolve = resolve;
\r
2743 return new Promise((resolve, reject) => {
\r
2744 let server = net_1.createServer((socket) => {
\r
2747 new messageReader_1.SocketMessageReader(socket, encoding),
\r
2748 new messageWriter_1.SocketMessageWriter(socket, encoding)
\r
2751 server.on('error', reject);
\r
2752 server.listen(pipeName, () => {
\r
2753 server.removeListener('error', reject);
\r
2755 onConnected: () => { return connected; }
\r
2760 exports.createClientPipeTransport = createClientPipeTransport;
\r
2761 function createServerPipeTransport(pipeName, encoding = 'utf-8') {
\r
2762 const socket = net_1.createConnection(pipeName);
\r
2764 new messageReader_1.SocketMessageReader(socket, encoding),
\r
2765 new messageWriter_1.SocketMessageWriter(socket, encoding)
\r
2768 exports.createServerPipeTransport = createServerPipeTransport;
\r
2773 /***/ (function(module, exports) {
2775 module.exports = require("os");
2779 /***/ (function(module, exports) {
2781 module.exports = require("crypto");
2785 /***/ (function(module, exports) {
2787 module.exports = require("net");
2791 /***/ (function(module, exports, __webpack_require__) {
2794 /* --------------------------------------------------------------------------------------------
\r
2795 * Copyright (c) Microsoft Corporation. All rights reserved.
\r
2796 * Licensed under the MIT License. See License.txt in the project root for license information.
\r
2797 * ------------------------------------------------------------------------------------------ */
\r
2799 Object.defineProperty(exports, "__esModule", { value: true });
\r
2800 const net_1 = __webpack_require__(15);
\r
2801 const messageReader_1 = __webpack_require__(7);
\r
2802 const messageWriter_1 = __webpack_require__(9);
\r
2803 function createClientSocketTransport(port, encoding = 'utf-8') {
\r
2804 let connectResolve;
\r
2805 let connected = new Promise((resolve, _reject) => {
\r
2806 connectResolve = resolve;
\r
2808 return new Promise((resolve, reject) => {
\r
2809 let server = net_1.createServer((socket) => {
\r
2812 new messageReader_1.SocketMessageReader(socket, encoding),
\r
2813 new messageWriter_1.SocketMessageWriter(socket, encoding)
\r
2816 server.on('error', reject);
\r
2817 server.listen(port, '127.0.0.1', () => {
\r
2818 server.removeListener('error', reject);
\r
2820 onConnected: () => { return connected; }
\r
2825 exports.createClientSocketTransport = createClientSocketTransport;
\r
2826 function createServerSocketTransport(port, encoding = 'utf-8') {
\r
2827 const socket = net_1.createConnection(port, '127.0.0.1');
\r
2829 new messageReader_1.SocketMessageReader(socket, encoding),
\r
2830 new messageWriter_1.SocketMessageWriter(socket, encoding)
\r
2833 exports.createServerSocketTransport = createServerSocketTransport;
\r
2838 /***/ (function(module, __webpack_exports__, __webpack_require__) {
2841 __webpack_require__.r(__webpack_exports__);
2842 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Position", function() { return Position; });
2843 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Range", function() { return Range; });
2844 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Location", function() { return Location; });
2845 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LocationLink", function() { return LocationLink; });
2846 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Color", function() { return Color; });
2847 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColorInformation", function() { return ColorInformation; });
2848 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColorPresentation", function() { return ColorPresentation; });
2849 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FoldingRangeKind", function() { return FoldingRangeKind; });
2850 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FoldingRange", function() { return FoldingRange; });
2851 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiagnosticRelatedInformation", function() { return DiagnosticRelatedInformation; });
2852 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiagnosticSeverity", function() { return DiagnosticSeverity; });
2853 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiagnosticTag", function() { return DiagnosticTag; });
2854 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Diagnostic", function() { return Diagnostic; });
2855 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Command", function() { return Command; });
2856 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextEdit", function() { return TextEdit; });
2857 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextDocumentEdit", function() { return TextDocumentEdit; });
2858 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CreateFile", function() { return CreateFile; });
2859 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RenameFile", function() { return RenameFile; });
2860 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DeleteFile", function() { return DeleteFile; });
2861 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WorkspaceEdit", function() { return WorkspaceEdit; });
2862 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WorkspaceChange", function() { return WorkspaceChange; });
2863 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextDocumentIdentifier", function() { return TextDocumentIdentifier; });
2864 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VersionedTextDocumentIdentifier", function() { return VersionedTextDocumentIdentifier; });
2865 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextDocumentItem", function() { return TextDocumentItem; });
2866 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkupKind", function() { return MarkupKind; });
2867 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkupContent", function() { return MarkupContent; });
2868 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItemKind", function() { return CompletionItemKind; });
2869 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InsertTextFormat", function() { return InsertTextFormat; });
2870 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItem", function() { return CompletionItem; });
2871 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionList", function() { return CompletionList; });
2872 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkedString", function() { return MarkedString; });
2873 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Hover", function() { return Hover; });
2874 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ParameterInformation", function() { return ParameterInformation; });
2875 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SignatureInformation", function() { return SignatureInformation; });
2876 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentHighlightKind", function() { return DocumentHighlightKind; });
2877 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentHighlight", function() { return DocumentHighlight; });
2878 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SymbolKind", function() { return SymbolKind; });
2879 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SymbolInformation", function() { return SymbolInformation; });
2880 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentSymbol", function() { return DocumentSymbol; });
2881 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeActionKind", function() { return CodeActionKind; });
2882 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeActionContext", function() { return CodeActionContext; });
2883 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeAction", function() { return CodeAction; });
2884 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeLens", function() { return CodeLens; });
2885 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormattingOptions", function() { return FormattingOptions; });
2886 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentLink", function() { return DocumentLink; });
2887 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EOL", function() { return EOL; });
2888 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextDocument", function() { return TextDocument; });
2889 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextDocumentSaveReason", function() { return TextDocumentSaveReason; });
2890 /* --------------------------------------------------------------------------------------------
\r
2891 * Copyright (c) Microsoft Corporation. All rights reserved.
\r
2892 * Licensed under the MIT License. See License.txt in the project root for license information.
\r
2893 * ------------------------------------------------------------------------------------------ */
\r
2896 * The Position namespace provides helper functions to work with
\r
2897 * [Position](#Position) literals.
\r
2900 (function (Position) {
\r
2902 * Creates a new Position literal from the given line and character.
\r
2903 * @param line The position's line.
\r
2904 * @param character The position's character.
\r
2906 function create(line, character) {
\r
2907 return { line: line, character: character };
\r
2909 Position.create = create;
\r
2911 * Checks whether the given liternal conforms to the [Position](#Position) interface.
\r
2913 function is(value) {
\r
2914 var candidate = value;
\r
2915 return Is.objectLiteral(candidate) && Is.number(candidate.line) && Is.number(candidate.character);
\r
2918 })(Position || (Position = {}));
\r
2920 * The Range namespace provides helper functions to work with
\r
2921 * [Range](#Range) literals.
\r
2924 (function (Range) {
\r
2925 function create(one, two, three, four) {
\r
2926 if (Is.number(one) && Is.number(two) && Is.number(three) && Is.number(four)) {
\r
2927 return { start: Position.create(one, two), end: Position.create(three, four) };
\r
2929 else if (Position.is(one) && Position.is(two)) {
\r
2930 return { start: one, end: two };
\r
2933 throw new Error("Range#create called with invalid arguments[" + one + ", " + two + ", " + three + ", " + four + "]");
\r
2936 Range.create = create;
\r
2938 * Checks whether the given literal conforms to the [Range](#Range) interface.
\r
2940 function is(value) {
\r
2941 var candidate = value;
\r
2942 return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);
\r
2945 })(Range || (Range = {}));
\r
2947 * The Location namespace provides helper functions to work with
\r
2948 * [Location](#Location) literals.
\r
2951 (function (Location) {
\r
2953 * Creates a Location literal.
\r
2954 * @param uri The location's uri.
\r
2955 * @param range The location's range.
\r
2957 function create(uri, range) {
\r
2958 return { uri: uri, range: range };
\r
2960 Location.create = create;
\r
2962 * Checks whether the given literal conforms to the [Location](#Location) interface.
\r
2964 function is(value) {
\r
2965 var candidate = value;
\r
2966 return Is.defined(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri));
\r
2969 })(Location || (Location = {}));
\r
2971 * The LocationLink namespace provides helper functions to work with
\r
2972 * [LocationLink](#LocationLink) literals.
\r
2975 (function (LocationLink) {
\r
2977 * Creates a LocationLink literal.
\r
2978 * @param targetUri The definition's uri.
\r
2979 * @param targetRange The full range of the definition.
\r
2980 * @param targetSelectionRange The span of the symbol definition at the target.
\r
2981 * @param originSelectionRange The span of the symbol being defined in the originating source file.
\r
2983 function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) {
\r
2984 return { targetUri: targetUri, targetRange: targetRange, targetSelectionRange: targetSelectionRange, originSelectionRange: originSelectionRange };
\r
2986 LocationLink.create = create;
\r
2988 * Checks whether the given literal conforms to the [LocationLink](#LocationLink) interface.
\r
2990 function is(value) {
\r
2991 var candidate = value;
\r
2992 return Is.defined(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri)
\r
2993 && (Range.is(candidate.targetSelectionRange) || Is.undefined(candidate.targetSelectionRange))
\r
2994 && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange));
\r
2996 LocationLink.is = is;
\r
2997 })(LocationLink || (LocationLink = {}));
\r
2999 * The Color namespace provides helper functions to work with
\r
3000 * [Color](#Color) literals.
\r
3003 (function (Color) {
\r
3005 * Creates a new Color literal.
\r
3007 function create(red, green, blue, alpha) {
\r
3015 Color.create = create;
\r
3017 * Checks whether the given literal conforms to the [Color](#Color) interface.
\r
3019 function is(value) {
\r
3020 var candidate = value;
\r
3021 return Is.number(candidate.red)
\r
3022 && Is.number(candidate.green)
\r
3023 && Is.number(candidate.blue)
\r
3024 && Is.number(candidate.alpha);
\r
3027 })(Color || (Color = {}));
\r
3029 * The ColorInformation namespace provides helper functions to work with
\r
3030 * [ColorInformation](#ColorInformation) literals.
\r
3032 var ColorInformation;
\r
3033 (function (ColorInformation) {
\r
3035 * Creates a new ColorInformation literal.
\r
3037 function create(range, color) {
\r
3043 ColorInformation.create = create;
\r
3045 * Checks whether the given literal conforms to the [ColorInformation](#ColorInformation) interface.
\r
3047 function is(value) {
\r
3048 var candidate = value;
\r
3049 return Range.is(candidate.range) && Color.is(candidate.color);
\r
3051 ColorInformation.is = is;
\r
3052 })(ColorInformation || (ColorInformation = {}));
\r
3054 * The Color namespace provides helper functions to work with
\r
3055 * [ColorPresentation](#ColorPresentation) literals.
\r
3057 var ColorPresentation;
\r
3058 (function (ColorPresentation) {
\r
3060 * Creates a new ColorInformation literal.
\r
3062 function create(label, textEdit, additionalTextEdits) {
\r
3065 textEdit: textEdit,
\r
3066 additionalTextEdits: additionalTextEdits,
\r
3069 ColorPresentation.create = create;
\r
3071 * Checks whether the given literal conforms to the [ColorInformation](#ColorInformation) interface.
\r
3073 function is(value) {
\r
3074 var candidate = value;
\r
3075 return Is.string(candidate.label)
\r
3076 && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate))
\r
3077 && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is));
\r
3079 ColorPresentation.is = is;
\r
3080 })(ColorPresentation || (ColorPresentation = {}));
\r
3082 * Enum of known range kinds
\r
3084 var FoldingRangeKind;
\r
3085 (function (FoldingRangeKind) {
\r
3087 * Folding range for a comment
\r
3089 FoldingRangeKind["Comment"] = "comment";
\r
3091 * Folding range for a imports or includes
\r
3093 FoldingRangeKind["Imports"] = "imports";
\r
3095 * Folding range for a region (e.g. `#region`)
\r
3097 FoldingRangeKind["Region"] = "region";
\r
3098 })(FoldingRangeKind || (FoldingRangeKind = {}));
\r
3100 * The folding range namespace provides helper functions to work with
\r
3101 * [FoldingRange](#FoldingRange) literals.
\r
3104 (function (FoldingRange) {
\r
3106 * Creates a new FoldingRange literal.
\r
3108 function create(startLine, endLine, startCharacter, endCharacter, kind) {
\r
3110 startLine: startLine,
\r
3113 if (Is.defined(startCharacter)) {
\r
3114 result.startCharacter = startCharacter;
\r
3116 if (Is.defined(endCharacter)) {
\r
3117 result.endCharacter = endCharacter;
\r
3119 if (Is.defined(kind)) {
\r
3120 result.kind = kind;
\r
3124 FoldingRange.create = create;
\r
3126 * Checks whether the given literal conforms to the [FoldingRange](#FoldingRange) interface.
\r
3128 function is(value) {
\r
3129 var candidate = value;
\r
3130 return Is.number(candidate.startLine) && Is.number(candidate.startLine)
\r
3131 && (Is.undefined(candidate.startCharacter) || Is.number(candidate.startCharacter))
\r
3132 && (Is.undefined(candidate.endCharacter) || Is.number(candidate.endCharacter))
\r
3133 && (Is.undefined(candidate.kind) || Is.string(candidate.kind));
\r
3135 FoldingRange.is = is;
\r
3136 })(FoldingRange || (FoldingRange = {}));
\r
3138 * The DiagnosticRelatedInformation namespace provides helper functions to work with
\r
3139 * [DiagnosticRelatedInformation](#DiagnosticRelatedInformation) literals.
\r
3141 var DiagnosticRelatedInformation;
\r
3142 (function (DiagnosticRelatedInformation) {
\r
3144 * Creates a new DiagnosticRelatedInformation literal.
\r
3146 function create(location, message) {
\r
3148 location: location,
\r
3152 DiagnosticRelatedInformation.create = create;
\r
3154 * Checks whether the given literal conforms to the [DiagnosticRelatedInformation](#DiagnosticRelatedInformation) interface.
\r
3156 function is(value) {
\r
3157 var candidate = value;
\r
3158 return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message);
\r
3160 DiagnosticRelatedInformation.is = is;
\r
3161 })(DiagnosticRelatedInformation || (DiagnosticRelatedInformation = {}));
\r
3163 * The diagnostic's severity.
\r
3165 var DiagnosticSeverity;
\r
3166 (function (DiagnosticSeverity) {
\r
3168 * Reports an error.
\r
3170 DiagnosticSeverity.Error = 1;
\r
3172 * Reports a warning.
\r
3174 DiagnosticSeverity.Warning = 2;
\r
3176 * Reports an information.
\r
3178 DiagnosticSeverity.Information = 3;
\r
3182 DiagnosticSeverity.Hint = 4;
\r
3183 })(DiagnosticSeverity || (DiagnosticSeverity = {}));
\r
3184 var DiagnosticTag;
\r
3185 (function (DiagnosticTag) {
\r
3187 * Unused or unnecessary code.
\r
3189 * Clients are allowed to render diagnostics with this tag faded out instead of having
\r
3190 * an error squiggle.
\r
3192 DiagnosticTag.Unnecessary = 1;
\r
3193 })(DiagnosticTag || (DiagnosticTag = {}));
\r
3195 * The Diagnostic namespace provides helper functions to work with
\r
3196 * [Diagnostic](#Diagnostic) literals.
\r
3199 (function (Diagnostic) {
\r
3201 * Creates a new Diagnostic literal.
\r
3203 function create(range, message, severity, code, source, relatedInformation) {
\r
3204 var result = { range: range, message: message };
\r
3205 if (Is.defined(severity)) {
\r
3206 result.severity = severity;
\r
3208 if (Is.defined(code)) {
\r
3209 result.code = code;
\r
3211 if (Is.defined(source)) {
\r
3212 result.source = source;
\r
3214 if (Is.defined(relatedInformation)) {
\r
3215 result.relatedInformation = relatedInformation;
\r
3219 Diagnostic.create = create;
\r
3221 * Checks whether the given literal conforms to the [Diagnostic](#Diagnostic) interface.
\r
3223 function is(value) {
\r
3224 var candidate = value;
\r
3225 return Is.defined(candidate)
\r
3226 && Range.is(candidate.range)
\r
3227 && Is.string(candidate.message)
\r
3228 && (Is.number(candidate.severity) || Is.undefined(candidate.severity))
\r
3229 && (Is.number(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code))
\r
3230 && (Is.string(candidate.source) || Is.undefined(candidate.source))
\r
3231 && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is));
\r
3233 Diagnostic.is = is;
\r
3234 })(Diagnostic || (Diagnostic = {}));
\r
3236 * The Command namespace provides helper functions to work with
\r
3237 * [Command](#Command) literals.
\r
3240 (function (Command) {
\r
3242 * Creates a new Command literal.
\r
3244 function create(title, command) {
\r
3246 for (var _i = 2; _i < arguments.length; _i++) {
\r
3247 args[_i - 2] = arguments[_i];
\r
3249 var result = { title: title, command: command };
\r
3250 if (Is.defined(args) && args.length > 0) {
\r
3251 result.arguments = args;
\r
3255 Command.create = create;
\r
3257 * Checks whether the given literal conforms to the [Command](#Command) interface.
\r
3259 function is(value) {
\r
3260 var candidate = value;
\r
3261 return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command);
\r
3264 })(Command || (Command = {}));
\r
3266 * The TextEdit namespace provides helper function to create replace,
\r
3267 * insert and delete edits more easily.
\r
3270 (function (TextEdit) {
\r
3272 * Creates a replace text edit.
\r
3273 * @param range The range of text to be replaced.
\r
3274 * @param newText The new text.
\r
3276 function replace(range, newText) {
\r
3277 return { range: range, newText: newText };
\r
3279 TextEdit.replace = replace;
\r
3281 * Creates a insert text edit.
\r
3282 * @param position The position to insert the text at.
\r
3283 * @param newText The text to be inserted.
\r
3285 function insert(position, newText) {
\r
3286 return { range: { start: position, end: position }, newText: newText };
\r
3288 TextEdit.insert = insert;
\r
3290 * Creates a delete text edit.
\r
3291 * @param range The range of text to be deleted.
\r
3293 function del(range) {
\r
3294 return { range: range, newText: '' };
\r
3296 TextEdit.del = del;
\r
3297 function is(value) {
\r
3298 var candidate = value;
\r
3299 return Is.objectLiteral(candidate)
\r
3300 && Is.string(candidate.newText)
\r
3301 && Range.is(candidate.range);
\r
3304 })(TextEdit || (TextEdit = {}));
\r
3306 * The TextDocumentEdit namespace provides helper function to create
\r
3307 * an edit that manipulates a text document.
\r
3309 var TextDocumentEdit;
\r
3310 (function (TextDocumentEdit) {
\r
3312 * Creates a new `TextDocumentEdit`
\r
3314 function create(textDocument, edits) {
\r
3315 return { textDocument: textDocument, edits: edits };
\r
3317 TextDocumentEdit.create = create;
\r
3318 function is(value) {
\r
3319 var candidate = value;
\r
3320 return Is.defined(candidate)
\r
3321 && VersionedTextDocumentIdentifier.is(candidate.textDocument)
\r
3322 && Array.isArray(candidate.edits);
\r
3324 TextDocumentEdit.is = is;
\r
3325 })(TextDocumentEdit || (TextDocumentEdit = {}));
\r
3327 (function (CreateFile) {
\r
3328 function create(uri, options) {
\r
3333 if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) {
\r
3334 result.options = options;
\r
3338 CreateFile.create = create;
\r
3339 function is(value) {
\r
3340 var candidate = value;
\r
3341 return candidate && candidate.kind === 'create' && Is.string(candidate.uri) &&
\r
3342 (candidate.options === void 0 ||
\r
3343 ((candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))));
\r
3345 CreateFile.is = is;
\r
3346 })(CreateFile || (CreateFile = {}));
\r
3348 (function (RenameFile) {
\r
3349 function create(oldUri, newUri, options) {
\r
3355 if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) {
\r
3356 result.options = options;
\r
3360 RenameFile.create = create;
\r
3361 function is(value) {
\r
3362 var candidate = value;
\r
3363 return candidate && candidate.kind === 'rename' && Is.string(candidate.oldUri) && Is.string(candidate.newUri) &&
\r
3364 (candidate.options === void 0 ||
\r
3365 ((candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))));
\r
3367 RenameFile.is = is;
\r
3368 })(RenameFile || (RenameFile = {}));
\r
3370 (function (DeleteFile) {
\r
3371 function create(uri, options) {
\r
3376 if (options !== void 0 && (options.recursive !== void 0 || options.ignoreIfNotExists !== void 0)) {
\r
3377 result.options = options;
\r
3381 DeleteFile.create = create;
\r
3382 function is(value) {
\r
3383 var candidate = value;
\r
3384 return candidate && candidate.kind === 'delete' && Is.string(candidate.uri) &&
\r
3385 (candidate.options === void 0 ||
\r
3386 ((candidate.options.recursive === void 0 || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === void 0 || Is.boolean(candidate.options.ignoreIfNotExists))));
\r
3388 DeleteFile.is = is;
\r
3389 })(DeleteFile || (DeleteFile = {}));
\r
3390 var WorkspaceEdit;
\r
3391 (function (WorkspaceEdit) {
\r
3392 function is(value) {
\r
3393 var candidate = value;
\r
3394 return candidate &&
\r
3395 (candidate.changes !== void 0 || candidate.documentChanges !== void 0) &&
\r
3396 (candidate.documentChanges === void 0 || candidate.documentChanges.every(function (change) {
\r
3397 if (Is.string(change.kind)) {
\r
3398 return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change);
\r
3401 return TextDocumentEdit.is(change);
\r
3405 WorkspaceEdit.is = is;
\r
3406 })(WorkspaceEdit || (WorkspaceEdit = {}));
\r
3407 var TextEditChangeImpl = /** @class */ (function () {
\r
3408 function TextEditChangeImpl(edits) {
\r
3409 this.edits = edits;
\r
3411 TextEditChangeImpl.prototype.insert = function (position, newText) {
\r
3412 this.edits.push(TextEdit.insert(position, newText));
\r
3414 TextEditChangeImpl.prototype.replace = function (range, newText) {
\r
3415 this.edits.push(TextEdit.replace(range, newText));
\r
3417 TextEditChangeImpl.prototype.delete = function (range) {
\r
3418 this.edits.push(TextEdit.del(range));
\r
3420 TextEditChangeImpl.prototype.add = function (edit) {
\r
3421 this.edits.push(edit);
\r
3423 TextEditChangeImpl.prototype.all = function () {
\r
3424 return this.edits;
\r
3426 TextEditChangeImpl.prototype.clear = function () {
\r
3427 this.edits.splice(0, this.edits.length);
\r
3429 return TextEditChangeImpl;
\r
3432 * A workspace change helps constructing changes to a workspace.
\r
3434 var WorkspaceChange = /** @class */ (function () {
\r
3435 function WorkspaceChange(workspaceEdit) {
\r
3437 this._textEditChanges = Object.create(null);
\r
3438 if (workspaceEdit) {
\r
3439 this._workspaceEdit = workspaceEdit;
\r
3440 if (workspaceEdit.documentChanges) {
\r
3441 workspaceEdit.documentChanges.forEach(function (change) {
\r
3442 if (TextDocumentEdit.is(change)) {
\r
3443 var textEditChange = new TextEditChangeImpl(change.edits);
\r
3444 _this._textEditChanges[change.textDocument.uri] = textEditChange;
\r
3448 else if (workspaceEdit.changes) {
\r
3449 Object.keys(workspaceEdit.changes).forEach(function (key) {
\r
3450 var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]);
\r
3451 _this._textEditChanges[key] = textEditChange;
\r
3456 Object.defineProperty(WorkspaceChange.prototype, "edit", {
\r
3458 * Returns the underlying [WorkspaceEdit](#WorkspaceEdit) literal
\r
3459 * use to be returned from a workspace edit operation like rename.
\r
3461 get: function () {
\r
3462 return this._workspaceEdit;
\r
3465 configurable: true
\r
3467 WorkspaceChange.prototype.getTextEditChange = function (key) {
\r
3468 if (VersionedTextDocumentIdentifier.is(key)) {
\r
3469 if (!this._workspaceEdit) {
\r
3470 this._workspaceEdit = {
\r
3471 documentChanges: []
\r
3474 if (!this._workspaceEdit.documentChanges) {
\r
3475 throw new Error('Workspace edit is not configured for document changes.');
\r
3477 var textDocument = key;
\r
3478 var result = this._textEditChanges[textDocument.uri];
\r
3481 var textDocumentEdit = {
\r
3482 textDocument: textDocument,
\r
3485 this._workspaceEdit.documentChanges.push(textDocumentEdit);
\r
3486 result = new TextEditChangeImpl(edits);
\r
3487 this._textEditChanges[textDocument.uri] = result;
\r
3492 if (!this._workspaceEdit) {
\r
3493 this._workspaceEdit = {
\r
3494 changes: Object.create(null)
\r
3497 if (!this._workspaceEdit.changes) {
\r
3498 throw new Error('Workspace edit is not configured for normal text edit changes.');
\r
3500 var result = this._textEditChanges[key];
\r
3503 this._workspaceEdit.changes[key] = edits;
\r
3504 result = new TextEditChangeImpl(edits);
\r
3505 this._textEditChanges[key] = result;
\r
3510 WorkspaceChange.prototype.createFile = function (uri, options) {
\r
3511 this.checkDocumentChanges();
\r
3512 this._workspaceEdit.documentChanges.push(CreateFile.create(uri, options));
\r
3514 WorkspaceChange.prototype.renameFile = function (oldUri, newUri, options) {
\r
3515 this.checkDocumentChanges();
\r
3516 this._workspaceEdit.documentChanges.push(RenameFile.create(oldUri, newUri, options));
\r
3518 WorkspaceChange.prototype.deleteFile = function (uri, options) {
\r
3519 this.checkDocumentChanges();
\r
3520 this._workspaceEdit.documentChanges.push(DeleteFile.create(uri, options));
\r
3522 WorkspaceChange.prototype.checkDocumentChanges = function () {
\r
3523 if (!this._workspaceEdit || !this._workspaceEdit.documentChanges) {
\r
3524 throw new Error('Workspace edit is not configured for document changes.');
\r
3527 return WorkspaceChange;
\r
3531 * The TextDocumentIdentifier namespace provides helper functions to work with
\r
3532 * [TextDocumentIdentifier](#TextDocumentIdentifier) literals.
\r
3534 var TextDocumentIdentifier;
\r
3535 (function (TextDocumentIdentifier) {
\r
3537 * Creates a new TextDocumentIdentifier literal.
\r
3538 * @param uri The document's uri.
\r
3540 function create(uri) {
\r
3541 return { uri: uri };
\r
3543 TextDocumentIdentifier.create = create;
\r
3545 * Checks whether the given literal conforms to the [TextDocumentIdentifier](#TextDocumentIdentifier) interface.
\r
3547 function is(value) {
\r
3548 var candidate = value;
\r
3549 return Is.defined(candidate) && Is.string(candidate.uri);
\r
3551 TextDocumentIdentifier.is = is;
\r
3552 })(TextDocumentIdentifier || (TextDocumentIdentifier = {}));
\r
3554 * The VersionedTextDocumentIdentifier namespace provides helper functions to work with
\r
3555 * [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) literals.
\r
3557 var VersionedTextDocumentIdentifier;
\r
3558 (function (VersionedTextDocumentIdentifier) {
\r
3560 * Creates a new VersionedTextDocumentIdentifier literal.
\r
3561 * @param uri The document's uri.
\r
3562 * @param uri The document's text.
\r
3564 function create(uri, version) {
\r
3565 return { uri: uri, version: version };
\r
3567 VersionedTextDocumentIdentifier.create = create;
\r
3569 * Checks whether the given literal conforms to the [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) interface.
\r
3571 function is(value) {
\r
3572 var candidate = value;
\r
3573 return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.number(candidate.version));
\r
3575 VersionedTextDocumentIdentifier.is = is;
\r
3576 })(VersionedTextDocumentIdentifier || (VersionedTextDocumentIdentifier = {}));
\r
3578 * The TextDocumentItem namespace provides helper functions to work with
\r
3579 * [TextDocumentItem](#TextDocumentItem) literals.
\r
3581 var TextDocumentItem;
\r
3582 (function (TextDocumentItem) {
\r
3584 * Creates a new TextDocumentItem literal.
\r
3585 * @param uri The document's uri.
\r
3586 * @param languageId The document's language identifier.
\r
3587 * @param version The document's version number.
\r
3588 * @param text The document's text.
\r
3590 function create(uri, languageId, version, text) {
\r
3591 return { uri: uri, languageId: languageId, version: version, text: text };
\r
3593 TextDocumentItem.create = create;
\r
3595 * Checks whether the given literal conforms to the [TextDocumentItem](#TextDocumentItem) interface.
\r
3597 function is(value) {
\r
3598 var candidate = value;
\r
3599 return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.number(candidate.version) && Is.string(candidate.text);
\r
3601 TextDocumentItem.is = is;
\r
3602 })(TextDocumentItem || (TextDocumentItem = {}));
\r
3604 * Describes the content type that a client supports in various
\r
3605 * result literals like `Hover`, `ParameterInfo` or `CompletionItem`.
\r
3607 * Please note that `MarkupKinds` must not start with a `$`. This kinds
\r
3608 * are reserved for internal usage.
\r
3611 (function (MarkupKind) {
\r
3613 * Plain text is supported as a content format
\r
3615 MarkupKind.PlainText = 'plaintext';
\r
3617 * Markdown is supported as a content format
\r
3619 MarkupKind.Markdown = 'markdown';
\r
3620 })(MarkupKind || (MarkupKind = {}));
\r
3621 (function (MarkupKind) {
\r
3623 * Checks whether the given value is a value of the [MarkupKind](#MarkupKind) type.
\r
3625 function is(value) {
\r
3626 var candidate = value;
\r
3627 return candidate === MarkupKind.PlainText || candidate === MarkupKind.Markdown;
\r
3629 MarkupKind.is = is;
\r
3630 })(MarkupKind || (MarkupKind = {}));
\r
3631 var MarkupContent;
\r
3632 (function (MarkupContent) {
\r
3634 * Checks whether the given value conforms to the [MarkupContent](#MarkupContent) interface.
\r
3636 function is(value) {
\r
3637 var candidate = value;
\r
3638 return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);
\r
3640 MarkupContent.is = is;
\r
3641 })(MarkupContent || (MarkupContent = {}));
\r
3643 * The kind of a completion entry.
\r
3645 var CompletionItemKind;
\r
3646 (function (CompletionItemKind) {
\r
3647 CompletionItemKind.Text = 1;
\r
3648 CompletionItemKind.Method = 2;
\r
3649 CompletionItemKind.Function = 3;
\r
3650 CompletionItemKind.Constructor = 4;
\r
3651 CompletionItemKind.Field = 5;
\r
3652 CompletionItemKind.Variable = 6;
\r
3653 CompletionItemKind.Class = 7;
\r
3654 CompletionItemKind.Interface = 8;
\r
3655 CompletionItemKind.Module = 9;
\r
3656 CompletionItemKind.Property = 10;
\r
3657 CompletionItemKind.Unit = 11;
\r
3658 CompletionItemKind.Value = 12;
\r
3659 CompletionItemKind.Enum = 13;
\r
3660 CompletionItemKind.Keyword = 14;
\r
3661 CompletionItemKind.Snippet = 15;
\r
3662 CompletionItemKind.Color = 16;
\r
3663 CompletionItemKind.File = 17;
\r
3664 CompletionItemKind.Reference = 18;
\r
3665 CompletionItemKind.Folder = 19;
\r
3666 CompletionItemKind.EnumMember = 20;
\r
3667 CompletionItemKind.Constant = 21;
\r
3668 CompletionItemKind.Struct = 22;
\r
3669 CompletionItemKind.Event = 23;
\r
3670 CompletionItemKind.Operator = 24;
\r
3671 CompletionItemKind.TypeParameter = 25;
\r
3672 })(CompletionItemKind || (CompletionItemKind = {}));
\r
3674 * Defines whether the insert text in a completion item should be interpreted as
\r
3675 * plain text or a snippet.
\r
3677 var InsertTextFormat;
\r
3678 (function (InsertTextFormat) {
\r
3680 * The primary text to be inserted is treated as a plain string.
\r
3682 InsertTextFormat.PlainText = 1;
\r
3684 * The primary text to be inserted is treated as a snippet.
\r
3686 * A snippet can define tab stops and placeholders with `$1`, `$2`
\r
3687 * and `${3:foo}`. `$0` defines the final tab stop, it defaults to
\r
3688 * the end of the snippet. Placeholders with equal identifiers are linked,
\r
3689 * that is typing in one will update others too.
\r
3691 * See also: https://github.com/Microsoft/vscode/blob/master/src/vs/editor/contrib/snippet/common/snippet.md
\r
3693 InsertTextFormat.Snippet = 2;
\r
3694 })(InsertTextFormat || (InsertTextFormat = {}));
\r
3696 * The CompletionItem namespace provides functions to deal with
\r
3697 * completion items.
\r
3699 var CompletionItem;
\r
3700 (function (CompletionItem) {
\r
3702 * Create a completion item and seed it with a label.
\r
3703 * @param label The completion item's label
\r
3705 function create(label) {
\r
3706 return { label: label };
\r
3708 CompletionItem.create = create;
\r
3709 })(CompletionItem || (CompletionItem = {}));
\r
3711 * The CompletionList namespace provides functions to deal with
\r
3712 * completion lists.
\r
3714 var CompletionList;
\r
3715 (function (CompletionList) {
\r
3717 * Creates a new completion list.
\r
3719 * @param items The completion items.
\r
3720 * @param isIncomplete The list is not complete.
\r
3722 function create(items, isIncomplete) {
\r
3723 return { items: items ? items : [], isIncomplete: !!isIncomplete };
\r
3725 CompletionList.create = create;
\r
3726 })(CompletionList || (CompletionList = {}));
\r
3728 (function (MarkedString) {
\r
3730 * Creates a marked string from plain text.
\r
3732 * @param plainText The plain text.
\r
3734 function fromPlainText(plainText) {
\r
3735 return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, "\\$&"); // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash
\r
3737 MarkedString.fromPlainText = fromPlainText;
\r
3739 * Checks whether the given value conforms to the [MarkedString](#MarkedString) type.
\r
3741 function is(value) {
\r
3742 var candidate = value;
\r
3743 return Is.string(candidate) || (Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value));
\r
3745 MarkedString.is = is;
\r
3746 })(MarkedString || (MarkedString = {}));
\r
3748 (function (Hover) {
\r
3750 * Checks whether the given value conforms to the [Hover](#Hover) interface.
\r
3752 function is(value) {
\r
3753 var candidate = value;
\r
3754 return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) ||
\r
3755 MarkedString.is(candidate.contents) ||
\r
3756 Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === void 0 || Range.is(value.range));
\r
3759 })(Hover || (Hover = {}));
\r
3761 * The ParameterInformation namespace provides helper functions to work with
\r
3762 * [ParameterInformation](#ParameterInformation) literals.
\r
3764 var ParameterInformation;
\r
3765 (function (ParameterInformation) {
\r
3767 * Creates a new parameter information literal.
\r
3769 * @param label A label string.
\r
3770 * @param documentation A doc string.
\r
3772 function create(label, documentation) {
\r
3773 return documentation ? { label: label, documentation: documentation } : { label: label };
\r
3775 ParameterInformation.create = create;
\r
3777 })(ParameterInformation || (ParameterInformation = {}));
\r
3779 * The SignatureInformation namespace provides helper functions to work with
\r
3780 * [SignatureInformation](#SignatureInformation) literals.
\r
3782 var SignatureInformation;
\r
3783 (function (SignatureInformation) {
\r
3784 function create(label, documentation) {
\r
3785 var parameters = [];
\r
3786 for (var _i = 2; _i < arguments.length; _i++) {
\r
3787 parameters[_i - 2] = arguments[_i];
\r
3789 var result = { label: label };
\r
3790 if (Is.defined(documentation)) {
\r
3791 result.documentation = documentation;
\r
3793 if (Is.defined(parameters)) {
\r
3794 result.parameters = parameters;
\r
3797 result.parameters = [];
\r
3801 SignatureInformation.create = create;
\r
3802 })(SignatureInformation || (SignatureInformation = {}));
\r
3804 * A document highlight kind.
\r
3806 var DocumentHighlightKind;
\r
3807 (function (DocumentHighlightKind) {
\r
3809 * A textual occurrence.
\r
3811 DocumentHighlightKind.Text = 1;
\r
3813 * Read-access of a symbol, like reading a variable.
\r
3815 DocumentHighlightKind.Read = 2;
\r
3817 * Write-access of a symbol, like writing to a variable.
\r
3819 DocumentHighlightKind.Write = 3;
\r
3820 })(DocumentHighlightKind || (DocumentHighlightKind = {}));
\r
3822 * DocumentHighlight namespace to provide helper functions to work with
\r
3823 * [DocumentHighlight](#DocumentHighlight) literals.
\r
3825 var DocumentHighlight;
\r
3826 (function (DocumentHighlight) {
\r
3828 * Create a DocumentHighlight object.
\r
3829 * @param range The range the highlight applies to.
\r
3831 function create(range, kind) {
\r
3832 var result = { range: range };
\r
3833 if (Is.number(kind)) {
\r
3834 result.kind = kind;
\r
3838 DocumentHighlight.create = create;
\r
3839 })(DocumentHighlight || (DocumentHighlight = {}));
\r
3844 (function (SymbolKind) {
\r
3845 SymbolKind.File = 1;
\r
3846 SymbolKind.Module = 2;
\r
3847 SymbolKind.Namespace = 3;
\r
3848 SymbolKind.Package = 4;
\r
3849 SymbolKind.Class = 5;
\r
3850 SymbolKind.Method = 6;
\r
3851 SymbolKind.Property = 7;
\r
3852 SymbolKind.Field = 8;
\r
3853 SymbolKind.Constructor = 9;
\r
3854 SymbolKind.Enum = 10;
\r
3855 SymbolKind.Interface = 11;
\r
3856 SymbolKind.Function = 12;
\r
3857 SymbolKind.Variable = 13;
\r
3858 SymbolKind.Constant = 14;
\r
3859 SymbolKind.String = 15;
\r
3860 SymbolKind.Number = 16;
\r
3861 SymbolKind.Boolean = 17;
\r
3862 SymbolKind.Array = 18;
\r
3863 SymbolKind.Object = 19;
\r
3864 SymbolKind.Key = 20;
\r
3865 SymbolKind.Null = 21;
\r
3866 SymbolKind.EnumMember = 22;
\r
3867 SymbolKind.Struct = 23;
\r
3868 SymbolKind.Event = 24;
\r
3869 SymbolKind.Operator = 25;
\r
3870 SymbolKind.TypeParameter = 26;
\r
3871 })(SymbolKind || (SymbolKind = {}));
\r
3872 var SymbolInformation;
\r
3873 (function (SymbolInformation) {
\r
3875 * Creates a new symbol information literal.
\r
3877 * @param name The name of the symbol.
\r
3878 * @param kind The kind of the symbol.
\r
3879 * @param range The range of the location of the symbol.
\r
3880 * @param uri The resource of the location of symbol, defaults to the current document.
\r
3881 * @param containerName The name of the symbol containing the symbol.
\r
3883 function create(name, kind, range, uri, containerName) {
\r
3887 location: { uri: uri, range: range }
\r
3889 if (containerName) {
\r
3890 result.containerName = containerName;
\r
3894 SymbolInformation.create = create;
\r
3895 })(SymbolInformation || (SymbolInformation = {}));
\r
3897 * Represents programming constructs like variables, classes, interfaces etc.
\r
3898 * that appear in a document. Document symbols can be hierarchical and they
\r
3899 * have two ranges: one that encloses its definition and one that points to
\r
3900 * its most interesting range, e.g. the range of an identifier.
\r
3902 var DocumentSymbol = /** @class */ (function () {
\r
3903 function DocumentSymbol() {
\r
3905 return DocumentSymbol;
\r
3908 (function (DocumentSymbol) {
\r
3910 * Creates a new symbol information literal.
\r
3912 * @param name The name of the symbol.
\r
3913 * @param detail The detail of the symbol.
\r
3914 * @param kind The kind of the symbol.
\r
3915 * @param range The range of the symbol.
\r
3916 * @param selectionRange The selectionRange of the symbol.
\r
3917 * @param children Children of the symbol.
\r
3919 function create(name, detail, kind, range, selectionRange, children) {
\r
3925 selectionRange: selectionRange
\r
3927 if (children !== void 0) {
\r
3928 result.children = children;
\r
3932 DocumentSymbol.create = create;
\r
3934 * Checks whether the given literal conforms to the [DocumentSymbol](#DocumentSymbol) interface.
\r
3936 function is(value) {
\r
3937 var candidate = value;
\r
3938 return candidate &&
\r
3939 Is.string(candidate.name) && Is.number(candidate.kind) &&
\r
3940 Range.is(candidate.range) && Range.is(candidate.selectionRange) &&
\r
3941 (candidate.detail === void 0 || Is.string(candidate.detail)) &&
\r
3942 (candidate.deprecated === void 0 || Is.boolean(candidate.deprecated)) &&
\r
3943 (candidate.children === void 0 || Array.isArray(candidate.children));
\r
3945 DocumentSymbol.is = is;
\r
3946 })(DocumentSymbol || (DocumentSymbol = {}));
\r
3948 * A set of predefined code action kinds
\r
3950 var CodeActionKind;
\r
3951 (function (CodeActionKind) {
\r
3953 * Base kind for quickfix actions: 'quickfix'
\r
3955 CodeActionKind.QuickFix = 'quickfix';
\r
3957 * Base kind for refactoring actions: 'refactor'
\r
3959 CodeActionKind.Refactor = 'refactor';
\r
3961 * Base kind for refactoring extraction actions: 'refactor.extract'
\r
3963 * Example extract actions:
\r
3965 * - Extract method
\r
3966 * - Extract function
\r
3967 * - Extract variable
\r
3968 * - Extract interface from class
\r
3971 CodeActionKind.RefactorExtract = 'refactor.extract';
\r
3973 * Base kind for refactoring inline actions: 'refactor.inline'
\r
3975 * Example inline actions:
\r
3977 * - Inline function
\r
3978 * - Inline variable
\r
3979 * - Inline constant
\r
3982 CodeActionKind.RefactorInline = 'refactor.inline';
\r
3984 * Base kind for refactoring rewrite actions: 'refactor.rewrite'
\r
3986 * Example rewrite actions:
\r
3988 * - Convert JavaScript function to class
\r
3989 * - Add or remove parameter
\r
3990 * - Encapsulate field
\r
3991 * - Make method static
\r
3992 * - Move method to base class
\r
3995 CodeActionKind.RefactorRewrite = 'refactor.rewrite';
\r
3997 * Base kind for source actions: `source`
\r
3999 * Source code actions apply to the entire file.
\r
4001 CodeActionKind.Source = 'source';
\r
4003 * Base kind for an organize imports source action: `source.organizeImports`
\r
4005 CodeActionKind.SourceOrganizeImports = 'source.organizeImports';
\r
4006 })(CodeActionKind || (CodeActionKind = {}));
\r
4008 * The CodeActionContext namespace provides helper functions to work with
\r
4009 * [CodeActionContext](#CodeActionContext) literals.
\r
4011 var CodeActionContext;
\r
4012 (function (CodeActionContext) {
\r
4014 * Creates a new CodeActionContext literal.
\r
4016 function create(diagnostics, only) {
\r
4017 var result = { diagnostics: diagnostics };
\r
4018 if (only !== void 0 && only !== null) {
\r
4019 result.only = only;
\r
4023 CodeActionContext.create = create;
\r
4025 * Checks whether the given literal conforms to the [CodeActionContext](#CodeActionContext) interface.
\r
4027 function is(value) {
\r
4028 var candidate = value;
\r
4029 return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string));
\r
4031 CodeActionContext.is = is;
\r
4032 })(CodeActionContext || (CodeActionContext = {}));
\r
4034 (function (CodeAction) {
\r
4035 function create(title, commandOrEdit, kind) {
\r
4036 var result = { title: title };
\r
4037 if (Command.is(commandOrEdit)) {
\r
4038 result.command = commandOrEdit;
\r
4041 result.edit = commandOrEdit;
\r
4043 if (kind !== void null) {
\r
4044 result.kind = kind;
\r
4048 CodeAction.create = create;
\r
4049 function is(value) {
\r
4050 var candidate = value;
\r
4051 return candidate && Is.string(candidate.title) &&
\r
4052 (candidate.diagnostics === void 0 || Is.typedArray(candidate.diagnostics, Diagnostic.is)) &&
\r
4053 (candidate.kind === void 0 || Is.string(candidate.kind)) &&
\r
4054 (candidate.edit !== void 0 || candidate.command !== void 0) &&
\r
4055 (candidate.command === void 0 || Command.is(candidate.command)) &&
\r
4056 (candidate.edit === void 0 || WorkspaceEdit.is(candidate.edit));
\r
4058 CodeAction.is = is;
\r
4059 })(CodeAction || (CodeAction = {}));
\r
4061 * The CodeLens namespace provides helper functions to work with
\r
4062 * [CodeLens](#CodeLens) literals.
\r
4065 (function (CodeLens) {
\r
4067 * Creates a new CodeLens literal.
\r
4069 function create(range, data) {
\r
4070 var result = { range: range };
\r
4071 if (Is.defined(data))
\r
4072 result.data = data;
\r
4075 CodeLens.create = create;
\r
4077 * Checks whether the given literal conforms to the [CodeLens](#CodeLens) interface.
\r
4079 function is(value) {
\r
4080 var candidate = value;
\r
4081 return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command));
\r
4084 })(CodeLens || (CodeLens = {}));
\r
4086 * The FormattingOptions namespace provides helper functions to work with
\r
4087 * [FormattingOptions](#FormattingOptions) literals.
\r
4089 var FormattingOptions;
\r
4090 (function (FormattingOptions) {
\r
4092 * Creates a new FormattingOptions literal.
\r
4094 function create(tabSize, insertSpaces) {
\r
4095 return { tabSize: tabSize, insertSpaces: insertSpaces };
\r
4097 FormattingOptions.create = create;
\r
4099 * Checks whether the given literal conforms to the [FormattingOptions](#FormattingOptions) interface.
\r
4101 function is(value) {
\r
4102 var candidate = value;
\r
4103 return Is.defined(candidate) && Is.number(candidate.tabSize) && Is.boolean(candidate.insertSpaces);
\r
4105 FormattingOptions.is = is;
\r
4106 })(FormattingOptions || (FormattingOptions = {}));
\r
4108 * A document link is a range in a text document that links to an internal or external resource, like another
\r
4109 * text document or a web site.
\r
4111 var DocumentLink = /** @class */ (function () {
\r
4112 function DocumentLink() {
\r
4114 return DocumentLink;
\r
4118 * The DocumentLink namespace provides helper functions to work with
\r
4119 * [DocumentLink](#DocumentLink) literals.
\r
4121 (function (DocumentLink) {
\r
4123 * Creates a new DocumentLink literal.
\r
4125 function create(range, target, data) {
\r
4126 return { range: range, target: target, data: data };
\r
4128 DocumentLink.create = create;
\r
4130 * Checks whether the given literal conforms to the [DocumentLink](#DocumentLink) interface.
\r
4132 function is(value) {
\r
4133 var candidate = value;
\r
4134 return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target));
\r
4136 DocumentLink.is = is;
\r
4137 })(DocumentLink || (DocumentLink = {}));
\r
4138 var EOL = ['\n', '\r\n', '\r'];
\r
4140 (function (TextDocument) {
\r
4142 * Creates a new ITextDocument literal from the given uri and content.
\r
4143 * @param uri The document's uri.
\r
4144 * @param languageId The document's language Id.
\r
4145 * @param content The document's content.
\r
4147 function create(uri, languageId, version, content) {
\r
4148 return new FullTextDocument(uri, languageId, version, content);
\r
4150 TextDocument.create = create;
\r
4152 * Checks whether the given literal conforms to the [ITextDocument](#ITextDocument) interface.
\r
4154 function is(value) {
\r
4155 var candidate = value;
\r
4156 return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.number(candidate.lineCount)
\r
4157 && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;
\r
4159 TextDocument.is = is;
\r
4160 function applyEdits(document, edits) {
\r
4161 var text = document.getText();
\r
4162 var sortedEdits = mergeSort(edits, function (a, b) {
\r
4163 var diff = a.range.start.line - b.range.start.line;
\r
4165 return a.range.start.character - b.range.start.character;
\r
4169 var lastModifiedOffset = text.length;
\r
4170 for (var i = sortedEdits.length - 1; i >= 0; i--) {
\r
4171 var e = sortedEdits[i];
\r
4172 var startOffset = document.offsetAt(e.range.start);
\r
4173 var endOffset = document.offsetAt(e.range.end);
\r
4174 if (endOffset <= lastModifiedOffset) {
\r
4175 text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length);
\r
4178 throw new Error('Overlapping edit');
\r
4180 lastModifiedOffset = startOffset;
\r
4184 TextDocument.applyEdits = applyEdits;
\r
4185 function mergeSort(data, compare) {
\r
4186 if (data.length <= 1) {
\r
4190 var p = (data.length / 2) | 0;
\r
4191 var left = data.slice(0, p);
\r
4192 var right = data.slice(p);
\r
4193 mergeSort(left, compare);
\r
4194 mergeSort(right, compare);
\r
4198 while (leftIdx < left.length && rightIdx < right.length) {
\r
4199 var ret = compare(left[leftIdx], right[rightIdx]);
\r
4201 // smaller_equal -> take left to preserve order
\r
4202 data[i++] = left[leftIdx++];
\r
4205 // greater -> take right
\r
4206 data[i++] = right[rightIdx++];
\r
4209 while (leftIdx < left.length) {
\r
4210 data[i++] = left[leftIdx++];
\r
4212 while (rightIdx < right.length) {
\r
4213 data[i++] = right[rightIdx++];
\r
4217 })(TextDocument || (TextDocument = {}));
\r
4219 * Represents reasons why a text document is saved.
\r
4221 var TextDocumentSaveReason;
\r
4222 (function (TextDocumentSaveReason) {
\r
4224 * Manually triggered, e.g. by the user pressing save, by starting debugging,
\r
4225 * or by an API call.
\r
4227 TextDocumentSaveReason.Manual = 1;
\r
4229 * Automatic after a delay.
\r
4231 TextDocumentSaveReason.AfterDelay = 2;
\r
4233 * When the editor lost focus.
\r
4235 TextDocumentSaveReason.FocusOut = 3;
\r
4236 })(TextDocumentSaveReason || (TextDocumentSaveReason = {}));
\r
4237 var FullTextDocument = /** @class */ (function () {
\r
4238 function FullTextDocument(uri, languageId, version, content) {
\r
4240 this._languageId = languageId;
\r
4241 this._version = version;
\r
4242 this._content = content;
\r
4243 this._lineOffsets = null;
\r
4245 Object.defineProperty(FullTextDocument.prototype, "uri", {
\r
4246 get: function () {
\r
4250 configurable: true
\r
4252 Object.defineProperty(FullTextDocument.prototype, "languageId", {
\r
4253 get: function () {
\r
4254 return this._languageId;
\r
4257 configurable: true
\r
4259 Object.defineProperty(FullTextDocument.prototype, "version", {
\r
4260 get: function () {
\r
4261 return this._version;
\r
4264 configurable: true
\r
4266 FullTextDocument.prototype.getText = function (range) {
\r
4268 var start = this.offsetAt(range.start);
\r
4269 var end = this.offsetAt(range.end);
\r
4270 return this._content.substring(start, end);
\r
4272 return this._content;
\r
4274 FullTextDocument.prototype.update = function (event, version) {
\r
4275 this._content = event.text;
\r
4276 this._version = version;
\r
4277 this._lineOffsets = null;
\r
4279 FullTextDocument.prototype.getLineOffsets = function () {
\r
4280 if (this._lineOffsets === null) {
\r
4281 var lineOffsets = [];
\r
4282 var text = this._content;
\r
4283 var isLineStart = true;
\r
4284 for (var i = 0; i < text.length; i++) {
\r
4285 if (isLineStart) {
\r
4286 lineOffsets.push(i);
\r
4287 isLineStart = false;
\r
4289 var ch = text.charAt(i);
\r
4290 isLineStart = (ch === '\r' || ch === '\n');
\r
4291 if (ch === '\r' && i + 1 < text.length && text.charAt(i + 1) === '\n') {
\r
4295 if (isLineStart && text.length > 0) {
\r
4296 lineOffsets.push(text.length);
\r
4298 this._lineOffsets = lineOffsets;
\r
4300 return this._lineOffsets;
\r
4302 FullTextDocument.prototype.positionAt = function (offset) {
\r
4303 offset = Math.max(Math.min(offset, this._content.length), 0);
\r
4304 var lineOffsets = this.getLineOffsets();
\r
4305 var low = 0, high = lineOffsets.length;
\r
4307 return Position.create(0, offset);
\r
4309 while (low < high) {
\r
4310 var mid = Math.floor((low + high) / 2);
\r
4311 if (lineOffsets[mid] > offset) {
\r
4318 // low is the least x for which the line offset is larger than the current offset
\r
4319 // or array.length if no line offset is larger than the current offset
\r
4320 var line = low - 1;
\r
4321 return Position.create(line, offset - lineOffsets[line]);
\r
4323 FullTextDocument.prototype.offsetAt = function (position) {
\r
4324 var lineOffsets = this.getLineOffsets();
\r
4325 if (position.line >= lineOffsets.length) {
\r
4326 return this._content.length;
\r
4328 else if (position.line < 0) {
\r
4331 var lineOffset = lineOffsets[position.line];
\r
4332 var nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length;
\r
4333 return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset);
\r
4335 Object.defineProperty(FullTextDocument.prototype, "lineCount", {
\r
4336 get: function () {
\r
4337 return this.getLineOffsets().length;
\r
4340 configurable: true
\r
4342 return FullTextDocument;
\r
4346 var toString = Object.prototype.toString;
\r
4347 function defined(value) {
\r
4348 return typeof value !== 'undefined';
\r
4350 Is.defined = defined;
\r
4351 function undefined(value) {
\r
4352 return typeof value === 'undefined';
\r
4354 Is.undefined = undefined;
\r
4355 function boolean(value) {
\r
4356 return value === true || value === false;
\r
4358 Is.boolean = boolean;
\r
4359 function string(value) {
\r
4360 return toString.call(value) === '[object String]';
\r
4362 Is.string = string;
\r
4363 function number(value) {
\r
4364 return toString.call(value) === '[object Number]';
\r
4366 Is.number = number;
\r
4367 function func(value) {
\r
4368 return toString.call(value) === '[object Function]';
\r
4371 function objectLiteral(value) {
\r
4372 // Strictly speaking class instances pass this check as well. Since the LSP
\r
4373 // doesn't use classes we ignore this for now. If we do we need to add something
\r
4374 // like this: `Object.getPrototypeOf(Object.getPrototypeOf(x)) === null`
\r
4375 return value !== null && typeof value === 'object';
\r
4377 Is.objectLiteral = objectLiteral;
\r
4378 function typedArray(value, check) {
\r
4379 return Array.isArray(value) && value.every(check);
\r
4381 Is.typedArray = typedArray;
\r
4382 })(Is || (Is = {}));
\r
4387 /***/ (function(module, exports, __webpack_require__) {
4390 /* --------------------------------------------------------------------------------------------
\r
4391 * Copyright (c) Microsoft Corporation. All rights reserved.
\r
4392 * Licensed under the MIT License. See License.txt in the project root for license information.
\r
4393 * ------------------------------------------------------------------------------------------ */
\r
4395 Object.defineProperty(exports, "__esModule", { value: true });
\r
4396 const Is = __webpack_require__(19);
\r
4397 const vscode_jsonrpc_1 = __webpack_require__(4);
\r
4398 const protocol_implementation_1 = __webpack_require__(20);
\r
4399 exports.ImplementationRequest = protocol_implementation_1.ImplementationRequest;
\r
4400 const protocol_typeDefinition_1 = __webpack_require__(21);
\r
4401 exports.TypeDefinitionRequest = protocol_typeDefinition_1.TypeDefinitionRequest;
\r
4402 const protocol_workspaceFolders_1 = __webpack_require__(22);
\r
4403 exports.WorkspaceFoldersRequest = protocol_workspaceFolders_1.WorkspaceFoldersRequest;
\r
4404 exports.DidChangeWorkspaceFoldersNotification = protocol_workspaceFolders_1.DidChangeWorkspaceFoldersNotification;
\r
4405 const protocol_configuration_1 = __webpack_require__(23);
\r
4406 exports.ConfigurationRequest = protocol_configuration_1.ConfigurationRequest;
\r
4407 const protocol_colorProvider_1 = __webpack_require__(24);
\r
4408 exports.DocumentColorRequest = protocol_colorProvider_1.DocumentColorRequest;
\r
4409 exports.ColorPresentationRequest = protocol_colorProvider_1.ColorPresentationRequest;
\r
4410 const protocol_foldingRange_1 = __webpack_require__(25);
\r
4411 exports.FoldingRangeRequest = protocol_foldingRange_1.FoldingRangeRequest;
\r
4412 const protocol_declaration_1 = __webpack_require__(26);
\r
4413 exports.DeclarationRequest = protocol_declaration_1.DeclarationRequest;
\r
4414 // @ts-ignore: to avoid inlining LocatioLink as dynamic import
\r
4415 let __noDynamicImport;
\r
4416 var DocumentFilter;
\r
4417 (function (DocumentFilter) {
\r
4418 function is(value) {
\r
4419 let candidate = value;
\r
4420 return Is.string(candidate.language) || Is.string(candidate.scheme) || Is.string(candidate.pattern);
\r
4422 DocumentFilter.is = is;
\r
4423 })(DocumentFilter = exports.DocumentFilter || (exports.DocumentFilter = {}));
\r
4425 * The `client/registerCapability` request is sent from the server to the client to register a new capability
\r
4426 * handler on the client side.
\r
4428 var RegistrationRequest;
\r
4429 (function (RegistrationRequest) {
\r
4430 RegistrationRequest.type = new vscode_jsonrpc_1.RequestType('client/registerCapability');
\r
4431 })(RegistrationRequest = exports.RegistrationRequest || (exports.RegistrationRequest = {}));
\r
4433 * The `client/unregisterCapability` request is sent from the server to the client to unregister a previously registered capability
\r
4434 * handler on the client side.
\r
4436 var UnregistrationRequest;
\r
4437 (function (UnregistrationRequest) {
\r
4438 UnregistrationRequest.type = new vscode_jsonrpc_1.RequestType('client/unregisterCapability');
\r
4439 })(UnregistrationRequest = exports.UnregistrationRequest || (exports.UnregistrationRequest = {}));
\r
4440 var ResourceOperationKind;
\r
4441 (function (ResourceOperationKind) {
\r
4443 * Supports creating new files and folders.
\r
4445 ResourceOperationKind.Create = 'create';
\r
4447 * Supports renaming existing files and folders.
\r
4449 ResourceOperationKind.Rename = 'rename';
\r
4451 * Supports deleting existing files and folders.
\r
4453 ResourceOperationKind.Delete = 'delete';
\r
4454 })(ResourceOperationKind = exports.ResourceOperationKind || (exports.ResourceOperationKind = {}));
\r
4455 var FailureHandlingKind;
\r
4456 (function (FailureHandlingKind) {
\r
4458 * Applying the workspace change is simply aborted if one of the changes provided
\r
4459 * fails. All operations executed before the failing operation stay executed.
\r
4461 FailureHandlingKind.Abort = 'abort';
\r
4463 * All operations are executed transactional. That means they either all
\r
4464 * succeed or no changes at all are applied to the workspace.
\r
4466 FailureHandlingKind.Transactional = 'transactional';
\r
4468 * If the workspace edit contains only textual file changes they are executed transactional.
\r
4469 * If resource changes (create, rename or delete file) are part of the change the failure
\r
4470 * handling startegy is abort.
\r
4472 FailureHandlingKind.TextOnlyTransactional = 'textOnlyTransactional';
\r
4474 * The client tries to undo the operations already executed. But there is no
\r
4475 * guaruntee that this is succeeding.
\r
4477 FailureHandlingKind.Undo = 'undo';
\r
4478 })(FailureHandlingKind = exports.FailureHandlingKind || (exports.FailureHandlingKind = {}));
\r
4480 * Defines how the host (editor) should sync
\r
4481 * document changes to the language server.
\r
4483 var TextDocumentSyncKind;
\r
4484 (function (TextDocumentSyncKind) {
\r
4486 * Documents should not be synced at all.
\r
4488 TextDocumentSyncKind.None = 0;
\r
4490 * Documents are synced by always sending the full content
\r
4491 * of the document.
\r
4493 TextDocumentSyncKind.Full = 1;
\r
4495 * Documents are synced by sending the full content on open.
\r
4496 * After that only incremental updates to the document are
\r
4499 TextDocumentSyncKind.Incremental = 2;
\r
4500 })(TextDocumentSyncKind = exports.TextDocumentSyncKind || (exports.TextDocumentSyncKind = {}));
\r
4502 * The initialize request is sent from the client to the server.
\r
4503 * It is sent once as the request after starting up the server.
\r
4504 * The requests parameter is of type [InitializeParams](#InitializeParams)
\r
4505 * the response if of type [InitializeResult](#InitializeResult) of a Thenable that
\r
4506 * resolves to such.
\r
4508 var InitializeRequest;
\r
4509 (function (InitializeRequest) {
\r
4510 InitializeRequest.type = new vscode_jsonrpc_1.RequestType('initialize');
\r
4511 })(InitializeRequest = exports.InitializeRequest || (exports.InitializeRequest = {}));
\r
4513 * Known error codes for an `InitializeError`;
\r
4515 var InitializeError;
\r
4516 (function (InitializeError) {
\r
4518 * If the protocol version provided by the client can't be handled by the server.
\r
4519 * @deprecated This initialize error got replaced by client capabilities. There is
\r
4520 * no version handshake in version 3.0x
\r
4522 InitializeError.unknownProtocolVersion = 1;
\r
4523 })(InitializeError = exports.InitializeError || (exports.InitializeError = {}));
\r
4525 * The intialized notification is sent from the client to the
\r
4526 * server after the client is fully initialized and the server
\r
4527 * is allowed to send requests from the server to the client.
\r
4529 var InitializedNotification;
\r
4530 (function (InitializedNotification) {
\r
4531 InitializedNotification.type = new vscode_jsonrpc_1.NotificationType('initialized');
\r
4532 })(InitializedNotification = exports.InitializedNotification || (exports.InitializedNotification = {}));
\r
4533 //---- Shutdown Method ----
\r
4535 * A shutdown request is sent from the client to the server.
\r
4536 * It is sent once when the client decides to shutdown the
\r
4537 * server. The only notification that is sent after a shutdown request
\r
4538 * is the exit event.
\r
4540 var ShutdownRequest;
\r
4541 (function (ShutdownRequest) {
\r
4542 ShutdownRequest.type = new vscode_jsonrpc_1.RequestType0('shutdown');
\r
4543 })(ShutdownRequest = exports.ShutdownRequest || (exports.ShutdownRequest = {}));
\r
4544 //---- Exit Notification ----
\r
4546 * The exit event is sent from the client to the server to
\r
4547 * ask the server to exit its process.
\r
4549 var ExitNotification;
\r
4550 (function (ExitNotification) {
\r
4551 ExitNotification.type = new vscode_jsonrpc_1.NotificationType0('exit');
\r
4552 })(ExitNotification = exports.ExitNotification || (exports.ExitNotification = {}));
\r
4553 //---- Configuration notification ----
\r
4555 * The configuration change notification is sent from the client to the server
\r
4556 * when the client's configuration has changed. The notification contains
\r
4557 * the changed configuration as defined by the language client.
\r
4559 var DidChangeConfigurationNotification;
\r
4560 (function (DidChangeConfigurationNotification) {
\r
4561 DidChangeConfigurationNotification.type = new vscode_jsonrpc_1.NotificationType('workspace/didChangeConfiguration');
\r
4562 })(DidChangeConfigurationNotification = exports.DidChangeConfigurationNotification || (exports.DidChangeConfigurationNotification = {}));
\r
4563 //---- Message show and log notifications ----
\r
4565 * The message type
\r
4568 (function (MessageType) {
\r
4570 * An error message.
\r
4572 MessageType.Error = 1;
\r
4574 * A warning message.
\r
4576 MessageType.Warning = 2;
\r
4578 * An information message.
\r
4580 MessageType.Info = 3;
\r
4584 MessageType.Log = 4;
\r
4585 })(MessageType = exports.MessageType || (exports.MessageType = {}));
\r
4587 * The show message notification is sent from a server to a client to ask
\r
4588 * the client to display a particular message in the user interface.
\r
4590 var ShowMessageNotification;
\r
4591 (function (ShowMessageNotification) {
\r
4592 ShowMessageNotification.type = new vscode_jsonrpc_1.NotificationType('window/showMessage');
\r
4593 })(ShowMessageNotification = exports.ShowMessageNotification || (exports.ShowMessageNotification = {}));
\r
4595 * The show message request is sent from the server to the client to show a message
\r
4596 * and a set of options actions to the user.
\r
4598 var ShowMessageRequest;
\r
4599 (function (ShowMessageRequest) {
\r
4600 ShowMessageRequest.type = new vscode_jsonrpc_1.RequestType('window/showMessageRequest');
\r
4601 })(ShowMessageRequest = exports.ShowMessageRequest || (exports.ShowMessageRequest = {}));
\r
4603 * The log message notification is sent from the server to the client to ask
\r
4604 * the client to log a particular message.
\r
4606 var LogMessageNotification;
\r
4607 (function (LogMessageNotification) {
\r
4608 LogMessageNotification.type = new vscode_jsonrpc_1.NotificationType('window/logMessage');
\r
4609 })(LogMessageNotification = exports.LogMessageNotification || (exports.LogMessageNotification = {}));
\r
4610 //---- Telemetry notification
\r
4612 * The telemetry event notification is sent from the server to the client to ask
\r
4613 * the client to log telemetry data.
\r
4615 var TelemetryEventNotification;
\r
4616 (function (TelemetryEventNotification) {
\r
4617 TelemetryEventNotification.type = new vscode_jsonrpc_1.NotificationType('telemetry/event');
\r
4618 })(TelemetryEventNotification = exports.TelemetryEventNotification || (exports.TelemetryEventNotification = {}));
\r
4620 * The document open notification is sent from the client to the server to signal
\r
4621 * newly opened text documents. The document's truth is now managed by the client
\r
4622 * and the server must not try to read the document's truth using the document's
\r
4623 * uri. Open in this sense means it is managed by the client. It doesn't necessarily
\r
4624 * mean that its content is presented in an editor. An open notification must not
\r
4625 * be sent more than once without a corresponding close notification send before.
\r
4626 * This means open and close notification must be balanced and the max open count
\r
4629 var DidOpenTextDocumentNotification;
\r
4630 (function (DidOpenTextDocumentNotification) {
\r
4631 DidOpenTextDocumentNotification.type = new vscode_jsonrpc_1.NotificationType('textDocument/didOpen');
\r
4632 })(DidOpenTextDocumentNotification = exports.DidOpenTextDocumentNotification || (exports.DidOpenTextDocumentNotification = {}));
\r
4634 * The document change notification is sent from the client to the server to signal
\r
4635 * changes to a text document.
\r
4637 var DidChangeTextDocumentNotification;
\r
4638 (function (DidChangeTextDocumentNotification) {
\r
4639 DidChangeTextDocumentNotification.type = new vscode_jsonrpc_1.NotificationType('textDocument/didChange');
\r
4640 })(DidChangeTextDocumentNotification = exports.DidChangeTextDocumentNotification || (exports.DidChangeTextDocumentNotification = {}));
\r
4642 * The document close notification is sent from the client to the server when
\r
4643 * the document got closed in the client. The document's truth now exists where
\r
4644 * the document's uri points to (e.g. if the document's uri is a file uri the
\r
4645 * truth now exists on disk). As with the open notification the close notification
\r
4646 * is about managing the document's content. Receiving a close notification
\r
4647 * doesn't mean that the document was open in an editor before. A close
\r
4648 * notification requires a previous open notification to be sent.
\r
4650 var DidCloseTextDocumentNotification;
\r
4651 (function (DidCloseTextDocumentNotification) {
\r
4652 DidCloseTextDocumentNotification.type = new vscode_jsonrpc_1.NotificationType('textDocument/didClose');
\r
4653 })(DidCloseTextDocumentNotification = exports.DidCloseTextDocumentNotification || (exports.DidCloseTextDocumentNotification = {}));
\r
4655 * The document save notification is sent from the client to the server when
\r
4656 * the document got saved in the client.
\r
4658 var DidSaveTextDocumentNotification;
\r
4659 (function (DidSaveTextDocumentNotification) {
\r
4660 DidSaveTextDocumentNotification.type = new vscode_jsonrpc_1.NotificationType('textDocument/didSave');
\r
4661 })(DidSaveTextDocumentNotification = exports.DidSaveTextDocumentNotification || (exports.DidSaveTextDocumentNotification = {}));
\r
4663 * A document will save notification is sent from the client to the server before
\r
4664 * the document is actually saved.
\r
4666 var WillSaveTextDocumentNotification;
\r
4667 (function (WillSaveTextDocumentNotification) {
\r
4668 WillSaveTextDocumentNotification.type = new vscode_jsonrpc_1.NotificationType('textDocument/willSave');
\r
4669 })(WillSaveTextDocumentNotification = exports.WillSaveTextDocumentNotification || (exports.WillSaveTextDocumentNotification = {}));
\r
4671 * A document will save request is sent from the client to the server before
\r
4672 * the document is actually saved. The request can return an array of TextEdits
\r
4673 * which will be applied to the text document before it is saved. Please note that
\r
4674 * clients might drop results if computing the text edits took too long or if a
\r
4675 * server constantly fails on this request. This is done to keep the save fast and
\r
4678 var WillSaveTextDocumentWaitUntilRequest;
\r
4679 (function (WillSaveTextDocumentWaitUntilRequest) {
\r
4680 WillSaveTextDocumentWaitUntilRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/willSaveWaitUntil');
\r
4681 })(WillSaveTextDocumentWaitUntilRequest = exports.WillSaveTextDocumentWaitUntilRequest || (exports.WillSaveTextDocumentWaitUntilRequest = {}));
\r
4682 //---- File eventing ----
\r
4684 * The watched files notification is sent from the client to the server when
\r
4685 * the client detects changes to file watched by the language client.
\r
4687 var DidChangeWatchedFilesNotification;
\r
4688 (function (DidChangeWatchedFilesNotification) {
\r
4689 DidChangeWatchedFilesNotification.type = new vscode_jsonrpc_1.NotificationType('workspace/didChangeWatchedFiles');
\r
4690 })(DidChangeWatchedFilesNotification = exports.DidChangeWatchedFilesNotification || (exports.DidChangeWatchedFilesNotification = {}));
\r
4692 * The file event type
\r
4694 var FileChangeType;
\r
4695 (function (FileChangeType) {
\r
4697 * The file got created.
\r
4699 FileChangeType.Created = 1;
\r
4701 * The file got changed.
\r
4703 FileChangeType.Changed = 2;
\r
4705 * The file got deleted.
\r
4707 FileChangeType.Deleted = 3;
\r
4708 })(FileChangeType = exports.FileChangeType || (exports.FileChangeType = {}));
\r
4710 (function (WatchKind) {
\r
4712 * Interested in create events.
\r
4714 WatchKind.Create = 1;
\r
4716 * Interested in change events
\r
4718 WatchKind.Change = 2;
\r
4720 * Interested in delete events
\r
4722 WatchKind.Delete = 4;
\r
4723 })(WatchKind = exports.WatchKind || (exports.WatchKind = {}));
\r
4724 //---- Diagnostic notification ----
\r
4726 * Diagnostics notification are sent from the server to the client to signal
\r
4727 * results of validation runs.
\r
4729 var PublishDiagnosticsNotification;
\r
4730 (function (PublishDiagnosticsNotification) {
\r
4731 PublishDiagnosticsNotification.type = new vscode_jsonrpc_1.NotificationType('textDocument/publishDiagnostics');
\r
4732 })(PublishDiagnosticsNotification = exports.PublishDiagnosticsNotification || (exports.PublishDiagnosticsNotification = {}));
\r
4734 * How a completion was triggered
\r
4736 var CompletionTriggerKind;
\r
4737 (function (CompletionTriggerKind) {
\r
4739 * Completion was triggered by typing an identifier (24x7 code
\r
4740 * complete), manual invocation (e.g Ctrl+Space) or via API.
\r
4742 CompletionTriggerKind.Invoked = 1;
\r
4744 * Completion was triggered by a trigger character specified by
\r
4745 * the `triggerCharacters` properties of the `CompletionRegistrationOptions`.
\r
4747 CompletionTriggerKind.TriggerCharacter = 2;
\r
4749 * Completion was re-triggered as current completion list is incomplete
\r
4751 CompletionTriggerKind.TriggerForIncompleteCompletions = 3;
\r
4752 })(CompletionTriggerKind = exports.CompletionTriggerKind || (exports.CompletionTriggerKind = {}));
\r
4754 * Request to request completion at a given text document position. The request's
\r
4755 * parameter is of type [TextDocumentPosition](#TextDocumentPosition) the response
\r
4756 * is of type [CompletionItem[]](#CompletionItem) or [CompletionList](#CompletionList)
\r
4757 * or a Thenable that resolves to such.
\r
4759 * The request can delay the computation of the [`detail`](#CompletionItem.detail)
\r
4760 * and [`documentation`](#CompletionItem.documentation) properties to the `completionItem/resolve`
\r
4761 * request. However, properties that are needed for the initial sorting and filtering, like `sortText`,
\r
4762 * `filterText`, `insertText`, and `textEdit`, must not be changed during resolve.
\r
4764 var CompletionRequest;
\r
4765 (function (CompletionRequest) {
\r
4766 CompletionRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/completion');
\r
4767 })(CompletionRequest = exports.CompletionRequest || (exports.CompletionRequest = {}));
\r
4769 * Request to resolve additional information for a given completion item.The request's
\r
4770 * parameter is of type [CompletionItem](#CompletionItem) the response
\r
4771 * is of type [CompletionItem](#CompletionItem) or a Thenable that resolves to such.
\r
4773 var CompletionResolveRequest;
\r
4774 (function (CompletionResolveRequest) {
\r
4775 CompletionResolveRequest.type = new vscode_jsonrpc_1.RequestType('completionItem/resolve');
\r
4776 })(CompletionResolveRequest = exports.CompletionResolveRequest || (exports.CompletionResolveRequest = {}));
\r
4777 //---- Hover Support -------------------------------
\r
4779 * Request to request hover information at a given text document position. The request's
\r
4780 * parameter is of type [TextDocumentPosition](#TextDocumentPosition) the response is of
\r
4781 * type [Hover](#Hover) or a Thenable that resolves to such.
\r
4784 (function (HoverRequest) {
\r
4785 HoverRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/hover');
\r
4786 })(HoverRequest = exports.HoverRequest || (exports.HoverRequest = {}));
\r
4787 var SignatureHelpRequest;
\r
4788 (function (SignatureHelpRequest) {
\r
4789 SignatureHelpRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/signatureHelp');
\r
4790 })(SignatureHelpRequest = exports.SignatureHelpRequest || (exports.SignatureHelpRequest = {}));
\r
4791 //---- Goto Definition -------------------------------------
\r
4793 * A request to resolve the definition location of a symbol at a given text
\r
4794 * document position. The request's parameter is of type [TextDocumentPosition]
\r
4795 * (#TextDocumentPosition) the response is of either type [Definition](#Definition)
\r
4796 * or a typed array of [DefinitionLink](#DefinitionLink) or a Thenable that resolves
\r
4799 var DefinitionRequest;
\r
4800 (function (DefinitionRequest) {
\r
4801 DefinitionRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/definition');
\r
4802 })(DefinitionRequest = exports.DefinitionRequest || (exports.DefinitionRequest = {}));
\r
4804 * A request to resolve project-wide references for the symbol denoted
\r
4805 * by the given text document position. The request's parameter is of
\r
4806 * type [ReferenceParams](#ReferenceParams) the response is of type
\r
4807 * [Location[]](#Location) or a Thenable that resolves to such.
\r
4809 var ReferencesRequest;
\r
4810 (function (ReferencesRequest) {
\r
4811 ReferencesRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/references');
\r
4812 })(ReferencesRequest = exports.ReferencesRequest || (exports.ReferencesRequest = {}));
\r
4813 //---- Document Highlight ----------------------------------
\r
4815 * Request to resolve a [DocumentHighlight](#DocumentHighlight) for a given
\r
4816 * text document position. The request's parameter is of type [TextDocumentPosition]
\r
4817 * (#TextDocumentPosition) the request response is of type [DocumentHighlight[]]
\r
4818 * (#DocumentHighlight) or a Thenable that resolves to such.
\r
4820 var DocumentHighlightRequest;
\r
4821 (function (DocumentHighlightRequest) {
\r
4822 DocumentHighlightRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/documentHighlight');
\r
4823 })(DocumentHighlightRequest = exports.DocumentHighlightRequest || (exports.DocumentHighlightRequest = {}));
\r
4824 //---- Document Symbol Provider ---------------------------
\r
4826 * A request to list all symbols found in a given text document. The request's
\r
4827 * parameter is of type [TextDocumentIdentifier](#TextDocumentIdentifier) the
\r
4828 * response is of type [SymbolInformation[]](#SymbolInformation) or a Thenable
\r
4829 * that resolves to such.
\r
4831 var DocumentSymbolRequest;
\r
4832 (function (DocumentSymbolRequest) {
\r
4833 DocumentSymbolRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/documentSymbol');
\r
4834 })(DocumentSymbolRequest = exports.DocumentSymbolRequest || (exports.DocumentSymbolRequest = {}));
\r
4835 //---- Workspace Symbol Provider ---------------------------
\r
4837 * A request to list project-wide symbols matching the query string given
\r
4838 * by the [WorkspaceSymbolParams](#WorkspaceSymbolParams). The response is
\r
4839 * of type [SymbolInformation[]](#SymbolInformation) or a Thenable that
\r
4840 * resolves to such.
\r
4842 var WorkspaceSymbolRequest;
\r
4843 (function (WorkspaceSymbolRequest) {
\r
4844 WorkspaceSymbolRequest.type = new vscode_jsonrpc_1.RequestType('workspace/symbol');
\r
4845 })(WorkspaceSymbolRequest = exports.WorkspaceSymbolRequest || (exports.WorkspaceSymbolRequest = {}));
\r
4847 * A request to provide commands for the given text document and range.
\r
4849 var CodeActionRequest;
\r
4850 (function (CodeActionRequest) {
\r
4851 CodeActionRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/codeAction');
\r
4852 })(CodeActionRequest = exports.CodeActionRequest || (exports.CodeActionRequest = {}));
\r
4854 * A request to provide code lens for the given text document.
\r
4856 var CodeLensRequest;
\r
4857 (function (CodeLensRequest) {
\r
4858 CodeLensRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/codeLens');
\r
4859 })(CodeLensRequest = exports.CodeLensRequest || (exports.CodeLensRequest = {}));
\r
4861 * A request to resolve a command for a given code lens.
\r
4863 var CodeLensResolveRequest;
\r
4864 (function (CodeLensResolveRequest) {
\r
4865 CodeLensResolveRequest.type = new vscode_jsonrpc_1.RequestType('codeLens/resolve');
\r
4866 })(CodeLensResolveRequest = exports.CodeLensResolveRequest || (exports.CodeLensResolveRequest = {}));
\r
4868 * A request to to format a whole document.
\r
4870 var DocumentFormattingRequest;
\r
4871 (function (DocumentFormattingRequest) {
\r
4872 DocumentFormattingRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/formatting');
\r
4873 })(DocumentFormattingRequest = exports.DocumentFormattingRequest || (exports.DocumentFormattingRequest = {}));
\r
4875 * A request to to format a range in a document.
\r
4877 var DocumentRangeFormattingRequest;
\r
4878 (function (DocumentRangeFormattingRequest) {
\r
4879 DocumentRangeFormattingRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/rangeFormatting');
\r
4880 })(DocumentRangeFormattingRequest = exports.DocumentRangeFormattingRequest || (exports.DocumentRangeFormattingRequest = {}));
\r
4882 * A request to format a document on type.
\r
4884 var DocumentOnTypeFormattingRequest;
\r
4885 (function (DocumentOnTypeFormattingRequest) {
\r
4886 DocumentOnTypeFormattingRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/onTypeFormatting');
\r
4887 })(DocumentOnTypeFormattingRequest = exports.DocumentOnTypeFormattingRequest || (exports.DocumentOnTypeFormattingRequest = {}));
\r
4889 * A request to rename a symbol.
\r
4891 var RenameRequest;
\r
4892 (function (RenameRequest) {
\r
4893 RenameRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/rename');
\r
4894 })(RenameRequest = exports.RenameRequest || (exports.RenameRequest = {}));
\r
4896 * A request to test and perform the setup necessary for a rename.
\r
4898 var PrepareRenameRequest;
\r
4899 (function (PrepareRenameRequest) {
\r
4900 PrepareRenameRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/prepareRename');
\r
4901 })(PrepareRenameRequest = exports.PrepareRenameRequest || (exports.PrepareRenameRequest = {}));
\r
4903 * A request to provide document links
\r
4905 var DocumentLinkRequest;
\r
4906 (function (DocumentLinkRequest) {
\r
4907 DocumentLinkRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/documentLink');
\r
4908 })(DocumentLinkRequest = exports.DocumentLinkRequest || (exports.DocumentLinkRequest = {}));
\r
4910 * Request to resolve additional information for a given document link. The request's
\r
4911 * parameter is of type [DocumentLink](#DocumentLink) the response
\r
4912 * is of type [DocumentLink](#DocumentLink) or a Thenable that resolves to such.
\r
4914 var DocumentLinkResolveRequest;
\r
4915 (function (DocumentLinkResolveRequest) {
\r
4916 DocumentLinkResolveRequest.type = new vscode_jsonrpc_1.RequestType('documentLink/resolve');
\r
4917 })(DocumentLinkResolveRequest = exports.DocumentLinkResolveRequest || (exports.DocumentLinkResolveRequest = {}));
\r
4919 * A request send from the client to the server to execute a command. The request might return
\r
4920 * a workspace edit which the client will apply to the workspace.
\r
4922 var ExecuteCommandRequest;
\r
4923 (function (ExecuteCommandRequest) {
\r
4924 ExecuteCommandRequest.type = new vscode_jsonrpc_1.RequestType('workspace/executeCommand');
\r
4925 })(ExecuteCommandRequest = exports.ExecuteCommandRequest || (exports.ExecuteCommandRequest = {}));
\r
4927 * A request sent from the server to the client to modified certain resources.
\r
4929 var ApplyWorkspaceEditRequest;
\r
4930 (function (ApplyWorkspaceEditRequest) {
\r
4931 ApplyWorkspaceEditRequest.type = new vscode_jsonrpc_1.RequestType('workspace/applyEdit');
\r
4932 })(ApplyWorkspaceEditRequest = exports.ApplyWorkspaceEditRequest || (exports.ApplyWorkspaceEditRequest = {}));
\r
4937 /***/ (function(module, exports, __webpack_require__) {
4940 /* --------------------------------------------------------------------------------------------
\r
4941 * Copyright (c) Microsoft Corporation. All rights reserved.
\r
4942 * Licensed under the MIT License. See License.txt in the project root for license information.
\r
4943 * ------------------------------------------------------------------------------------------ */
\r
4945 Object.defineProperty(exports, "__esModule", { value: true });
\r
4946 function boolean(value) {
\r
4947 return value === true || value === false;
\r
4949 exports.boolean = boolean;
\r
4950 function string(value) {
\r
4951 return typeof value === 'string' || value instanceof String;
\r
4953 exports.string = string;
\r
4954 function number(value) {
\r
4955 return typeof value === 'number' || value instanceof Number;
\r
4957 exports.number = number;
\r
4958 function error(value) {
\r
4959 return value instanceof Error;
\r
4961 exports.error = error;
\r
4962 function func(value) {
\r
4963 return typeof value === 'function';
\r
4965 exports.func = func;
\r
4966 function array(value) {
\r
4967 return Array.isArray(value);
\r
4969 exports.array = array;
\r
4970 function stringArray(value) {
\r
4971 return array(value) && value.every(elem => string(elem));
\r
4973 exports.stringArray = stringArray;
\r
4974 function typedArray(value, check) {
\r
4975 return Array.isArray(value) && value.every(check);
\r
4977 exports.typedArray = typedArray;
\r
4978 function thenable(value) {
\r
4979 return value && func(value.then);
\r
4981 exports.thenable = thenable;
\r
4986 /***/ (function(module, exports, __webpack_require__) {
4989 /* --------------------------------------------------------------------------------------------
\r
4990 * Copyright (c) Microsoft Corporation. All rights reserved.
\r
4991 * Licensed under the MIT License. See License.txt in the project root for license information.
\r
4992 * ------------------------------------------------------------------------------------------ */
\r
4994 Object.defineProperty(exports, "__esModule", { value: true });
\r
4995 const vscode_jsonrpc_1 = __webpack_require__(4);
\r
4996 // @ts-ignore: to avoid inlining LocatioLink as dynamic import
\r
4997 let __noDynamicImport;
\r
4999 * A request to resolve the implementation locations of a symbol at a given text
\r
5000 * document position. The request's parameter is of type [TextDocumentPositioParams]
\r
5001 * (#TextDocumentPositionParams) the response is of type [Definition](#Definition) or a
\r
5002 * Thenable that resolves to such.
\r
5004 var ImplementationRequest;
\r
5005 (function (ImplementationRequest) {
\r
5006 ImplementationRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/implementation');
\r
5007 })(ImplementationRequest = exports.ImplementationRequest || (exports.ImplementationRequest = {}));
\r
5012 /***/ (function(module, exports, __webpack_require__) {
5015 /* --------------------------------------------------------------------------------------------
\r
5016 * Copyright (c) Microsoft Corporation. All rights reserved.
\r
5017 * Licensed under the MIT License. See License.txt in the project root for license information.
\r
5018 * ------------------------------------------------------------------------------------------ */
\r
5020 Object.defineProperty(exports, "__esModule", { value: true });
\r
5021 const vscode_jsonrpc_1 = __webpack_require__(4);
\r
5022 // @ts-ignore: to avoid inlining LocatioLink as dynamic import
\r
5023 let __noDynamicImport;
\r
5025 * A request to resolve the type definition locations of a symbol at a given text
\r
5026 * document position. The request's parameter is of type [TextDocumentPositioParams]
\r
5027 * (#TextDocumentPositionParams) the response is of type [Definition](#Definition) or a
\r
5028 * Thenable that resolves to such.
\r
5030 var TypeDefinitionRequest;
\r
5031 (function (TypeDefinitionRequest) {
\r
5032 TypeDefinitionRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/typeDefinition');
\r
5033 })(TypeDefinitionRequest = exports.TypeDefinitionRequest || (exports.TypeDefinitionRequest = {}));
\r
5038 /***/ (function(module, exports, __webpack_require__) {
5041 /* --------------------------------------------------------------------------------------------
\r
5042 * Copyright (c) Microsoft Corporation. All rights reserved.
\r
5043 * Licensed under the MIT License. See License.txt in the project root for license information.
\r
5044 * ------------------------------------------------------------------------------------------ */
\r
5046 Object.defineProperty(exports, "__esModule", { value: true });
\r
5047 const vscode_jsonrpc_1 = __webpack_require__(4);
\r
5049 * The `workspace/workspaceFolders` is sent from the server to the client to fetch the open workspace folders.
\r
5051 var WorkspaceFoldersRequest;
\r
5052 (function (WorkspaceFoldersRequest) {
\r
5053 WorkspaceFoldersRequest.type = new vscode_jsonrpc_1.RequestType0('workspace/workspaceFolders');
\r
5054 })(WorkspaceFoldersRequest = exports.WorkspaceFoldersRequest || (exports.WorkspaceFoldersRequest = {}));
\r
5056 * The `workspace/didChangeWorkspaceFolders` notification is sent from the client to the server when the workspace
\r
5057 * folder configuration changes.
\r
5059 var DidChangeWorkspaceFoldersNotification;
\r
5060 (function (DidChangeWorkspaceFoldersNotification) {
\r
5061 DidChangeWorkspaceFoldersNotification.type = new vscode_jsonrpc_1.NotificationType('workspace/didChangeWorkspaceFolders');
\r
5062 })(DidChangeWorkspaceFoldersNotification = exports.DidChangeWorkspaceFoldersNotification || (exports.DidChangeWorkspaceFoldersNotification = {}));
\r
5067 /***/ (function(module, exports, __webpack_require__) {
5070 /* --------------------------------------------------------------------------------------------
\r
5071 * Copyright (c) Microsoft Corporation. All rights reserved.
\r
5072 * Licensed under the MIT License. See License.txt in the project root for license information.
\r
5073 * ------------------------------------------------------------------------------------------ */
\r
5075 Object.defineProperty(exports, "__esModule", { value: true });
\r
5076 const vscode_jsonrpc_1 = __webpack_require__(4);
\r
5078 * The 'workspace/configuration' request is sent from the server to the client to fetch a certain
\r
5079 * configuration setting.
\r
5081 * This pull model replaces the old push model were the client signaled configuration change via an
\r
5082 * event. If the server still needs to react to configuration changes (since the server caches the
\r
5083 * result of `workspace/configuration` requests) the server should register for an empty configuration
\r
5084 * change event and empty the cache if such an event is received.
\r
5086 var ConfigurationRequest;
\r
5087 (function (ConfigurationRequest) {
\r
5088 ConfigurationRequest.type = new vscode_jsonrpc_1.RequestType('workspace/configuration');
\r
5089 })(ConfigurationRequest = exports.ConfigurationRequest || (exports.ConfigurationRequest = {}));
\r
5094 /***/ (function(module, exports, __webpack_require__) {
5097 /* --------------------------------------------------------------------------------------------
\r
5098 * Copyright (c) Microsoft Corporation. All rights reserved.
\r
5099 * Licensed under the MIT License. See License.txt in the project root for license information.
\r
5100 * ------------------------------------------------------------------------------------------ */
\r
5102 Object.defineProperty(exports, "__esModule", { value: true });
\r
5103 const vscode_jsonrpc_1 = __webpack_require__(4);
\r
5105 * A request to list all color symbols found in a given text document. The request's
\r
5106 * parameter is of type [DocumentColorParams](#DocumentColorParams) the
\r
5107 * response is of type [ColorInformation[]](#ColorInformation) or a Thenable
\r
5108 * that resolves to such.
\r
5110 var DocumentColorRequest;
\r
5111 (function (DocumentColorRequest) {
\r
5112 DocumentColorRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/documentColor');
\r
5113 })(DocumentColorRequest = exports.DocumentColorRequest || (exports.DocumentColorRequest = {}));
\r
5115 * A request to list all presentation for a color. The request's
\r
5116 * parameter is of type [ColorPresentationParams](#ColorPresentationParams) the
\r
5117 * response is of type [ColorInformation[]](#ColorInformation) or a Thenable
\r
5118 * that resolves to such.
\r
5120 var ColorPresentationRequest;
\r
5121 (function (ColorPresentationRequest) {
\r
5122 ColorPresentationRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/colorPresentation');
\r
5123 })(ColorPresentationRequest = exports.ColorPresentationRequest || (exports.ColorPresentationRequest = {}));
\r
5128 /***/ (function(module, exports, __webpack_require__) {
5132 /*---------------------------------------------------------------------------------------------
\r
5133 * Copyright (c) Microsoft Corporation. All rights reserved.
\r
5134 * Licensed under the MIT License. See License.txt in the project root for license information.
\r
5135 *--------------------------------------------------------------------------------------------*/
\r
5136 Object.defineProperty(exports, "__esModule", { value: true });
\r
5137 const vscode_jsonrpc_1 = __webpack_require__(4);
\r
5139 * Enum of known range kinds
\r
5141 var FoldingRangeKind;
\r
5142 (function (FoldingRangeKind) {
\r
5144 * Folding range for a comment
\r
5146 FoldingRangeKind["Comment"] = "comment";
\r
5148 * Folding range for a imports or includes
\r
5150 FoldingRangeKind["Imports"] = "imports";
\r
5152 * Folding range for a region (e.g. `#region`)
\r
5154 FoldingRangeKind["Region"] = "region";
\r
5155 })(FoldingRangeKind = exports.FoldingRangeKind || (exports.FoldingRangeKind = {}));
\r
5157 * A request to provide folding ranges in a document. The request's
\r
5158 * parameter is of type [FoldingRangeParams](#FoldingRangeParams), the
\r
5159 * response is of type [FoldingRangeList](#FoldingRangeList) or a Thenable
\r
5160 * that resolves to such.
\r
5162 var FoldingRangeRequest;
\r
5163 (function (FoldingRangeRequest) {
\r
5164 FoldingRangeRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/foldingRange');
\r
5165 })(FoldingRangeRequest = exports.FoldingRangeRequest || (exports.FoldingRangeRequest = {}));
\r
5170 /***/ (function(module, exports, __webpack_require__) {
5173 /* --------------------------------------------------------------------------------------------
\r
5174 * Copyright (c) Microsoft Corporation. All rights reserved.
\r
5175 * Licensed under the MIT License. See License.txt in the project root for license information.
\r
5176 * ------------------------------------------------------------------------------------------ */
\r
5178 Object.defineProperty(exports, "__esModule", { value: true });
\r
5179 const vscode_jsonrpc_1 = __webpack_require__(4);
\r
5180 // @ts-ignore: to avoid inlining LocatioLink as dynamic import
\r
5181 let __noDynamicImport;
\r
5183 * A request to resolve the type definition locations of a symbol at a given text
\r
5184 * document position. The request's parameter is of type [TextDocumentPositioParams]
\r
5185 * (#TextDocumentPositionParams) the response is of type [Declaration](#Declaration)
\r
5186 * or a typed array of [DeclarationLink](#DeclarationLink) or a Thenable that resolves
\r
5189 var DeclarationRequest;
\r
5190 (function (DeclarationRequest) {
\r
5191 DeclarationRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/declaration');
\r
5192 })(DeclarationRequest = exports.DeclarationRequest || (exports.DeclarationRequest = {}));
\r
5197 /***/ (function(module, exports, __webpack_require__) {
5200 /* --------------------------------------------------------------------------------------------
\r
5201 * Copyright (c) TypeFox and others. All rights reserved.
\r
5202 * Licensed under the MIT License. See License.txt in the project root for license information.
\r
5203 * ------------------------------------------------------------------------------------------ */
\r
5205 Object.defineProperty(exports, "__esModule", { value: true });
\r
5206 const vscode_jsonrpc_1 = __webpack_require__(4);
\r
5208 * The direction of a call hierarchy request.
\r
5210 var CallHierarchyDirection;
\r
5211 (function (CallHierarchyDirection) {
\r
5215 CallHierarchyDirection.CallsFrom = 1;
\r
5219 CallHierarchyDirection.CallsTo = 2;
\r
5220 })(CallHierarchyDirection = exports.CallHierarchyDirection || (exports.CallHierarchyDirection = {}));
\r
5222 * Request to provide the call hierarchy at a given text document position.
\r
5224 * The request's parameter is of type [CallHierarchyParams](#CallHierarchyParams). The response
\r
5225 * is of type [CallHierarchyCall[]](#CallHierarchyCall) or a Thenable that resolves to such.
\r
5227 * Evaluates the symbol defined (or referenced) at the given position, and returns all incoming or outgoing calls to the symbol(s).
\r
5229 var CallHierarchyRequest;
\r
5230 (function (CallHierarchyRequest) {
\r
5231 CallHierarchyRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/callHierarchy');
\r
5232 })(CallHierarchyRequest = exports.CallHierarchyRequest || (exports.CallHierarchyRequest = {}));
\r
5237 /***/ (function(module, exports, __webpack_require__) {
5240 /* --------------------------------------------------------------------------------------------
\r
5241 * Copyright (c) Microsoft Corporation. All rights reserved.
\r
5242 * Licensed under the MIT License. See License.txt in the project root for license information.
\r
5243 * ------------------------------------------------------------------------------------------ */
\r
5245 Object.defineProperty(exports, "__esModule", { value: true });
\r
5246 const vscode_jsonrpc_1 = __webpack_require__(4);
\r
5248 * The `window/progress/start` notification is sent from the server to the client
\r
5249 * to initiate a progress.
\r
5251 var ProgressStartNotification;
\r
5252 (function (ProgressStartNotification) {
\r
5253 ProgressStartNotification.type = new vscode_jsonrpc_1.NotificationType('window/progress/start');
\r
5254 })(ProgressStartNotification = exports.ProgressStartNotification || (exports.ProgressStartNotification = {}));
\r
5256 * The `window/progress/report` notification is sent from the server to the client
\r
5257 * to initiate a progress.
\r
5259 var ProgressReportNotification;
\r
5260 (function (ProgressReportNotification) {
\r
5261 ProgressReportNotification.type = new vscode_jsonrpc_1.NotificationType('window/progress/report');
\r
5262 })(ProgressReportNotification = exports.ProgressReportNotification || (exports.ProgressReportNotification = {}));
\r
5264 * The `window/progress/done` notification is sent from the server to the client
\r
5265 * to initiate a progress.
\r
5267 var ProgressDoneNotification;
\r
5268 (function (ProgressDoneNotification) {
\r
5269 ProgressDoneNotification.type = new vscode_jsonrpc_1.NotificationType('window/progress/done');
\r
5270 })(ProgressDoneNotification = exports.ProgressDoneNotification || (exports.ProgressDoneNotification = {}));
\r
5272 * The `window/progress/cancel` notification is sent client to the server to cancel a progress
\r
5273 * initiated on the server side.
\r
5275 var ProgressCancelNotification;
\r
5276 (function (ProgressCancelNotification) {
\r
5277 ProgressCancelNotification.type = new vscode_jsonrpc_1.NotificationType('window/progress/cancel');
\r
5278 })(ProgressCancelNotification = exports.ProgressCancelNotification || (exports.ProgressCancelNotification = {}));
\r
5283 /***/ (function(module, exports, __webpack_require__) {
5287 /*---------------------------------------------------------------------------------------------
\r
5288 * Copyright (c) Microsoft Corporation. All rights reserved.
\r
5289 * Licensed under the MIT License. See License.txt in the project root for license information.
\r
5290 *--------------------------------------------------------------------------------------------*/
\r
5291 Object.defineProperty(exports, "__esModule", { value: true });
\r
5292 const vscode_jsonrpc_1 = __webpack_require__(4);
\r
5293 const vscode_languageserver_types_1 = __webpack_require__(17);
\r
5295 * The SelectionRange namespace provides helper function to work with
\r
5296 * SelectionRange literals.
\r
5298 var SelectionRange;
\r
5299 (function (SelectionRange) {
\r
5301 * Creates a new SelectionRange
\r
5302 * @param range the range.
\r
5303 * @param parent an optional parent.
\r
5305 function create(range, parent) {
\r
5306 return { range, parent };
\r
5308 SelectionRange.create = create;
\r
5309 function is(value) {
\r
5310 let candidate = value;
\r
5311 return candidate !== undefined && vscode_languageserver_types_1.Range.is(candidate.range) && (candidate.parent === undefined || SelectionRange.is(candidate.parent));
\r
5313 SelectionRange.is = is;
\r
5314 })(SelectionRange = exports.SelectionRange || (exports.SelectionRange = {}));
\r
5316 * A request to provide selection ranges in a document. The request's
\r
5317 * parameter is of type [SelectionRangeParams](#SelectionRangeParams), the
\r
5318 * response is of type [SelectionRange[]](#SelectionRange[]) or a Thenable
\r
5319 * that resolves to such.
\r
5321 var SelectionRangeRequest;
\r
5322 (function (SelectionRangeRequest) {
\r
5323 SelectionRangeRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/selectionRange');
\r
5324 })(SelectionRangeRequest = exports.SelectionRangeRequest || (exports.SelectionRangeRequest = {}));
\r
5329 /***/ (function(module) {
5331 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"}]};
5335 /***/ (function(module, exports, __webpack_require__) {
5338 /*---------------------------------------------------------------------------------------------
5339 * Copyright (c) Microsoft Corporation. All rights reserved.
5340 * Licensed under the MIT License. See License.txt in the project root for license information.
5341 *--------------------------------------------------------------------------------------------*/
5343 Object.defineProperty(exports, "__esModule", { value: true });
5345 * Return a hash value for an object.
5347 function hash(obj, hashVal = 0) {
5348 switch (typeof obj) {
5351 return numberHash(349, hashVal);
5353 else if (Array.isArray(obj)) {
5354 return arrayHash(obj, hashVal);
5356 return objectHash(obj, hashVal);
5358 return stringHash(obj, hashVal);
5360 return booleanHash(obj, hashVal);
5362 return numberHash(obj, hashVal);
5364 return numberHash(obj, 937);
5366 return numberHash(obj, 617);
5369 exports.hash = hash;
5370 function numberHash(val, initialHashVal) {
5371 return (((initialHashVal << 5) - initialHashVal) + val) | 0; // hashVal * 31 + ch, keep as int32
5373 function booleanHash(b, initialHashVal) {
5374 return numberHash(b ? 433 : 863, initialHashVal);
5376 function stringHash(s, hashVal) {
5377 hashVal = numberHash(149417, hashVal);
5378 for (let i = 0, length = s.length; i < length; i++) {
5379 hashVal = numberHash(s.charCodeAt(i), hashVal);
5383 function arrayHash(arr, initialHashVal) {
5384 initialHashVal = numberHash(104579, initialHashVal);
5385 return arr.reduce((hashVal, item) => hash(item, hashVal), initialHashVal);
5387 function objectHash(obj, initialHashVal) {
5388 initialHashVal = numberHash(181387, initialHashVal);
5389 return Object.keys(obj).sort().reduce((hashVal, key) => {
5390 hashVal = stringHash(key, hashVal);
5391 return hash(obj[key], hashVal);
5398 /***/ (function(module, exports) {
5400 module.exports = require("coc.nvim");